From 6242d1809b9740073b27b3de36b445280eb1b024 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Wed, 31 Jul 2019 17:17:08 +0300 Subject: [PATCH] - changed the order of the menu entries in the FIle -> Open ... - organized the list of recent files so the Project entries are to the top and separated from the other types of file --- FlatCAMApp.py | 38 ++++++++++++++++++++++++++++++-------- README.md | 5 +++++ flatcamGUI/FlatCAMGUI.py | 13 ++++++------- 3 files changed, 41 insertions(+), 15 deletions(-) diff --git a/FlatCAMApp.py b/FlatCAMApp.py index aa4e800b..b60df560 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -8293,20 +8293,42 @@ class App(QtCore.QObject): self.ui.recent.clear() # Create menu items + # First add tbe projects for recent in self.recent: filename = recent['filename'].split('/')[-1].split('\\')[-1] - try: - action = QtWidgets.QAction(QtGui.QIcon(icons[recent["kind"]]), filename, self) + if recent['kind'] == 'project': + try: + action = QtWidgets.QAction(QtGui.QIcon(icons[recent["kind"]]), filename, self) - # Attach callback - o = make_callback(openers[recent["kind"]], recent['filename']) - action.triggered.connect(o) + # Attach callback + o = make_callback(openers[recent["kind"]], recent['filename']) + action.triggered.connect(o) - self.ui.recent.addAction(action) + self.ui.recent.addAction(action) - except KeyError: - App.log.error("Unsupported file type: %s" % recent["kind"]) + except KeyError: + App.log.error("Unsupported file type: %s" % recent["kind"]) + + # Second, add a separator in the menu + self.ui.recent.addSeparator() + + # Then add tbe rest of the files + for recent in self.recent: + filename = recent['filename'].split('/')[-1].split('\\')[-1] + + if recent['kind'] != 'project': + try: + action = QtWidgets.QAction(QtGui.QIcon(icons[recent["kind"]]), filename, self) + + # Attach callback + o = make_callback(openers[recent["kind"]], recent['filename']) + action.triggered.connect(o) + + self.ui.recent.addAction(action) + + except KeyError: + App.log.error("Unsupported file type: %s" % recent["kind"]) # Last action in Recent Files menu is one that Clear the content clear_action = QtWidgets.QAction(QtGui.QIcon('share/trash32.png'), (_("Clear Recent files")), self) diff --git a/README.md b/README.md index d18c855a..0cf4037f 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,11 @@ CAD program, and create G-Code for Isolation routing. ================================================= +31.07.2019 + +- changed the order of the menu entries in the FIle -> Open ... +- organized the list of recent files so the Project entries are to the top and separated from the other types of file + 30.07.2019 - fixed bug that crashed the software when trying to edit a GUI value in Geometry selected tab without having a tool in the Tools Table diff --git a/flatcamGUI/FlatCAMGUI.py b/flatcamGUI/FlatCAMGUI.py index 0bac089b..bc3b4885 100644 --- a/flatcamGUI/FlatCAMGUI.py +++ b/flatcamGUI/FlatCAMGUI.py @@ -79,13 +79,16 @@ class FlatCAMGUI(QtWidgets.QMainWindow): self.menufile_open = self.menufile.addMenu(QtGui.QIcon('share/folder32_bis.png'), _('Open')) self.menufile_open.setToolTipsVisible(True) - # Open gerber ... + # Open Project ... + self.menufileopenproject = QtWidgets.QAction(QtGui.QIcon('share/folder16.png'), _('Open &Project ...'), self) + self.menufile_open.addAction(self.menufileopenproject) + self.menufile_open.addSeparator() + + # Open Gerber ... self.menufileopengerber = QtWidgets.QAction(QtGui.QIcon('share/flatcam_icon24.png'), _('Open &Gerber ...\tCTRL+G'), self) self.menufile_open.addAction(self.menufileopengerber) - self.menufile_open.addSeparator() - # Open Excellon ... self.menufileopenexcellon = QtWidgets.QAction(QtGui.QIcon('share/open_excellon32.png'), _('Open &Excellon ...\tCTRL+E'), self) @@ -95,10 +98,6 @@ class FlatCAMGUI(QtWidgets.QMainWindow): self.menufileopengcode = QtWidgets.QAction(QtGui.QIcon('share/code.png'), _('Open G-&Code ...'), self) self.menufile_open.addAction(self.menufileopengcode) - # Open Project ... - self.menufileopenproject = QtWidgets.QAction(QtGui.QIcon('share/folder16.png'), _('Open &Project ...'), self) - self.menufile_open.addAction(self.menufileopenproject) - self.menufile_open.addSeparator() # Open Config File...