mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
refactor: Remove log messages from status bar
With the new warn/error button, the user already is informed if something important is logged. By only showing nearly all log messages in the status bar, messages can be missed easily. Fixes also an issue where the status bar was accessed before it was initialized (crash with assert). (Fixes #299).
This commit is contained in:
@@ -131,7 +131,6 @@ private:
|
||||
BlackCore::CActionBind m_actionPtt { BlackMisc::Input::pttHotkeyAction(), BlackMisc::CIcons::StandardIconRadio16, this, &SwiftGuiStd::onPttChanged };
|
||||
BlackCore::CActionBindings m_menuHotkeyHandlers;
|
||||
BlackGui::CManagedStatusBar m_statusBar;
|
||||
BlackMisc::CLogHistoryReplica m_logHistoryForStatus { this };
|
||||
BlackMisc::CLogHistoryReplica m_logHistoryForLogButtons { this };
|
||||
BlackMisc::CLogHistoryReplica m_logHistoryForOverlay { this };
|
||||
BlackMisc::CSetting<BlackMisc::Audio::TSettings> m_audioSettings { this };
|
||||
|
||||
@@ -75,13 +75,8 @@ void SwiftGuiStd::init()
|
||||
sGui->initMainApplicationWidget(this);
|
||||
|
||||
// log messages
|
||||
m_logHistoryForStatus.setFilter(CLogPattern().withSeverityAtOrAbove(CStatusMessage::SeverityInfo));
|
||||
m_logHistoryForOverlay.setFilter(CLogPattern().withSeverityAtOrAbove(CStatusMessage::SeverityError));
|
||||
m_logHistoryForLogButtons.setFilter(CLogPattern().withSeverityAtOrAbove(SeverityWarning));
|
||||
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(CLogCategories::validation())) { ui->fr_CentralFrameInside->showOverlayMessage(message); }
|
||||
@@ -96,7 +91,6 @@ void SwiftGuiStd::init()
|
||||
m_statusBar.showWarningButton();
|
||||
}
|
||||
});
|
||||
m_logHistoryForStatus.initialize(sApp->getDataLinkDBus());
|
||||
m_logHistoryForOverlay.initialize(sApp->getDataLinkDBus());
|
||||
m_logHistoryForLogButtons.initialize(sApp->getDataLinkDBus());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user