mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-09 05:28:09 +08:00
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
This commit is contained in:
committed by
Mathew Sutcliffe
parent
012543ef02
commit
8e57914e67
48
src/blackgui/statusmessageformsmall.cpp
Normal file
48
src/blackgui/statusmessageformsmall.cpp
Normal file
@@ -0,0 +1,48 @@
|
||||
/* 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
|
||||
Reference in New Issue
Block a user