beremiz

add hotkeys to open recent projects

2017-03-09, Andrey Skvortsov
aec0ed4b6f39
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 ...
  • +2 -2
    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)