From 0e1d3237fe280a07a228eda14008bc116e36463a Mon Sep 17 00:00:00 2001 From: pvdk Date: Sun, 8 Dec 2013 22:58:29 +0100 Subject: [PATCH] Added some logic to the page switching --- apps/wizard/componentselectionpage.cpp | 7 +++++++ apps/wizard/componentselectionpage.hpp | 2 ++ apps/wizard/conclusionpage.cpp | 5 +++++ apps/wizard/conclusionpage.hpp | 2 ++ apps/wizard/existinginstallationpage.cpp | 7 +++++++ apps/wizard/existinginstallationpage.hpp | 2 ++ apps/wizard/importpage.cpp | 7 +++++++ apps/wizard/importpage.hpp | 2 ++ apps/wizard/installationpage.cpp | 7 +++++++ apps/wizard/installationpage.hpp | 2 ++ apps/wizard/installationtargetpage.cpp | 7 +++++++ apps/wizard/installationtargetpage.hpp | 2 ++ apps/wizard/intropage.cpp | 7 +++++++ apps/wizard/intropage.hpp | 2 ++ apps/wizard/methodselectionpage.cpp | 11 +++++++++++ apps/wizard/methodselectionpage.hpp | 2 ++ 16 files changed, 74 insertions(+) diff --git a/apps/wizard/componentselectionpage.cpp b/apps/wizard/componentselectionpage.cpp index dbfa9412e..0293bdc05 100644 --- a/apps/wizard/componentselectionpage.cpp +++ b/apps/wizard/componentselectionpage.cpp @@ -1,7 +1,14 @@ #include "componentselectionpage.hpp" +#include "mainwizard.hpp" + Wizard::ComponentSelectionPage::ComponentSelectionPage(QWidget *parent) : QWizardPage(parent) { setupUi(this); } + +int Wizard::ComponentSelectionPage::nextId() const +{ + return MainWizard::Page_Installation; +} diff --git a/apps/wizard/componentselectionpage.hpp b/apps/wizard/componentselectionpage.hpp index cc36ee485..277845774 100644 --- a/apps/wizard/componentselectionpage.hpp +++ b/apps/wizard/componentselectionpage.hpp @@ -14,6 +14,8 @@ namespace Wizard public: ComponentSelectionPage(QWidget *parent = 0); + int nextId() const; + }; } diff --git a/apps/wizard/conclusionpage.cpp b/apps/wizard/conclusionpage.cpp index 2913e431d..567d325b3 100644 --- a/apps/wizard/conclusionpage.cpp +++ b/apps/wizard/conclusionpage.cpp @@ -5,3 +5,8 @@ Wizard::ConclusionPage::ConclusionPage(QWidget *parent) : { setupUi(this); } + +int Wizard::ConclusionPage::nextId() const +{ + return -1; +} diff --git a/apps/wizard/conclusionpage.hpp b/apps/wizard/conclusionpage.hpp index 37c477b44..e00fc0fe3 100644 --- a/apps/wizard/conclusionpage.hpp +++ b/apps/wizard/conclusionpage.hpp @@ -14,6 +14,8 @@ namespace Wizard public: ConclusionPage(QWidget *parent = 0); + int nextId() const; + }; } diff --git a/apps/wizard/existinginstallationpage.cpp b/apps/wizard/existinginstallationpage.cpp index ad540de73..d6dea0af9 100644 --- a/apps/wizard/existinginstallationpage.cpp +++ b/apps/wizard/existinginstallationpage.cpp @@ -1,7 +1,14 @@ #include "existinginstallationpage.hpp" +#include "mainwizard.hpp" + Wizard::ExistingInstallationPage::ExistingInstallationPage(QWidget *parent) : QWizardPage(parent) { setupUi(this); } + +int Wizard::ExistingInstallationPage::nextId() const +{ + return MainWizard::Page_ComponentSelection; +} diff --git a/apps/wizard/existinginstallationpage.hpp b/apps/wizard/existinginstallationpage.hpp index 5048a14d4..823bc2140 100644 --- a/apps/wizard/existinginstallationpage.hpp +++ b/apps/wizard/existinginstallationpage.hpp @@ -14,6 +14,8 @@ namespace Wizard public: ExistingInstallationPage(QWidget *parent = 0); + int nextId() const; + }; } diff --git a/apps/wizard/importpage.cpp b/apps/wizard/importpage.cpp index 2ac92efd0..29db6919d 100644 --- a/apps/wizard/importpage.cpp +++ b/apps/wizard/importpage.cpp @@ -1,7 +1,14 @@ #include "importpage.hpp" +#include "mainwizard.hpp" + Wizard::ImportPage::ImportPage(QWidget *parent) : QWizardPage(parent) { setupUi(this); } + +int Wizard::ImportPage::nextId() const +{ + return MainWizard::Page_Conclusion; +} diff --git a/apps/wizard/importpage.hpp b/apps/wizard/importpage.hpp index e3917c837..f1cc11e03 100644 --- a/apps/wizard/importpage.hpp +++ b/apps/wizard/importpage.hpp @@ -14,6 +14,8 @@ namespace Wizard public: ImportPage(QWidget *parent = 0); + int nextId() const; + }; } diff --git a/apps/wizard/installationpage.cpp b/apps/wizard/installationpage.cpp index 20737ebfb..092cf62e0 100644 --- a/apps/wizard/installationpage.cpp +++ b/apps/wizard/installationpage.cpp @@ -1,7 +1,14 @@ #include "installationpage.hpp" +#include "mainwizard.hpp" + Wizard::InstallationPage::InstallationPage(QWidget *parent) : QWizardPage(parent) { setupUi(this); } + +int Wizard::InstallationPage::nextId() const +{ + return MainWizard::Page_Import; +} diff --git a/apps/wizard/installationpage.hpp b/apps/wizard/installationpage.hpp index 3c4470047..125fcc2e1 100644 --- a/apps/wizard/installationpage.hpp +++ b/apps/wizard/installationpage.hpp @@ -14,6 +14,8 @@ namespace Wizard public: InstallationPage(QWidget *parent = 0); + int nextId() const; + }; } diff --git a/apps/wizard/installationtargetpage.cpp b/apps/wizard/installationtargetpage.cpp index 7632b2331..fa178f913 100644 --- a/apps/wizard/installationtargetpage.cpp +++ b/apps/wizard/installationtargetpage.cpp @@ -1,7 +1,14 @@ #include "installationtargetpage.hpp" +#include "mainwizard.hpp" + Wizard::InstallationTargetPage::InstallationTargetPage(QWidget *parent) : QWizardPage(parent) { setupUi(this); } + +int Wizard::InstallationTargetPage::nextId() const +{ + return MainWizard::Page_ComponentSelection; +} diff --git a/apps/wizard/installationtargetpage.hpp b/apps/wizard/installationtargetpage.hpp index 266d1adc7..4e399b707 100644 --- a/apps/wizard/installationtargetpage.hpp +++ b/apps/wizard/installationtargetpage.hpp @@ -14,6 +14,8 @@ namespace Wizard public: InstallationTargetPage(QWidget *parent = 0); + int nextId() const; + }; } diff --git a/apps/wizard/intropage.cpp b/apps/wizard/intropage.cpp index 7b390f059..72c769ae6 100644 --- a/apps/wizard/intropage.cpp +++ b/apps/wizard/intropage.cpp @@ -1,7 +1,14 @@ #include "intropage.hpp" +#include "mainwizard.hpp" + Wizard::IntroPage::IntroPage(QWidget *parent) : QWizardPage(parent) { setupUi(this); } + +int Wizard::IntroPage::nextId() const +{ + return MainWizard::Page_MethodSelection; +} diff --git a/apps/wizard/intropage.hpp b/apps/wizard/intropage.hpp index b247efd89..603d283fa 100644 --- a/apps/wizard/intropage.hpp +++ b/apps/wizard/intropage.hpp @@ -14,6 +14,8 @@ namespace Wizard public: IntroPage(QWidget *parent = 0); + int nextId() const; + }; } diff --git a/apps/wizard/methodselectionpage.cpp b/apps/wizard/methodselectionpage.cpp index bd9997367..59125f251 100644 --- a/apps/wizard/methodselectionpage.cpp +++ b/apps/wizard/methodselectionpage.cpp @@ -1,7 +1,18 @@ #include "methodselectionpage.hpp" +#include "mainwizard.hpp" + Wizard::MethodSelectionPage::MethodSelectionPage(QWidget *parent) : QWizardPage(parent) { setupUi(this); } + +int Wizard::MethodSelectionPage::nextId() const +{ + if (newLocationRadioButton->isChecked()) { + return MainWizard::Page_InstallationTarget; + } else { + return MainWizard::Page_ExistingInstallation; + } +} diff --git a/apps/wizard/methodselectionpage.hpp b/apps/wizard/methodselectionpage.hpp index cc32a825e..1555ea157 100644 --- a/apps/wizard/methodselectionpage.hpp +++ b/apps/wizard/methodselectionpage.hpp @@ -14,6 +14,8 @@ namespace Wizard public: MethodSelectionPage(QWidget *parent = 0); + int nextId() const; + }; }