[GRASS-SVN] r52881 - in grass/branches/releasebranch_6_4/gui/wxpython: dbmgr gcp mapdisp

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Aug 25 02:59:06 PDT 2012


Author: annakrat
Date: 2012-08-25 02:59:03 -0700 (Sat, 25 Aug 2012)
New Revision: 52881

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/dbmgr/dialogs.py
   grass/branches/releasebranch_6_4/gui/wxpython/gcp/mapdisplay.py
   grass/branches/releasebranch_6_4/gui/wxpython/mapdisp/frame.py
   grass/branches/releasebranch_6_4/gui/wxpython/mapdisp/mapwindow.py
Log:
wxGUI: fixed #1617, when closing attribute dialog do not rerender everything (merge from trunk, r52879)

Modified: grass/branches/releasebranch_6_4/gui/wxpython/dbmgr/dialogs.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/dbmgr/dialogs.py	2012-08-25 09:50:15 UTC (rev 52880)
+++ grass/branches/releasebranch_6_4/gui/wxpython/dbmgr/dialogs.py	2012-08-25 09:59:03 UTC (rev 52881)
@@ -301,14 +301,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/branches/releasebranch_6_4/gui/wxpython/gcp/mapdisplay.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gcp/mapdisplay.py	2012-08-25 09:50:15 UTC (rev 52880)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gcp/mapdisplay.py	2012-08-25 09:59:03 UTC (rev 52881)
@@ -289,6 +289,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/branches/releasebranch_6_4/gui/wxpython/mapdisp/frame.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/mapdisp/frame.py	2012-08-25 09:50:15 UTC (rev 52880)
+++ grass/branches/releasebranch_6_4/gui/wxpython/mapdisp/frame.py	2012-08-25 09:59:03 UTC (rev 52881)
@@ -434,13 +434,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",
@@ -807,14 +810,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/branches/releasebranch_6_4/gui/wxpython/mapdisp/mapwindow.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/mapdisp/mapwindow.py	2012-08-25 09:50:15 UTC (rev 52880)
+++ grass/branches/releasebranch_6_4/gui/wxpython/mapdisp/mapwindow.py	2012-08-25 09:59:03 UTC (rev 52881)
@@ -1118,8 +1118,7 @@
             layers = self.GetSelectedLayer(type = 'item', multi = True)
 
             self.parent.Query(self.mouse['begin'][0],self.mouse['begin'][1], layers)
-            self.UpdateMap(render = False, renderVector = False)
-            
+
         elif self.mouse["use"] in ["measure", "profile"]:
             # measure or profile
             if self.mouse["use"] == "measure":



More information about the grass-commit mailing list