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

@@ -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
//! @{