diff --git a/src/Gui/PrefWidgets.cpp b/src/Gui/PrefWidgets.cpp index 614798cc2..68da915d5 100644 --- a/src/Gui/PrefWidgets.cpp +++ b/src/Gui/PrefWidgets.cpp @@ -534,6 +534,16 @@ void PrefQuantitySpinBox::contextMenuEvent(QContextMenuEvent *event) delete menu; } +void PrefQuantitySpinBox::onSave() +{ + pushToHistory(); +} + +void PrefQuantitySpinBox::onRestore() +{ + setToLastUsedValue(); +} + void PrefQuantitySpinBox::pushToHistory(const QString &valueq) { Q_D(PrefQuantitySpinBox); @@ -594,7 +604,11 @@ void PrefQuantitySpinBox::setToLastUsedValue() void PrefQuantitySpinBox::setParamGrpPath(const QByteArray& path) { Q_D(PrefQuantitySpinBox); - d->handle = App::GetApplication().GetParameterGroupByPath(path); + QByteArray groupPath = path; + if (!groupPath.startsWith("User parameter:")) { + groupPath.prepend("User parameter:BaseApp/Preferences/"); + } + d->handle = App::GetApplication().GetParameterGroupByPath(groupPath); if (d->handle.isValid()) d->prefGrp = path; } diff --git a/src/Gui/PrefWidgets.h b/src/Gui/PrefWidgets.h index 333224d3b..1a9870334 100644 --- a/src/Gui/PrefWidgets.h +++ b/src/Gui/PrefWidgets.h @@ -296,6 +296,10 @@ public: int historySize() const; /// set the value of the history size property void setHistorySize(int); + /// Convenience method as offered by PrefWidget. Does the same as pushToHistory(). + void onSave(); + /// Convenience method as offered by PrefWidget. Does the same as setToLastUsedValue(). + void onRestore(); /** @name history and default management */ //@{