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

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Oct 2 16:27:25 EDT 2011


Author: martinl
Date: 2011-10-02 13:27:25 -0700 (Sun, 02 Oct 2011)
New Revision: 48597

Modified:
   grass/trunk/gui/wxpython/gui_modules/colorrules.py
Log:
wxGUI: fix RasterColorTable - OnApply()
       (merge r48596 from trunk)


Modified: grass/trunk/gui/wxpython/gui_modules/colorrules.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/colorrules.py	2011-10-02 20:24:21 UTC (rev 48596)
+++ grass/trunk/gui/wxpython/gui_modules/colorrules.py	2011-10-02 20:27:25 UTC (rev 48597)
@@ -519,22 +519,18 @@
           
     def OnApply(self, event):
         """!Apply selected color table
-
+        
         @return True on success otherwise False
         """
         ret = self.CreateColorTable()
         if not ret:
             gcmd.GMessage(parent = self, message = _("No valid color rules given."))
-
-        if self.colorTable:
-            self.UseAttrColumn(False)
-        else:
-            self.UseAttrColumn(True)            
+        
         if ret:
             display = self.parent.GetLayerTree().GetMapDisplay()
             if display and display.IsAutoRendered():
                 display.GetWindow().UpdateMap(render = True)
-           
+        
         return ret
 
     def OnOK(self, event):
@@ -1616,7 +1612,19 @@
         self.DeleteTemporaryColumn()
         self.Map.Clean()
         self.Destroy()
+
+    def OnApply(self, event):
+        """!Apply selected color table
         
+        @return True on success otherwise False
+        """
+        if self.colorTable:
+            self.UseAttrColumn(False)
+        else:
+            self.UseAttrColumn(True)
+        
+        return ColorTable.OnApply()
+        
 class ThematicVectorTable(VectorColorTable):
     def __init__(self, parent, vectorType, **kwargs):
         """!Dialog for interactively entering color/size rules
@@ -1637,7 +1645,6 @@
 
         @return True on success otherwise False
         """
-        
         ret = self.CreateColorTable()
         if not ret:
             gcmd.GMessage(parent = self, message = _("No valid color rules given."))
@@ -1824,4 +1831,4 @@
     def EraseMap(self):
         """!Erase preview"""
         self.Draw(self.pdc, pdctype = 'clear')
-    
\ No newline at end of file
+    



More information about the grass-commit mailing list