Gui: by default restore the last visited page in the preferences dialog

See also: https://forum.freecad.org/viewtopic.php?t=77071
This commit is contained in:
wmayer
2023-03-24 19:52:15 +01:00
committed by wwmayer
parent 3d6c9a4cc1
commit c0a0ddf1e0
3 changed files with 34 additions and 5 deletions

View File

@@ -370,8 +370,19 @@ Action * StdCmdDlgPreferences::createAction()
void StdCmdDlgPreferences::activated(int iMsg)
{
Q_UNUSED(iMsg);
static QString groupName{};
static int index{};
Gui::Dialog::DlgPreferencesImp cDlg(getMainWindow());
cDlg.exec();
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences");
if (hGrp->GetBool("RestoreGroupPage", true)) {
cDlg.activateGroupPage(groupName, index);
}
if (cDlg.exec()) {
cDlg.activeGroupPage(groupName, index);
}
}
//===========================================================================