1 /***************************************************************************
2 * Copyright (C) 2005-08 by the Quassel Project *
3 * devel@quassel-irc.org *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) version 3. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
21 #ifndef _CORECONNECTDLG_H
22 #define _CORECONNECTDLG_H
24 #include <QAbstractSocket>
28 #include "ui_coreconnectdlg.h"
29 #include "ui_coreconnectprogressdlg.h"
30 #include "ui_coreaccounteditdlg.h"
33 class CoreConnectProgressDlg;
35 class CoreConnectDlg : public QDialog {
39 CoreConnectDlg(QWidget *parent = 0, bool doAutoConnect = false);
41 QVariant getCoreState();
47 void setWidgetStates();
49 void connectionSuccess();
50 void connectionFailure();
52 /*** Phase One: Connection ***/
54 void restartPhaseNull();
55 void initPhaseError(const QString &error);
56 void initPhaseMsg(const QString &msg);
57 void initPhaseSocketState(QAbstractSocket::SocketState);
59 /*** Phase Two: Login ***/
61 void loginFailed(const QString &);
63 /*** Phase Three: Sync ***/
67 Ui::CoreConnectDlg ui;
68 ClientSyncer *clientSyncer;
70 AccountId autoConnectAccount;
71 QHash<AccountId, QVariantMap> accounts;
72 QVariantMap accountData;
75 void editAccount(QString);
77 QAction *newAccAction, *editAccAction, *delAccAction;
79 CoreConnectProgressDlg *progressDlg;
82 class CoreAccountEditDlg : public QDialog {
86 CoreAccountEditDlg(AccountId id, const QVariantMap &data, const QStringList &existing = QStringList(), QWidget *parent = 0);
87 QVariantMap accountData();
96 Ui::CoreAccountEditDlg ui;
102 class CoreConnectProgressDlg : public QDialog {
106 CoreConnectProgressDlg(ClientSyncer *, QDialog *parent = 0);
112 void coreSessionProgress(quint32, quint32);
113 void coreNetworksProgress(quint32, quint32);
114 void coreChannelsProgress(quint32, quint32);
115 void coreIrcUsersProgress(quint32, quint32);
118 Ui::CoreConnectProgressDlg ui;