refs #485, moved central GUI functionality to sGui

* allow to send status message to main window (from everywhere)
* Use sGui::changedStylesheet where possible
* message when model is stashed
* improved application startup
This commit is contained in:
Klaus Basan
2016-03-13 18:14:19 +00:00
committed by Mathew Sutcliffe
parent b1353cefd4
commit fb046ae1fb
24 changed files with 181 additions and 36 deletions

View File

@@ -54,6 +54,18 @@ SwiftGuiStd::SwiftGuiStd(BlackGui::CEnableForFramelessWindow::WindowMode windowM
SwiftGuiStd::~SwiftGuiStd()
{ }
bool SwiftGuiStd::displayInStatusBar(const CStatusMessage &message)
{
this->ps_displayStatusMessageInGui(message);
return true;
}
bool SwiftGuiStd::displayInOverlayWindow(const CStatusMessage &message)
{
this->ui->fr_CentralFrameInside->showOverlayMessage(message);
return true;
}
void SwiftGuiStd::mouseMoveEvent(QMouseEvent *event)
{
if (!handleMouseMoveEvent(event)) { QMainWindow::mouseMoveEvent(event); }
@@ -197,6 +209,7 @@ bool SwiftGuiStd::isContextAudioAvailableCheck()
void SwiftGuiStd::ps_displayStatusMessageInGui(const CStatusMessage &statusMessage)
{
if (!this->m_init) { return; }
// used with log subscriber
if (statusMessage.wasHandledBy(this)) { return; }
statusMessage.markAsHandledBy(this);
this->m_statusBar.displayStatusMessage(statusMessage);

View File

@@ -16,9 +16,6 @@
#pragma push_macro("interface")
#undef interface
#include "blackcore/contextallinterfaces.h"
#include "blackcore/actionbind.h"
#include "blackcore/data/globalsetup.h"
#include "blackgui/components/maininfoareacomponent.h"
#include "blackgui/components/navigatordialog.h"
#include "blackgui/components/transpondermodeselector.h"
@@ -28,7 +25,10 @@
#include "blackgui/models/statusmessagelistmodel.h"
#include "blackgui/enableforframelesswindow.h"
#include "blackgui/managedstatusbar.h"
#include "blackgui/overlaymessagesframe.h"
#include "blackgui/mainwindowaccess.h"
#include "blackcore/contextallinterfaces.h"
#include "blackcore/actionbind.h"
#include "blackcore/data/globalsetup.h"
#include "blackmisc/network/textmessage.h"
#include "blackmisc/loghandler.h"
#include "blackmisc/identifiable.h"
@@ -46,7 +46,8 @@ namespace Ui { class SwiftGuiStd; }
class SwiftGuiStd :
public QMainWindow,
public BlackMisc::CIdentifiable,
public BlackGui::CEnableForFramelessWindow
public BlackGui::CEnableForFramelessWindow,
public BlackGui::IMainWindowAccess
{
Q_OBJECT
@@ -70,6 +71,12 @@ public:
//! Log message category
static QString getMessageCategory() { return "swift.gui.stdgui"; }
//! \name direct access to main application window
//! @{
virtual bool displayInStatusBar(const BlackMisc::CStatusMessage &message) override;
virtual bool displayInOverlayWindow(const BlackMisc::CStatusMessage &message) override;
//! }@
signals:
//! GUI is shutting down, request graceful shutdown
void requestGracefulShutdown();

View File

@@ -19,7 +19,6 @@ CSwiftGuiStdApplication::CSwiftGuiStdApplication() : CGuiApplication("swift pilo
this->addParserOption(this->m_cmdFacadeMode);
this->addWindowModeOption();
this->addDBusAddressOption();
this->useWebDataServices(CWebReaderFlags::AllReaders, CWebReaderFlags::FromCache);
}
bool CSwiftGuiStdApplication::startHookIn()

View File

@@ -10,9 +10,9 @@
#include "swiftguistd.h"
#include "ui_swiftguistd.h"
#include "blackcore/contextallinterfaces.h"
#include "blackgui/stylesheetutility.h"
#include "blackgui/guiapplication.h"
#include "blackgui/guiutility.h"
#include "blackgui/stylesheetutility.h"
#include "blackgui/components/allmaininfoareacomponents.h"
#include "blackgui/models/atcstationlistmodel.h"
#include "blackmisc/dbusserver.h"
@@ -182,11 +182,11 @@ void SwiftGuiStd::initGuiSignals()
connect(this->ui->menu_InternalsDisplayCachedFiles, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
// command line / text messages
connect(this->ui->comp_MainInfoArea->getTextMessageComponent(), &CTextMessageComponent::displayInInfoWindow, this->ui->fr_CentralFrameInside, &COverlayMessagesFrame::showVariant);
connect(this->ui->comp_MainInfoArea->getTextMessageComponent(), &CTextMessageComponent::displayInInfoWindow, this->ui->fr_CentralFrameInside, &COverlayMessagesFrame::showOverlayVariant);
// settings (GUI component), styles
connect(this->ui->comp_MainInfoArea->getSettingsComponent(), &CSettingsComponent::changedWindowsOpacity, this, &SwiftGuiStd::ps_onChangedWindowOpacity);
connect(&CStyleSheetUtility::instance(), &CStyleSheetUtility::styleSheetsChanged, this, &SwiftGuiStd::ps_onStyleSheetsChanged);
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &SwiftGuiStd::ps_onStyleSheetsChanged);
// sliders
connect(this->ui->comp_MainInfoArea->getSettingsComponent(), &CSettingsComponent::changedUsersUpdateInterval, this->ui->comp_MainInfoArea->getUserComponent(), &CUserComponent::setUpdateIntervalSeconds);