X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fcoreconfigwizard.h;h=bed887bd880ebab222ae8f63426e66e5996379f3;hp=1940fee4dd658646bcb92e4f4db392a396acca3c;hb=f04db2cb802b1296ca739c823495930c71d3b4ab;hpb=0c9cd0eef379e1d3e10a75cc8506a7e65f95fd67 diff --git a/src/qtui/coreconfigwizard.h b/src/qtui/coreconfigwizard.h index 1940fee4..bed887bd 100644 --- a/src/qtui/coreconfigwizard.h +++ b/src/qtui/coreconfigwizard.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel IRC Team * + * Copyright (C) 2005-2013 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -15,7 +15,7 @@ * 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 _CORECONFIGWIZARD_H_ @@ -30,126 +30,144 @@ #include "ui_coreconfigwizardstorageselectionpage.h" #include "ui_coreconfigwizardsyncpage.h" +class CoreConnection; + namespace CoreConfigWizardPages { - class SyncPage; - class SyncRelayPage; +class SyncPage; +class SyncRelayPage; }; -class CoreConfigWizard : public QWizard { - Q_OBJECT +class CoreConfigWizard : public QWizard +{ + Q_OBJECT - public: +public: enum { - IntroPage, - AdminUserPage, - StorageSelectionPage, - SyncPage, - SyncRelayPage, - StorageDetailsPage, - ConclusionPage + IntroPage, + AdminUserPage, + StorageSelectionPage, + SyncPage, + SyncRelayPage, + StorageDetailsPage, + ConclusionPage }; - CoreConfigWizard(const QList &backends, QWidget *parent = 0); + CoreConfigWizard(CoreConnection *connection, const QList &backends, QWidget *parent = 0); QHash backends() const; - signals: + inline CoreConnection *coreConnection() const { return _connection; } + +signals: void setupCore(const QVariant &setupData); - void loginToCore(const QVariantMap &loginData); + void loginToCore(const QString &user, const QString &password, bool rememberPassword); - public slots: +public slots: void loginSuccess(); void syncFinished(); - private slots: - void prepareCoreSetup(const QString &backend); +private slots: + void prepareCoreSetup(const QString &backend, const QVariantMap &connectionProperties); void coreSetupSuccess(); void coreSetupFailed(const QString &); void startOver(); - private: +private: QHash _backends; CoreConfigWizardPages::SyncPage *syncPage; CoreConfigWizardPages::SyncRelayPage *syncRelayPage; + + CoreConnection *_connection; }; -namespace CoreConfigWizardPages { - class IntroPage : public QWizardPage { +namespace CoreConfigWizardPages { +class IntroPage : public QWizardPage +{ Q_OBJECT - public: - IntroPage(QWidget *parent = 0); - int nextId() const; - private: - Ui::CoreConfigWizardIntroPage ui; - }; +public: + IntroPage(QWidget *parent = 0); + int nextId() const; +private: + Ui::CoreConfigWizardIntroPage ui; +}; + - class AdminUserPage : public QWizardPage { +class AdminUserPage : public QWizardPage +{ Q_OBJECT - public: - AdminUserPage(QWidget *parent = 0); - int nextId() const; - bool isComplete() const; - private: - Ui::CoreConfigWizardAdminUserPage ui; - }; +public: + AdminUserPage(QWidget *parent = 0); + int nextId() const; + bool isComplete() const; +private: + Ui::CoreConfigWizardAdminUserPage ui; +}; + - class StorageSelectionPage : public QWizardPage { +class StorageSelectionPage : public QWizardPage +{ Q_OBJECT - public: - StorageSelectionPage(const QHash &backends, QWidget *parent = 0); - int nextId() const; - QString selectedBackend() const; - private slots: - void on_backendList_currentIndexChanged(); - private: - Ui::CoreConfigWizardStorageSelectionPage ui; - QHash _backends; - }; - - class SyncPage : public QWizardPage { +public: + StorageSelectionPage(const QHash &backends, QWidget *parent = 0); + int nextId() const; + QString selectedBackend() const; + QVariantMap connectionProperties() const; + +private slots: + void on_backendList_currentIndexChanged(); +private: + Ui::CoreConfigWizardStorageSelectionPage ui; + QGroupBox *_connectionBox; + QHash _backends; +}; + + +class SyncPage : public QWizardPage +{ Q_OBJECT - public: - SyncPage(QWidget *parent = 0); - void initializePage(); - int nextId() const; - bool isComplete() const; +public: + SyncPage(QWidget *parent = 0); + void initializePage(); + int nextId() const; + bool isComplete() const; - public slots: - void setStatus(const QString &status); - void setError(bool); - void setComplete(bool); +public slots: + void setStatus(const QString &status); + void setError(bool); + void setComplete(bool); - signals: - void setupCore(const QString &backend); +signals: + void setupCore(const QString &backend, const QVariantMap &); - private: - Ui::CoreConfigWizardSyncPage ui; - bool complete; - bool hasError; - }; +private: + Ui::CoreConfigWizardSyncPage ui; + bool complete; + bool hasError; +}; - class SyncRelayPage : public QWizardPage { - Q_OBJECT - public: - SyncRelayPage(QWidget *parent = 0); - int nextId() const; - enum Mode { Success, Error }; +class SyncRelayPage : public QWizardPage +{ + Q_OBJECT - public slots: - void setMode(Mode); +public: + SyncRelayPage(QWidget *parent = 0); + int nextId() const; + enum Mode { Success, Error }; - signals: - void startOver() const; +public slots: + void setMode(Mode); - private: - Mode mode; - }; +signals: + void startOver() const; +private: + Mode mode; +}; } #endif