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

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Oct 13 14:44:19 EDT 2010


Author: martinl
Date: 2010-10-13 11:44:19 -0700 (Wed, 13 Oct 2010)
New Revision: 43890

Modified:
   grass/trunk/gui/wxpython/gui_modules/globalvar.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: define list of commands for auto-rendering
(merge r43889 from devbr6)


Modified: grass/trunk/gui/wxpython/gui_modules/globalvar.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/globalvar.py	2010-10-13 18:34:40 UTC (rev 43889)
+++ grass/trunk/gui/wxpython/gui_modules/globalvar.py	2010-10-13 18:44:19 UTC (rev 43890)
@@ -179,3 +179,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/trunk/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/goutput.py	2010-10-13 18:34:40 UTC (rev 43889)
+++ grass/trunk/gui/wxpython/gui_modules/goutput.py	2010-10-13 18:44:19 UTC (rev 43890)
@@ -712,9 +712,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/trunk/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2010-10-13 18:34:40 UTC (rev 43889)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2010-10-13 18:44:19 UTC (rev 43890)
@@ -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/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py	2010-10-13 18:34:40 UTC (rev 43889)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py	2010-10-13 18:44:19 UTC (rev 43890)
@@ -894,13 +894,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