diff --git a/apps/wizard/CMakeLists.txt b/apps/wizard/CMakeLists.txt new file mode 100644 index 000000000..d6423daad --- /dev/null +++ b/apps/wizard/CMakeLists.txt @@ -0,0 +1,96 @@ +set(WIZARD + main.cpp + wizard.cpp + +) +# if(NOT WIN32) +# LIST(APPEND WIZARD unshieldthread.cpp) +# endif(NOT WIN32) + +set(WIZARD_HEADER + wizard.hpp +) +# if(NOT WIN32) +# LIST(APPEND WIZARD_HEADER unshieldthread.hpp) +# endif(NOT WIN32) + + +# Headers that must be pre-processed +set(WIZARD_HEADER_MOC + wizard.hpp +) + +# if(NOT WIN32) +# LIST(APPEND WIZARD_HEADER_MOC unshieldthread.hpp) +# endif(NOT WIN32) + + +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 + ${CMAKE_SOURCE_DIR}/files/ui/wizard/installationtargetpage.ui + ${CMAKE_SOURCE_DIR}/files/ui/wizard/intropage.ui + ${CMAKE_SOURCE_DIR}/files/ui/wizard/methodselectionpage.ui +) + +source_group(wizard FILES ${WIZARD} ${WIZARD_HEADER}) + +find_package(Qt4 REQUIRED) +set(QT_USE_QTGUI 1) + +# Set some platform specific settings +if(WIN32) + set(GUI_TYPE WIN32) + set(QT_USE_QTMAIN TRUE) +endif(WIN32) + +QT4_ADD_RESOURCES(RCC_SRCS ${CMAKE_SOURCE_DIR}/files/wizard/wizard.qrc) +QT4_WRAP_CPP(MOC_SRCS ${WIZARD_HEADER_MOC}) +QT4_WRAP_UI(UI_HDRS ${WIZARD_UI}) + + +include(${QT_USE_FILE}) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) +if(NOT WIN32) + include_directories(${LIBUNSHIELD_INCLUDE}) +endif(NOT WIN32) + +add_executable(openmw-wizard + ${GUI_TYPE} + ${WIZARD} + ${WIZARD_HEADER} + ${RCC_SRCS} + ${MOC_SRCS} + ${UI_HDRS} +) + +target_link_libraries(openmw-wizard +# ${Boost_LIBRARIES} + ${QT_LIBRARIES} +) +if(NOT WIN32) + target_link_libraries(openmw-wizard + ${LIBUNSHIELD_LIBRARY} + ) +endif(NOT WIN32) + + + +if(DPKG_PROGRAM) + INSTALL(TARGETS openmw-wizard RUNTIME DESTINATION games COMPONENT openmw-wizard) +endif() + +if (BUILD_WITH_CODE_COVERAGE) + add_definitions (--coverage) + target_link_libraries(openmw-wizard gcov) +endif() + +# Workaround for binutil => 2.23 problem when linking, should be fixed eventually upstream +if (UNIX AND NOT APPLE) +target_link_libraries(openmw-wizard dl Xt) +endif() + diff --git a/apps/wizard/main.cpp b/apps/wizard/main.cpp new file mode 100644 index 000000000..ed3f3a6ea --- /dev/null +++ b/apps/wizard/main.cpp @@ -0,0 +1,51 @@ +#include +#include +#include +#include + +#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 +#define MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ +#endif // MAC_OS_X_VERSION_MIN_REQUIRED + +int main(int argc, char *argv[]) +{ + + QApplication app(argc, argv); + + // Now we make sure the current dir is set to application path + QDir dir(QCoreApplication::applicationDirPath()); + + #ifdef Q_OS_MAC + if (dir.dirName() == "MacOS") { + dir.cdUp(); + dir.cdUp(); + dir.cdUp(); + } + + // force Qt to load only LOCAL plugins, don't touch system Qt installation + QDir pluginsPath(QCoreApplication::applicationDirPath()); + pluginsPath.cdUp(); + pluginsPath.cd("Plugins"); + + QStringList libraryPaths; + libraryPaths << pluginsPath.path() << QCoreApplication::applicationDirPath(); + app.setLibraryPaths(libraryPaths); + #endif + + QDir::setCurrent(dir.absolutePath()); + + // Support non-latin characters + QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); + +// Launcher::MainDialog mainWin; + +// if (mainWin.setup()) { +// mainWin.show(); +// } else { +// return 0; +// } + + return app.exec(); +} diff --git a/apps/wizard/wizard.cpp b/apps/wizard/wizard.cpp new file mode 100644 index 000000000..8d1c8b69c --- /dev/null +++ b/apps/wizard/wizard.cpp @@ -0,0 +1 @@ + diff --git a/apps/wizard/wizard.hpp b/apps/wizard/wizard.hpp new file mode 100644 index 000000000..8d1c8b69c --- /dev/null +++ b/apps/wizard/wizard.hpp @@ -0,0 +1 @@ + diff --git a/files/ui/wizard/componentselectionpage.ui b/files/ui/wizard/componentselectionpage.ui new file mode 100644 index 000000000..c3333752a --- /dev/null +++ b/files/ui/wizard/componentselectionpage.ui @@ -0,0 +1,60 @@ + + + ComponentSelectionPage + + + + 0 + 0 + 454 + 393 + + + + WizardPage + + + Select Components + + + Which components should be installed? + + + + + + <html><head/><body><p>Select which official Morrowind expansions should be installed. For best results, it is recommended to have both expansions installed.</p><p><span style=" font-weight:bold;">Note:</span> It is possible to install expansions later by re-running this Wizard.<br/></p></body></html> + + + true + + + + + + + Selected components: + + + + + + + + + + Qt::Vertical + + + + 20 + 81 + + + + + + + + + diff --git a/files/ui/wizard/conclusionpage.ui b/files/ui/wizard/conclusionpage.ui new file mode 100644 index 000000000..bedad3e2a --- /dev/null +++ b/files/ui/wizard/conclusionpage.ui @@ -0,0 +1,36 @@ + + + ConclusionPage + + + + 0 + 0 + 400 + 300 + + + + WizardPage + + + Completing the OpenMW Wizard + + + + + + The OpenMW Wizard successfully installed Morrowind on your computer. + +Click Finish to close the Wizard. + + + true + + + + + + + + diff --git a/files/ui/wizard/configurationpage.ui b/files/ui/wizard/configurationpage.ui new file mode 100644 index 000000000..8340b2ebf --- /dev/null +++ b/files/ui/wizard/configurationpage.ui @@ -0,0 +1,58 @@ + + + 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/existinginstallationpage.ui b/files/ui/wizard/existinginstallationpage.ui new file mode 100644 index 000000000..579ddbe67 --- /dev/null +++ b/files/ui/wizard/existinginstallationpage.ui @@ -0,0 +1,85 @@ + + + ExistingInstallationPage + + + + 0 + 0 + 400 + 300 + + + + WizardPage + + + Select Existing Installation + + + Select an existing installation for OpenMW to use or modify. + + + + + + Detected Installations: + + + + + + + + No existing installations detected + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Browse... + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + diff --git a/files/ui/wizard/importpage.ui b/files/ui/wizard/importpage.ui new file mode 100644 index 000000000..21037f3e8 --- /dev/null +++ b/files/ui/wizard/importpage.ui @@ -0,0 +1,67 @@ + + + ImportPage + + + + 0 + 0 + 513 + 328 + + + + WizardPage + + + Import Settings + + + Import settings from the Morrowind installation. + + + + + + <html><head/><body><p>OpenMW needs to import settings from the Morrowind configuration file in order to function properly.</p><p><span style=" font-weight:bold;">Note:</span> It is possible to import settings later by re-running this Wizard.</p><p/></body></html> + + + true + + + + + + + Import settings from Morrowind.ini + + + true + + + + + + + Import previously selected add-ons (creates a new Content List in the launcher) + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + diff --git a/files/ui/wizard/installationpage.ui b/files/ui/wizard/installationpage.ui new file mode 100644 index 000000000..3e94c1e30 --- /dev/null +++ b/files/ui/wizard/installationpage.ui @@ -0,0 +1,51 @@ + + + InstallationPage + + + + 0 + 0 + 518 + 423 + + + + WizardPage + + + Installing + + + Please wait while Morrowind is installed on your computer. + + + + + + Extracting: %1 + + + + + + + 24 + + + + + + + false + + + true + + + + + + + + diff --git a/files/ui/wizard/installationtargetpage.ui b/files/ui/wizard/installationtargetpage.ui new file mode 100644 index 000000000..6bdac5592 --- /dev/null +++ b/files/ui/wizard/installationtargetpage.ui @@ -0,0 +1,99 @@ + + + InstallationTargetPage + + + + 0 + 0 + 400 + 300 + + + + WizardPage + + + Select Installation Destination + + + Where should Morrowind be installed? + + + + + + + + + 0 + 0 + + + + <html><head/><body><p><img src=":/icons/tango/48x48/folder.png"/></p></body></html> + + + Qt::RichText + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + Morrowind will be installed to the following location. + + + true + + + + + + + + + Click Next to continue. If you would like to select a different location, click Browse. + + + true + + + + + + + + + + + + Browse... + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + diff --git a/files/ui/wizard/intropage.ui b/files/ui/wizard/intropage.ui new file mode 100644 index 000000000..bb597e3a6 --- /dev/null +++ b/files/ui/wizard/intropage.ui @@ -0,0 +1,34 @@ + + + IntroPage + + + + 0 + 0 + 474 + 370 + + + + WizardPage + + + Welcome to the OpenMW Wizard + + + + + + This Wizard will help you install Morrowind and its add-ons for OpenMW to use. + + + true + + + + + + + + diff --git a/files/ui/wizard/methodselectionpage.ui b/files/ui/wizard/methodselectionpage.ui new file mode 100644 index 000000000..e77349f5c --- /dev/null +++ b/files/ui/wizard/methodselectionpage.ui @@ -0,0 +1,156 @@ + + + MethodSelectionPage + + + + 0 + 0 + 398 + 298 + + + + WizardPage + + + Select Installation Method + + + Select how OpenMW should get the required Morrowind installation files. + + + + + + font-weight:bold; + + + Install to a new location + + + true + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Maximum + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + <html><head/><body><p><img src=":/icons/tango/48x48/system-installer.png"/></p></body></html> + + + Qt::RichText + + + false + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + newLocationRadioButton + + + + + + + Install Morrowind to a new location for OpenMW to use. + + + true + + + + + + + + + font-weight:bold + + + Select an existing installation + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Maximum + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + <html><head/><body><p><img src=":/icons/tango/48x48/folder.png"/></p></body></html> + + + Qt::RichText + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + Select an existing Morrowind installation for OpenMW to use. + + + true + + + + + + + + + + + + diff --git a/files/wizard/icons/tango/48x48/folder.png b/files/wizard/icons/tango/48x48/folder.png new file mode 100644 index 000000000..e93d7cf8f Binary files /dev/null and b/files/wizard/icons/tango/48x48/folder.png differ diff --git a/files/wizard/icons/tango/48x48/system-installer.png b/files/wizard/icons/tango/48x48/system-installer.png new file mode 100644 index 000000000..dbd08f7e2 Binary files /dev/null and b/files/wizard/icons/tango/48x48/system-installer.png differ diff --git a/files/wizard/icons/tango/index.theme b/files/wizard/icons/tango/index.theme new file mode 100644 index 000000000..3ffebebc9 --- /dev/null +++ b/files/wizard/icons/tango/index.theme @@ -0,0 +1,8 @@ +[Icon Theme] +Name=Tango +Comment=Tango Theme +Inherits=default +Directories=48x48 + +[48x48] +Size=48 \ No newline at end of file diff --git a/files/wizard/wizard.qrc b/files/wizard/wizard.qrc new file mode 100644 index 000000000..86b3795c4 --- /dev/null +++ b/files/wizard/wizard.qrc @@ -0,0 +1,7 @@ + + + icons/tango/index.theme + icons/tango/48x48/folder.png + icons/tango/48x48/system-installer.png + +