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

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Mar 15 08:33:04 EDT 2010


Author: martinl
Date: 2010-03-15 08:33:03 -0400 (Mon, 15 Mar 2010)
New Revision: 41443

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
Log:
bugfix #928
(merge r41442 from relbr64)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py	2010-03-15 12:18:24 UTC (rev 41442)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py	2010-03-15 12:33:03 UTC (rev 41443)
@@ -101,7 +101,7 @@
                 aborted = False
             
             time.sleep(.1)
-            
+
             # set default color table for raster data
             if UserSettings.Get(group='cmd', key='rasterColorTable', subkey='enabled') and \
                     args[0][0][:2] == 'r.':
@@ -121,7 +121,7 @@
                               time = requestTime,
                               pid = requestId,
                               onDone = onDone)
-
+            
             # send event
             wx.PostEvent(self.parent, event)
             
@@ -400,7 +400,7 @@
             self.Map = curr_disp.GetRender()
         except:
             curr_disp = None
-
+        
         # command given as a string ?
         try:
             cmdlist = command.strip().split(' ')
@@ -416,7 +416,7 @@
             fileHistory.write(cmdString + '\n')
         finally:
             fileHistory.close()
-
+        
         # update history items
         if self.parent.GetName() == 'LayerManager':
             try:
@@ -427,7 +427,7 @@
         if cmdlist[0] in globalvar.grassCmd['all']:
             # send GRASS command without arguments to GUI command interface
             # except display commands (they are handled differently)
-            if cmdlist[0][0:2] == "d.":
+            if self.parent.GetName() == "LayerManager" and cmdlist[0][0:2] == "d.":
                 #
                 # display GRASS commands
                 #
@@ -447,7 +447,9 @@
                                  'd.rhumbline'    : 'rhumb',
                                  'd.labels'       : 'labels'}[cmdlist[0]]
                 except KeyError:
-                    wx.MessageBox(message=_("Command '%s' not yet implemented in the GUI. Try adding it as a command layer instead.") % cmdlist[0])
+                    wx.MessageBox(caption = _("Message"),
+                                  message=_("Command '%s' not yet implemented in the GUI. "
+                                            "Try adding it as a command layer instead.") % cmdlist[0])
                     return None
 
                 # add layer into layer tree
@@ -459,11 +461,12 @@
                                                       layerType = 'vector')
                 else:
                     lname = None
-                
-                self.parent.curr_page.maptree.AddLayer(ltype=layertype,
-                                                       lname=lname,
-                                                       lcmd=cmdlist)
 
+                if self.parent.GetName() == "LayerManager":                
+                    self.parent.curr_page.maptree.AddLayer(ltype=layertype,
+                                                           lname=lname,
+                                                           lcmd=cmdlist)
+            
             else:
                 #
                 # other GRASS commands (r|v|g|...)

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2010-03-15 12:18:24 UTC (rev 41442)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2010-03-15 12:33:03 UTC (rev 41443)
@@ -864,7 +864,7 @@
         if cmd == None or len(cmd) < 2:
             return
 
-        if cmd[0][0:2] != "d.":
+        if self.standalone or cmd[0][0:2] != "d.":
             # Send any non-display command to parent window (probably wxgui.py)
             # put to parents
             # switch to 'Command output'
@@ -873,13 +873,13 @@
             
             try:
                 self.goutput.RunCmd(cmd)
-            except AttributeError,e:
+            except AttributeError, e:
                 print >> sys.stderr, "%s: Propably not running in wxgui.py session?" % (e)
                 print >> sys.stderr, "parent window is: %s" % (str(self.parent))
             # Send any other command to the shell.
         else:
             gcmd.Command(cmd)
-
+        
         # update buttons status
         for btn in (self.btn_run,
                     self.btn_cancel,



More information about the grass-commit mailing list