[GRASS-SVN] r33008 - in grass/trunk/gui/wxpython: . gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Aug 22 12:31:49 EDT 2008
Author: martinl
Date: 2008-08-22 12:31:48 -0400 (Fri, 22 Aug 2008)
New Revision: 33008
Modified:
grass/trunk/gui/wxpython/gui_modules/mapdisp.py
grass/trunk/gui/wxpython/wxgui.py
Log:
wxGUI: close edited vector layer properly when window is closed
(merge from devbr6, r33007)
Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp.py 2008-08-22 16:28:53 UTC (rev 33007)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp.py 2008-08-22 16:31:48 UTC (rev 33008)
@@ -3183,13 +3183,24 @@
"""
pgnum = None
self.Map.Clean()
+
+ # close edited map properly
+ digitToolbar = self.toolbars['vdigit']
+ if digitToolbar:
+ maplayer = digitToolbar.GetLayer()
+ if maplayer:
+ self.toolbars['vdigit'].OnExit()
+ self.imgVectorMap = None
+
if self.page:
pgnum = self.layerbook.GetPageIndex(self.page)
if pgnum > -1:
self.layerbook.DeletePage(pgnum)
-
+
#self.Destroy()
+ event.Skip()
+
def GetRender(self):
"""
Returns the current instance of render.Map()
Modified: grass/trunk/gui/wxpython/wxgui.py
===================================================================
--- grass/trunk/gui/wxpython/wxgui.py 2008-08-22 16:28:53 UTC (rev 33007)
+++ grass/trunk/gui/wxpython/wxgui.py 2008-08-22 16:31:48 UTC (rev 33008)
@@ -1417,16 +1417,12 @@
if self.curr_page.maptree.GetPyData(layer)[0]['type'] == 'group':
self.curr_page.maptree.DeleteChildren(layer)
self.curr_page.maptree.Delete(layer)
-
- #Misc methods
+
def OnCloseWindow(self, event):
"""Cleanup when wxgui.py is quit"""
- try:
- for page in range(self.gm_cb.GetPageCount()):
- self.gm_cb.GetPage(page).maptree.Map.Clean()
- self.DeleteAllPages()
- except:
- pass
+ for page in range(self.gm_cb.GetPageCount()):
+ self.gm_cb.GetPage(page).maptree.mapdisplay.OnCloseWindow(event)
+ self.gm_cb.DeleteAllPages()
# self.DestroyChildren()
self._auimgr.UnInit()
self.Destroy()
More information about the grass-commit
mailing list