1 /***************************************************************************
2 * Copyright (C) 2005-08 by the Quassel IRC Team *
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);
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;
106 void on_backendList_currentIndexChanged();
108 Ui::CoreConfigWizardStorageSelectionPage ui;
109 QHash<QString, QVariant> _backends;
112 class SyncPage : public QWizardPage {
116 SyncPage(QWidget *parent = 0);
117 void initializePage();
119 bool isComplete() const;
122 void setStatus(const QString &status);
124 void setComplete(bool);
127 void setupCore(const QString &backend);
130 Ui::CoreConfigWizardSyncPage ui;
135 class SyncRelayPage : public QWizardPage {
139 SyncRelayPage(QWidget *parent = 0);
141 enum Mode { Success, Error };
147 void startOver() const;