[GRASS-SVN] r43889 -
grass/branches/develbranch_6/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Oct 13 14:34:40 EDT 2010
Author: martinl
Date: 2010-10-13 11:34:40 -0700 (Wed, 13 Oct 2010)
New Revision: 43889
Modified:
grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.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: define list of commands for auto-rendering
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py 2010-10-13 18:33:49 UTC (rev 43888)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/globalvar.py 2010-10-13 18:34:40 UTC (rev 43889)
@@ -180,3 +180,6 @@
"""@Check version of wxPython, use agwStyle for 2.8.11+"""
hasAgw = CheckWxVersion()
+
+"""@List of commands for auto-rendering"""
+cmdAutoRender = [ 'r.colors', 'i.landsat.rgb' ]
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py 2010-10-13 18:33:49 UTC (rev 43888)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py 2010-10-13 18:34:40 UTC (rev 43889)
@@ -710,9 +710,9 @@
# set focus on prompt
if self.parent.GetName() == "LayerManager":
self.btn_abort.Enable(False)
- if event.cmd[0] in ('r.colors'):
+ if event.cmd[0] in globalvar.cmdAutoRender:
display = self.parent.GetLayerTree().GetMapDisplay()
- if display:
+ if display and display.IsAutoRendered():
display.GetWindow().UpdateMap(render = True)
else:
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py 2010-10-13 18:33:49 UTC (rev 43888)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/mapdisp.py 2010-10-13 18:34:40 UTC (rev 43889)
@@ -666,16 +666,18 @@
# event.Skip()
def OnToggleRender(self, event):
+ """!Enable/disable auto-rendering
"""
- Enable/disable auto-rendering
- """
if self.statusbarWin['render'].GetValue():
self.OnRender(None)
+ def IsAutoRendered(self):
+ """!Check if auto-rendering is enabled"""
+ return self.statusbarWin['render'].IsChecked()
+
def OnToggleShowRegion(self, event):
+ """!Show/Hide extent in map canvas
"""
- Show/Hide extent in map canvas
- """
if self.statusbarWin['region'].GetValue():
# show extent
self.MapWindow.regionCoords = []
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py 2010-10-13 18:33:49 UTC (rev 43888)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py 2010-10-13 18:34:40 UTC (rev 43889)
@@ -854,13 +854,13 @@
returncode != 0:
return
- if cmd[0] in ('r.colors'):
+ if cmd[0] in globalvar.cmdAutoRender:
if self.parent.GetName() == 'LayerTree':
display = self.parent.GetMapDisplay()
else: # Layer Manager
display = self.parent.GetLayerTree().GetMapDisplay()
- if display:
+ if display and display.IsAutoRendered():
display.GetWindow().UpdateMap(render = True)
def OnOK(self, event):
More information about the grass-commit
mailing list