diff --git a/CHANGELOG.md b/CHANGELOG.md index 4680f0e11b..f390cb72a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ Bug #3812: Wrong multiline tooltips width when word-wrapping is enabled Bug #3894: Hostile spell effects not detected/present on first frame of OnPCHitMe Bug #3977: Non-ASCII characters in object ID's are not supported + Bug #4009: Launcher does not show data files on the first run after installing Bug #4077: Enchanted items are not recharged if they are not in the player's inventory Bug #4202: Open .omwaddon files without needing toopen openmw-cs first Bug #4240: Ash storm origin coordinates and hand shielding animation behavior are incorrect diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index 4ec7f34a7e..f69213c4a9 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -116,6 +116,10 @@ void Launcher::MainDialog::createIcons() void Launcher::MainDialog::createPages() { + // Avoid creating the widgets twice + if (pagesWidget->count() != 0) + return; + mPlayPage = new PlayPage(this); mDataFilesPage = new DataFilesPage(mCfgMgr, mGameSettings, mLauncherSettings, this); mGraphicsPage = new GraphicsPage(mCfgMgr, mEngineSettings, this); @@ -166,18 +170,20 @@ Launcher::FirstRunDialogResult Launcher::MainDialog::showFirstRunDialog() QAbstractButton *skipButton = msgBox.addButton(tr("Skip"), QMessageBox::RejectRole); - Q_UNUSED(skipButton); // Surpress compiler unused warning - msgBox.exec(); if (msgBox.clickedButton() == wizardButton) { - if (!mWizardInvoker->startProcess(QLatin1String("openmw-wizard"), false)) { - return FirstRunDialogResultFailure; - } else { + if (mWizardInvoker->startProcess(QLatin1String("openmw-wizard"), false)) return FirstRunDialogResultWizard; - } } + else if (msgBox.clickedButton() == skipButton) + { + // Don't bother setting up absent game data. + if (setup()) + return FirstRunDialogResultContinue; + } + return FirstRunDialogResultFailure; } if (!setup() || !setupGameData()) { @@ -384,22 +390,23 @@ bool Launcher::MainDialog::setupGameData() QMessageBox msgBox; msgBox.setWindowTitle(tr("Error detecting Morrowind installation")); msgBox.setIcon(QMessageBox::Warning); - msgBox.setStandardButtons(QMessageBox::Cancel); + msgBox.setStandardButtons(QMessageBox::NoButton); msgBox.setText(tr("
Could not find the Data Files location

\ The directory containing the data files was not found.")); QAbstractButton *wizardButton = msgBox.addButton(tr("Run &Installation Wizard..."), QMessageBox::ActionRole); + QAbstractButton *skipButton = + msgBox.addButton(tr("Skip"), QMessageBox::RejectRole); + + Q_UNUSED(skipButton); // Supress compiler unused warning msgBox.exec(); if (msgBox.clickedButton() == wizardButton) { - if (!mWizardInvoker->startProcess(QLatin1String("openmw-wizard"), false)) { + if (!mWizardInvoker->startProcess(QLatin1String("openmw-wizard"), false)) return false; - } else { - return true; - } } } @@ -582,7 +589,7 @@ void Launcher::MainDialog::wizardFinished(int exitCode, QProcess::ExitStatus exi // HACK: Ensure the pages are created, else segfault setup(); - if (reloadSettings()) + if (setupGameData() && reloadSettings()) show(); }