X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fcoreconfigwizard.h;h=2943c15842587c262763f3f652b4f1b5927eec7c;hp=b22fd19cc2c4684a78f56e44a9a3cab1ee2724c3;hb=54ebc1bf00f4f9a8376629925329f0e72be04662;hpb=258d157a228d2b2b46b01d3b33ab932b9979436a diff --git a/src/qtui/coreconfigwizard.h b/src/qtui/coreconfigwizard.h index b22fd19c..2943c158 100644 --- a/src/qtui/coreconfigwizard.h +++ b/src/qtui/coreconfigwizard.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2016 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -18,10 +18,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef _CORECONFIGWIZARD_H_ -#define _CORECONFIGWIZARD_H_ +#pragma once + +#include +#include -#include #include #include @@ -34,8 +35,10 @@ class CoreConnection; namespace CoreConfigWizardPages { + class SyncPage; class SyncRelayPage; + }; class CoreConfigWizard : public QWizard @@ -54,9 +57,7 @@ public: ConclusionPage }; - CoreConfigWizard(CoreConnection *connection, const QList &backends, const QList &authenticators, QWidget *parent = 0); - QHash backends() const; - QHash authenticators() const; + CoreConfigWizard(CoreConnection *connection, const QVariantList &backendInfos, const QVariantList &authInfos, QWidget *parent = 0); inline CoreConnection *coreConnection() const { return _connection; } @@ -65,7 +66,6 @@ signals: void loginToCore(const QString &user, const QString &password, bool rememberPassword); public slots: - void loginSuccess(); void syncFinished(); private slots: @@ -75,9 +75,6 @@ private slots: void startOver(); private: - QHash _backends; - QHash _authenticators; - CoreConfigWizardPages::SyncPage *syncPage; CoreConfigWizardPages::SyncRelayPage *syncRelayPage; @@ -86,6 +83,7 @@ private: namespace CoreConfigWizardPages { + class IntroPage : public QWizardPage { Q_OBJECT @@ -110,43 +108,51 @@ private: Ui::CoreConfigWizardAdminUserPage ui; }; -// Authentication selection before storage selection. + class AuthenticationSelectionPage : public QWizardPage { Q_OBJECT + using FieldInfo = std::tuple; public: - AuthenticationSelectionPage(const QHash &backends, QWidget *parent = 0); + AuthenticationSelectionPage(const QVariantList &authInfos, QWidget *parent = 0); int nextId() const; - QString selectedBackend() const; - QVariantMap connectionProperties() const; + QString displayName() const; + QString authenticator() const; + QVariantMap authProperties() const; private slots: - void on_backendList_currentIndexChanged(); + void on_backendList_currentIndexChanged(int index); + private: Ui::CoreConfigWizardAuthenticationSelectionPage ui; - QGroupBox *_connectionBox; - QHash _backends; + std::vector _authProperties; + std::vector> _authFields; }; + class StorageSelectionPage : public QWizardPage { Q_OBJECT + using FieldInfo = std::tuple; public: - StorageSelectionPage(const QHash &backends, QWidget *parent = 0); + StorageSelectionPage(const QVariantList &backendInfos, QWidget *parent = 0); int nextId() const; - QString selectedBackend() const; - QVariantMap connectionProperties() const; + QString displayName() const; + QString backend() const; + QVariantMap backendProperties() const; private slots: - void on_backendList_currentIndexChanged(); + void on_backendList_currentIndexChanged(int index); + private: Ui::CoreConfigWizardStorageSelectionPage ui; - QGroupBox *_connectionBox; - QHash _backends; + std::vector _backendProperties; + std::vector> _backendFields; }; + class SyncPage : public QWizardPage { Q_OBJECT @@ -167,8 +173,8 @@ signals: private: Ui::CoreConfigWizardSyncPage ui; - bool complete; - bool hasError; + bool _complete {false}; + bool _hasError {false}; }; @@ -190,6 +196,5 @@ signals: private: Mode mode; }; -} -#endif +}