Pref: wb: change parameter group to prevent issues between 0.21 and older versions.

This commit is contained in:
Paddle
2023-03-30 11:46:54 +02:00
parent 9a4088f4ed
commit 0d61b99a36
2 changed files with 6 additions and 21 deletions

View File

@@ -279,7 +279,7 @@ void DlgSettingsWorkbenchesImp::saveSettings()
if (enabledStr.str().empty()) //make sure that we have at least one enabled workbench.
enabledStr << "NoneWorkbench";
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Workbenches");
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Workbenches");
hGrp->SetASCII("Enabled", enabledStr.str().c_str());
App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/General")->
@@ -377,7 +377,7 @@ QStringList DlgSettingsWorkbenchesImp::getEnabledWorkbenches()
ParameterGrp::handle hGrp;
QString allWorkbenches = QString::fromLatin1("ALL");
hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Workbenches");
hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Workbenches");
enabled_wbs = QString::fromStdString(hGrp->GetASCII("Enabled", allWorkbenches.toStdString().c_str()));
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
enabled_wbs_list = enabled_wbs.split(QLatin1String(","), Qt::SkipEmptyParts);
@@ -410,7 +410,7 @@ void DlgSettingsWorkbenchesImp::addToEnabledWorkenches(const QString wbToAddName
enabledStr << wbName.toStdString();
}
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Workbenches");
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Workbenches");
hGrp->SetASCII("Enabled", enabledStr.str().c_str());
}
@@ -427,7 +427,7 @@ void DlgSettingsWorkbenchesImp::removeFromEnabledWorkenches(const QString wbToRe
}
}
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Workbenches");
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Workbenches");
hGrp->SetASCII("Enabled", enabledStr.str().c_str());
}

View File

@@ -609,7 +609,7 @@ class Addon:
self.enable_workbench()
def enable_workbench(self):
pref = fci.ParamGet("User parameter:BaseApp/Workbenches")
pref = fci.ParamGet("User parameter:BaseApp/Preferences/Workbenches")
enabled_wbs = pref.GetString("Enabled", "All")
#print(f"start enabling : {enabled_wbs}")
@@ -633,7 +633,7 @@ class Addon:
#print(f"Done enabling {enabled_wbs} \n")
def disable_workbench(self):
pref = fci.ParamGet("User parameter:BaseApp/Workbenches")
pref = fci.ParamGet("User parameter:BaseApp/Preferences/Workbenches")
enabled_wbs = pref.GetString("Enabled", "All")
#print(f"start disabling {enabled_wbs}")
@@ -707,21 +707,6 @@ class Addon:
#print(f"Found name {wb_name} \n")
return wb_name
# @dataclass(frozen)
class MissingDependencies:
"""Encapsulates a group of four types of dependencies: