cleaning up a bit (views menu and mainwin.cpp)
[quassel.git] / src / qtui / mainwin.h
index d841630..5549cde 100644 (file)
@@ -1,11 +1,11 @@
 /***************************************************************************
- *   Copyright (C) 2005-07 by The Quassel Team                             *
+ *   Copyright (C) 2005-08 by the Quassel Project                          *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
  *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
+ *   (at your option) version 3.                                           *
  *                                                                         *
  *   This program is distributed in the hope that it will be useful,       *
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 #include "ui_mainwin.h"
 
 #include "qtui.h"
-#include "bufferviewfilter.h"
+#include "titlesetter.h"
+
+#include <QSystemTrayIcon>
+#include <QTimer>
+
 
 class ServerListDlg;
+class ChannelListDlg;
 class CoreConnectDlg;
 class Buffer;
+class BufferViewConfig;
 class SettingsDlg;
 class QtUi;
 class Message;
+class NickListWidget;
+class DebugConsole;
+
 
 //!\brief The main window of Quassel's QtUi.
 class MainWin : public QMainWindow {
@@ -42,55 +51,103 @@ class MainWin : public QMainWindow {
     virtual ~MainWin();
 
     void init();
-    void addBufferView(const QString &, QAbstractItemModel *, const BufferViewFilter::Modes &, const QList<uint> &);
+    void addBufferView(BufferViewConfig *config = 0);
 
-    AbstractUiMsg *layoutMsg(const Message &);
+    void displayTrayIconMessage(const QString &title, const QString &message);
+
+    virtual bool event(QEvent *event);
+
+  public slots:
+    void setTrayIconActivity(bool active = false);
 
   protected:
     void closeEvent(QCloseEvent *event);
+    virtual void changeEvent(QEvent *event);
 
   protected slots:
     void connectedToCore();
+    void setConnectedState();
+    void securedConnection();
     void disconnectedFromCore();
+    void setDisconnectedState();
+    void systrayActivated( QSystemTrayIcon::ActivationReason );
 
   private slots:
-
-    void showServerList();
+    void addBufferView(int bufferViewConfigId);
+    void removeBufferView(int bufferViewConfigId);
+    void receiveMessage(const Message &msg);
+    void showChannelList(NetworkId netId = NetworkId());
     void showSettingsDlg();
+    void showNetworkDlg();
+    void on_actionManageViews_triggered();
+    void on_actionLockDockPositions_toggled(bool lock);
+    void showAboutDlg();
+    void showDebugConsole();
+
     void showCoreConnectionDlg(bool autoConnect = false);
     void coreConnectionDlgFinished(int result);
 
-    void showBuffer(BufferInfo);
-    void showBuffer(Buffer *);
+    void clientNetworkCreated(NetworkId);
+    void clientNetworkRemoved(NetworkId);
+    void clientNetworkUpdated();
+    void connectOrDisconnectFromNet();
 
-    void importBacklog();
+    void changeTopic(const QString &topic);
+    void makeTrayIconBlink();
+    void saveStatusBarStatus(bool enabled);
 
+    void loadLayout();
+    void saveLayout();
+  
   signals:
     void connectToCore(const QVariantMap &connInfo);
     void disconnectFromCore();
     void requestBacklog(BufferInfo, QVariant, QVariant);
-    void importOldBacklog();
 
   private:
     Ui::MainWin ui;
     QtUi *gui;
 
+    QMenu *systrayMenu;
+    QLabel *sslLabel;
+
+    TitleSetter _titleSetter;
+
     void setupMenus();
     void setupViews();
+    void setupNickWidget();
+    void setupChatMonitor();
+    void setupInputWidget();
+    void setupTopicWidget();
+    void setupStatusBar();
+    void setupSystray();
+
     void setupSettingsDlg();
 
+    void toggleVisibility();
+
     void enableMenus();
 
     QSystemTrayIcon *systray;
+    QIcon activeTrayIcon;
+    QIcon onlineTrayIcon;
+    QIcon offlineTrayIcon;
+    bool trayIconActive;
+    QTimer *timer;
 
-    ServerListDlg *serverListDlg;
     CoreConnectDlg *coreConnectDlg;
+    ChannelListDlg *channelListDlg;
     SettingsDlg *settingsDlg;
+    DebugConsole *debugConsole;
 
-    uint currentBuffer;
+    BufferId currentBuffer;
     QString currentProfile;
 
-    QList<QDockWidget *> netViews;
+    QList<QDockWidget *> _netViews;
+    NickListWidget *nickListWidget;
+
+    QAction *actionEditNetworks;
+    QList<QAction *> networkActions;
 
     friend class QtUi;
 };