[GRASS-SVN] r41444 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Mar 15 08:37:30 EDT 2010


Author: martinl
Date: 2010-03-15 08:37:30 -0400 (Mon, 15 Mar 2010)
New Revision: 41444

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


Modified: grass/trunk/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/goutput.py	2010-03-15 12:33:03 UTC (rev 41443)
+++ grass/trunk/gui/wxpython/gui_modules/goutput.py	2010-03-15 12:37:30 UTC (rev 41444)
@@ -102,7 +102,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.':
@@ -122,7 +122,7 @@
                               time = requestTime,
                               pid = requestId,
                               onDone = onDone)
-
+            
             # send event
             wx.PostEvent(self.parent, event)
             
@@ -401,7 +401,7 @@
             self.Map = curr_disp.GetRender()
         except:
             curr_disp = None
-
+        
         # command given as a string ?
         try:
             cmdlist = command.strip().split(' ')
@@ -417,7 +417,7 @@
             fileHistory.write(cmdString + '\n')
         finally:
             fileHistory.close()
-
+        
         # update history items
         if self.parent.GetName() == 'LayerManager':
             try:
@@ -428,7 +428,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
                 #
@@ -448,7 +448,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
@@ -460,11 +462,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/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py	2010-03-15 12:33:03 UTC (rev 41443)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py	2010-03-15 12:37:30 UTC (rev 41444)
@@ -910,7 +910,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'
@@ -927,7 +927,7 @@
             # 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