[GRASS-SVN] r69685 - grass/trunk/gui/wxpython/tplot

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Oct 8 18:51:29 PDT 2016


Author: annakrat
Date: 2016-10-08 18:51:29 -0700 (Sat, 08 Oct 2016)
New Revision: 69685

Modified:
   grass/trunk/gui/wxpython/tplot/frame.py
Log:
g.gui.tplot: do not use EVT_COMBOBOX_CLOSEUP, not available on all platforms, see #3175

Modified: grass/trunk/gui/wxpython/tplot/frame.py
===================================================================
--- grass/trunk/gui/wxpython/tplot/frame.py	2016-10-07 04:29:32 UTC (rev 69684)
+++ grass/trunk/gui/wxpython/tplot/frame.py	2016-10-09 01:51:29 UTC (rev 69685)
@@ -228,7 +228,7 @@
         self.datasetSelectV = gselect.Select(
             parent=self.controlPanelVector, id=wx.ID_ANY,
             size=globalvar.DIALOG_GSELECT_SIZE, type='stvds', multiple=True)
-        self.datasetSelectV.Bind(wx.EVT_COMBOBOX_CLOSEUP,
+        self.datasetSelectV.Bind(wx.EVT_TEXT,
                                  self.OnVectorSelected)
 
         self.attribute = gselect.ColumnSelect(parent=self.controlPanelVector)
@@ -886,7 +886,18 @@
     def OnVectorSelected(self, event):
         """Update the controlbox related to stvds"""
         dataset = self.datasetSelectV.GetValue().strip()
-        if dataset:
+        name = dataset.split('@')[0]
+        mapset = dataset.split('@')[1] if len(dataset.split('@')) > 1 else ''
+        found = False
+        for each in tgis.tlist(type='stvds', dbif=self.dbif):
+            each_name, each_mapset = each.split('@')
+            if name == each_name:
+                if mapset and mapset != each_mapset:
+                    continue
+                dataset = name + '@' + each_mapset
+                found = True
+                break
+        if found:
             try:
                 vect_list = grass.read_command('t.vect.list', flags='s',
                                                input=dataset, column='name')
@@ -901,7 +912,7 @@
             for vec in vect_list:
                 self.attribute.InsertColumns(vec, 1)
         else:
-            return
+            self.attribute.Clear()
 
 
 class LookUp:



More information about the grass-commit mailing list