X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fqtui.h;h=9a00ef4e4e4684bb0e35743e05a01b8c480d63de;hp=db06409c3651306bae5c7c3cd4f982f8ecc831f2;hb=d0e9b9ff20a9b8e41b7983c6601aa4e04a50062f;hpb=011d2825dd89d2f93a72a49748581b16cc9bdb50 diff --git a/src/qtui/qtui.h b/src/qtui/qtui.h index db06409c..9a00ef4e 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; @@ -48,19 +49,21 @@ public: inline static QtUiStyle *style(); inline static MainWin *mainWindow(); - //! Access the global ActionCollection. - /** This ActionCollection is associated with the main window, i.e. it contains global + //! Access global ActionCollections. + /** These ActionCollections are associated with the main window, i.e. they contain global * actions (and thus, shortcuts). Widgets providing application-wide shortcuts should - * create appropriate Action objects using QtUi::actionCollection()->add\(). + * create appropriate Action objects using QtUi::actionCollection(cat)->add\(). + * @param category The category (default: "General") */ - inline static ActionCollection *actionCollection(); + static ActionCollection *actionCollection(const QString &category = "General"); + inline AbstractActionProvider *actionProvider() const; /* Notifications */ static void registerNotificationBackend(AbstractNotificationBackend *); static void unregisterNotificationBackend(AbstractNotificationBackend *); static void unregisterAllNotificationBackends(); - static const QSet ¬ificationBackends(); + static const QList ¬ificationBackends(); static uint invokeNotification(BufferId bufId, const QString &sender, const QString &text); static void closeNotification(uint notificationId); static void closeNotifications(BufferId bufferId = BufferId()); @@ -74,15 +77,17 @@ protected slots: void disconnectedFromCore(); private: - static MainWin *_mainWin; - static ActionCollection *_actionCollection; + AbstractActionProvider *_actionProvider; + + static QPointer _mainWin; + static QHash _actionCollections; static QtUiStyle *_style; - static QSet _notificationBackends; + static QList _notificationBackends; static QList _notifications; }; -ActionCollection *QtUi::actionCollection() { return _actionCollection; } QtUiStyle *QtUi::style() { return _style; } MainWin *QtUi::mainWindow() { return _mainWin; } +AbstractActionProvider *QtUi::actionProvider() const { return _actionProvider; } #endif