summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl <26797547+Al12rs@users.noreply.github.com>2020-02-14 13:35:20 +0100
committerGitHub <noreply@github.com>2020-02-14 13:35:20 +0100
commit2af0698484ec316e420fa0d223a97f9d4a07b47e (patch)
tree31ca40e09790e737e3096f21479b8619436fbbcc
parentd2af089a14e75f8ea6114584c569a1994773ab5b (diff)
parent3079f849540193fa0d887637be412af398b82f1c (diff)
Merge pull request #991 from Al12rs/remember_last_modinfo_tab
Always remember last opened ModInfoDialog tab.
-rw-r--r--src/modinfodialog.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/modinfodialog.cpp b/src/modinfodialog.cpp
index fb093529..bfb8d2c7 100644
--- a/src/modinfodialog.cpp
+++ b/src/modinfodialog.cpp
@@ -285,12 +285,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();
@@ -700,6 +701,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)