[GRASS-SVN] r32709 - grass/branches/develbranch_6/gui/wxpython

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Aug 12 03:04:25 EDT 2008


Author: cmbarton
Date: 2008-08-12 03:04:25 -0400 (Tue, 12 Aug 2008)
New Revision: 32709

Modified:
   grass/branches/develbranch_6/gui/wxpython/wxgui.py
Log:
update to use new raster color table creator

Modified: grass/branches/develbranch_6/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/wxgui.py	2008-08-12 07:03:01 UTC (rev 32708)
+++ grass/branches/develbranch_6/gui/wxpython/wxgui.py	2008-08-12 07:04:25 UTC (rev 32709)
@@ -85,6 +85,7 @@
 import gui_modules.workspace as workspace
 import gui_modules.goutput as goutput
 import gui_modules.gdialogs as gdialogs
+import gui_modules.colorrules as colorrules
 from   gui_modules.debug import Debug as Debug
 from   icons.icon import Icons as Icons
 
@@ -868,6 +869,7 @@
 
         self.disp_idx = 0
         self.curr_page = None
+        
 
     def RulesCmd(self, event):
         """
@@ -875,33 +877,32 @@
         input and processes rules
         """
         command = self.GetMenuCmd(event)
-
-        dlg = rules.RulesText(self, cmd=command)
-        if dlg.ShowModal() == wx.ID_OK:
-            gtemp = utils.GetTempfile()
-            output = open(gtemp, "w")
-            try:
-                output.write(dlg.rules)
-            finally:
-                output.close()
-
-            if command[0] == 'r.colors':
+        
+        if command[0] == 'r.colors':
+            ctable = colorrules.ColorTable(self, cmd=command)
+            ctable.Show()      
+        else:
+            dlg = rules.RulesText(self, cmd=command)
+            if dlg.ShowModal() == wx.ID_OK:
+                gtemp = utils.GetTempfile()
+                output = open(gtemp, "w")
+                try:
+                    output.write(dlg.rules)
+                finally:
+                    output.close()
+    
                 cmdlist = [command[0],
-                           'map=%s' % dlg.inmap,
-                           'rules=%s' % gtemp]
-            else:
-                cmdlist = [command[0],
                            'input=%s' % dlg.inmap,
                            'output=%s' % dlg.outmap,
                            'rules=%s' % gtemp]
+    
+                if dlg.overwrite == True:
+                    cmdlist.append('--o')
+    
+                dlg.Destroy()
+    
+                self.goutput.RunCmd(cmdlist)
 
-            if dlg.overwrite == True:
-                cmdlist.append('--o')
-
-            dlg.Destroy()
-
-            self.goutput.RunCmd(cmdlist)
-
     def OnXTerm(self, event):
         """
         Run commands that need interactive xmon



More information about the grass-commit mailing list