浏览代码

wxGUI/pyedit: add quit toolbar tool (#1022)

Tomas Zigo 4 年之前
父节点
当前提交
b44377c951
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      gui/wxpython/gui_core/pyedit.py

+ 5 - 1
gui/wxpython/gui_core/pyedit.py

@@ -440,7 +440,7 @@ class PyEditController(object):
 
 
         Asks user if replacement is OK depending on the state of the editor.
         Asks user if replacement is OK depending on the state of the editor.
         Use before replacing all editor content by some other text.
         Use before replacing all editor content by some other text.
-        
+
         :param by_message: message used to ask user if it is OK to replace
         :param by_message: message used to ask user if it is OK to replace
             the content with something else; special values are 'template',
             the content with something else; special values are 'template',
             'example' and 'file' which will use predefined messages, otherwise
             'example' and 'file' which will use predefined messages, otherwise
@@ -530,6 +530,8 @@ class PyEditToolbar(BaseToolbar):
                                       label=_('Activate overwrite')),
                                       label=_('Activate overwrite')),
             'overwriteFalse': MetaIcon(img='unlocked',
             'overwriteFalse': MetaIcon(img='unlocked',
                                        label=_('Deactive overwrite')),
                                        label=_('Deactive overwrite')),
+            'quit': MetaIcon(img='quit',
+                             label=_('Quit Simple Python Editor')),
         }
         }
 
 
         # workaround for http://trac.wxwidgets.org/ticket/13888
         # workaround for http://trac.wxwidgets.org/ticket/13888
@@ -555,6 +557,8 @@ class PyEditToolbar(BaseToolbar):
                                      (None, ),
                                      (None, ),
                                      ("help", BaseIcons['help'],
                                      ("help", BaseIcons['help'],
                                       self.parent.OnHelp),
                                       self.parent.OnHelp),
+                                     ('quit', self.icons['quit'],
+                                      self.parent.OnClose),
                                      ))
                                      ))
 
 
     # TODO: add overwrite also to the menu and sync with toolbar
     # TODO: add overwrite also to the menu and sync with toolbar