[GRASS-SVN] r71165 - grass/trunk/gui/wxpython/lmgr

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jun 4 19:54:37 PDT 2017


Author: annakrat
Date: 2017-06-04 19:54:37 -0700 (Sun, 04 Jun 2017)
New Revision: 71165

Modified:
   grass/trunk/gui/wxpython/lmgr/frame.py
Log:
wxGUI: remove decorations when creating new workspace, see #3350

Modified: grass/trunk/gui/wxpython/lmgr/frame.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/frame.py	2017-06-04 21:57:51 UTC (rev 71164)
+++ grass/trunk/gui/wxpython/lmgr/frame.py	2017-06-05 02:54:37 UTC (rev 71165)
@@ -1308,12 +1308,12 @@
         if not self.currentPage:
             self.NewDisplay()
 
-        maptree = self.GetLayerTree()
+        maptrees = [self.notebookLayers.GetPage(i).maptree for i in range(self.notebookLayers.GetPageCount())]
 
         # ask user to save current settings
         if self.workspaceFile and self.workspaceChanged:
             self.OnWorkspaceSave()
-        elif self.workspaceFile is None and maptree.GetCount() > 0:
+        elif self.workspaceFile is None and any(tree.GetCount() for tree in maptrees):
             dlg = wx.MessageDialog(
                 self,
                 message=_(
@@ -1331,9 +1331,15 @@
 
             dlg.Destroy()
 
-        # delete all items
-        maptree.DeleteAllLayers()
+        # delete all layers in map displays
+        for maptree in maptrees:
+            maptree.DeleteAllLayers()
 
+        # delete all decorations
+        for display in self.GetAllMapDisplays():
+            for overlayId in display.decorations.keys():
+                display.RemoveOverlay(overlayId)
+
         # no workspace file loaded
         self.workspaceFile = None
         self.workspaceChanged = False



More information about the grass-commit mailing list