Przeglądaj źródła

wxGUI/gmodeler: fix parametrized dialog on more items with the same label (merge https://trac.osgeo.org/grass/changeset/67761 from trunk)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@67762 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 9 lat temu
rodzic
commit
3923402ddb
1 zmienionych plików z 4 dodań i 1 usunięć
  1. 4 1
      gui/wxpython/gmodeler/model.py

+ 4 - 1
gui/wxpython/gmodeler/model.py

@@ -813,9 +813,11 @@ class Model(object):
                 continue
             name   = action.GetLabel()
             params = action.GetParams()
+            increment = False
             for f in params['flags']:
                 if f.get('parameterized', False):
                     if name not in result:
+                        increment = True
                         result[name] = { 'flags' : list(),
                                          'params': list(),
                                          'idx'   : idx }
@@ -823,11 +825,12 @@ class Model(object):
             for p in params['params']:
                 if p.get('parameterized', False):
                     if name not in result:
+                        increment = True
                         result[name] = { 'flags' : list(),
                                          'params': list(),
                                          'idx'   : idx }
                     result[name]['params'].append(p)
-            if name in result:
+            if increment:
                 idx += 1
         
         self.variablesParams = result # record parameters