[GRASS-SVN] r59125 - grass/trunk/gui/wxpython/dbmgr
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Feb 23 07:01:56 PST 2014
Author: martinl
Date: 2014-02-23 07:01:56 -0800 (Sun, 23 Feb 2014)
New Revision: 59125
Modified:
grass/trunk/gui/wxpython/dbmgr/base.py
Log:
wxGUI/dbmgr: highlight selected feature only when where cond is given
Modified: grass/trunk/gui/wxpython/dbmgr/base.py
===================================================================
--- grass/trunk/gui/wxpython/dbmgr/base.py 2014-02-23 14:37:32 UTC (rev 59124)
+++ grass/trunk/gui/wxpython/dbmgr/base.py 2014-02-23 15:01:56 UTC (rev 59125)
@@ -1791,6 +1791,7 @@
if not win:
return
+ showSelected = False
wx.BeginBusyCursor()
if win.GetSelection() == 0:
# simple sql statement
@@ -1799,6 +1800,7 @@
whereVal = self.FindWindowById(self.layerPage[self.selLayer]['where']).GetValue().strip()
try:
if len(whereVal) > 0:
+ showSelected = True
keyColumn = listWin.LoadData(self.selLayer, where = whereCol + whereOpe + whereVal)
else:
keyColumn = listWin.LoadData(self.selLayer)
@@ -1813,6 +1815,8 @@
cols, where = self.ValidateSelectStatement(win.GetValue())
if cols is None and where is None:
sql = win.GetValue()
+ if where:
+ showSelected = True
except TypeError:
GError(parent = self,
message = _("Loading attribute data failed.\n"
@@ -1847,7 +1851,12 @@
# update map display if needed
if UserSettings.Get(group = 'atm', key = 'highlight', subkey = 'auto'):
- self._drawSelected(zoom=False, selectedOnly=False) # TODO: replace by signals
+ # TODO: replace by signals
+ if showSelected:
+ self._drawSelected(zoom=False, selectedOnly=False)
+ else:
+ self.mapdisplay.RemoveQueryLayer()
+ self.mapdisplay.MapWindow.UpdateMap(render=False) # TODO: replace by signals
def OnBuilder(self,event):
"""!SQL Builder button pressed -> show the SQLBuilder dialog"""
More information about the grass-commit
mailing list