Skip to content

Commit

Permalink
refactor: Remove log messages from status bar
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
ltoenning committed Oct 6, 2024
1 parent 1fdfa3c commit 13da07f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/swiftguistandard/swiftguistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ class SwiftGuiStd :
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 };
Expand Down
6 changes: 0 additions & 6 deletions src/swiftguistandard/swiftguistdinit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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); }
Expand All @@ -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());

Expand Down

0 comments on commit 13da07f

Please sign in to comment.