fixed focus when closing ChatViewSearchbar
[quassel.git] / src / qtui / mainwin.h
index c905e08..9807550 100644 (file)
@@ -31,8 +31,6 @@
 #  include <windows.h>
 #endif
 
-#include <QSystemTrayIcon>
-
 #include "qtui.h"
 #include "titlesetter.h"
 #include "uisettings.h"
@@ -42,12 +40,15 @@ class BufferHotListFilter;
 class BufferView;
 class BufferViewConfig;
 class ClientBufferViewConfig;
+class CoreAccount;
+class CoreConnectionStatusWidget;
 class BufferViewDock;
 class BufferWidget;
 class InputWidget;
 class MsgProcessorStatusWidget;
 class NickListWidget;
 class SystemTray;
+class ChatMonitorView;
 
 class QMenu;
 class QLabel;
@@ -73,7 +74,11 @@ class MainWin
     void addBufferView(ClientBufferViewConfig *config);
     BufferView *allBuffersView() const;
 
-    inline SystemTray *systemTray() const;
+    inline BufferWidget *bufferWidget() const { return _bufferWidget; }
+
+#ifndef QT_NO_SYSTEMTRAYICON
+    inline SystemTray *systemTray() const { return _systemTray; }
+#endif
 
     bool event(QEvent *event);
 
@@ -86,11 +91,16 @@ class MainWin
   public slots:
     void showStatusBarMessage(const QString &message);
 
+#ifndef QT_NO_SYSTEMTRAYICON
     void toggleMinimizedToTray();
+#endif
 
     //! Bring window to front and focus it
     void forceActivated();
 
+    //! Quit application
+    void quit();
+
   protected:
     void closeEvent(QCloseEvent *event);
     void changeEvent(QEvent *event);
@@ -100,7 +110,6 @@ class MainWin
   protected slots:
     void connectedToCore();
     void setConnectedState();
-    void updateLagIndicator(int lag = -1);
     void disconnectedFromCore();
     void setDisconnectedState();
 
@@ -108,18 +117,28 @@ class MainWin
     void addBufferView(int bufferViewConfigId);
     void awayLogDestroyed();
     void removeBufferView(int bufferViewConfigId);
+    void currentBufferChanged(BufferId);
     void messagesInserted(const QModelIndex &parent, int start, int end);
     void showAboutDlg();
     void showChannelList(NetworkId netId = NetworkId());
-    void startInternalCore();
-    void showCoreConnectionDlg(bool autoConnect = false);
+    void showCoreConnectionDlg();
+    void showCoreConfigWizard(const QVariantList &);
     void showCoreInfoDlg();
     void showAwayLog();
     void showSettingsDlg();
     void showNotificationsDlg();
+    void showIgnoreList(QString newRule = QString());
 #ifdef HAVE_KDE
     void showShortcutsDlg();
 #endif
+    void handleCoreConnectionError(const QString &errorMsg);
+    void userAuthenticationRequired(CoreAccount *, bool *valid, const QString &errorMessage);
+    void handleNoSslInClient(bool *accepted);
+    void handleNoSslInCore(bool *accepted);
+#ifdef HAVE_SSL
+    void handleSslErrors(const QSslSocket *socket, bool *accepted, bool *permanently);
+#endif
+
     void on_actionConfigureNetworks_triggered();
     void on_actionConfigureViews_triggered();
     void on_actionLockLayout_toggled(bool lock);
@@ -135,8 +154,8 @@ class MainWin
     void clientNetworkUpdated();
     void connectOrDisconnectFromNet();
 
+    void saveMenuBarStatus(bool enabled);
     void saveStatusBarStatus(bool enabled);
-    void aboutToQuit();
 
     void loadLayout();
     void saveLayout();
@@ -152,9 +171,8 @@ class MainWin
     KHelpMenu *_kHelpMenu;
 #endif
 
-    QLabel *coreLagLabel;
-    QLabel *sslLabel;
-    MsgProcessorStatusWidget *msgProcessorStatusWidget;
+    MsgProcessorStatusWidget *_msgProcessorStatusWidget;
+    CoreConnectionStatusWidget *_coreConnectionStatusWidget;
 
     TitleSetter _titleSetter;
 
@@ -174,14 +192,16 @@ class MainWin
     void updateIcon();
     void enableMenus();
 
+#ifndef QT_NO_SYSTEMTRAYICON
     void hideToTray();
-
     SystemTray *_systemTray;
+#endif
 
     QList<BufferViewDock *> _bufferViews;
     BufferWidget *_bufferWidget;
     NickListWidget *_nickListWidget;
     InputWidget *_inputWidget;
+    ChatMonitorView *_chatMonitorView;
 
     QMenu *_fileMenu, *_networksMenu, *_viewMenu, *_bufferViewsMenu, *_settingsMenu, *_helpMenu, *_helpDebugMenu;
     QMenu *_toolbarMenu;
@@ -189,9 +209,10 @@ class MainWin
 
     QWidget *_awayLog;
 
+    bool _layoutLoaded;
+
     QSize _normalSize; //!< Size of the non-maximized window
     QPoint _normalPos; //!< Position of the non-maximized window
-    bool _isHidden;
 
 #ifdef Q_WS_WIN
     DWORD dwTickCount;
@@ -202,8 +223,4 @@ class MainWin
     friend class QtUi;
 };
 
-SystemTray *MainWin::systemTray() const {
-  return _systemTray;
-}
-
 #endif