From 288f3aad09625f383ee81ee32fe727321a2590e4 Mon Sep 17 00:00:00 2001 From: Roy-043 Date: Tue, 14 Jan 2025 21:48:16 +0100 Subject: [PATCH] Draft: Save fillet settings Fixes #16248. --- src/Mod/Draft/draftguitools/gui_fillets.py | 10 +++++++--- src/Mod/Draft/draftutils/params.py | 3 +++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Mod/Draft/draftguitools/gui_fillets.py b/src/Mod/Draft/draftguitools/gui_fillets.py index 74c47a1abf..03a0f63439 100644 --- a/src/Mod/Draft/draftguitools/gui_fillets.py +++ b/src/Mod/Draft/draftguitools/gui_fillets.py @@ -42,6 +42,7 @@ import Draft_rc from draftguitools import gui_base_original from draftguitools import gui_tool_utils from draftmake import make_fillet +from draftutils import params from draftutils import utils from draftutils.messages import _err, _toolmsg from draftutils.translate import translate @@ -73,9 +74,9 @@ class Fillet(gui_base_original.Creator): super().Activated(name=name) if self.ui: - self.rad = 100 - self.chamfer = False - self.delete = False + self.rad = params.get_param("FilletRadius") + self.chamfer = params.get_param("FilletChamferMode") + self.delete = params.get_param("FilletDeleteMode") label = translate("draft", "Fillet radius") tooltip = translate("draft", "Radius of fillet") @@ -127,10 +128,12 @@ class Fillet(gui_base_original.Creator): def set_delete(self): """Execute as a callback when the delete checkbox changes.""" self.delete = self.ui.check_delete.isChecked() + params.set_param("FilletDeleteMode", self.delete) def set_chamfer(self): """Execute as a callback when the chamfer checkbox changes.""" self.chamfer = self.ui.check_chamfer.isChecked() + params.set_param("FilletChamferMode", self.chamfer) def numericRadius(self, rad): """Validate the entry radius in the user interface. @@ -139,6 +142,7 @@ class Fillet(gui_base_original.Creator): when a valid radius has been entered in the input field. """ self.rad = rad + params.set_param("FilletRadius", self.rad) self.draw_arc(rad, self.chamfer, self.delete) def draw_arc(self, rad, chamfer, delete): diff --git a/src/Mod/Draft/draftutils/params.py b/src/Mod/Draft/draftutils/params.py index 69a9ee5c99..a1a6b50fa7 100644 --- a/src/Mod/Draft/draftutils/params.py +++ b/src/Mod/Draft/draftutils/params.py @@ -390,6 +390,9 @@ def _get_param_dictionary(): "DefaultPrintColor": ("unsigned", 255), "Draft_array_fuse": ("bool", False), "Draft_array_Link": ("bool", True), + "FilletRadius": ("float", 100.0), + "FilletChamferMode": ("bool", False), + "FilletDeleteMode": ("bool", False), "fillmode": ("bool", True), "GlobalMode": ("bool", False), "GridHideInOtherWorkbenches": ("bool", True),