diff --git a/launcher/firstLaunch/firstlaunch_moc.cpp b/launcher/firstLaunch/firstlaunch_moc.cpp index 1bee68b91..12b52f9c8 100644 --- a/launcher/firstLaunch/firstlaunch_moc.cpp +++ b/launcher/firstLaunch/firstlaunch_moc.cpp @@ -189,10 +189,10 @@ void FirstLaunchView::activateTabModPreset() modPresetUpdate(); } -void FirstLaunchView::exitSetup() +void FirstLaunchView::exitSetup(bool goToMods) { if(auto * mainWindow = dynamic_cast(QApplication::activeWindow())) - mainWindow->exitSetup(); + mainWindow->exitSetup(goToMods); } // Tab Language @@ -548,7 +548,7 @@ void FirstLaunchView::modPresetUpdate() // we can't install anything - either repository checkout is off or all recommended mods are already installed if (!checkCanInstallTranslation() && !checkCanInstallExtras() && !checkCanInstallHota() && !checkCanInstallWog()) - exitSetup(); + exitSetup(false); } QString FirstLaunchView::findTranslationModName() @@ -625,7 +625,8 @@ void FirstLaunchView::on_pushButtonPresetNext_clicked() if (ui->buttonPresetHota->isChecked() && checkCanInstallHota()) modsToInstall.push_back("hota"); - exitSetup(); + bool goToMods = !modsToInstall.empty(); + exitSetup(goToMods); for (auto const & modName : modsToInstall) getModView()->doInstallMod(modName); diff --git a/launcher/firstLaunch/firstlaunch_moc.h b/launcher/firstLaunch/firstlaunch_moc.h index a5fb752f3..995504656 100644 --- a/launcher/firstLaunch/firstlaunch_moc.h +++ b/launcher/firstLaunch/firstlaunch_moc.h @@ -29,7 +29,7 @@ class FirstLaunchView : public QWidget void activateTabLanguage(); void activateTabHeroesData(); void activateTabModPreset(); - void exitSetup(); + void exitSetup(bool goToMods); // Tab Language void languageSelected(const QString & languageCode); diff --git a/launcher/mainwindow_moc.cpp b/launcher/mainwindow_moc.cpp index e7adb1b10..d7d74f1e8 100644 --- a/launcher/mainwindow_moc.cpp +++ b/launcher/mainwindow_moc.cpp @@ -157,7 +157,7 @@ void MainWindow::enterSetup() ui->tabListWidget->setCurrentIndex(TabRows::SETUP); } -void MainWindow::exitSetup() +void MainWindow::exitSetup(bool goToMods) { Settings writer = settings.write["launcher"]["setupCompleted"]; writer->Bool() = true; @@ -166,7 +166,10 @@ void MainWindow::exitSetup() ui->settingsButton->setEnabled(true); ui->aboutButton->setEnabled(true); ui->modslistButton->setEnabled(true); - ui->tabListWidget->setCurrentIndex(TabRows::MODS); + if (goToMods) + ui->tabListWidget->setCurrentIndex(TabRows::MODS); + else + ui->tabListWidget->setCurrentIndex(TabRows::START); } void MainWindow::switchToStartTab() diff --git a/launcher/mainwindow_moc.h b/launcher/mainwindow_moc.h index 1f4685cac..6f644417c 100644 --- a/launcher/mainwindow_moc.h +++ b/launcher/mainwindow_moc.h @@ -62,7 +62,7 @@ public: void detectPreferredLanguage(); void enterSetup(); - void exitSetup(); + void exitSetup(bool goToMods); void switchToModsTab(); void switchToStartTab(); diff --git a/launcher/modManager/cmodlistview_moc.cpp b/launcher/modManager/cmodlistview_moc.cpp index 48a538b7c..84203c181 100644 --- a/launcher/modManager/cmodlistview_moc.cpp +++ b/launcher/modManager/cmodlistview_moc.cpp @@ -1013,7 +1013,7 @@ void CModListView::doInstallMod(const QString & modName) bool CModListView::isModAvailable(const QString & modName) { - return !modStateModel->isModInstalled(modName); + return modStateModel->isModExists(modName) && !modStateModel->isModInstalled(modName); } bool CModListView::isModEnabled(const QString & modName)