mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-17 01:10:10 +00:00
Implemented the language selection page
This commit is contained in:
parent
d7f9604140
commit
c82f0ec35f
@ -6,6 +6,7 @@ set(WIZARD
|
|||||||
installationpage.cpp
|
installationpage.cpp
|
||||||
installationtargetpage.cpp
|
installationtargetpage.cpp
|
||||||
intropage.cpp
|
intropage.cpp
|
||||||
|
languageselectionpage.cpp
|
||||||
main.cpp
|
main.cpp
|
||||||
mainwizard.cpp
|
mainwizard.cpp
|
||||||
methodselectionpage.cpp
|
methodselectionpage.cpp
|
||||||
@ -22,6 +23,7 @@ set(WIZARD_HEADER
|
|||||||
installationpage.hpp
|
installationpage.hpp
|
||||||
installationtargetpage.hpp
|
installationtargetpage.hpp
|
||||||
intropage.hpp
|
intropage.hpp
|
||||||
|
languageselectionpage.hpp
|
||||||
mainwizard.hpp
|
mainwizard.hpp
|
||||||
methodselectionpage.hpp
|
methodselectionpage.hpp
|
||||||
)
|
)
|
||||||
@ -39,6 +41,7 @@ set(WIZARD_HEADER_MOC
|
|||||||
installationpage.hpp
|
installationpage.hpp
|
||||||
installationtargetpage.hpp
|
installationtargetpage.hpp
|
||||||
intropage.hpp
|
intropage.hpp
|
||||||
|
languageselectionpage.hpp
|
||||||
mainwizard.hpp
|
mainwizard.hpp
|
||||||
methodselectionpage.hpp
|
methodselectionpage.hpp
|
||||||
)
|
)
|
||||||
@ -56,6 +59,7 @@ set(WIZARD_UI
|
|||||||
${CMAKE_SOURCE_DIR}/files/ui/wizard/installationpage.ui
|
${CMAKE_SOURCE_DIR}/files/ui/wizard/installationpage.ui
|
||||||
${CMAKE_SOURCE_DIR}/files/ui/wizard/installationtargetpage.ui
|
${CMAKE_SOURCE_DIR}/files/ui/wizard/installationtargetpage.ui
|
||||||
${CMAKE_SOURCE_DIR}/files/ui/wizard/intropage.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
|
${CMAKE_SOURCE_DIR}/files/ui/wizard/methodselectionpage.ui
|
||||||
)
|
)
|
||||||
|
|
||||||
|
18
apps/wizard/languageselectionpage.cpp
Normal file
18
apps/wizard/languageselectionpage.cpp
Normal file
@ -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;
|
||||||
|
}
|
25
apps/wizard/languageselectionpage.hpp
Normal file
25
apps/wizard/languageselectionpage.hpp
Normal file
@ -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 "intropage.hpp"
|
||||||
#include "methodselectionpage.hpp"
|
#include "methodselectionpage.hpp"
|
||||||
|
#include "languageselectionpage.hpp"
|
||||||
#include "existinginstallationpage.hpp"
|
#include "existinginstallationpage.hpp"
|
||||||
#include "installationtargetpage.hpp"
|
#include "installationtargetpage.hpp"
|
||||||
#include "componentselectionpage.hpp"
|
#include "componentselectionpage.hpp"
|
||||||
@ -57,6 +58,7 @@ void Wizard::MainWizard::setupPages()
|
|||||||
{
|
{
|
||||||
setPage(Page_Intro, new IntroPage(this));
|
setPage(Page_Intro, new IntroPage(this));
|
||||||
setPage(Page_MethodSelection, new MethodSelectionPage(this));
|
setPage(Page_MethodSelection, new MethodSelectionPage(this));
|
||||||
|
setPage(Page_LanguageSelection, new LanguageSelectionPage(this));
|
||||||
setPage(Page_ExistingInstallation, new ExistingInstallationPage(this));
|
setPage(Page_ExistingInstallation, new ExistingInstallationPage(this));
|
||||||
setPage(Page_InstallationTarget, new InstallationTargetPage(this));
|
setPage(Page_InstallationTarget, new InstallationTargetPage(this));
|
||||||
setPage(Page_ComponentSelection, new ComponentSelectionPage(this));
|
setPage(Page_ComponentSelection, new ComponentSelectionPage(this));
|
||||||
|
@ -21,6 +21,7 @@ namespace Wizard
|
|||||||
enum {
|
enum {
|
||||||
Page_Intro,
|
Page_Intro,
|
||||||
Page_MethodSelection,
|
Page_MethodSelection,
|
||||||
|
Page_LanguageSelection,
|
||||||
Page_ExistingInstallation,
|
Page_ExistingInstallation,
|
||||||
Page_InstallationTarget,
|
Page_InstallationTarget,
|
||||||
Page_ComponentSelection,
|
Page_ComponentSelection,
|
||||||
|
@ -13,11 +13,5 @@ Wizard::MethodSelectionPage::MethodSelectionPage(MainWizard *wizard) :
|
|||||||
|
|
||||||
int Wizard::MethodSelectionPage::nextId() const
|
int Wizard::MethodSelectionPage::nextId() const
|
||||||
{
|
{
|
||||||
if (newLocationRadioButton->isChecked()) {
|
return MainWizard::Page_LanguageSelection;
|
||||||
//wizard()->setField("installation.new", true);
|
|
||||||
return MainWizard::Page_InstallationTarget;
|
|
||||||
} else {
|
|
||||||
//wizard()->setField("installation.new", false);
|
|
||||||
return MainWizard::Page_ExistingInstallation;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>WizardPage</class>
|
<class>LanguageSelectionPage</class>
|
||||||
<widget class="QWizardPage" name="WizardPage">
|
<widget class="QWizardPage" name="LanguageSelectionPage">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
@ -13,11 +13,17 @@
|
|||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>WizardPage</string>
|
<string>WizardPage</string>
|
||||||
</property>
|
</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">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="folderIconLabel">
|
<widget class="QLabel" name="flagIconLabel">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@ -38,7 +44,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="infoLabel">
|
<widget class="QLabel" name="infoLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>What is the language of the Morrowind installation?</string>
|
<string>Select the language of the Morrowind installation.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="wordWrap">
|
<property name="wordWrap">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@ -48,7 +54,79 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<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>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
|
Loading…
Reference in New Issue
Block a user