Bläddra i källkod

wxGUI: fixed https://trac.osgeo.org/grass/ticket/1617, when closing attribute dialog do not rerender everything

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@52879 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 12 år sedan
förälder
incheckning
d18dbc4585

+ 8 - 6
gui/wxpython/dbmgr/dialogs.py

@@ -299,14 +299,16 @@ class DisplayAttributesDialog(wx.Dialog):
     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):

+ 1 - 0
gui/wxpython/gcp/mapdisplay.py

@@ -287,6 +287,7 @@ class MapFrame(SingleMapFrame):
     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:

+ 9 - 6
gui/wxpython/mapdisp/frame.py

@@ -438,13 +438,16 @@ class MapFrame(SingleMapFrame):
         
         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 @@ class MapFrame(SingleMapFrame):
         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,

+ 0 - 8
gui/wxpython/mapdisp/mapwindow.py

@@ -1177,14 +1177,6 @@ class BufferedWindow(MapWindow, wx.Window):
             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