X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fmainwin.h;h=13aa2f3d4c98e0c6ecb9e50c1a8632b1f951088f;hb=860dfc7ed65d6810cd759b1f92c2c18616c02393;hp=4d168253e2909db7eb141bc755a105ad05d0811e;hpb=ee7d56f3abdb6ee4ce6c79ddea0142407b4e9e74;p=quassel.git diff --git a/src/qtui/mainwin.h b/src/qtui/mainwin.h index 4d168253..13aa2f3d 100644 --- a/src/qtui/mainwin.h +++ b/src/qtui/mainwin.h @@ -27,11 +27,15 @@ # include #endif +#ifdef Q_WS_WIN +# include +#endif + #include #include "qtui.h" -#include "sessionsettings.h" #include "titlesetter.h" +#include "uisettings.h" class ActionCollection; class BufferView; @@ -42,7 +46,7 @@ class BufferWidget; class InputWidget; class MsgProcessorStatusWidget; class NickListWidget; -class SystemTrayIcon; +class SystemTray; class QMenu; class QLabel; @@ -68,21 +72,29 @@ class MainWin void addBufferView(ClientBufferViewConfig *config); BufferView *allBuffersView() const; - inline QSystemTrayIcon *systemTrayIcon() const; + inline SystemTray *systemTray() const; - virtual bool event(QEvent *event); + bool event(QEvent *event); static void flagRemoteCoreOnly(QObject *object) { object->setProperty("REMOTE_CORE_ONLY", true); } static bool isRemoteCoreOnly(QObject *object) { return object->property("REMOTE_CORE_ONLY").toBool(); } + void saveStateToSettings(UiSettings &); + void restoreStateFromSettings(UiSettings &); + public slots: - void saveStateToSession(const QString &sessionId); - void saveStateToSessionSettings(SessionSettings &s); void showStatusBarMessage(const QString &message); + void toggleMinimizedToTray(); + + //! Bring window to front and focus it + void forceActivated(); + protected: void closeEvent(QCloseEvent *event); - virtual void changeEvent(QEvent *event); + void changeEvent(QEvent *event); + void moveEvent(QMoveEvent *event); + void resizeEvent(QResizeEvent *event); protected slots: void connectedToCore(); @@ -90,7 +102,6 @@ class MainWin void updateLagIndicator(int lag = -1); void disconnectedFromCore(); void setDisconnectedState(); - void systrayActivated(QSystemTrayIcon::ActivationReason); private slots: void addBufferView(int bufferViewConfigId); @@ -121,6 +132,7 @@ class MainWin void connectOrDisconnectFromNet(); void saveStatusBarStatus(bool enabled); + void aboutToQuit(); void loadLayout(); void saveLayout(); @@ -134,7 +146,6 @@ class MainWin KHelpMenu *_kHelpMenu; #endif - QMenu *systrayMenu; QLabel *coreLagLabel; QLabel *sslLabel; MsgProcessorStatusWidget *msgProcessorStatusWidget; @@ -154,11 +165,11 @@ class MainWin void setupToolBars(); void updateIcon(); - void hideToTray(); - void toggleMinimizedToTray(); void enableMenus(); - QSystemTrayIcon *_trayIcon; + void hideToTray(); + + SystemTray *_systemTray; QList _bufferViews; BufferWidget *_bufferWidget; @@ -170,11 +181,20 @@ class MainWin QToolBar *_mainToolBar, *_chatViewToolBar, *_nickToolBar; QWidget *_awayLog; + + QSize _normalSize; //!< Size of the non-maximized window + QPoint _normalPos; //!< Position of the non-maximized window + bool _isHidden; + +#ifdef Q_WS_WIN + DWORD dwTickCount; +#endif + friend class QtUi; }; -QSystemTrayIcon *MainWin::systemTrayIcon() const { - return _trayIcon; +SystemTray *MainWin::systemTray() const { + return _systemTray; } #endif