From 55453bd69dc27108898609191c74651d469acef9 Mon Sep 17 00:00:00 2001 From: Russell Johnson <47639332+Russ4262@users.noreply.github.com> Date: Thu, 18 Mar 2021 23:21:41 -0500 Subject: [PATCH] Path: Fix update of Extensions `Default Length` GUI spin box Fix the bug hindering update of the Default Length spin box in the Extensions tab after editing and change of focus. With the fix, the spin box updates after change of focus, as do other spin boxes in the Path workbench. Used method found in PathDrillingGui module. --- src/Mod/Path/PathScripts/PathPocketShapeGui.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Mod/Path/PathScripts/PathPocketShapeGui.py b/src/Mod/Path/PathScripts/PathPocketShapeGui.py index 4e1b651148..e6aac3eae2 100644 --- a/src/Mod/Path/PathScripts/PathPocketShapeGui.py +++ b/src/Mod/Path/PathScripts/PathPocketShapeGui.py @@ -222,7 +222,7 @@ class TaskPanelExtensionPage(PathOpGui.TaskPanelPage): if obj.ExtensionCorners != self.form.extendCorners.isChecked(): self.form.extendCorners.toggle() - self.defaultLength.updateSpinBox() + self.updateQuantitySpinBoxes() self.extensions = obj.Proxy.getExtensions(obj) # pylint: disable=attribute-defined-outside-init self.setExtensions(self.extensions) @@ -341,11 +341,15 @@ class TaskPanelExtensionPage(PathOpGui.TaskPanelPage): self.form.extensionTree.blockSignals(False) + def updateQuantitySpinBoxes(self, index = None): + self.defaultLength.updateSpinBox() + def updateData(self, obj, prop): PathLog.track(obj.Label, prop, self.blockUpdateData) if not self.blockUpdateData: if prop in ['Base', 'ExtensionLengthDefault']: self.setExtensions(obj.Proxy.getExtensions(obj)) + self.updateQuantitySpinBoxes() def restoreSelection(self, selection): PathLog.track() @@ -458,6 +462,7 @@ class TaskPanelExtensionPage(PathOpGui.TaskPanelPage): self.form.buttonClear.clicked.connect(self.extensionsClear) self.form.buttonDisable.clicked.connect(self.extensionsDisable) self.form.buttonEnable.clicked.connect(self.extensionsEnable) + self.form.defaultLength.editingFinished.connect(self.updateQuantitySpinBoxes) self.model.itemChanged.connect(self.updateItemEnabled)