From 418ebd66062648a7e681c4a513c6822d888ea3bf Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Sat, 11 Apr 2020 01:51:43 +0300 Subject: [PATCH] - minor changes in GUI (Save locations in Menu -> File) and the key shortcuts --- FlatCAMApp.py | 2 +- README.md | 1 + flatcamGUI/FlatCAMGUI.py | 68 ++++++++++++++++++++++++---------------- 3 files changed, 43 insertions(+), 28 deletions(-) diff --git a/FlatCAMApp.py b/FlatCAMApp.py index 6f6d0919..ef6c9357 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -2016,7 +2016,7 @@ class App(QtCore.QObject): self.ui.menufilesaveproject.triggered.connect(self.on_file_saveproject) self.ui.menufilesaveprojectas.triggered.connect(self.on_file_saveprojectas) - self.ui.menufilesaveprojectcopy.triggered.connect(lambda: self.on_file_saveprojectas(make_copy=True)) + # self.ui.menufilesaveprojectcopy.triggered.connect(lambda: self.on_file_saveprojectas(make_copy=True)) self.ui.menufilesavedefaults.triggered.connect(self.on_file_savedefaults) self.ui.menufileexportpref.triggered.connect(self.on_export_preferences) diff --git a/README.md b/README.md index a85ea37d..6bcade76 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ CAD program, and create G-Code for Isolation routing. - made sure that the timeout parameter used by some Tcl Commands is seen as an integer in all cases - minor changes in Paint Tool +- minor changes in GUI (Save locations in Menu -> File) and the key shortcuts 9.04.2020 diff --git a/flatcamGUI/FlatCAMGUI.py b/flatcamGUI/FlatCAMGUI.py index 09bdb939..0401b164 100644 --- a/flatcamGUI/FlatCAMGUI.py +++ b/flatcamGUI/FlatCAMGUI.py @@ -51,7 +51,8 @@ class FlatCAMGUI(QtWidgets.QMainWindow): # ######### ## self.menu = self.menuBar() - self.menu_toggle_nb = QtWidgets.QAction(QtGui.QIcon(self.app.resource_location + '/notebook32.png'), _("Toggle Panel")) + self.menu_toggle_nb = QtWidgets.QAction( + QtGui.QIcon(self.app.resource_location + '/notebook32.png'), _("Toggle Panel")) self.menu_toggle_nb.setToolTip( _("Toggle Panel") ) @@ -139,6 +140,26 @@ class FlatCAMGUI(QtWidgets.QMainWindow): self.recent = self.menufile.addMenu( QtGui.QIcon(self.app.resource_location + '/recent_files.png'), _("Recent files")) + # SAVE category + self.menufile_save = self.menufile.addMenu(QtGui.QIcon(self.app.resource_location + '/save_as.png'), _('Save')) + + # Save Project + self.menufilesaveproject = QtWidgets.QAction( + QtGui.QIcon(self.app.resource_location + '/floppy16.png'), _('&Save Project ...\tCtrl+S'), self) + self.menufile_save.addAction(self.menufilesaveproject) + + # Save Project As ... + self.menufilesaveprojectas = QtWidgets.QAction( + QtGui.QIcon(self.app.resource_location + '/floppy16.png'), _('Save Project &As ...\tCtrl+Shift+S'), self) + self.menufile_save.addAction(self.menufilesaveprojectas) + + # Save Project Copy ... + # self.menufilesaveprojectcopy = QtWidgets.QAction( + # QtGui.QIcon(self.app.resource_location + '/floppy16.png'), _('Save Project C&opy ...'), self) + # self.menufile_save.addAction(self.menufilesaveprojectcopy) + + self.menufile_save.addSeparator() + # Separator self.menufile.addSeparator() @@ -265,25 +286,6 @@ class FlatCAMGUI(QtWidgets.QMainWindow): QtGui.QIcon(self.app.resource_location + '/printer32.png'), '%s\tCtrl+P' % _('Print (PDF)')) self.menufile.addAction(self.menufile_print) - self.menufile_save = self.menufile.addMenu(QtGui.QIcon(self.app.resource_location + '/save_as.png'), _('Save')) - - # Save Project - self.menufilesaveproject = QtWidgets.QAction( - QtGui.QIcon(self.app.resource_location + '/floppy16.png'), _('&Save Project ...'), self) - self.menufile_save.addAction(self.menufilesaveproject) - - # Save Project As ... - self.menufilesaveprojectas = QtWidgets.QAction( - QtGui.QIcon(self.app.resource_location + '/save_as.png'), _('Save Project &As ...\tCtrl+S'), self) - self.menufile_save.addAction(self.menufilesaveprojectas) - - # Save Project Copy ... - self.menufilesaveprojectcopy = QtWidgets.QAction( - QtGui.QIcon(self.app.resource_location + '/floppy16.png'), _('Save Project C&opy ...'), self) - self.menufile_save.addAction(self.menufilesaveprojectcopy) - - self.menufile_save.addSeparator() - # Separator self.menufile.addSeparator() @@ -541,7 +543,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow): QtGui.QIcon(self.app.resource_location + '/text32.png'), _('Add Text\tT')) self.geo_editor_menu.addSeparator() self.geo_union_menuitem = self.geo_editor_menu.addAction( - QtGui.QIcon(self.app.resource_location + '/union16.png'),_('Polygon Union\tU')) + QtGui.QIcon(self.app.resource_location + '/union16.png'), _('Polygon Union\tU')) self.geo_intersection_menuitem = self.geo_editor_menu.addAction( QtGui.QIcon(self.app.resource_location + '/intersection16.png'), _('Polygon Intersection\tE')) self.geo_subtract_menuitem = self.geo_editor_menu.addAction( @@ -550,7 +552,8 @@ class FlatCAMGUI(QtWidgets.QMainWindow): self.geo_editor_menu.addSeparator() self.geo_cutpath_menuitem = self.geo_editor_menu.addAction( QtGui.QIcon(self.app.resource_location + '/cutpath16.png'), _('Cut Path\tX')) - # self.move_menuitem = self.menu.addAction(QtGui.QIcon(self.app.resource_location + '/move16.png'), "Move Objects 'm'") + # self.move_menuitem = self.menu.addAction( + # QtGui.QIcon(self.app.resource_location + '/move16.png'), "Move Objects 'm'") self.geo_copy_menuitem = self.geo_editor_menu.addAction( QtGui.QIcon(self.app.resource_location + '/copy16.png'), _("Copy Geom\tC")) self.geo_delete_menuitem = self.geo_editor_menu.addAction( @@ -1640,6 +1643,14 @@ class FlatCAMGUI(QtWidgets.QMainWindow):     + + Ctrl+Shift+S +  %s + + +   +   + F1  %s @@ -1687,7 +1698,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow): # CTRL section _("Select All"), _("Copy Obj"), _("Open Tools Database"), _("Open Excellon File"), _("Open Gerber File"), _("Distance Tool"), _("New Project"), - _("Open Project"), _("Print (PDF)"), _("PDF Import Tool"), _("Save Project As"), _("Toggle Plot Area"), + _("Open Project"), _("Print (PDF)"), _("PDF Import Tool"), _("Save Project"), _("Toggle Plot Area"), # SHIFT section _("Copy Obj_Name"), @@ -1708,6 +1719,9 @@ class FlatCAMGUI(QtWidgets.QMainWindow): # CTRL + ALT section _("Abort current task (gracefully)"), + # CTRL + SHIFT section + _("Save Project As"), + # F keys section _("Open Online Manual"), _("Open Online Tutorials"), _("Refresh Plots"), _("Delete Object"), _("Alternate: Delete Tool"), @@ -2816,7 +2830,10 @@ class FlatCAMGUI(QtWidgets.QMainWindow): if key == QtCore.Qt.Key_X: self.app.abort_all_tasks() return - + if modifiers == QtCore.Qt.ControlModifier | QtCore.Qt.ShiftModifier: + if key == QtCore.Qt.Key_S: + self.app.on_file_saveprojectas() + return elif modifiers == QtCore.Qt.ControlModifier: # Select All if key == QtCore.Qt.Key_A: @@ -2942,7 +2959,6 @@ class FlatCAMGUI(QtWidgets.QMainWindow): self.app.on_skewy() return elif modifiers == QtCore.Qt.AltModifier: - # Eanble all plots if key == Qt.Key_1: self.app.enable_all_plots() @@ -3161,7 +3177,6 @@ class FlatCAMGUI(QtWidgets.QMainWindow): else: self.app.collection.set_active(names_list[active_index+1]) - # New Geometry if key == QtCore.Qt.Key_B: self.app.new_gerber_object() @@ -3350,7 +3365,6 @@ class FlatCAMGUI(QtWidgets.QMainWindow): # Abort the current action if key == QtCore.Qt.Key_Escape or key == 'Escape': - # TODO: ...? # self.on_tool_select("select") self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled."))