Fix header guard
[quassel.git] / src / qtui / coreconnectdlg.h
index 4714a01..040d5ec 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-08 by the Quassel IRC Team                         *
+ *   Copyright (C) 2005-2014 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   You should have received a copy of the GNU General Public License     *
  *   along with this program; if not, write to the                         *
  *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
-#ifndef _CORECONNECTDLG_H_
-#define _CORECONNECTDLG_H_
+#ifndef CORECONNECTDLG_H
+#define CORECONNECTDLG_H
 
-#include <QAbstractSocket>
+#include <QDialog>
 
-#include "ui_coreconnectdlg.h"
-#include "ui_coreaccounteditdlg.h"
+#include "coreaccount.h"
 
-class ClientSyncer;
+#include "ui_coreconnectauthdlg.h"
 
-class CoreConnectDlg : public QDialog {
-  Q_OBJECT
+class CoreAccountSettingsPage;
 
-  public:
-    CoreConnectDlg(QWidget *parent = 0, bool = false);
-    ~CoreConnectDlg();
+class CoreConnectDlg : public QDialog
+{
+    Q_OBJECT
 
-  private slots:
+public:
+    CoreConnectDlg(QWidget *parent = 0);
+    AccountId selectedAccount() const;
 
-    /*** Phase Null: Accounts ***/
-    void restartPhaseNull();
+    void accept();
 
-    void on_accountList_itemSelectionChanged();
-    void on_autoConnect_clicked(bool);
-
-    void on_addAccount_clicked();
-    void on_editAccount_clicked();
-    void on_deleteAccount_clicked();
-
-    void on_accountList_itemDoubleClicked(QListWidgetItem *item);
-    void on_accountButtonBox_accepted();
-
-    void setAccountWidgetStates();
-
-    /*** Phase One: Connection ***/
-    void connectToCore();
-
-    void initPhaseError(const QString &error);
-    void initPhaseMsg(const QString &msg);
-    void initPhaseSocketState(QAbstractSocket::SocketState);
-
-    /*** Phase Two: Login ***/
-    void startLogin();
-    void doLogin();
-    void loginFailed(const QString &);
-
-    void setLoginWidgetStates();
-
-    /*** Phase Three: Sync ***/
-    void startSync();
-
-    void coreSessionProgress(quint32, quint32);
-    void coreNetworksProgress(quint32, quint32);
-    void coreChannelsProgress(quint32, quint32);
-    void coreIrcUsersProgress(quint32, quint32);
-
-  private:
-    Ui::CoreConnectDlg ui;
-
-    QString autoConnectAccount;
-    QHash<QString, QVariantMap> accounts;
-    QVariantMap account;
-    QString accountName;
-
-    bool doingAutoConnect;
-
-    ClientSyncer *clientSyncer;
+private:
+    CoreAccountSettingsPage *_settingsPage;
 };
 
-class CoreAccountEditDlg : public QDialog {
-  Q_OBJECT
-
-  public:
-    CoreAccountEditDlg(const QString &name, const QVariantMap &data, const QStringList &existing = QStringList(), QWidget *parent = 0);
 
-    QString accountName() const;
-    QVariantMap accountData();
+class CoreConnectAuthDlg : public QDialog
+{
+    Q_OBJECT
 
-  private slots:
-    void on_host_textChanged(const QString &);
-    void on_accountName_textChanged(const QString &);
-    void on_useRemote_toggled(bool);
+public:
+    CoreConnectAuthDlg(CoreAccount *account, QWidget *parent = 0);
 
-    void setWidgetStates();
+    void accept();
 
-  private:
-    Ui::CoreAccountEditDlg ui;
+private slots:
+    void setButtonStates();
 
-    QStringList existing;
-    QVariantMap account;
+private:
+    Ui::CoreConnectAuthDlg ui;
+    CoreAccount *_account;
 };
 
+
 #endif