From 3079f849540193fa0d887637be412af398b82f1c Mon Sep 17 00:00:00 2001 From: AL <26797547+Al12rs@users.noreply.github.com> Date: Wed, 5 Feb 2020 16:26:44 +0100 Subject: Always remember last opened ModInfoDialog tab. Don't reopen saved tab if mainwindow requested specific tab. --- src/modinfodialog.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/modinfodialog.cpp') diff --git a/src/modinfodialog.cpp b/src/modinfodialog.cpp index 302175aa..d7656211 100644 --- a/src/modinfodialog.cpp +++ b/src/modinfodialog.cpp @@ -272,12 +272,13 @@ int ModInfoDialog::exec() // whether to select the first tab; if the main window requested a specific // tab, it is selected when encountered in update() - const auto selectFirst = (m_initialTab == ModInfoTabIDs::None); + const auto noCustomTabRequested = (m_initialTab == ModInfoTabIDs::None); + const auto requestedTab = m_initialTab; update(true); - if (selectFirst && ui->tabWidget->count() > 0) { - ui->tabWidget->setCurrentIndex(0); + if (noCustomTabRequested) { + m_core->settings().widgets().restoreIndex(ui->tabWidget); } const int r = TutorableDialog::exec(); @@ -687,6 +688,8 @@ void ModInfoDialog::saveTabOrder() const } m_core->settings().geometry().setModInfoTabOrder(names); + // save last opened index + m_core->settings().widgets().saveIndex(ui->tabWidget); } void ModInfoDialog::onOriginModified(int originID) -- cgit v1.3.1