[GRASS-SVN] r39925 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Dec 6 15:45:03 EST 2009


Author: martinl
Date: 2009-12-06 15:45:02 -0500 (Sun, 06 Dec 2009)
New Revision: 39925

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/help.py
Log:
fix bug introduced in r39922 - menu items are not grass commands,
eval() required


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/help.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/help.py	2009-12-06 20:31:13 UTC (rev 39924)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/help.py	2009-12-06 20:45:02 UTC (rev 39925)
@@ -65,7 +65,7 @@
 
         self.panel = wx.Panel(parent = self, id = wx.ID_ANY)
         self.dataBox = wx.StaticBox(parent = self.panel, id = wx.ID_ANY,
-                               label=" %s " % _("Menu tree (double-click to run command)"))        
+                                    label=" %s " % _("Menu tree (double-click to run command)"))        
         # tree
         self.tree = MenuTree(parent = self.panel, data = menudata.Data())
         self.tree.Load()
@@ -116,9 +116,6 @@
         sizer = wx.BoxSizer(wx.VERTICAL)
         
         # body
-#        dataBox = wx.StaticBox(parent = self.panel, id = wx.ID_ANY,
-#                               label=" %s " % _("Menu tree (double-click to run command)"))
-        
         dataSizer = wx.StaticBoxSizer(self.dataBox, wx.HORIZONTAL)
         dataSizer.Add(item = self.tree, proportion =1,
                       flag = wx.EXPAND)
@@ -177,14 +174,15 @@
             return
 
         handler = 'self.parent.' + data['handler'].lstrip('self.')
-        print 'handler = '+data['handler']
         if data['handler'] == 'self.OnXTerm':
-            wx.MessageBox('You must run this command from the menu or command line',
-                          'This command require an XTerm')
+            wx.MessageBox(parent = self,
+                          message = _('You must run this command from the menu or command line',
+                                      'This command require an XTerm'),
+                          caption = _('Message'), style=wx.OK | wx.ICON_ERROR | wx.CENTRE)
         elif data['command']:
-            self.parent.goutput.RunCmd(data['command'], switchPage = True)
+            eval(handler)(event = None, cmd = data['command'].split())
         else:
-            pass
+            eval(handler)(None)
         
         if self.closeOnRun.IsChecked():
             self.OnCloseWindow(None)



More information about the grass-commit mailing list