Selaa lähdekoodia

wxGUI: fix layer > 1

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@35533 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 16 vuotta sitten
vanhempi
commit
1c9b2cc4bc
1 muutettua tiedostoa jossa 15 lisäystä ja 10 poistoa
  1. 15 10
      gui/wxpython/gui_modules/menuform.py

+ 15 - 10
gui/wxpython/gui_modules/menuform.py

@@ -1327,8 +1327,7 @@ class cmdPanel(wx.Panel):
         # set widget relations for OnUpdateSelection
         # set widget relations for OnUpdateSelection
         #
         #
         pMap = None
         pMap = None
-        pLayer = None
-        pLayerList = []
+        pLayer = []
         pDriver = None
         pDriver = None
         pDatabase = None
         pDatabase = None
         pTable = None
         pTable = None
@@ -1344,11 +1343,9 @@ class cmdPanel(wx.Panel):
                 if name in ('map', 'input'):
                 if name in ('map', 'input'):
                     pMap = p
                     pMap = p
             elif prompt == 'layer':
             elif prompt == 'layer':
-                pLayerList.append(p['wxId'])
-                if not pLayer: # TODO: check all 'layer' options
-                    pLayer = p
+                pLayer.append(p)
             elif prompt == 'dbcolumn':
             elif prompt == 'dbcolumn':
-                pColumn.append(p['wxId'])
+                pColumn.append(p)
             elif prompt == 'dbdriver':
             elif prompt == 'dbdriver':
                 pDriver = p
                 pDriver = p
             elif prompt == 'dbname':
             elif prompt == 'dbname':
@@ -1356,13 +1353,20 @@ class cmdPanel(wx.Panel):
             elif prompt == 'dbtable':
             elif prompt == 'dbtable':
                 pTable = p
                 pTable = p
         
         
+        pColumnIds = []
+        for p in pColumn:
+            pColumnIds.append(p['wxId'])
+        pLayerIds = []
+        for p in pLayer:
+            pLayerIds.append(p['wxId']) 
+        
         if pMap:
         if pMap:
-            pMap['wxId-bind'] = copy.copy(pColumn)
+            pMap['wxId-bind'] = copy.copy(pColumnIds)
             if pLayer:
             if pLayer:
-                pMap['wxId-bind'] += pLayerList
+                pMap['wxId-bind'] += pLayerIds
         
         
-        if pLayer:
-            p['wxId-bind'] = pColumn
+        for p in pLayer:
+            p['wxId-bind'] = copy.copy(pColumnIds)
 
 
         if pDriver and pTable:
         if pDriver and pTable:
             pDriver['wxId-bind'] = [pTable['wxId'], ]
             pDriver['wxId-bind'] = [pTable['wxId'], ]
@@ -1537,6 +1541,7 @@ class cmdPanel(wx.Panel):
             id = event.GetId()
             id = event.GetId()
         
         
         p = self.task.get_param(id, element='wxId', raiseError=False)
         p = self.task.get_param(id, element='wxId', raiseError=False)
+        
         if not p or \
         if not p or \
                 not p.has_key('wxId-bind'):
                 not p.has_key('wxId-bind'):
             return
             return