Jelajahi Sumber

- 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

Marius Stanciu 6 tahun lalu
induk
melakukan
6242d1809b
3 mengubah file dengan 41 tambahan dan 15 penghapusan
  1. 30 8
      FlatCAMApp.py
  2. 5 0
      README.md
  3. 6 7
      flatcamGUI/FlatCAMGUI.py

+ 30 - 8
FlatCAMApp.py

@@ -8293,20 +8293,42 @@ class App(QtCore.QObject):
         self.ui.recent.clear()
         self.ui.recent.clear()
 
 
         # Create menu items
         # Create menu items
+        # First add tbe projects
         for recent in self.recent:
         for recent in self.recent:
             filename = recent['filename'].split('/')[-1].split('\\')[-1]
             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
         # 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)
         clear_action = QtWidgets.QAction(QtGui.QIcon('share/trash32.png'), (_("Clear Recent files")), self)

+ 5 - 0
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
 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
 - 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

+ 6 - 7
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 = self.menufile.addMenu(QtGui.QIcon('share/folder32_bis.png'), _('Open'))
         self.menufile_open.setToolTipsVisible(True)
         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'),
         self.menufileopengerber = QtWidgets.QAction(QtGui.QIcon('share/flatcam_icon24.png'),
                                                     _('Open &Gerber ...\tCTRL+G'), self)
                                                     _('Open &Gerber ...\tCTRL+G'), self)
         self.menufile_open.addAction(self.menufileopengerber)
         self.menufile_open.addAction(self.menufileopengerber)
 
 
-        self.menufile_open.addSeparator()
-
         # Open Excellon ...
         # Open Excellon ...
         self.menufileopenexcellon = QtWidgets.QAction(QtGui.QIcon('share/open_excellon32.png'),
         self.menufileopenexcellon = QtWidgets.QAction(QtGui.QIcon('share/open_excellon32.png'),
                                                       _('Open &Excellon ...\tCTRL+E'), self)
                                                       _('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.menufileopengcode = QtWidgets.QAction(QtGui.QIcon('share/code.png'), _('Open G-&Code ...'), self)
         self.menufile_open.addAction(self.menufileopengcode)
         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()
         self.menufile_open.addSeparator()
 
 
         # Open Config File...
         # Open Config File...