Browse Source

wxGUI/forms: fix MapsetSelect updating

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@58679 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 11 years ago
parent
commit
6b8b6eec3f
2 changed files with 8 additions and 2 deletions
  1. 4 1
      gui/wxpython/gui_core/forms.py
  2. 4 1
      gui/wxpython/gui_core/gselect.py

+ 4 - 1
gui/wxpython/gui_core/forms.py

@@ -187,6 +187,9 @@ class UpdateThread(Thread):
                 continue
                 continue
             
             
             name = win.GetName()
             name = win.GetName()
+            
+            ### @todo: replace name by isinstance() and signals
+
             pBind = self.task.get_param(uid, element = 'wxId', raiseError = False)
             pBind = self.task.get_param(uid, element = 'wxId', raiseError = False)
             if pBind:
             if pBind:
                 pBind['value'] = ''
                 pBind['value'] = ''
@@ -1387,7 +1390,7 @@ class CmdPanel(wx.Panel):
                                                        value = value, new = new,
                                                        value = value, new = new,
                                                        multiple = p.get('multiple', False))
                                                        multiple = p.get('multiple', False))
                             textWin = win.GetTextCtrl()
                             textWin = win.GetTextCtrl()
-                            p['wxId'] = [ textWin.GetId(), ]
+                            p['wxId'] = [ win.GetId(), ]
                             
                             
                             textWin.Bind(wx.EVT_TEXT, self.OnSetValue)
                             textWin.Bind(wx.EVT_TEXT, self.OnSetValue)
                             win.Bind(wx.EVT_TEXT, self.OnUpdateSelection)
                             win.Bind(wx.EVT_TEXT, self.OnUpdateSelection)

+ 4 - 1
gui/wxpython/gui_core/gselect.py

@@ -1093,7 +1093,6 @@ class MapsetSelect(wx.combo.ComboCtrl):
                                     style = style, **kwargs)
                                     style = style, **kwargs)
         self.searchPath  = searchPath
         self.searchPath  = searchPath
         self.skipCurrent = skipCurrent
         self.skipCurrent = skipCurrent
-        
         self.SetName("MapsetSelect")
         self.SetName("MapsetSelect")
         if not gisdbase:
         if not gisdbase:
             self.gisdbase = grass.gisenv()['GISDBASE']
             self.gisdbase = grass.gisenv()['GISDBASE']
@@ -1121,6 +1120,9 @@ class MapsetSelect(wx.combo.ComboCtrl):
         if dbase:
         if dbase:
             self.gisdbase = dbase
             self.gisdbase = dbase
         self.location = location
         self.location = location
+        
+        self.tcp.DeleteAllItems()
+        
         if location:
         if location:
             self.tcp.SetItems(self._getMapsets())
             self.tcp.SetItems(self._getMapsets())
         else:
         else:
@@ -1159,6 +1161,7 @@ class MapsetSelect(wx.combo.ComboCtrl):
         """!For backward compatibility. MapsetSelect changed to allow
         """!For backward compatibility. MapsetSelect changed to allow
         multiple selection, this required to change super-class from
         multiple selection, this required to change super-class from
         wx.ComboBox to wx.combo.ComboCtrl"""
         wx.ComboBox to wx.combo.ComboCtrl"""
+        self.tcp.DeleteAllItems()
         self.tcp.SetItems(items)
         self.tcp.SetItems(items)
 
 
 class SubGroupSelect(wx.ComboBox):
 class SubGroupSelect(wx.ComboBox):