From d842b490a80b733352886e3c7a8f6530e007defc Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Sat, 7 Nov 2020 20:26:11 +0200 Subject: [PATCH] - added support for shortcut key F2 when in the Project Tab and that will allow the object renaming much faster --- CHANGELOG.md | 1 + appGUI/MainGUI.py | 9 +++++++++ appObjects/ObjectCollection.py | 1 + 3 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e816d7b..f5cbcf41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ CHANGELOG for FlatCAM beta - updated the GCode generation section. Now the GCode is generated only once, when a CNCJob object was created. If the user chose to use the GCode Editor the GCode is only updated. If the user chose to include or remove the CNC Code Snippets, only then the GCode is regenerated. This has a higher impact on CNCJobs with very complex and long GCode. - in GCode Editor added handlers for the Insert Code buttons - in Project tab, when selecting multiple CNCJob objects, in the context menu the name of the Save entry change to Batch Save and those objects are all saved each in its own file +- added support for shortcut key F2 when in the Project Tab and that will allow the object renaming much faster 7.11.2020 diff --git a/appGUI/MainGUI.py b/appGUI/MainGUI.py index a2db6145..1ef5ec51 100644 --- a/appGUI/MainGUI.py +++ b/appGUI/MainGUI.py @@ -2720,6 +2720,10 @@ class MainGUI(QtWidgets.QMainWindow): if key == QtCore.Qt.Key_F1 or key == 'F1': webbrowser.open(self.app.manual_url) + # Rename Objects in the Project Tab + if key == QtCore.Qt.Key_F2: + self.app.collection.view.edit(self.app.collection.view.currentIndex()) + # Show shortcut list if key == QtCore.Qt.Key_F3 or key == 'F3': self.app.on_shortcut_list() @@ -4404,6 +4408,10 @@ class ShortcutsTab(QtWidgets.QWidget): %s  %s + + %s +  %s + '%s'  %s @@ -4512,6 +4520,7 @@ class ShortcutsTab(QtWidgets.QWidget): # F keys section _('F1'), _("Open Online Manual"), + _('F2'), _("Rename Objects"), _('F4'), _("Open Online Tutorials"), _('F5'), _("Refresh Plots"), _('Del'), _("Delete Object"), diff --git a/appObjects/ObjectCollection.py b/appObjects/ObjectCollection.py index 41fece58..ae2046bc 100644 --- a/appObjects/ObjectCollection.py +++ b/appObjects/ObjectCollection.py @@ -75,6 +75,7 @@ class KeySensitiveListView(QtWidgets.QTreeView): def keyPressEvent(self, event): # super(KeySensitiveListView, self).keyPressEvent(event) + # print(QtGui.QKeySequence(event.key()).toString()) self.keyPressed.emit(event.key()) def dragEnterEvent(self, event):