From 5a9201d2c591bb658975fc46fc61cbbc2b5ce622 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Thu, 4 Aug 2022 17:40:05 +0200 Subject: [PATCH] Draft: Enabled shortcut for undo segment - fixes #6181 That shortcut had apparently been left out last time the system was recoded.. I used the default shortcut '/' because Ctrl doesn't really work with the current system, and Z is already taken --- src/Mod/Draft/DraftGui.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Mod/Draft/DraftGui.py b/src/Mod/Draft/DraftGui.py index 2f705cbc5d..dc6fbd283e 100644 --- a/src/Mod/Draft/DraftGui.py +++ b/src/Mod/Draft/DraftGui.py @@ -156,6 +156,11 @@ inCommandShortcuts = { translate("draft","Toggle near snap on/off"), None ], + "Undo": [ + Draft.getParam("inCommandShortcutNearSnap", "/"), + translate("draft","Undo last segment"), + None + ], } from draftutils.todo import todo @@ -785,7 +790,7 @@ class DraftToolBar: # self.symmetricButton.setToolTip(translate("draft", "Make Bezier node symmetric")) # self.arc3PtButton.setToolTip(translate("draft", "Toggle radius and angles arc editing")) - self.undoButton.setText(translate("draft", "&Undo (CTRL+Z)")) + self.undoButton.setText(translate("draft", "&Undo")+" ("+inCommandShortcuts["Undo"][0]+")") self.undoButton.setToolTip(translate("draft", "Undo the last segment")) self.closeButton.setText(translate("draft", "Close")+" ("+inCommandShortcuts["Close"][0]+")") self.closeButton.setToolTip(translate("draft", "Finishes and closes the current line")) @@ -1631,6 +1636,7 @@ class DraftToolBar: #Length #Wipe #SetWP + #Undo spec = False if txt.upper().startswith(inCommandShortcuts["Relative"][0]): @@ -1705,6 +1711,9 @@ class DraftToolBar: if self.isCopy.isVisible(): self.isCopy.setChecked(not self.isCopy.isChecked()) spec = True + elif txt.upper().startswith(inCommandShortcuts["Undo"][0]): + self.undoSegment() + spec = True elif txt.upper().startswith(inCommandShortcuts["SubelementMode"][0]): if self.isSubelementMode.isVisible(): self.isSubelementMode.setChecked(not self.isSubelementMode.isChecked())