Selaa lähdekoodia

wxGUI: do validation of new added item also if parameters were given

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@48635 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 13 vuotta sitten
vanhempi
commit
0406edbc6c
1 muutettua tiedostoa jossa 7 lisäystä ja 20 poistoa
  1. 7 20
      gui/wxpython/gui_modules/gmodeler.py

+ 7 - 20
gui/wxpython/gui_modules/gmodeler.py

@@ -1225,9 +1225,13 @@ class ModelFrame(wx.Frame):
         
         # 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()
         
@@ -1283,23 +1287,6 @@ class ModelFrame(wx.Frame):
     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']: