X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fqtui.h;h=44c47411d02535afcf28ae456013fe441308a1e9;hb=5b57b917b4905f7ae9e253bd331ec1ff274a5467;hp=7ef22e0dc6fe36b1605796d6963003e043da6ecf;hpb=9ea27e456f4163c37118f6dc34188809fc37d6d9;p=quassel.git diff --git a/src/qtui/qtui.h b/src/qtui/qtui.h index 7ef22e0d..44c47411 100644 --- a/src/qtui/qtui.h +++ b/src/qtui/qtui.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-09 by the Quassel Project * + * Copyright (C) 2005-2010 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -24,12 +24,11 @@ #include "graphicalui.h" #include "abstractnotificationbackend.h" -#include "mainwin.h" +#include "qtuistyle.h" class MainWin; class MessageModel; class QtUiMessageProcessor; -class QtUiStyle; //! This class encapsulates Quassel's Qt-based GUI. /** This is basically a wrapper around MainWin, which is necessary because we cannot derive MainWin @@ -49,6 +48,8 @@ public: inline static QtUiStyle *style(); inline static MainWin *mainWindow(); + static bool haveSystemTray(); + /* Notifications */ static void registerNotificationBackend(AbstractNotificationBackend *); @@ -68,16 +69,24 @@ protected slots: void disconnectedFromCore(); void notificationActivated(uint notificationId); +protected: + virtual void minimizeRestore(bool show); + virtual bool isHidingMainWidgetAllowed() const; + +private slots: + void useSystemTrayChanged(const QVariant &); + private: - static QPointer _instance; - static QPointer _mainWin; - static QtUiStyle *_style; + static QtUi *_instance; + static MainWin *_mainWin; static QList _notificationBackends; static QList _notifications; + + bool _useSystemTray; }; -QtUi *QtUi::instance() { return _instance ? _instance.data() : new QtUi(); } -QtUiStyle *QtUi::style() { return _style; } +QtUi *QtUi::instance() { return _instance ? _instance : new QtUi(); } +QtUiStyle *QtUi::style() { return qobject_cast(uiStyle()); } MainWin *QtUi::mainWindow() { return _mainWin; } #endif