1 /***************************************************************************
2 * Copyright (C) 2005-09 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 _CORECONFIGWIZARD_H_
22 #define _CORECONFIGWIZARD_H_
26 #include <QVariantMap>
28 #include "ui_coreconfigwizardintropage.h"
29 #include "ui_coreconfigwizardadminuserpage.h"
30 #include "ui_coreconfigwizardstorageselectionpage.h"
31 #include "ui_coreconfigwizardsyncpage.h"
33 namespace CoreConfigWizardPages {
38 class CoreConfigWizard : public QWizard {
52 CoreConfigWizard(const QList<QVariant> &backends, QWidget *parent = 0);
53 QHash<QString, QVariant> backends() const;
56 void setupCore(const QVariant &setupData);
57 void loginToCore(const QVariantMap &loginData);
64 void prepareCoreSetup(const QString &backend, const QVariantMap &connectionProperties);
65 void coreSetupSuccess();
66 void coreSetupFailed(const QString &);
70 QHash<QString, QVariant> _backends;
71 CoreConfigWizardPages::SyncPage *syncPage;
72 CoreConfigWizardPages::SyncRelayPage *syncRelayPage;
75 namespace CoreConfigWizardPages {
77 class IntroPage : public QWizardPage {
81 IntroPage(QWidget *parent = 0);
84 Ui::CoreConfigWizardIntroPage ui;
87 class AdminUserPage : public QWizardPage {
91 AdminUserPage(QWidget *parent = 0);
93 bool isComplete() const;
95 Ui::CoreConfigWizardAdminUserPage ui;
98 class StorageSelectionPage : public QWizardPage {
102 StorageSelectionPage(const QHash<QString, QVariant> &backends, QWidget *parent = 0);
104 QString selectedBackend() const;
105 QVariantMap connectionProperties() const;
108 void on_backendList_currentIndexChanged();
110 Ui::CoreConfigWizardStorageSelectionPage ui;
111 QGroupBox *_connectionBox;
112 QHash<QString, QVariant> _backends;
115 class SyncPage : public QWizardPage {
119 SyncPage(QWidget *parent = 0);
120 void initializePage();
122 bool isComplete() const;
125 void setStatus(const QString &status);
127 void setComplete(bool);
130 void setupCore(const QString &backend, const QVariantMap &);
133 Ui::CoreConfigWizardSyncPage ui;
138 class SyncRelayPage : public QWizardPage {
142 SyncRelayPage(QWidget *parent = 0);
144 enum Mode { Success, Error };
150 void startOver() const;