[GRASS-SVN] r52879 - in grass/trunk/gui/wxpython: dbmgr gcp mapdisp
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Aug 25 02:27:45 PDT 2012
Author: annakrat
Date: 2012-08-25 02:27:45 -0700 (Sat, 25 Aug 2012)
New Revision: 52879
Modified:
grass/trunk/gui/wxpython/dbmgr/dialogs.py
grass/trunk/gui/wxpython/gcp/mapdisplay.py
grass/trunk/gui/wxpython/mapdisp/frame.py
grass/trunk/gui/wxpython/mapdisp/mapwindow.py
Log:
wxGUI: fixed #1617, when closing attribute dialog do not rerender everything
Modified: grass/trunk/gui/wxpython/dbmgr/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/dbmgr/dialogs.py 2012-08-24 19:17:05 UTC (rev 52878)
+++ grass/trunk/gui/wxpython/dbmgr/dialogs.py 2012-08-25 09:27:45 UTC (rev 52879)
@@ -299,14 +299,16 @@
def OnCancel(self, event):
"""!Cancel button pressed
"""
- self.parent.parent.dialogs['attributes'] = None
-
+ frame = self.parent.parent
+ frame.dialogs['attributes'] = None
if hasattr(self, "digit"):
self.parent.digit.GetDisplay().SetSelected([])
- self.parent.UpdateMap(render = False)
- else:
- self.parent.parent.OnRender(None)
-
+ if frame.IsAutoRendered():
+ self.parent.UpdateMap(render = False)
+ elif frame.IsAutoRendered():
+ frame.RemoveQueryLayer()
+ self.parent.UpdateMap(render = True)
+
self.Close()
def OnSubmit(self, event):
Modified: grass/trunk/gui/wxpython/gcp/mapdisplay.py
===================================================================
--- grass/trunk/gui/wxpython/gcp/mapdisplay.py 2012-08-24 19:17:05 UTC (rev 52878)
+++ grass/trunk/gui/wxpython/gcp/mapdisplay.py 2012-08-25 09:27:45 UTC (rev 52879)
@@ -287,6 +287,7 @@
def OnRender(self, event):
"""!Re-render map composition (each map layer)
"""
+ # FIXME: remove qlayer code or use RemoveQueryLayer() now in mapdisp.frame
# delete tmp map layers (queries)
qlayer = self.Map.GetListOfLayers(l_name=globalvar.QUERYLAYER)
for layer in qlayer:
Modified: grass/trunk/gui/wxpython/mapdisp/frame.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/frame.py 2012-08-24 19:17:05 UTC (rev 52878)
+++ grass/trunk/gui/wxpython/mapdisp/frame.py 2012-08-25 09:27:45 UTC (rev 52879)
@@ -438,13 +438,16 @@
event.Skip()
+ def RemoveQueryLayer(self):
+ """!Removes temporary map layers (queries)"""
+ qlayer = self.GetMap().GetListOfLayers(l_name = globalvar.QUERYLAYER)
+ for layer in qlayer:
+ self.GetMap().DeleteLayer(layer)
+
def OnRender(self, event):
"""!Re-render map composition (each map layer)
"""
- # delete tmp map layers (queries)
- qlayer = self.Map.GetListOfLayers(l_name = globalvar.QUERYLAYER)
- for layer in qlayer:
- self.Map.DeleteLayer(layer)
+ self.RemoveQueryLayer()
# delete tmp lines
if self.MapWindow.mouse["use"] in ("measure",
@@ -810,14 +813,14 @@
cats = self.dialogs['attributes'].GetCats()
qlayer = None
- if not self.IsPaneShown('3d'):
+ if not self.IsPaneShown('3d') and self.IsAutoRendered():
try:
qlayer = self.Map.GetListOfLayers(l_name = globalvar.QUERYLAYER)[0]
except IndexError:
pass
if self.dialogs['attributes'].mapDBInfo and cats:
- if not self.IsPaneShown('3d'):
+ if not self.IsPaneShown('3d') and self.IsAutoRendered():
# highlight feature & re-draw map
if qlayer:
qlayer.SetCmd(self.AddTmpVectorMapLayer(mapName, cats,
Modified: grass/trunk/gui/wxpython/mapdisp/mapwindow.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/mapwindow.py 2012-08-24 19:17:05 UTC (rev 52878)
+++ grass/trunk/gui/wxpython/mapdisp/mapwindow.py 2012-08-25 09:27:45 UTC (rev 52879)
@@ -1177,14 +1177,6 @@
layers = self.GetSelectedLayer(type = 'item', multi = True)
self.frame.Query(self.mouse['begin'][0],self.mouse['begin'][1], layers)
- self.UpdateMap(render = False, renderVector = False)
-
- elif self.mouse["use"] == "queryVector":
- # editable mode for vector map layers
- self.frame.QueryVector(self.mouse['begin'][0], self.mouse['begin'][1])
-
- # clear temp canvas
- self.UpdateMap(render = False, renderVector = False)
elif self.mouse["use"] in ["measure", "profile"]:
# measure or profile
More information about the grass-commit
mailing list