[GRASS-SVN] r69817 - grass/branches/releasebranch_7_2/gui/wxpython/tplot

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Nov 13 15:40:02 PST 2016


Author: annakrat
Date: 2016-11-13 15:40:02 -0800 (Sun, 13 Nov 2016)
New Revision: 69817

Modified:
   grass/branches/releasebranch_7_2/gui/wxpython/tplot/frame.py
Log:
g.gui.tplot: do not use EVT_COMBOBOX_CLOSEUP, not available on all platforms, see #3175 (merge from trunk, r69685)

Modified: grass/branches/releasebranch_7_2/gui/wxpython/tplot/frame.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/tplot/frame.py	2016-11-13 23:24:40 UTC (rev 69816)
+++ grass/branches/releasebranch_7_2/gui/wxpython/tplot/frame.py	2016-11-13 23:40:02 UTC (rev 69817)
@@ -227,7 +227,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)
@@ -885,7 +885,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')
@@ -900,7 +911,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