mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-18 03:15:34 +08:00
Issue #15 [GUI] Use CLogHistoryReplica in CLogComponent and swift applications
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include "blackcore/context/contextaudio.h"
|
||||
#include "blacksound/audioutilities.h"
|
||||
#include "blackmisc/network/networkutils.h"
|
||||
#include "blackmisc/sharedstate/datalinkdbus.h"
|
||||
#include "blackmisc/loghandler.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/logpattern.h"
|
||||
@@ -83,7 +84,20 @@ void SwiftGuiStd::init()
|
||||
// if (CBuildConfig::isLocalDeveloperDebugBuild()) { BlackSound::occupyAudioInputDevice(); }
|
||||
|
||||
// log messages
|
||||
m_logSubscriber.changeSubscription(CLogPattern().withSeverityAtOrAbove(CStatusMessage::SeverityInfo));
|
||||
m_logHistoryForStatus.setFilter(CLogPattern().withSeverityAtOrAbove(CStatusMessage::SeverityInfo));
|
||||
m_logHistoryForOverlay.setFilter(CLogPattern().withSeverityAtOrAbove(CStatusMessage::SeverityError));
|
||||
connect(&m_logHistoryForStatus, &CLogHistoryReplica::elementAdded, this, [this](const CStatusMessage& message)
|
||||
{
|
||||
m_statusBar.displayStatusMessage(message);
|
||||
ui->comp_MainInfoArea->displayStatusMessage(message);
|
||||
});
|
||||
connect(&m_logHistoryForOverlay, &CLogHistoryReplica::elementAdded, this, [this](const CStatusMessage& message)
|
||||
{
|
||||
//! \todo filter out validation messages at CLogPattern level
|
||||
if (!message.getCategories().contains(CLogCategory::validation())) { ui->fr_CentralFrameInside->showOverlayMessage(message); }
|
||||
});
|
||||
m_logHistoryForStatus.initialize(sApp->getDataLinkDBus());
|
||||
m_logHistoryForOverlay.initialize(sApp->getDataLinkDBus());
|
||||
|
||||
// style
|
||||
this->initStyleSheet();
|
||||
|
||||
Reference in New Issue
Block a user