diff clients/editor/plugins/LayerTool.py @ 367:598547404022

* Initial support for closing maps: * Lots of cleanup functions has been added * TODO: Cameras are only removed when all maps are closed * TODO: Screen leaves traces when the last map is closed * Replaced pre/postMapRemove events with pre/postMapClosed * Fixed a bug in the Toolbar where it didn't properly handle removal of actions from an actiongroup
author cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
date Thu, 29 Oct 2009 22:11:48 +0000
parents ad5818097cd6
children
line wrap: on
line diff
--- a/clients/editor/plugins/LayerTool.py	Thu Oct 29 20:19:08 2009 +0000
+++ b/clients/editor/plugins/LayerTool.py	Thu Oct 29 22:11:48 2009 +0000
@@ -84,6 +84,7 @@
 		self.toggle()
 		
 		events.postMapShown.connect(self.update)
+		events.preMapClosed.connect(self._mapClosed)
 
 	def disable(self):
 		""" Disable plugin """
@@ -93,6 +94,7 @@
 		self._container.hide()
 		
 		events.postMapShown.disconnect(self.update)
+		events.preMapClosed.disconnect(self._mapClosed)
 		
 		self._editor._tools_menu.removeAction(self._action_show)
 
@@ -105,6 +107,10 @@
 		return u"Layertool"
 	
 	#--- End plugin functions ---#
+	def _mapClosed(self):
+		self.update(mapview=None)
+		
+	
 	def showLayerWizard(self):
 		""" Show layer wizard """
 		if not self._mapview: return