[GRASS-SVN] r58679 - grass/trunk/gui/wxpython/gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jan 12 03:08:31 PST 2014


Author: martinl
Date: 2014-01-12 03:08:30 -0800 (Sun, 12 Jan 2014)
New Revision: 58679

Modified:
   grass/trunk/gui/wxpython/gui_core/forms.py
   grass/trunk/gui/wxpython/gui_core/gselect.py
Log:
wxGUI/forms: fix MapsetSelect updating

Modified: grass/trunk/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/forms.py	2014-01-11 21:15:00 UTC (rev 58678)
+++ grass/trunk/gui/wxpython/gui_core/forms.py	2014-01-12 11:08:30 UTC (rev 58679)
@@ -187,6 +187,9 @@
                 continue
             
             name = win.GetName()
+            
+            ### @todo: replace name by isinstance() and signals
+
             pBind = self.task.get_param(uid, element = 'wxId', raiseError = False)
             if pBind:
                 pBind['value'] = ''
@@ -1387,7 +1390,7 @@
                                                        value = value, new = new,
                                                        multiple = p.get('multiple', False))
                             textWin = win.GetTextCtrl()
-                            p['wxId'] = [ textWin.GetId(), ]
+                            p['wxId'] = [ win.GetId(), ]
                             
                             textWin.Bind(wx.EVT_TEXT, self.OnSetValue)
                             win.Bind(wx.EVT_TEXT, self.OnUpdateSelection)

Modified: grass/trunk/gui/wxpython/gui_core/gselect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/gselect.py	2014-01-11 21:15:00 UTC (rev 58678)
+++ grass/trunk/gui/wxpython/gui_core/gselect.py	2014-01-12 11:08:30 UTC (rev 58679)
@@ -1093,7 +1093,6 @@
                                     style = style, **kwargs)
         self.searchPath  = searchPath
         self.skipCurrent = skipCurrent
-        
         self.SetName("MapsetSelect")
         if not gisdbase:
             self.gisdbase = grass.gisenv()['GISDBASE']
@@ -1121,6 +1120,9 @@
         if dbase:
             self.gisdbase = dbase
         self.location = location
+        
+        self.tcp.DeleteAllItems()
+        
         if location:
             self.tcp.SetItems(self._getMapsets())
         else:
@@ -1159,6 +1161,7 @@
         """!For backward compatibility. MapsetSelect changed to allow
         multiple selection, this required to change super-class from
         wx.ComboBox to wx.combo.ComboCtrl"""
+        self.tcp.DeleteAllItems()
         self.tcp.SetItems(items)
 
 class SubGroupSelect(wx.ComboBox):



More information about the grass-commit mailing list