Implemented the language selection page

pull/136/head
pvdk 11 years ago
parent d7f9604140
commit c82f0ec35f

@ -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
)

@ -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;
}

@ -0,0 +1,25 @@
#ifndef LANGUAGESELECTIONPAGE_HPP
#define LANGUAGESELECTIONPAGE_HPP
#include <QWizardPage>
#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

@ -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));

@ -21,6 +21,7 @@ namespace Wizard
enum {
Page_Intro,
Page_MethodSelection,
Page_LanguageSelection,
Page_ExistingInstallation,
Page_InstallationTarget,
Page_ComponentSelection,

@ -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;
}

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>WizardPage</class>
<widget class="QWizardPage" name="WizardPage">
<class>LanguageSelectionPage</class>
<widget class="QWizardPage" name="LanguageSelectionPage">
<property name="geometry">
<rect>
<x>0</x>
@ -13,11 +13,17 @@
<property name="windowTitle">
<string>WizardPage</string>
</property>
<property name="title">
<string>Select Morrowind Language</string>
</property>
<property name="subTitle">
<string>What is the language of the Morrowind installation?</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="folderIconLabel">
<widget class="QLabel" name="flagIconLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
<horstretch>0</horstretch>
@ -38,7 +44,7 @@
<item>
<widget class="QLabel" name="infoLabel">
<property name="text">
<string>What is the language of the Morrowind installation?</string>
<string>Select the language of the Morrowind installation.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
@ -48,7 +54,79 @@
</layout>
</item>
<item>
<widget class="QComboBox" name="comboBox"/>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QComboBox" name="languagesComboBox">
<property name="minimumSize">
<size>
<width>250</width>
<height>0</height>
</size>
</property>
<item>
<property name="text">
<string>English</string>
</property>
</item>
<item>
<property name="text">
<string>French</string>
</property>
</item>
<item>
<property name="text">
<string>Russian</string>
</property>
</item>
<item>
<property name="text">
<string>Polish</string>
</property>
</item>
<item>
<property name="text">
<string>Italian</string>
</property>
</item>
<item>
<property name="text">
<string>Spanish</string>
</property>
</item>
<item>
<property name="text">
<string>German</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">

Loading…
Cancel
Save