Ver código fonte

wxGUI: add icon for python editor to the Layer Manager toolbar

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@68318 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 9 anos atrás
pai
commit
b02c4ddf74

BIN
gui/icons/grass/python.png


+ 1 - 1
gui/wxpython/lmgr/pyshell.py

@@ -132,5 +132,5 @@ class PyShellWindow(wx.Panel):
         # there when closing the main GUI
         # there when closing the main GUI
         simpleEditor = PyEditFrame(parent=self, giface=self.giface)
         simpleEditor = PyEditFrame(parent=self, giface=self.giface)
         simpleEditor.SetSize(self.parent.GetSize())
         simpleEditor.SetSize(self.parent.GetSize())
-        simpleEditor.CenterOnParent()
+        simpleEditor.CenterOnScreen()
         simpleEditor.Show()
         simpleEditor.Show()

+ 4 - 0
gui/wxpython/lmgr/toolbars.py

@@ -142,6 +142,8 @@ class LMToolsToolbar(BaseToolbar):
                                  label = _('Cartographic Composer')),
                                  label = _('Cartographic Composer')),
             'script-load': MetaIcon(img = 'script-load',
             'script-load': MetaIcon(img = 'script-load',
                                  label = _('Launch user-defined script')),
                                  label = _('Launch user-defined script')),
+            'python': MetaIcon(img = 'python',
+                               label = _('Open a simple Python code editor')),
             }
             }
         
         
         return self._getToolbarData((('importMap', icons["import"],
         return self._getToolbarData((('importMap', icons["import"],
@@ -158,6 +160,8 @@ class LMToolsToolbar(BaseToolbar):
                                      (None, ),
                                      (None, ),
                                      ('script-load', icons['script-load'],
                                      ('script-load', icons['script-load'],
                                       self.parent.OnRunScript),
                                       self.parent.OnRunScript),
+                                     ('python', icons['python'],
+                                      self.parent.pyshell.OnSimpleEditor),
                                      ))
                                      ))
 
 
 class LMMiscToolbar(BaseToolbar):
 class LMMiscToolbar(BaseToolbar):