From f458f0c6c16d13bac0d45ccd7ed972d92cfed870 Mon Sep 17 00:00:00 2001 From: pvdk Date: Sat, 7 Dec 2013 23:17:50 +0100 Subject: [PATCH] Added the Wizard .ui/resource files and some basic source to get started --- apps/wizard/CMakeLists.txt | 96 +++++++++++ apps/wizard/main.cpp | 51 ++++++ apps/wizard/wizard.cpp | 1 + apps/wizard/wizard.hpp | 1 + files/ui/wizard/componentselectionpage.ui | 60 +++++++ files/ui/wizard/conclusionpage.ui | 36 ++++ files/ui/wizard/configurationpage.ui | 58 +++++++ files/ui/wizard/existinginstallationpage.ui | 85 ++++++++++ files/ui/wizard/importpage.ui | 67 ++++++++ files/ui/wizard/installationpage.ui | 51 ++++++ files/ui/wizard/installationtargetpage.ui | 99 +++++++++++ files/ui/wizard/intropage.ui | 34 ++++ files/ui/wizard/methodselectionpage.ui | 156 ++++++++++++++++++ files/wizard/icons/tango/48x48/folder.png | Bin 0 -> 1610 bytes .../icons/tango/48x48/system-installer.png | Bin 0 -> 2663 bytes files/wizard/icons/tango/index.theme | 8 + files/wizard/wizard.qrc | 7 + 17 files changed, 810 insertions(+) create mode 100644 apps/wizard/CMakeLists.txt create mode 100644 apps/wizard/main.cpp create mode 100644 apps/wizard/wizard.cpp create mode 100644 apps/wizard/wizard.hpp create mode 100644 files/ui/wizard/componentselectionpage.ui create mode 100644 files/ui/wizard/conclusionpage.ui create mode 100644 files/ui/wizard/configurationpage.ui create mode 100644 files/ui/wizard/existinginstallationpage.ui create mode 100644 files/ui/wizard/importpage.ui create mode 100644 files/ui/wizard/installationpage.ui create mode 100644 files/ui/wizard/installationtargetpage.ui create mode 100644 files/ui/wizard/intropage.ui create mode 100644 files/ui/wizard/methodselectionpage.ui create mode 100644 files/wizard/icons/tango/48x48/folder.png create mode 100644 files/wizard/icons/tango/48x48/system-installer.png create mode 100644 files/wizard/icons/tango/index.theme create mode 100644 files/wizard/wizard.qrc diff --git a/apps/wizard/CMakeLists.txt b/apps/wizard/CMakeLists.txt new file mode 100644 index 0000000000..d6423daad4 --- /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 0000000000..ed3f3a6eae --- /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 0000000000..8d1c8b69c3 --- /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 0000000000..8d1c8b69c3 --- /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 0000000000..c3333752ad --- /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 0000000000..bedad3e2aa --- /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 0000000000..8340b2ebf9 --- /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 0000000000..579ddbe672 --- /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 0000000000..21037f3e8b --- /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 0000000000..3e94c1e30b --- /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 0000000000..6bdac55927 --- /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 0000000000..bb597e3a61 --- /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 0000000000..e77349f5cc --- /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 0000000000000000000000000000000000000000..e93d7cf8f8460c1576f40b6981d42181a1e1b38f GIT binary patch literal 1610 zcmV-Q2DSN#P)$Qp1=mSL zK~!ko?U~DqWJwjqe-ZbQkIIKN(@NvQh5aXpOL5^W8pPGW;L?rD?gl|-(F>P0xaw}) z%tG)F(4~zi!fZqvM22Bt#Dy>vgWXnERc7A2_r~+M=zDXrvZ^byYUoOoIuPW^xWwiA z;yWkeL|nMB8@sXpX;Z6z9zJ~d6Q$JqB9a0qr99voKPaVa<42{GSs7XZgb z=+U39i$J>iM?`*h_wL%jxO;fG4 ze)sy z2wSPJ9#Xe&-yZdPJ@)ta>G%6+tx-y$)Tu>}hSc&|2!UtMo_+7$y?eiY`t<4S(gZ>X z)>_N)@i9k7N5mK}rNU|`0UR70EJ3#*+orW%5^McD&jCVF6k}j^6$NVN9HY@_Is2;w zHmR^qpatIkt}4;`Ns=rHXsr>En5Jp(sv%T+@0rbJ93CDn0l!X#^(0;gze=JdvOepp zewJkb(HPUcDuK#5$8b2rT1yCl-~H;Go+S#O ze{<;b?2q4l@B_R49_PcSfBxkU-?=CUDr+r8Q81ZI2q7@7Z}HO~eTQK$yROYu17BV5 zENjotfA!(pTPZLY45+FK<07Ew zKBeE)2(mNq08xa>c(i76o?NR6l&u1z(TKD=V$|>8{qDf~ASk7%YKId2;z9zg0!2}9 ze0n3j%yzk|Ex5Ng54D9!S!DJ$zlc)2NwYin(66;NTo zpx432cRPCIjEK81NHQh{MLuh97RlNEjXI61woCSctsXCWKs? zrrH?8yw;>|=Tt79jd|G?sBG?)&E<4iJG?h9HxcL_92|7-+_{rvS%&KLQAvuife_@& z&FCdM*B_e@S(Mhfay|z}Kmo*c0y(fZola8`NsKX6Zop6!#%)esx%7kWLrk2oFvh!j zRsn-%==?kao%wvOVvI?aWq933rwL(qhq2{x($prH*^3F#0Su6}-!1f74v11J{JTgf zLr$;X-7R{7>B(G7ZNuk(|LsT3{fk=tFw-jFn`VtMAN=*jTR#q(?30iG$<8hMmoGp0 z!~50bVAfm~y9VnQ*Gi2IfIXlO^cuO6MkTe2^L%^K1!|ydTG0?WLja(=0zPdBBs(Gy zn$^ZPfK5XnoVnOLuZC(8MX&D_*BLww*wCmT+}MrX*#DpX7iXTUrIOxbGynhq07*qo IM6N<$f?B=}0ssI2 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..dbd08f7e2f5d40f313206326b379ccc467c139c1 GIT binary patch literal 2663 zcmV-t3YhhYP)xO!+%$cd3Sbm2BIP#{3;NJy+iHYw_2o0Le3mZ)8l zyWDe|nLKdGP$acW$r6$R8enj4Gv|E&@BiIq4%}+D+O78gx`~YrJb3Wn-+_I}+Ktb- z#uiH{zwyc|ul(SK19;|{XZ|LW$$W2M;J%bpYVAve_|#gf1tGsV{+n751b=n-@ZtZw zVE_&uJow#wKKBoUy9P6-PK{D7mv4&tJ3Bk+=;-9=FOSt~wc0mdef8B>H!@E)5&j!( zZEgSb@WY?WoIZV;nVFfJX3KMPb4aNe7#MITC#Rkm7#Ns(@4fflyKVr_KKtxnx3;$a z+upr<-IFIr?S%`|b;7Qxi)$G_J3EI`iU%KjP)$rs?7#Qkd#lHfAOA%o0P1QFJkR_4 z=bwKb*LAu7{`=RMnza@o1f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