[GRASS-SVN] r53803 - in grass/branches/develbranch_6/gui/wxpython: lmgr xml

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Nov 14 04:08:27 PST 2012


Author: martinl
Date: 2012-11-14 04:08:24 -0800 (Wed, 14 Nov 2012)
New Revision: 53803

Modified:
   grass/branches/develbranch_6/gui/wxpython/lmgr/frame.py
   grass/branches/develbranch_6/gui/wxpython/xml/menudata.xml
Log:
wxGUI: define separate handlers for color rules
       (merge r53802 from trunk)


Modified: grass/branches/develbranch_6/gui/wxpython/lmgr/frame.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/lmgr/frame.py	2012-11-14 12:05:15 UTC (rev 53802)
+++ grass/branches/develbranch_6/gui/wxpython/lmgr/frame.py	2012-11-14 12:08:24 UTC (rev 53803)
@@ -1196,18 +1196,19 @@
                                        'loc' : grass.gisenv()["LOCATION_NAME"] })
         dlg.Destroy()
         
-    def RulesCmd(self, event, cmd = None):
-        """!Launches dialog for commands that need rules input and
-        processes rules
+    def OnRasterRules(self, event):
+        """!Launches dialog for raster color rules
         """
-        cmd = self.GetMenuCmd(event)
-        
-        if cmd[0] == 'r.colors':
-            ctable = RasterColorTable(self)
-        else:
-            ctable = VectorColorTable(self, attributeType = 'color')
+        ctable = RasterColorTable(self)
         ctable.CentreOnScreen()
         ctable.Show()
+
+    def OnVectorRules(self, event):
+        """!Launches dialog for vector color rules
+        """
+        ctable = VectorColorTable(self, attributeType = 'color')
+        ctable.CentreOnScreen()
+        ctable.Show()
         
     def OnXTermNoXMon(self, event):
         """!

Modified: grass/branches/develbranch_6/gui/wxpython/xml/menudata.xml
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/xml/menudata.xml	2012-11-14 12:05:15 UTC (rev 53802)
+++ grass/branches/develbranch_6/gui/wxpython/xml/menudata.xml	2012-11-14 12:08:24 UTC (rev 53803)
@@ -1037,7 +1037,7 @@
               <label>Color rules</label>
               <help>Interactive management of raster color tables.</help>
               <keywords>raster,color table</keywords>
-              <handler>RulesCmd</handler>
+              <handler>OnRasterRules</handler>
             </menuitem>
             <menuitem>
               <label>Export color table</label>
@@ -2092,9 +2092,8 @@
             <menuitem>
               <label>Color rules</label>
               <help>Interactive management of vector color tables.</help>
-              <handler>RulesCmd</handler>
+              <handler>OnVectorRules</handler>
               <keywords>vector,color table</keywords>
-              <command>v.colors</command>
             </menuitem>
           </items>
         </menu>



More information about the grass-commit mailing list