Preferences: reset preference pages parameters set without using "PrefWidgets" objects

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
This commit is contained in:
CalligaroV
2024-01-13 11:39:22 +01:00
committed by Chris Hennes
parent bdb82b8f8a
commit adb1fcfed8
15 changed files with 184 additions and 3 deletions

View File

@@ -327,6 +327,23 @@ void DlgSettingsEditor::loadSettings()
ui->displayItems->setCurrentItem(ui->displayItems->topLevelItem(0));
}
void DlgSettingsEditor::resetSettingsToDefaults()
{
ParameterGrp::handle hGrp;
hGrp = WindowParameter::getDefaultParameter()->GetGroup("Editor");
//reset the parameters in the "Editor" group
for (QVector<QPair<QString, unsigned int> >::Iterator it = d->colormap.begin(); it != d->colormap.end(); ++it) {
hGrp->RemoveUnsigned((*it).first.toLatin1());
}
//reset "FontSize" parameter
hGrp->RemoveInt("FontSize");
//reset "Font" parameter
hGrp->RemoveASCII("Font");
//finally reset all the parameters associated to Gui::Pref* widgets
PreferencePage::resetSettingsToDefaults();
}
/**
* Sets the strings of the subwidgets using the current language.
*/