diff --git a/apps/wizard/CMakeLists.txt b/apps/wizard/CMakeLists.txt index d6423daad..3ff41c206 100644 --- a/apps/wizard/CMakeLists.txt +++ b/apps/wizard/CMakeLists.txt @@ -1,14 +1,29 @@ set(WIZARD + componentselectionpage.cpp + conclusionpage.cpp + existinginstallationpage.cpp + importpage.cpp + installationpage.cpp + installationtargetpage.cpp + intropage.cpp main.cpp - wizard.cpp - + mainwizard.cpp + methodselectionpage.cpp ) # if(NOT WIN32) # LIST(APPEND WIZARD unshieldthread.cpp) # endif(NOT WIN32) set(WIZARD_HEADER - wizard.hpp + componentselectionpage.hpp + conclusionpage.hpp + existinginstallationpage.hpp + importpage.hpp + installationpage.hpp + installationtargetpage.hpp + intropage.hpp + mainwizard.hpp + methodselectionpage.hpp ) # if(NOT WIN32) # LIST(APPEND WIZARD_HEADER unshieldthread.hpp) @@ -17,7 +32,15 @@ set(WIZARD_HEADER # Headers that must be pre-processed set(WIZARD_HEADER_MOC - wizard.hpp + componentselectionpage.hpp + conclusionpage.hpp + existinginstallationpage.hpp + importpage.hpp + installationpage.hpp + installationtargetpage.hpp + intropage.hpp + mainwizard.hpp + methodselectionpage.hpp ) # if(NOT WIN32) @@ -28,7 +51,6 @@ set(WIZARD_HEADER_MOC set(WIZARD_UI ${CMAKE_SOURCE_DIR}/files/ui/wizard/componentselectionpage.ui ${CMAKE_SOURCE_DIR}/files/ui/wizard/conclusionpage.ui - ${CMAKE_SOURCE_DIR}/files/ui/wizard/configurationpage.ui ${CMAKE_SOURCE_DIR}/files/ui/wizard/existinginstallationpage.ui ${CMAKE_SOURCE_DIR}/files/ui/wizard/importpage.ui ${CMAKE_SOURCE_DIR}/files/ui/wizard/installationpage.ui diff --git a/apps/wizard/componentselectionpage.cpp b/apps/wizard/componentselectionpage.cpp new file mode 100644 index 000000000..dbfa9412e --- /dev/null +++ b/apps/wizard/componentselectionpage.cpp @@ -0,0 +1,7 @@ +#include "componentselectionpage.hpp" + +Wizard::ComponentSelectionPage::ComponentSelectionPage(QWidget *parent) : + QWizardPage(parent) +{ + setupUi(this); +} diff --git a/apps/wizard/componentselectionpage.hpp b/apps/wizard/componentselectionpage.hpp new file mode 100644 index 000000000..cc36ee485 --- /dev/null +++ b/apps/wizard/componentselectionpage.hpp @@ -0,0 +1,21 @@ +#ifndef COMPONENTSELECTIONPAGE_HPP +#define COMPONENTSELECTIONPAGE_HPP + +#include + +#include "ui_componentselectionpage.h" + +namespace Wizard +{ + + class ComponentSelectionPage : public QWizardPage, private Ui::ComponentSelectionPage + { + Q_OBJECT + public: + ComponentSelectionPage(QWidget *parent = 0); + + }; + +} + +#endif // COMPONENTSELECTIONPAGE_HPP diff --git a/apps/wizard/conclusionpage.cpp b/apps/wizard/conclusionpage.cpp new file mode 100644 index 000000000..2913e431d --- /dev/null +++ b/apps/wizard/conclusionpage.cpp @@ -0,0 +1,7 @@ +#include "conclusionpage.hpp" + +Wizard::ConclusionPage::ConclusionPage(QWidget *parent) : + QWizardPage(parent) +{ + setupUi(this); +} diff --git a/apps/wizard/conclusionpage.hpp b/apps/wizard/conclusionpage.hpp new file mode 100644 index 000000000..37c477b44 --- /dev/null +++ b/apps/wizard/conclusionpage.hpp @@ -0,0 +1,21 @@ +#ifndef CONCLUSIONPAGE_HPP +#define CONCLUSIONPAGE_HPP + +#include + +#include "ui_conclusionpage.h" + +namespace Wizard +{ + + class ConclusionPage : public QWizardPage, private Ui::ConclusionPage + { + Q_OBJECT + public: + ConclusionPage(QWidget *parent = 0); + + }; + +} + +#endif // CONCLUSIONPAGE_HPP diff --git a/apps/wizard/existinginstallationpage.cpp b/apps/wizard/existinginstallationpage.cpp new file mode 100644 index 000000000..ad540de73 --- /dev/null +++ b/apps/wizard/existinginstallationpage.cpp @@ -0,0 +1,7 @@ +#include "existinginstallationpage.hpp" + +Wizard::ExistingInstallationPage::ExistingInstallationPage(QWidget *parent) : + QWizardPage(parent) +{ + setupUi(this); +} diff --git a/apps/wizard/existinginstallationpage.hpp b/apps/wizard/existinginstallationpage.hpp new file mode 100644 index 000000000..5048a14d4 --- /dev/null +++ b/apps/wizard/existinginstallationpage.hpp @@ -0,0 +1,21 @@ +#ifndef EXISTINGINSTALLATIONPAGE_HPP +#define EXISTINGINSTALLATIONPAGE_HPP + +#include + +#include "ui_existinginstallationpage.h" + +namespace Wizard +{ + + class ExistingInstallationPage : public QWizardPage, private Ui::ExistingInstallationPage + { + Q_OBJECT + public: + ExistingInstallationPage(QWidget *parent = 0); + + }; + +} + +#endif // EXISTINGINSTALLATIONPAGE_HPP diff --git a/apps/wizard/importpage.cpp b/apps/wizard/importpage.cpp new file mode 100644 index 000000000..2ac92efd0 --- /dev/null +++ b/apps/wizard/importpage.cpp @@ -0,0 +1,7 @@ +#include "importpage.hpp" + +Wizard::ImportPage::ImportPage(QWidget *parent) : + QWizardPage(parent) +{ + setupUi(this); +} diff --git a/apps/wizard/importpage.hpp b/apps/wizard/importpage.hpp new file mode 100644 index 000000000..e3917c837 --- /dev/null +++ b/apps/wizard/importpage.hpp @@ -0,0 +1,21 @@ +#ifndef IMPORTPAGE_HPP +#define IMPORTPAGE_HPP + +#include + +#include "ui_importpage.h" + +namespace Wizard +{ + + class ImportPage : public QWizardPage, private Ui::ImportPage + { + Q_OBJECT + public: + ImportPage(QWidget *parent = 0); + + }; + +} + +#endif // IMPORTPAGE_HPP diff --git a/apps/wizard/installationpage.cpp b/apps/wizard/installationpage.cpp new file mode 100644 index 000000000..20737ebfb --- /dev/null +++ b/apps/wizard/installationpage.cpp @@ -0,0 +1,7 @@ +#include "installationpage.hpp" + +Wizard::InstallationPage::InstallationPage(QWidget *parent) : + QWizardPage(parent) +{ + setupUi(this); +} diff --git a/apps/wizard/installationpage.hpp b/apps/wizard/installationpage.hpp new file mode 100644 index 000000000..3c4470047 --- /dev/null +++ b/apps/wizard/installationpage.hpp @@ -0,0 +1,21 @@ +#ifndef INSTALLATIONPAGE_HPP +#define INSTALLATIONPAGE_HPP + +#include + +#include "ui_installationpage.h" + +namespace Wizard +{ + + class InstallationPage : public QWizardPage, private Ui::InstallationPage + { + Q_OBJECT + public: + InstallationPage(QWidget *parent = 0); + + }; + +} + +#endif // INSTALLATIONPAGE_HPP diff --git a/apps/wizard/installationtargetpage.cpp b/apps/wizard/installationtargetpage.cpp new file mode 100644 index 000000000..7632b2331 --- /dev/null +++ b/apps/wizard/installationtargetpage.cpp @@ -0,0 +1,7 @@ +#include "installationtargetpage.hpp" + +Wizard::InstallationTargetPage::InstallationTargetPage(QWidget *parent) : + QWizardPage(parent) +{ + setupUi(this); +} diff --git a/apps/wizard/installationtargetpage.hpp b/apps/wizard/installationtargetpage.hpp new file mode 100644 index 000000000..266d1adc7 --- /dev/null +++ b/apps/wizard/installationtargetpage.hpp @@ -0,0 +1,21 @@ +#ifndef INSTALLATIONTARGETPAGE_HPP +#define INSTALLATIONTARGETPAGE_HPP + +#include + +#include "ui_installationtargetpage.h" + +namespace Wizard +{ + + class InstallationTargetPage : public QWizardPage, private Ui::InstallationTargetPage + { + Q_OBJECT + public: + InstallationTargetPage(QWidget *parent = 0); + + }; + +} + +#endif // INSTALLATIONTARGETPAGE_HPP diff --git a/apps/wizard/intropage.cpp b/apps/wizard/intropage.cpp new file mode 100644 index 000000000..7b390f059 --- /dev/null +++ b/apps/wizard/intropage.cpp @@ -0,0 +1,7 @@ +#include "intropage.hpp" + +Wizard::IntroPage::IntroPage(QWidget *parent) : + QWizardPage(parent) +{ + setupUi(this); +} diff --git a/apps/wizard/intropage.hpp b/apps/wizard/intropage.hpp new file mode 100644 index 000000000..b247efd89 --- /dev/null +++ b/apps/wizard/intropage.hpp @@ -0,0 +1,21 @@ +#ifndef INTROPAGE_HPP +#define INTROPAGE_HPP + +#include + +#include "ui_intropage.h" + +namespace Wizard +{ + + class IntroPage : public QWizardPage, private Ui::IntroPage + { + Q_OBJECT + public: + IntroPage(QWidget *parent = 0); + + }; + +} + +#endif // INTROPAGE_HPP diff --git a/apps/wizard/main.cpp b/apps/wizard/main.cpp index ed3f3a6ea..e6a94118a 100644 --- a/apps/wizard/main.cpp +++ b/apps/wizard/main.cpp @@ -3,6 +3,8 @@ #include #include +#include "mainwizard.hpp" + #ifdef MAC_OS_X_VERSION_MIN_REQUIRED #undef MAC_OS_X_VERSION_MIN_REQUIRED // We need to do this because of Qt: https://bugreports.qt-project.org/browse/QTBUG-22154 @@ -39,13 +41,8 @@ int main(int argc, char *argv[]) // Support non-latin characters QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); -// Launcher::MainDialog mainWin; - -// if (mainWin.setup()) { -// mainWin.show(); -// } else { -// return 0; -// } + Wizard::MainWizard wizard; + wizard.show(); return app.exec(); } diff --git a/apps/wizard/mainwizard.cpp b/apps/wizard/mainwizard.cpp new file mode 100644 index 000000000..438d9e576 --- /dev/null +++ b/apps/wizard/mainwizard.cpp @@ -0,0 +1,36 @@ +#include "mainwizard.hpp" +#include "intropage.hpp" +#include "methodselectionpage.hpp" +#include "existinginstallationpage.hpp" +#include "installationtargetpage.hpp" +#include "componentselectionpage.hpp" +#include "installationpage.hpp" +#include "importpage.hpp" +#include "conclusionpage.hpp" + +Wizard::MainWizard::MainWizard(QWidget *parent) : + QWizard(parent) +{ + +#ifndef Q_OS_MAC + setWizardStyle(QWizard::ModernStyle); +#else + setWizardStyle(QWizard::ClassicStyle); +#endif + + setWindowTitle(tr("OpenMW Wizard")); + setupPages(); +} + +void Wizard::MainWizard::setupPages() +{ + setPage(Page_Intro, new IntroPage); + setPage(Page_MethodSelection, new MethodSelectionPage); + setPage(Page_ExistingInstallation, new ExistingInstallationPage); + setPage(Page_InstallationTarget, new InstallationTargetPage); + setPage(Page_ComponentSelection, new ComponentSelectionPage); + setPage(Page_Installation, new InstallationPage); + setPage(Page_Import, new ImportPage); + setPage(Page_Conclusion, new ConclusionPage); + setStartId(Page_Intro); +} diff --git a/apps/wizard/mainwizard.hpp b/apps/wizard/mainwizard.hpp new file mode 100644 index 000000000..e5cdc866b --- /dev/null +++ b/apps/wizard/mainwizard.hpp @@ -0,0 +1,33 @@ +#ifndef MAINWIZARD_HPP +#define MAINWIZARD_HPP + +#include + +namespace Wizard +{ + + class MainWizard : public QWizard + { + Q_OBJECT + + public: + enum { + Page_Intro, + Page_MethodSelection, + Page_ExistingInstallation, + Page_InstallationTarget, + Page_ComponentSelection, + Page_Installation, + Page_Import, + Page_Conclusion + }; + + MainWizard(QWidget *parent = 0); + + private: + void setupPages(); + }; + +} + +#endif // MAINWIZARD_HPP diff --git a/apps/wizard/methodselectionpage.cpp b/apps/wizard/methodselectionpage.cpp new file mode 100644 index 000000000..bd9997367 --- /dev/null +++ b/apps/wizard/methodselectionpage.cpp @@ -0,0 +1,7 @@ +#include "methodselectionpage.hpp" + +Wizard::MethodSelectionPage::MethodSelectionPage(QWidget *parent) : + QWizardPage(parent) +{ + setupUi(this); +} diff --git a/apps/wizard/methodselectionpage.hpp b/apps/wizard/methodselectionpage.hpp new file mode 100644 index 000000000..cc32a825e --- /dev/null +++ b/apps/wizard/methodselectionpage.hpp @@ -0,0 +1,21 @@ +#ifndef METHODSELECTIONPAGE_HPP +#define METHODSELECTIONPAGE_HPP + +#include + +#include "ui_methodselectionpage.h" + +namespace Wizard +{ + + class MethodSelectionPage : public QWizardPage, private Ui::MethodSelectionPage + { + Q_OBJECT + public: + MethodSelectionPage(QWidget *parent = 0); + + }; + +} + +#endif // METHODSELECTIONPAGE_HPP diff --git a/apps/wizard/wizard.cpp b/apps/wizard/wizard.cpp deleted file mode 100644 index 8d1c8b69c..000000000 --- a/apps/wizard/wizard.cpp +++ /dev/null @@ -1 +0,0 @@ - diff --git a/apps/wizard/wizard.hpp b/apps/wizard/wizard.hpp deleted file mode 100644 index 8d1c8b69c..000000000 --- a/apps/wizard/wizard.hpp +++ /dev/null @@ -1 +0,0 @@ - diff --git a/files/ui/wizard/configurationpage.ui b/files/ui/wizard/configurationpage.ui deleted file mode 100644 index 8340b2ebf..000000000 --- a/files/ui/wizard/configurationpage.ui +++ /dev/null @@ -1,58 +0,0 @@ - - - WizardPage - - - - 0 - 0 - 440 - 300 - - - - WizardPage - - - - - - <html><head/><body><p>OpenMW needs to import settings from the Morrowind configuration file in order to function properly. Select the steps you want to be taken and click Next when you are ready to continue.</p><p><span style=" font-weight:600;">Note:</span> it is possible to import settings later, by re-running this Wizard.</p><p/></body></html> - - - true - - - - - - - Import settings from Morrowind.ini - - - - - - - Import selected add-ons (creates a new Cotent List in the launcher) - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - diff --git a/files/ui/wizard/installationtargetpage.ui b/files/ui/wizard/installationtargetpage.ui index 6bdac5592..c87214d8d 100644 --- a/files/ui/wizard/installationtargetpage.ui +++ b/files/ui/wizard/installationtargetpage.ui @@ -53,16 +53,6 @@ - - - - Click Next to continue. If you would like to select a different location, click Browse. - - - true - - -