Files
pilotclient/src/blackgui/statusmessageform.cpp
Klaus Basan a4ba45ce75 refs #522, as preparation for mutable in status message
* added the new human readable patterns ( also for #506 )
* adjusted using functions

Meeting:
https://dev.vatsim-germany.org/boards/22/topics/2786?r=2787#message-2787
2015-11-26 13:54:45 +01:00

49 lines
1.5 KiB
C++

/* Copyright (C) 2014
* 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 "statusmessageform.h"
#include "ui_statusmessageform.h"
#include <QLabel>
using namespace BlackMisc;
namespace BlackGui
{
CStatusMessageForm::CStatusMessageForm(QWidget *parent) :
QFrame(parent),
ui(new Ui::CStatusMessageForm)
{
ui->setupUi(this);
}
CStatusMessageForm::~CStatusMessageForm()
{ }
void CStatusMessageForm::setVariant(const CVariant &messageVariant)
{
if (!this->isVisible()) { return; }
this->setValue(messageVariant.value<CStatusMessage>());
}
void CStatusMessageForm::setValue(const CStatusMessage &message)
{
ui->te_Message->setPlainText(message.getMessage());
ui->lbl_SeverityIcon->setPixmap(message.toPixmap());
ui->le_Categories->setText(message.getHumanReadablePattern());
ui->le_Severity->setText(message.getSeverityAsString());
ui->le_Timestamp->setText(message.getFormattedUtcTimestampYmdhms());
}
void CStatusMessageForm::toggleVisibility()
{
this->setVisible(!isVisible());
}
} // ns