From c82f0ec35fb6464fd1485e61f0633cb51c8a8660 Mon Sep 17 00:00:00 2001 From: pvdk Date: Fri, 13 Dec 2013 15:30:49 +0100 Subject: [PATCH] Implemented the language selection page --- apps/wizard/CMakeLists.txt | 4 ++ apps/wizard/languageselectionpage.cpp | 18 +++++ apps/wizard/languageselectionpage.hpp | 25 +++++++ apps/wizard/mainwizard.cpp | 2 + apps/wizard/mainwizard.hpp | 1 + apps/wizard/methodselectionpage.cpp | 8 +-- files/ui/wizard/languageselectionpage.ui | 88 ++++++++++++++++++++++-- 7 files changed, 134 insertions(+), 12 deletions(-) create mode 100644 apps/wizard/languageselectionpage.cpp create mode 100644 apps/wizard/languageselectionpage.hpp diff --git a/apps/wizard/CMakeLists.txt b/apps/wizard/CMakeLists.txt index 3ff41c206b..a62327d85b 100644 --- a/apps/wizard/CMakeLists.txt +++ b/apps/wizard/CMakeLists.txt @@ -6,6 +6,7 @@ set(WIZARD installationpage.cpp installationtargetpage.cpp intropage.cpp + languageselectionpage.cpp main.cpp mainwizard.cpp methodselectionpage.cpp @@ -22,6 +23,7 @@ set(WIZARD_HEADER installationpage.hpp installationtargetpage.hpp intropage.hpp + languageselectionpage.hpp mainwizard.hpp methodselectionpage.hpp ) @@ -39,6 +41,7 @@ set(WIZARD_HEADER_MOC installationpage.hpp installationtargetpage.hpp intropage.hpp + languageselectionpage.hpp mainwizard.hpp methodselectionpage.hpp ) @@ -56,6 +59,7 @@ set(WIZARD_UI ${CMAKE_SOURCE_DIR}/files/ui/wizard/installationpage.ui ${CMAKE_SOURCE_DIR}/files/ui/wizard/installationtargetpage.ui ${CMAKE_SOURCE_DIR}/files/ui/wizard/intropage.ui + ${CMAKE_SOURCE_DIR}/files/ui/wizard/languageselectionpage.ui ${CMAKE_SOURCE_DIR}/files/ui/wizard/methodselectionpage.ui ) diff --git a/apps/wizard/languageselectionpage.cpp b/apps/wizard/languageselectionpage.cpp new file mode 100644 index 0000000000..dc64f1ae1b --- /dev/null +++ b/apps/wizard/languageselectionpage.cpp @@ -0,0 +1,18 @@ +#include "languageselectionpage.hpp" + +#include "mainwizard.hpp" + +Wizard::LanguageSelectionPage::LanguageSelectionPage(MainWizard *wizard) : + QWizardPage(wizard), + mWizard(wizard) +{ + setupUi(this); +} + +int Wizard::LanguageSelectionPage::nextId() const +{ + if (field("installation.new").toBool() == true) + return MainWizard::Page_InstallationTarget; + + return MainWizard::Page_ExistingInstallation; +} diff --git a/apps/wizard/languageselectionpage.hpp b/apps/wizard/languageselectionpage.hpp new file mode 100644 index 0000000000..aa7a81ff17 --- /dev/null +++ b/apps/wizard/languageselectionpage.hpp @@ -0,0 +1,25 @@ +#ifndef LANGUAGESELECTIONPAGE_HPP +#define LANGUAGESELECTIONPAGE_HPP + +#include + +#include "ui_languageselectionpage.h" + +namespace Wizard +{ + class MainWizard; + + class LanguageSelectionPage : public QWizardPage, private Ui::LanguageSelectionPage + { + Q_OBJECT + public: + LanguageSelectionPage(MainWizard *wizard); + + int nextId() const; + + private: + MainWizard *mWizard; + }; +} + +#endif // LANGUAGESELECTIONPAGE_HPP diff --git a/apps/wizard/mainwizard.cpp b/apps/wizard/mainwizard.cpp index a741546fdc..77f17499ef 100644 --- a/apps/wizard/mainwizard.cpp +++ b/apps/wizard/mainwizard.cpp @@ -5,6 +5,7 @@ #include "intropage.hpp" #include "methodselectionpage.hpp" +#include "languageselectionpage.hpp" #include "existinginstallationpage.hpp" #include "installationtargetpage.hpp" #include "componentselectionpage.hpp" @@ -57,6 +58,7 @@ void Wizard::MainWizard::setupPages() { setPage(Page_Intro, new IntroPage(this)); setPage(Page_MethodSelection, new MethodSelectionPage(this)); + setPage(Page_LanguageSelection, new LanguageSelectionPage(this)); setPage(Page_ExistingInstallation, new ExistingInstallationPage(this)); setPage(Page_InstallationTarget, new InstallationTargetPage(this)); setPage(Page_ComponentSelection, new ComponentSelectionPage(this)); diff --git a/apps/wizard/mainwizard.hpp b/apps/wizard/mainwizard.hpp index 15706e8e35..c6b541d35b 100644 --- a/apps/wizard/mainwizard.hpp +++ b/apps/wizard/mainwizard.hpp @@ -21,6 +21,7 @@ namespace Wizard enum { Page_Intro, Page_MethodSelection, + Page_LanguageSelection, Page_ExistingInstallation, Page_InstallationTarget, Page_ComponentSelection, diff --git a/apps/wizard/methodselectionpage.cpp b/apps/wizard/methodselectionpage.cpp index 1efffc13d8..4185fa2bcb 100644 --- a/apps/wizard/methodselectionpage.cpp +++ b/apps/wizard/methodselectionpage.cpp @@ -13,11 +13,5 @@ Wizard::MethodSelectionPage::MethodSelectionPage(MainWizard *wizard) : int Wizard::MethodSelectionPage::nextId() const { - if (newLocationRadioButton->isChecked()) { - //wizard()->setField("installation.new", true); - return MainWizard::Page_InstallationTarget; - } else { - //wizard()->setField("installation.new", false); - return MainWizard::Page_ExistingInstallation; - } + return MainWizard::Page_LanguageSelection; } diff --git a/files/ui/wizard/languageselectionpage.ui b/files/ui/wizard/languageselectionpage.ui index 134a9de86b..a76e3004b3 100644 --- a/files/ui/wizard/languageselectionpage.ui +++ b/files/ui/wizard/languageselectionpage.ui @@ -1,7 +1,7 @@ - WizardPage - + LanguageSelectionPage + 0 @@ -13,11 +13,17 @@ WizardPage + + Select Morrowind Language + + + What is the language of the Morrowind installation? + - + 0 @@ -38,7 +44,7 @@ - What is the language of the Morrowind installation? + Select the language of the Morrowind installation. true @@ -48,7 +54,79 @@ - + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 250 + 0 + + + + + English + + + + + French + + + + + Russian + + + + + Polish + + + + + Italian + + + + + Spanish + + + + + German + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + +