+void CoreConnectDlg::startCoreConfig(const QVariantList &backends) {
+ storageBackends = backends;
+ ui.loginStack->setCurrentWidget(ui.coreConfigPage);
+
+ //on_launchCoreConfigWizard_clicked();
+
+}
+
+void CoreConnectDlg::on_launchCoreConfigWizard_clicked() {
+ Q_ASSERT(!wizard);
+ wizard = new CoreConfigWizard(storageBackends, this);
+ connect(wizard, SIGNAL(setupCore(const QVariant &)), clientSyncer, SLOT(doCoreSetup(const QVariant &)));
+ connect(wizard, SIGNAL(loginToCore(const QVariantMap &)), this, SLOT(doLogin(const QVariantMap &)));
+ connect(clientSyncer, SIGNAL(coreSetupSuccess()), wizard, SLOT(coreSetupSuccess()));
+ connect(clientSyncer, SIGNAL(coreSetupFailed(const QString &)), wizard, SLOT(coreSetupFailed(const QString &)));
+ connect(wizard, SIGNAL(accepted()), this, SLOT(configWizardAccepted()));
+ connect(wizard, SIGNAL(rejected()), this, SLOT(configWizardRejected()));
+ connect(clientSyncer, SIGNAL(loginSuccess()), wizard, SLOT(loginSuccess()));
+ connect(clientSyncer, SIGNAL(syncFinished()), wizard, SLOT(syncFinished()));
+ wizard->show();
+}
+
+void CoreConnectDlg::configWizardAccepted() {
+
+ wizard->deleteLater();
+ wizard = 0;
+}
+
+void CoreConnectDlg::configWizardRejected() {
+
+ wizard->deleteLater();
+ wizard = 0;
+ //exit(1); // FIXME
+}
+
+