add hotkeys to open recent projects
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Thu, 09 Mar 2017 18:03:57 +0300
changeset 1659 aec0ed4b6f39
parent 1658 ba6a6d6e989c
child 1660 ccf2bcf66c70
child 1661 78f28f40bc10
add hotkeys to open recent projects

For simplicity only last 9 projects are saved.

Alt-F, R, 1 - to open last opened project
Alt-F, R, 2 ...
...
Alt-F, R, 9 ...
Beremiz.py
--- a/Beremiz.py	Thu Mar 09 17:29:17 2017 +0300
+++ b/Beremiz.py	Thu Mar 09 18:03:57 2017 +0300
@@ -166,7 +166,7 @@
 from ProjectController import ProjectController, GetAddMenuItems, MATIEC_ERROR_MODEL, ITEM_CONFNODE
 
 
-MAX_RECENT_PROJECTS = 10
+MAX_RECENT_PROJECTS = 9
 
 if wx.Platform == '__WXMSW__':
     faces = {
@@ -764,7 +764,7 @@
 
         self.FileMenu.Enable(ID_FILEMENURECENTPROJECTS, len(recent_projects) > 0)
         for idx, projectpath in enumerate(recent_projects):
-            text = u'%d: %s' % (idx + 1, projectpath)
+            text = u'&%d: %s' % (idx + 1, projectpath)
 
             if idx < self.RecentProjectsMenu.GetMenuItemCount():
                 item = self.RecentProjectsMenu.FindItemByPosition(idx)