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

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Nov 8 18:28:13 EST 2010


Author: martinl
Date: 2010-11-08 15:28:13 -0800 (Mon, 08 Nov 2010)
New Revision: 44271

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI/menuform: simplify OnSetValue
(merge r44269 from devbr6)


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py	2010-11-08 23:25:12 UTC (rev 44270)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/menuform.py	2010-11-08 23:28:13 UTC (rev 44271)
@@ -1690,7 +1690,7 @@
             pLocation['wxId-bind'] = pMapset['wxId']
         
         if pLocation and pMapset and pMap:
-            pLocation['wxId-bind'] = pMap['wxId']
+            pLocation['wxId-bind'] += pMap['wxId']
             pMapset['wxId-bind'] = pMap['wxId']
         
 	#
@@ -1848,29 +1848,30 @@
         for selectors.
         """
         myId = event.GetId()
-        me = wx.FindWindowById( myId )
+        me = wx.FindWindowById(myId)
         name = me.GetName()
-        
+
+        found = False
         for porf in self.task.params + self.task.flags:
             if not porf.has_key('wxId'):
                 continue
-            found = False
-            for id in porf['wxId']:
-                if id == myId:
-                    found = True
-                    break
-            
-            if found:
-                if name in ('LayerSelect', 'DriverSelect', 'TableSelect',
-                            'LocationSelect', 'MapsetSelect'):
-                    porf['value'] = me.GetStringSelection()
-                elif name == 'GdalSelect':
-                    porf['value'] = event.dsn
-                elif name == 'ModelParam':
-                    porf['parameterized'] = me.IsChecked()
-                else:
-                    porf['value'] = me.GetValue()
+            if myId in porf['wxId']:
+                found = True
+                break
         
+        if not found:
+            return
+        
+        if name in ('LayerSelect', 'DriverSelect', 'TableSelect',
+                    'LocationSelect', 'MapsetSelect', 'ProjSelect'):
+            porf['value'] = me.GetStringSelection()
+        elif name == 'GdalSelect':
+            porf['value'] = event.dsn
+        elif name == 'ModelParam':
+            porf['parameterized'] = me.IsChecked()
+        else:
+            porf['value'] = me.GetValue()
+        
         self.OnUpdateValues(event)
         
         event.Skip()



More information about the grass-commit mailing list