mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-08-12 04:35:41 +08:00
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:
committed by
Mathew Sutcliffe
parent
b1353cefd4
commit
fb046ae1fb
@@ -105,7 +105,7 @@ namespace BlackCore
|
||||
}
|
||||
|
||||
// parsing itself is done
|
||||
if (this->m_startSetupReader)
|
||||
if (this->m_startSetupReader && !this->m_setupReader->isSetupSyncronized())
|
||||
{
|
||||
CStatusMessage m(this->requestReloadOfSetupAndVersion());
|
||||
if (m.isWarningOrAbove())
|
||||
@@ -132,7 +132,7 @@ namespace BlackCore
|
||||
{
|
||||
QCoreApplication::instance()->processEvents(QEventLoop::AllEvents, 250);
|
||||
}
|
||||
if (this->m_startUpCompleted)
|
||||
if (!this->m_startUpCompleted)
|
||||
{
|
||||
CLogMessage(this).error("Waiting for startup timed out");
|
||||
}
|
||||
@@ -250,6 +250,11 @@ namespace BlackCore
|
||||
|
||||
this->m_useContexts = true;
|
||||
this->m_coreFacadeConfig = coreConfig;
|
||||
|
||||
if (!this->m_useWebData)
|
||||
{
|
||||
this->useWebDataServices(CWebReaderFlags::AllReaders, CWebReaderFlags::FromCache);
|
||||
}
|
||||
return this->startCoreFacade(); // will do nothing if setup is not yet loaded
|
||||
}
|
||||
|
||||
@@ -371,16 +376,21 @@ namespace BlackCore
|
||||
{
|
||||
if (success)
|
||||
{
|
||||
if (!this->m_started)
|
||||
{
|
||||
// follow up startups
|
||||
bool s = this->startWebDataServices();
|
||||
this->m_started = s && this->startCoreFacade();
|
||||
}
|
||||
emit setupSyncronized();
|
||||
this->m_started = this->asyncWebAndContextStart();
|
||||
}
|
||||
this->m_startUpCompleted = true;
|
||||
}
|
||||
|
||||
bool CApplication::asyncWebAndContextStart()
|
||||
{
|
||||
if (this->m_started) { return true; }
|
||||
|
||||
// follow up startups
|
||||
bool s = this->startWebDataServices();
|
||||
return s && this->startCoreFacade();
|
||||
}
|
||||
|
||||
void CApplication::severeStartupProblem(const CStatusMessage &message)
|
||||
{
|
||||
CLogMessage(this).preformatted(message);
|
||||
|
||||
@@ -198,6 +198,9 @@ namespace BlackCore
|
||||
virtual void gracefulShutdown();
|
||||
|
||||
signals:
|
||||
//! Setup syncronized
|
||||
void setupSyncronized();
|
||||
|
||||
//! Facade started
|
||||
void coreFacadeStarted();
|
||||
|
||||
@@ -257,6 +260,9 @@ namespace BlackCore
|
||||
//! Init parser
|
||||
void initParser();
|
||||
|
||||
//! Async. start when setup is loaded
|
||||
bool asyncWebAndContextStart();
|
||||
|
||||
//! static init part
|
||||
static void initEnvironment();
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "dblogincomponent.h"
|
||||
#include "ui_dblogincomponent.h"
|
||||
#include "blackgui/overlaymessagesframe.h"
|
||||
#include "blackmisc/verify.h"
|
||||
#include "blackmisc/network/url.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
|
||||
@@ -41,7 +42,7 @@ namespace BlackGui
|
||||
{
|
||||
if (msgs.isEmpty()) { return; }
|
||||
COverlayMessagesFrame *mf = qobject_cast<COverlayMessagesFrame *>(parentWidget());
|
||||
Q_ASSERT_X(mf, Q_FUNC_INFO, "No overlay widget");
|
||||
BLACK_VERIFY_X(mf, Q_FUNC_INFO, "No overlay widget");
|
||||
if (!mf) { return; }
|
||||
mf->showOverlayMessages(msgs);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace BlackGui
|
||||
this->ui->tvp_AircraftModel->menuRemoveItems(CAircraftModelView::MenuHighlightStashed); // not supported here
|
||||
connect(this->ui->tvp_AircraftModel, &CAircraftModelView::requestNewBackendData, this, &CDbModelComponent::ps_reload);
|
||||
connect(this->ui->tvp_AircraftModel, &CAircraftModelView::requestStash, this, &CDbModelComponent::requestStash);
|
||||
connect(&CStyleSheetUtility::instance(), &CStyleSheetUtility::styleSheetsChanged, this, &CDbModelComponent::ps_onStyleSheetChanged);
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CDbModelComponent::ps_onStyleSheetChanged);
|
||||
|
||||
// configure view
|
||||
this->ui->tvp_AircraftModel->setFilterWidget(this->ui->filter_AircraftModelFilter);
|
||||
|
||||
@@ -80,9 +80,8 @@ namespace BlackGui
|
||||
|
||||
CStatusMessage CDbStashComponent::stashModel(const CAircraftModel &model, bool replace)
|
||||
{
|
||||
|
||||
CAircraftModel stashModel(this->consolidateModel(model));
|
||||
CStatusMessage m(validateStashModel(stashModel, replace));
|
||||
const CAircraftModel stashModel(this->consolidateModel(model));
|
||||
const CStatusMessage m(validateStashModel(stashModel, replace));
|
||||
if (!m.isWarningOrAbove())
|
||||
{
|
||||
if (replace)
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "navigatordialog.h"
|
||||
#include "ui_navigatordialog.h"
|
||||
#include "blackgui/guiutility.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackgui/stylesheetutility.h"
|
||||
#include <QToolButton>
|
||||
#include <QGridLayout>
|
||||
@@ -36,7 +37,7 @@ namespace BlackGui
|
||||
this->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(this, &CNavigatorDialog::customContextMenuRequested, this, &CNavigatorDialog::ps_showContextMenu);
|
||||
|
||||
connect(&CStyleSheetUtility::instance(), &CStyleSheetUtility::styleSheetsChanged, this, &CNavigatorDialog::ps_onStyleSheetsChanged);
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CNavigatorDialog::ps_onStyleSheetsChanged);
|
||||
this->ps_onStyleSheetsChanged();
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,8 @@ namespace BlackGui
|
||||
|
||||
void CRegisterComponent::ps_update()
|
||||
{
|
||||
if (!sGui) { return; }
|
||||
Q_ASSERT_X(sGui->supportsContexts(), Q_FUNC_INFO, "Application does not support contexts");
|
||||
this->ui->tvp_RegisteredComponents->updateContainer(sGui->getIContextApplication()->getRegisteredApplications());
|
||||
}
|
||||
} // ns
|
||||
|
||||
@@ -8,7 +8,10 @@
|
||||
*/
|
||||
|
||||
#include "guiapplication.h"
|
||||
#include "guiutility.h"
|
||||
#include "stylesheetutility.h"
|
||||
#include "blackmisc/project.h"
|
||||
#include "blackmisc/verify.h"
|
||||
#include <QApplication>
|
||||
#include <QMessageBox>
|
||||
|
||||
@@ -26,6 +29,7 @@ namespace BlackGui
|
||||
CGuiApplication::CGuiApplication(const QString &applicationName, const QPixmap &icon) : CApplication(applicationName)
|
||||
{
|
||||
setWindowIcon(icon);
|
||||
connect(&CStyleSheetUtility::instance(), &CStyleSheetUtility::styleSheetsChanged, this, &CGuiApplication::styleSheetsChanged);
|
||||
sGui = this;
|
||||
}
|
||||
|
||||
@@ -68,6 +72,17 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
QWidget *CGuiApplication::mainApplicationWindow()
|
||||
{
|
||||
return CGuiUtility::mainApplicationWindow();
|
||||
}
|
||||
|
||||
IMainWindowAccess *CGuiApplication::mainWindowAccess()
|
||||
{
|
||||
IMainWindowAccess *m = dynamic_cast<IMainWindowAccess *>(mainApplicationWindow());
|
||||
return m;
|
||||
}
|
||||
|
||||
void CGuiApplication::initMainApplicationWindow(QWidget *mainWindow) const
|
||||
{
|
||||
if (!mainWindow) { return; }
|
||||
@@ -103,6 +118,22 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
bool CGuiApplication::displayInStatusBar(const CStatusMessage &message)
|
||||
{
|
||||
IMainWindowAccess *m = mainWindowAccess();
|
||||
BLACK_VERIFY_X(m, Q_FUNC_INFO, "No access interface");
|
||||
if (!m) { return false; }
|
||||
return m->displayInStatusBar(message);
|
||||
}
|
||||
|
||||
bool CGuiApplication::displayInOverlayWindow(const CStatusMessage &message)
|
||||
{
|
||||
IMainWindowAccess *m = mainWindowAccess();
|
||||
BLACK_VERIFY_X(m, Q_FUNC_INFO, "No access interface");
|
||||
if (!m) { return false; }
|
||||
return m->displayInOverlayWindow(message);
|
||||
}
|
||||
|
||||
void CGuiApplication::cmdLineHelpMessage()
|
||||
{
|
||||
if (CProject::isRunningOnWindowsNtPlatform())
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#define BLACKGUI_GUIAPPLICATION_H
|
||||
|
||||
#include "blackcore/application.h"
|
||||
#include "blackgui/mainwindowaccess.h"
|
||||
#include "blackgui/enableforframelesswindow.h"
|
||||
#include "blackgui/blackguiexport.h"
|
||||
|
||||
@@ -25,7 +26,9 @@ namespace BlackGui
|
||||
* GUI applications. It is normally used via the global sGui pointer. As an example of how to extend this
|
||||
* class see CSwiftGuiStdApplication.
|
||||
*/
|
||||
class BLACKGUI_EXPORT CGuiApplication : public BlackCore::CApplication
|
||||
class BLACKGUI_EXPORT CGuiApplication :
|
||||
public BlackCore::CApplication,
|
||||
public BlackGui::IMainWindowAccess
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -59,13 +62,29 @@ namespace BlackGui
|
||||
virtual void cmdLineErrorMessage(const QString &cmdLineErrorMessage) const override;
|
||||
//! @}
|
||||
|
||||
//! \name direct access to main application window
|
||||
//! @{
|
||||
virtual bool displayInStatusBar(const BlackMisc::CStatusMessage &message) override;
|
||||
virtual bool displayInOverlayWindow(const BlackMisc::CStatusMessage &message) override;
|
||||
//! }@
|
||||
|
||||
//! Set icon
|
||||
//! \note Pixmap requires a valid QApplication, so it cannot be passed as constructor parameter
|
||||
static void setWindowIcon(const QPixmap &icon);
|
||||
|
||||
//! Main application window
|
||||
static QWidget *mainApplicationWindow();
|
||||
|
||||
//! Main window access
|
||||
static BlackGui::IMainWindowAccess *mainWindowAccess();
|
||||
|
||||
//! Exit application, perform graceful shutdown and exit
|
||||
static void exit(int retcode = 0);
|
||||
|
||||
signals:
|
||||
//! Style sheet changed
|
||||
void styleSheetsChanged();
|
||||
|
||||
protected:
|
||||
//! \name print messages generated during parsing / cmd handling
|
||||
//! @{
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace BlackGui
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QWidget *CGuiUtility::mainApplicationWindowWidget()
|
||||
QWidget *CGuiUtility::mainApplicationWindow()
|
||||
{
|
||||
CEnableForFramelessWindow *mw = mainFramelessEnabledApplicationWindow();
|
||||
if (mw && mw->getWidget())
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace BlackGui
|
||||
static CEnableForFramelessWindow *mainFramelessEnabledApplicationWindow();
|
||||
|
||||
//! Main application window widget
|
||||
static QWidget *mainApplicationWindowWidget();
|
||||
static QWidget *mainApplicationWindow();
|
||||
|
||||
//! Is main window frameless?
|
||||
static bool isMainWindowFrameless();
|
||||
|
||||
31
src/blackgui/mainwindowaccess.h
Normal file
31
src/blackgui/mainwindowaccess.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/* Copyright (C) 2016
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef BLACKGUI_MAINWINDOWACCESS_H
|
||||
#define BLACKGUI_MAINWINDOWACCESS_H
|
||||
|
||||
#include "blackmisc/statusmessage.h"
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
/*!
|
||||
* Direct acccess to main window`s status bar, info bar and such
|
||||
*/
|
||||
class IMainWindowAccess
|
||||
{
|
||||
public:
|
||||
//! Display in status bar
|
||||
virtual bool displayInStatusBar(const BlackMisc::CStatusMessage &message) = 0;
|
||||
|
||||
//! Display in overlay window
|
||||
virtual bool displayInOverlayWindow(const BlackMisc::CStatusMessage &message) = 0;
|
||||
};
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
@@ -92,6 +92,7 @@ namespace BlackGui
|
||||
Q_ASSERT_X(this->m_statusBarIcon, Q_FUNC_INFO, "Missing status bar icon");
|
||||
Q_ASSERT_X(this->m_statusBar, Q_FUNC_INFO, "Missing status bar");
|
||||
|
||||
// used with log subscriber, make sure it is not displayed twice
|
||||
if (statusMessage.wasHandledBy(this)) { return; }
|
||||
statusMessage.markAsHandledBy(this);
|
||||
|
||||
@@ -111,7 +112,7 @@ namespace BlackGui
|
||||
|
||||
void CManagedStatusBar::displayStatusMessages(const BlackMisc::CStatusMessageList &statusMessages)
|
||||
{
|
||||
foreach(CStatusMessage m, statusMessages)
|
||||
foreach (CStatusMessage m, statusMessages)
|
||||
{
|
||||
displayStatusMessage(m);
|
||||
}
|
||||
|
||||
@@ -132,6 +132,7 @@ namespace BlackGui
|
||||
|
||||
signals:
|
||||
//! Sheets have been changed
|
||||
//! \deprecated use BlackGui::CGuiApplication::styleSheetsChanged
|
||||
void styleSheetsChanged();
|
||||
|
||||
private:
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "blackmisc/aviation/liverylist.h"
|
||||
#include "blackmisc/simulation//distributorlist.h"
|
||||
#include "blackgui/shortcut.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackgui/guiutility.h"
|
||||
#include "blackgui/filters/aircraftmodelfilterdialog.h"
|
||||
#include <QHeaderView>
|
||||
@@ -300,11 +301,13 @@ namespace BlackGui
|
||||
{
|
||||
if (!m_menus.testFlag(MenuCanStashModels)) { return; }
|
||||
if (!this->hasSelection()) { return; }
|
||||
emit requestStash(this->selectedObjects());
|
||||
const CAircraftModelList models(this->selectedObjects());
|
||||
emit requestStash(models);
|
||||
if (this->m_stashingClearsSelection)
|
||||
{
|
||||
this->clearSelection();
|
||||
}
|
||||
sGui->displayInStatusBar(CStatusMessage(CStatusMessage::SeverityInfo, "Stashed " + models.getModelStrings(true).join(" ")));
|
||||
}
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -138,7 +138,7 @@ namespace BlackGui
|
||||
|
||||
QWidget *CViewBaseNonTemplate::mainApplicationWindowWidget() const
|
||||
{
|
||||
return CGuiUtility::mainApplicationWindowWidget();
|
||||
return CGuiUtility::mainApplicationWindow();
|
||||
}
|
||||
|
||||
void CViewBaseNonTemplate::setCustomMenu(IMenuDelegate *menu, bool nestPreviousMenu)
|
||||
|
||||
@@ -38,6 +38,7 @@ int main(int argc, char *argv[])
|
||||
a.useContexts(a.isParserOptionSet("coreaudio") ?
|
||||
CCoreFacadeConfig::forCoreAllLocalInDBus(dBusAdress) :
|
||||
CCoreFacadeConfig::forCoreAllLocalInDBusNoAudio(dBusAdress));
|
||||
a.start();
|
||||
|
||||
if (!QSystemTrayIcon::isSystemTrayAvailable())
|
||||
{
|
||||
|
||||
@@ -14,9 +14,8 @@
|
||||
#include "blackmisc/project.h"
|
||||
#include "blackmisc/dbusserver.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackgui/components/logcomponent.h"
|
||||
#include "blackgui/stylesheetutility.h"
|
||||
#include "blackgui/components/logcomponent.h"
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QCloseEvent>
|
||||
@@ -116,7 +115,7 @@ void CSwiftCore::initSlots()
|
||||
connect(ui->pb_StartCore, &QPushButton::clicked, this, &CSwiftCore::ps_startCorePressed);
|
||||
connect(ui->pb_StopCore, &QPushButton::clicked, this, &CSwiftCore::ps_stopCorePressed);
|
||||
connect(ui->rb_P2PBus, &QRadioButton::toggled, this, &CSwiftCore::ps_p2pModeToggled);
|
||||
connect(&CStyleSheetUtility::instance(), &CStyleSheetUtility::styleSheetsChanged, this, &CSwiftCore::ps_onStyleSheetsChanged);
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CSwiftCore::ps_onStyleSheetsChanged);
|
||||
}
|
||||
|
||||
void CSwiftCore::initLogDisplay()
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackgui/components/datamaininfoareacomponent.h"
|
||||
#include "blackgui/components/datainfoareacomponent.h"
|
||||
#include "blackgui/components/dbmappingcomponent.h"
|
||||
#include "blackgui/components/logcomponent.h"
|
||||
#include "blackgui/stylesheetutility.h"
|
||||
#include "blackcore/webdataservices.h"
|
||||
@@ -53,6 +54,18 @@ void CSwiftData::initStyleSheet()
|
||||
CSwiftData::~CSwiftData()
|
||||
{ }
|
||||
|
||||
bool CSwiftData::displayInStatusBar(const CStatusMessage &message)
|
||||
{
|
||||
this->m_statusBar.displayStatusMessage(message);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CSwiftData::displayInOverlayWindow(const CStatusMessage &message)
|
||||
{
|
||||
this->ui->comp_MainInfoArea->getMappingComponent()->showOverlayMessage(message);
|
||||
return true;
|
||||
}
|
||||
|
||||
void CSwiftData::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
@@ -80,7 +93,7 @@ void CSwiftData::init()
|
||||
sGui->initMainApplicationWindow(this);
|
||||
this->initStyleSheet();
|
||||
this->initLogDisplay();
|
||||
connect(&CStyleSheetUtility::instance(), &CStyleSheetUtility::styleSheetsChanged, this, &CSwiftData::ps_onStyleSheetsChanged);
|
||||
connect(sGui, &CGuiApplication::styleSheetsChanged, this, &CSwiftData::ps_onStyleSheetsChanged);
|
||||
this->initMenu();
|
||||
}
|
||||
|
||||
|
||||
@@ -12,12 +12,13 @@
|
||||
#ifndef SWIFTDATA_H
|
||||
#define SWIFTDATA_H
|
||||
|
||||
#include "blackgui/systemtraywindow.h"
|
||||
#include "blackgui/managedstatusbar.h"
|
||||
#include "blackgui/mainwindowaccess.h"
|
||||
#include "blackcore/corefacade.h"
|
||||
#include "blackcore/data/globalsetup.h"
|
||||
#include "blackcore/data/updateinfo.h"
|
||||
#include "blackcore/setupreader.h"
|
||||
#include "blackgui/systemtraywindow.h"
|
||||
#include "blackgui/managedstatusbar.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
#include "blackmisc/identifiable.h"
|
||||
#include <QScopedPointer>
|
||||
@@ -30,7 +31,8 @@ namespace BlackCore { class CWebDataServices; }
|
||||
*/
|
||||
class CSwiftData :
|
||||
public QMainWindow,
|
||||
public BlackMisc::CIdentifiable
|
||||
public BlackMisc::CIdentifiable,
|
||||
public BlackGui::IMainWindowAccess
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -41,6 +43,12 @@ public:
|
||||
//! Destructor
|
||||
~CSwiftData();
|
||||
|
||||
//! \name direct access to main application window
|
||||
//! @{
|
||||
virtual bool displayInStatusBar(const BlackMisc::CStatusMessage &message) override;
|
||||
virtual bool displayInOverlayWindow(const BlackMisc::CStatusMessage &message) override;
|
||||
//! }@
|
||||
|
||||
protected:
|
||||
//! \copydoc QMainWindow::closeEvent
|
||||
virtual void closeEvent(QCloseEvent *event) override;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user