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

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Oct 5 08:09:17 EDT 2010


Author: martinl
Date: 2010-10-05 12:09:17 +0000 (Tue, 05 Oct 2010)
New Revision: 43794

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI:redraw display when r.colors is launched
(merge r43792 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py	2010-10-05 12:08:43 UTC (rev 43793)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py	2010-10-05 12:09:17 UTC (rev 43794)
@@ -991,7 +991,7 @@
         if params.has_key(name):
             item.SetParams(paramsOrig)
         
-    def OnDone(self, returncode):
+    def OnDone(self, cmd, returncode):
         """!Computation finished"""
         self.SetStatusText('', 0)
         

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py	2010-10-05 12:08:43 UTC (rev 43793)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py	2010-10-05 12:09:17 UTC (rev 43794)
@@ -127,7 +127,8 @@
                     self.requestCmdColor = callable(*argsColor, **kwds)
                     self.resultQ.put((requestId, self.requestCmdColor.run()))
             
-            event = wxCmdDone(aborted = aborted,
+            event = wxCmdDone(cmd = args[0],
+                              aborted = aborted,
                               returncode = returncode,
                               time = requestTime,
                               pid = requestId,
@@ -696,7 +697,7 @@
             self.btn_abort.Enable(False)
         
         if event.onDone:
-            event.onDone(returncode = event.returncode)
+            event.onDone(cmd = event.cmd, returncode = event.returncode)
         
         self.console_progressbar.SetValue(0) # reset progress bar on '0%'
 

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py	2010-10-05 12:08:43 UTC (rev 43793)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py	2010-10-05 12:09:17 UTC (rev 43794)
@@ -1337,9 +1337,9 @@
             if vectstr:
                 gcmd.RunCommand(vcmd)
         
-    def _QueryMapDone(self, returncode):
+    def _QueryMapDone(self, cmd, returncode):
         """!Restore settings after querying (restore GRASS_REGION)
-
+        
         @param returncode command return code
         """
         if hasattr(self, "tmpreg"):

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2010-10-05 12:08:43 UTC (rev 43793)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2010-10-05 12:09:17 UTC (rev 43794)
@@ -839,6 +839,21 @@
         
         event.Skip()
 
+    def OnDone(self, cmd, returncode):
+        """!This function is launched from OnRun() when command is
+        finished
+
+        @param returncode command's return code (0 for success)
+        """
+        if self.parent.GetName() != 'LayerTree' or \
+                returncode != 0:
+            return
+        
+        if cmd[0] in ('r.colors'):
+            display = self.parent.GetMapDisplay()
+            if display:
+                display.GetWindow().UpdateMap(render = True)
+        
     def OnOK(self, event):
         """!OK button pressed"""
         cmd = self.OnApply(event)
@@ -877,7 +892,7 @@
                 self.notebookpanel.notebook.SetSelection(self.notebookpanel.goutputId)
             
             try:
-                self.goutput.RunCmd(cmd)
+                self.goutput.RunCmd(cmd, onDone = self.OnDone)
             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))



More information about the grass-commit mailing list