X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fqtui.h;h=af267cad5e761452fb070d1472a5274f471a3843;hb=e531fd1f1ea36a360a9d876c94e73b0f3b1bcd22;hp=52c06b3a2d71a59a84d1a944c85899517625f1b8;hpb=4fc9a40ac1c6f34116cea134d4bfee8569e01c25;p=quassel.git diff --git a/src/qtui/qtui.h b/src/qtui/qtui.h index 52c06b3a..af267cad 100644 --- a/src/qtui/qtui.h +++ b/src/qtui/qtui.h @@ -24,6 +24,7 @@ #include "quasselui.h" #include "abstractnotificationbackend.h" +#include "mainwin.h" class ActionCollection; class MainWin; @@ -45,6 +46,7 @@ public: MessageModel *createMessageModel(QObject *parent); AbstractMessageProcessor *createMessageProcessor(QObject *parent); + inline static QtUi *instance(); inline static QtUiStyle *style(); inline static MainWin *mainWindow(); @@ -74,17 +76,20 @@ public slots: protected slots: void connectedToCore(); void disconnectedFromCore(); + void notificationActivated(); private: AbstractActionProvider *_actionProvider; - static MainWin *_mainWin; + static QPointer _instance; + static QPointer _mainWin; static QHash _actionCollections; static QtUiStyle *_style; static QList _notificationBackends; static QList _notifications; }; +QtUi *QtUi::instance() { return _instance ? _instance.data() : new QtUi(); } QtUiStyle *QtUi::style() { return _style; } MainWin *QtUi::mainWindow() { return _mainWin; } AbstractActionProvider *QtUi::actionProvider() const { return _actionProvider; }