From 7d321e0fb7faba64cbb5f11dea2ea8dbf70bdb27 Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Sat, 16 May 2015 13:18:04 +0300 Subject: [PATCH] Fix #2557 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don’t show main dialog right away if wizard is selected. --- apps/launcher/main.cpp | 6 ++++-- apps/launcher/maindialog.cpp | 10 +++++----- apps/launcher/maindialog.hpp | 8 +++++++- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/apps/launcher/main.cpp b/apps/launcher/main.cpp index 11ea56869..ba0686110 100644 --- a/apps/launcher/main.cpp +++ b/apps/launcher/main.cpp @@ -59,14 +59,16 @@ int main(int argc, char *argv[]) Launcher::MainDialog mainWin; - if (!mainWin.showFirstRunDialog()) + Launcher::FirstRunDialogResult result = mainWin.showFirstRunDialog(); + if (result == Launcher::FirstRunDialogResultFailure) return 0; // if (!mainWin.setup()) { // return 0; // } - mainWin.show(); + if (result == Launcher::FirstRunDialogResultContinue) + mainWin.show(); int returnValue = app.exec(); SDL_Quit(); diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index 00e6a9aa2..fd36993bf 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -148,10 +148,10 @@ void Launcher::MainDialog::createPages() } -bool Launcher::MainDialog::showFirstRunDialog() +Launcher::FirstRunDialogResult Launcher::MainDialog::showFirstRunDialog() { if (!setupLauncherSettings()) - return false; + return FirstRunDialogResultFailure; if (mLauncherSettings.value(QString("General/firstrun"), QString("true")) == QLatin1String("true")) { @@ -176,14 +176,14 @@ bool Launcher::MainDialog::showFirstRunDialog() if (msgBox.clickedButton() == wizardButton) { if (!mWizardInvoker->startProcess(QLatin1String("openmw-wizard"), false)) { - return false; + return FirstRunDialogResultFailure; } else { - return true; + return FirstRunDialogResultWizard; } } } - return setup(); + return setup() ? FirstRunDialogResultContinue : FirstRunDialogResultFailure; } bool Launcher::MainDialog::setup() diff --git a/apps/launcher/maindialog.hpp b/apps/launcher/maindialog.hpp index 0708f7002..4c21dbaf4 100644 --- a/apps/launcher/maindialog.hpp +++ b/apps/launcher/maindialog.hpp @@ -31,6 +31,12 @@ namespace Launcher class UnshieldThread; class SettingsPage; + typedef enum { + FirstRunDialogResultFailure, + FirstRunDialogResultContinue, + FirstRunDialogResultWizard + } FirstRunDialogResult; + #ifndef WIN32 bool expansions(Launcher::UnshieldThread& cd); #endif @@ -44,7 +50,7 @@ namespace Launcher ~MainDialog(); bool setup(); - bool showFirstRunDialog(); + FirstRunDialogResult showFirstRunDialog(); bool reloadSettings(); bool writeSettings();