[GRASS-SVN] r43792 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Oct 5 08:02:41 EDT 2010
Author: martinl
Date: 2010-10-05 12:02:40 +0000 (Tue, 05 Oct 2010)
New Revision: 43792
Modified:
grass/trunk/gui/wxpython/gui_modules/gmodeler.py
grass/trunk/gui/wxpython/gui_modules/goutput.py
grass/trunk/gui/wxpython/gui_modules/mapdisp.py
grass/trunk/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI:redraw display when r.colors is launched
Modified: grass/trunk/gui/wxpython/gui_modules/gmodeler.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gmodeler.py 2010-10-05 11:26:21 UTC (rev 43791)
+++ grass/trunk/gui/wxpython/gui_modules/gmodeler.py 2010-10-05 12:02:40 UTC (rev 43792)
@@ -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/trunk/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/goutput.py 2010-10-05 11:26:21 UTC (rev 43791)
+++ grass/trunk/gui/wxpython/gui_modules/goutput.py 2010-10-05 12:02:40 UTC (rev 43792)
@@ -128,7 +128,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,
@@ -697,7 +698,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/trunk/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp.py 2010-10-05 11:26:21 UTC (rev 43791)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp.py 2010-10-05 12:02:40 UTC (rev 43792)
@@ -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/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py 2010-10-05 11:26:21 UTC (rev 43791)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py 2010-10-05 12:02:40 UTC (rev 43792)
@@ -876,6 +876,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)
@@ -916,7 +931,7 @@
try:
if self.task.path:
cmd[0] = self.task.path # full path
- 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