Files
pilotclient/src/blackgui/statusmessageformsmall.cpp
Klaus Basan 8e57914e67 refs #471, removed old info window and migrated to overlay widget
* added small message display (more suitable for swift GUI)
* fixed nullptr bug with ESC key
* adjusted swift GUI
2015-11-19 21:06:33 +00:00

49 lines
1.5 KiB
C++

/* Copyright (C) 2015
* swift project Community / Contributors
*
* This file is part of swift Project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
#include "statusmessageformsmall.h"
#include "ui_statusmessageformsmall.h"
#include <QLabel>
using namespace BlackMisc;
namespace BlackGui
{
CStatusMessageFormSmall::CStatusMessageFormSmall(QWidget *parent) :
QFrame(parent),
ui(new Ui::CStatusMessageFormSmall)
{
ui->setupUi(this);
}
CStatusMessageFormSmall::~CStatusMessageFormSmall()
{ }
void CStatusMessageFormSmall::setVariant(const CVariant &messageVariant)
{
if (!this->isVisible()) { return; }
this->setValue(messageVariant.value<CStatusMessage>());
}
void CStatusMessageFormSmall::setValue(const CStatusMessage &message)
{
ui->te_Message->setPlainText(message.getMessage());
ui->lbl_SeverityIcon->setPixmap(message.toPixmap());
ui->le_Categories->setText(message.getCategories().toQString(true));
ui->le_Severity->setText(message.getSeverityAsString());
ui->le_Timestamp->setText(message.getFormattedUtcTimestampYmdhms());
}
void CStatusMessageFormSmall::toggleVisibility()
{
this->setVisible(!isVisible());
}
} // ns