diff options
| author | AL <26797547+Al12rs@users.noreply.github.com> | 2020-02-05 16:26:44 +0100 |
|---|---|---|
| committer | AL <26797547+Al12rs@users.noreply.github.com> | 2020-02-05 16:26:44 +0100 |
| commit | 3079f849540193fa0d887637be412af398b82f1c (patch) | |
| tree | b0708ef08df5c4b7e26b8616322f91da62684f43 | |
| parent | e9da5b4fad488a5e1ff61d68cc6a24b68f0d4440 (diff) | |
Always remember last opened ModInfoDialog tab.
Don't reopen saved tab if mainwindow requested specific tab.
| -rw-r--r-- | src/modinfodialog.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
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) |
