diff --git a/src/Mod/Path/Gui/DlgSettingsPathColor.cpp b/src/Mod/Path/Gui/DlgSettingsPathColor.cpp index 64bcdd02de..8001f50cde 100644 --- a/src/Mod/Path/Gui/DlgSettingsPathColor.cpp +++ b/src/Mod/Path/Gui/DlgSettingsPathColor.cpp @@ -64,6 +64,7 @@ void DlgSettingsPathColor::saveSettings() DefaultBBoxSelectionColor->onSave(); DefaultBBoxNormalColor->onSave(); DefaultSelectionStyle->onSave(); + DefaultTaskPanelLayout->onSave(); } void DlgSettingsPathColor::loadSettings() @@ -79,6 +80,7 @@ void DlgSettingsPathColor::loadSettings() DefaultBBoxSelectionColor->onRestore(); DefaultBBoxNormalColor->onRestore(); DefaultSelectionStyle->onRestore(); + DefaultTaskPanelLayout->onRestore(); } /** diff --git a/src/Mod/Path/Gui/DlgSettingsPathColor.ui b/src/Mod/Path/Gui/DlgSettingsPathColor.ui index 49ed19f0ab..7477b0932c 100644 --- a/src/Mod/Path/Gui/DlgSettingsPathColor.ui +++ b/src/Mod/Path/Gui/DlgSettingsPathColor.ui @@ -6,8 +6,8 @@ 0 0 - 357 - 372 + 483 + 536 @@ -396,6 +396,43 @@ + + + + Task Panel Layout + + + + + + + DefaultTaskPanelLayout + + + Mod/Path + + + + Classic + + + + + Classic - reversed + + + + + Multi Panel + + + + + Multi Panel - reversed + + + + diff --git a/src/Mod/Path/PathScripts/PathOpGui.py b/src/Mod/Path/PathScripts/PathOpGui.py index b897d85eca..3c72ca7cf8 100644 --- a/src/Mod/Path/PathScripts/PathOpGui.py +++ b/src/Mod/Path/PathScripts/PathOpGui.py @@ -35,20 +35,13 @@ import importlib from PySide import QtCore, QtGui from PathScripts.PathGeom import PathGeom +from PathScripts.PathPreferences import PathPreferences __title__ = "Path Operation UI base classes" __author__ = "sliptonic (Brad Collette)" __url__ = "http://www.freecadweb.org" __doc__ = "Base classes and framework for Path operation's UI" -# TaskPanelLayout -# 0 ... existing toolbox layout -# 1 ... reverse order -# 2 ... multi panel layout -# 3 ... multi panel layout reverse -TaskPanelLayout = 0 - - if False: PathLog.setLevel(PathLog.Level.DEBUG, PathLog.thisModule()) PathLog.trackModule(PathLog.thisModule()) @@ -748,11 +741,13 @@ class TaskPanel(object): page.initPage(obj) page.onDirtyChanged(self.pageDirtyChanged) - if TaskPanelLayout < 2: + taskPanelLayout = PathPreferences.defaultTaskPanelLayout() + + if taskPanelLayout < 2: opTitle = opPage.getTitle(obj) opPage.setTitle(translate('PathOp', 'Operation')) toolbox = QtGui.QToolBox() - if TaskPanelLayout == 0: + if taskPanelLayout == 0: for page in self.featurePages: toolbox.addItem(page.form, page.getTitle(obj)) toolbox.setCurrentIndex(len(self.featurePages)-1) @@ -765,13 +760,13 @@ class TaskPanel(object): toolbox.setWindowIcon(QtGui.QIcon(opPage.getIcon(obj))) self.form = toolbox - elif TaskPanelLayout == 2: + elif taskPanelLayout == 2: forms = [] for page in self.featurePages: page.form.setWindowTitle(page.getTitle(obj)) forms.append(page.form) self.form = forms - elif TaskPanelLayout == 3: + elif taskPanelLayout == 3: forms = [] for page in reversed(self.featurePages): page.form.setWindowTitle(page.getTitle(obj)) diff --git a/src/Mod/Path/PathScripts/PathPreferences.py b/src/Mod/Path/PathScripts/PathPreferences.py index f5e025913d..8dd58d611b 100644 --- a/src/Mod/Path/PathScripts/PathPreferences.py +++ b/src/Mod/Path/PathScripts/PathPreferences.py @@ -34,6 +34,7 @@ class PathPreferences: DefaultFilePath = "DefaultFilePath" DefaultJobTemplate = "DefaultJobTemplate" DefaultStockTemplate = "DefaultStockTemplate" + DefaultTaskPanelLayout = "DefaultTaskPanelLayout" PostProcessorDefault = "PostProcessorDefault" PostProcessorDefaultArgs = "PostProcessorDefaultArgs" @@ -180,6 +181,12 @@ class PathPreferences: def setDefaultStockTemplate(cls, template): cls.preferences().SetString(cls.DefaultStockTemplate, template) + @classmethod + def defaultTaskPanelLayout(cls): + return cls.preferences().GetInt(cls.DefaultTaskPanelLayout, 0) + @classmethod + def setDefaultTaskPanelLayout(cls, style): + cls.preferences().SetInt(cls.DefaultTaskPanelLayout, style) @classmethod def experimentalFeaturesEnabled(cls):