YES! We finally have dynamic signals between Core and Client, meaning that arbitrary
[quassel.git] / src / qtgui / mainwin.h
index e46e233..f522449 100644 (file)
 #ifndef _MAINWIN_H_
 #define _MAINWIN_H_
 
-#include <QtGui>
 #include "ui_mainwin.h"
 
-#include "quasselui.h"
-//#include "global.h"
-#include "message.h"
-#include "chatwidget.h"
+#include "qtgui.h"
 #include "bufferviewfilter.h"
-#include "bufferview.h"
 
 class ServerListDlg;
 class CoreConnectDlg;
 class Buffer;
 class SettingsDlg;
+class QtGui;
+class Message;
 
-//!\brief The main window and central object of Quassel GUI.
-/** In addition to displaying the main window including standard stuff like a menubar,
- * dockwidgets and of course the chat window, this class also stores all data it
- * receives from the core, and it maintains a list of all known nicks.
- */
-class MainWin : public QMainWindow, public AbstractUi {
+//!\brief The main window of Quassel's QtGui.
+class MainWin : public QMainWindow {
   Q_OBJECT
 
   public:
-    MainWin();
+    MainWin(QtGui *gui, QWidget *parent = 0);
     virtual ~MainWin();
 
     void init();
@@ -56,12 +49,16 @@ class MainWin : public QMainWindow, public AbstractUi {
   protected:
     void closeEvent(QCloseEvent *event);
 
-    //void importOldBacklog();
+  protected slots:
+    void connectedToCore();
+    void disconnectedFromCore();
 
   private slots:
 
     void showServerList();
     void showSettingsDlg();
+    void showCoreConnectionDlg(bool autoConnect = false);
+    void coreConnectionDlgFinished(int result);
 
     void showBuffer(BufferId);
     void showBuffer(Buffer *);
@@ -69,15 +66,21 @@ class MainWin : public QMainWindow, public AbstractUi {
     void importBacklog();
 
   signals:
+    void connectToCore(const QVariantMap &connInfo);
+    void disconnectFromCore();
+    void requestBacklog(BufferId, QVariant, QVariant);
     void importOldBacklog();
 
   private:
     Ui::MainWin ui;
+    QtGui *gui;
 
     void setupMenus();
     void setupViews();
     void setupSettingsDlg();
 
+    void enableMenus();
+
     QSystemTrayIcon *systray;
 
     ServerListDlg *serverListDlg;
@@ -85,9 +88,11 @@ class MainWin : public QMainWindow, public AbstractUi {
     SettingsDlg *settingsDlg;
 
     uint currentBuffer;
+    QString currentProfile;
 
     QList<QDockWidget *> netViews;
 
+    friend class QtGui;
 };
 
 #endif