[GRASS-SVN] r48636 - grass/branches/releasebranch_6_4/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Oct 5 05:00:33 EDT 2011


Author: martinl
Date: 2011-10-05 02:00:33 -0700 (Wed, 05 Oct 2011)
New Revision: 48636

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gmodeler.py
Log:
wxGUI: do validation of new added item also if parameters were given
       (merge r48635 from trunk)


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gmodeler.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gmodeler.py	2011-10-05 08:58:50 UTC (rev 48635)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gmodeler.py	2011-10-05 09:00:33 UTC (rev 48636)
@@ -1231,9 +1231,13 @@
         
         # show properties dialog
         win = action.GetPropDialog()
-        if not win and len(action.GetLog(string = False)) == 1:
-            module = menuform.GUI(parent = self, show = True).ParseCommand(action.GetLog(string = False),
-                                                                           completed = (self.GetOptData, action, action.GetParams()))
+        if not win:
+            if len(action.GetLog(string = False)) > 1:
+                self.GetOptData(dcmd = action.GetLog(string = False), layer = action,
+                                params = action.GetParams(), propwin = None)
+            else:
+                menuform.GUI(parent = self, show = True).ParseCommand(action.GetLog(string = False),
+                                                                      completed = (self.GetOptData, action, action.GetParams()))
         elif win and not win.IsShown():
             win.Show()
         
@@ -1289,23 +1293,6 @@
     def GetOptData(self, dcmd, layer, params, propwin):
         """!Process action data"""
         if params: # add data items
-            # for p in params['params']:
-            #     if p.get('prompt', '') in ('raster', 'vector', 'raster3d'):
-            #         try:
-            #             name, mapset = p.get('value', '').split('@', 1)
-            #         except (ValueError, IndexError):
-            #             continue
-                    
-            #         if mapset != grass.gisenv()['MAPSET']:
-            #             continue
-                    
-            #         # don't use fully qualified names
-            #         p['value'] = p.get('value', '').split('@')[0]
-            #         for idx in range(1, len(dcmd)):
-            #             if p.get('name', '') in dcmd[idx]:
-            #                 dcmd[idx] = p.get('name', '') + '=' + p.get('value', '')
-            #                 break
-            
             width, height = self.canvas.GetSize()
             x = [width/2 + 200, width/2 - 200]
             for p in params['params']:



More information about the grass-commit mailing list