Sfoglia il codice sorgente

wxGUI: fix G_OPT_V_FIELD opts (multi)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@38340 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 16 anni fa
parent
commit
f0bfbd3d20

+ 6 - 2
gui/wxpython/gui_modules/menuform.py

@@ -214,8 +214,12 @@ class UpdateThread(Thread):
             name = win.GetName()
             
             if name == 'LayerSelect':
-                self.data[win.InsertLayers] = { 'vector' : map }
-                
+                if not map and p.get('element', '') == 'vector':
+                    # standard way failed, try to track wxIds manually
+                    map = p.get('value', '')
+                if map:
+                    self.data[win.InsertLayers] = { 'vector' : map }
+            
             elif name == 'TableSelect':
                 pDriver = self.task.get_param('dbdriver', element='prompt', raiseError=False)
                 driver = db = None

+ 2 - 6
gui/wxpython/gui_modules/utils.py

@@ -240,17 +240,13 @@ def ListSortLower(list):
 
 def GetVectorNumberOfLayers(vector):
     """!Get list of vector layers"""
-    cmdlist = ['v.category',
-               'input=%s' % vector,
-               'option=report']
-    
-    layers = []
+    layers = list()
     
     ret = gcmd.RunCommand('v.category',
                           read = True,
                           input = vector,
                           option = 'report')
-
+    
     if not ret:
         return layers