X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fcoreconnectdlg.h;h=3cd729470aea271c731261137d1cc66eaaee95e2;hp=55041b92bf47b093d90837a4afc7e69147ba3c1c;hb=2a7928256ace73ac40b89b8c327cf08815da882d;hpb=99c92e21b3b9eb5ed661632cdfb69aabfc6b2deb diff --git a/src/qtui/coreconnectdlg.h b/src/qtui/coreconnectdlg.h index 55041b92..3cd72947 100644 --- a/src/qtui/coreconnectdlg.h +++ b/src/qtui/coreconnectdlg.h @@ -1,11 +1,11 @@ /*************************************************************************** - * Copyright (C) 2005/06 by The Quassel Team * + * Copyright (C) 2005-08 by the Quassel IRC Team * * 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 * @@ -18,52 +18,106 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef _CORECONNECTDLG_H -#define _CORECONNECTDLG_H +#ifndef _CORECONNECTDLG_H_ +#define _CORECONNECTDLG_H_ + +#include + +#include "types.h" #include "ui_coreconnectdlg.h" +#include "ui_coreaccounteditdlg.h" -class CoreConnectDlg: public QDialog { +class ClientSyncer; +class CoreConfigWizard; + +class CoreConnectDlg : public QDialog { Q_OBJECT public: - CoreConnectDlg(QWidget *parent, bool doAutoConnect = false); + CoreConnectDlg(QWidget *parent = 0, bool = false); ~CoreConnectDlg(); - QVariant getCoreState(); - - bool willDoInternalAutoConnect(); - - public slots: - void doAutoConnect(); private slots: - void createAccount(); - void removeAccount(); - void accountChanged(const QString & = ""); - void setAccountEditEnabled(bool); - void autoConnectToggled(bool); - bool checkInputValid(); - void hostEditChanged(QString); - void hostSelected(); - void doConnect(); - - void coreConnected(); - void coreConnectionError(QString); - //void coreConnectionMsg(const QString &); - //void coreConnectionProgress(uint partial, uint total); - void updateProgressBar(uint partial, uint total); - void recvCoreState(QVariant); - - void showConfigWizard(const QVariantMap &coredata); + + /*** Phase Null: Accounts ***/ + void restartPhaseNull(); + + 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); + void encrypted(bool); + + /*** Phase Two: Login ***/ + void startLogin(); + void doLogin(); + void doLogin(const QVariantMap &loginData); + void loginFailed(const QString &); + void startCoreConfig(const QVariantList &backends); + void configWizardAccepted(); + void configWizardRejected(); + void on_launchCoreConfigWizard_clicked(); + + void setLoginWidgetStates(); + + /*** Phase Three: Sync ***/ + void startSync(); + void syncFinished(); + + void coreSessionProgress(quint32, quint32); + void coreNetworksProgress(quint32, quint32); private: Ui::CoreConnectDlg ui; - QVariant coreState; - void cancelConnect(); - void setStartState(); + AccountId autoConnectAccount; + QHash accounts; QVariantMap accountData; - QString curacc; + AccountId account; + + bool doingAutoConnect; + + QVariantList storageBackends; + + ClientSyncer *clientSyncer; + CoreConfigWizard *wizard; +}; + +class CoreAccountEditDlg : public QDialog { + Q_OBJECT + + public: + CoreAccountEditDlg(AccountId id, const QVariantMap &data, const QStringList &existing = QStringList(), QWidget *parent = 0); + + QVariantMap accountData(); + + private slots: + void on_host_textChanged(const QString &); + void on_accountName_textChanged(const QString &); + void on_useRemote_toggled(bool); + + void setWidgetStates(); + + private: + Ui::CoreAccountEditDlg ui; + + QStringList existing; + QVariantMap account; }; #endif