changeset 316:6add14ebe9f5

Disabled recursing for some adaptLayout calls. This will make the editor more responsive
author cheesesucker@33b003aa-7bff-0310-803a-e67f0ece8222
date Sat, 15 Aug 2009 00:42:23 +0000
parents 21999e058c7b
children a185aff39051
files clients/editor/plugins/HistoryManager.py clients/editor/plugins/LayerTool.py clients/editor/plugins/ObjectEdit.py clients/editor/plugins/ObjectSelector.py clients/editor/scripts/gui/dockarea.py clients/editor/scripts/gui/faketabwidget.py clients/editor/scripts/gui/menubar.py clients/editor/scripts/gui/toolbar.py
diffstat 8 files changed, 21 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/clients/editor/plugins/HistoryManager.py	Fri Aug 14 22:15:47 2009 +0000
+++ b/clients/editor/plugins/HistoryManager.py	Sat Aug 15 00:42:23 2009 +0000
@@ -264,7 +264,7 @@
 				self.list.selected = i
 				break
 			i += 1
-		self.scrollarea.adaptLayout()
+		self.scrollarea.adaptLayout(False)
 
 	def show(self):
 		self.update()
--- a/clients/editor/plugins/LayerTool.py	Fri Aug 14 22:15:47 2009 +0000
+++ b/clients/editor/plugins/LayerTool.py	Sat Aug 15 00:42:23 2009 +0000
@@ -84,7 +84,6 @@
 			return
 		self.container.setDocked(False)
 		self.container.hide()
-		self.removeAllChildren()
 		
 		events.postMapShown.disconnect(self.update)
 		
@@ -177,7 +176,7 @@
 			self.wrapper.addChild(subwrapper)
 			self.subwrappers.append(subwrapper)
 		
-		self.container.adaptLayout()		
+		self.container.adaptLayout(False)		
 			
 	def toggle_layer_visibility(self, event, widget):
 		""" Callback for ToggleButtons 
@@ -248,7 +247,7 @@
 		widget.background_color = _HIGHLIGHT_BACKGROUND_COLOR
 		widget.foreground_color = _HIGHLIGHT_BACKGROUND_COLOR
 		widget.base_color = _HIGHLIGHT_BACKGROUND_COLOR
-		self.container.adaptLayout()
+		self.container.adaptLayout(False)
 		
 		self._mapview.getController().selectLayer(layerid)
 
--- a/clients/editor/plugins/ObjectEdit.py	Fri Aug 14 22:15:47 2009 +0000
+++ b/clients/editor/plugins/ObjectEdit.py	Sat Aug 15 00:42:23 2009 +0000
@@ -321,7 +321,7 @@
 				print "Collected rots from object ", self._avail_rotations
 				
 
-		self.container.adaptLayout()			
+		self.container.adaptLayout(False)			
 		
 	def toggle_gui(self):
 		"""
@@ -651,4 +651,4 @@
 					self._reset()
 					self.container.hide()
 					
-		self.container.adaptLayout()						
+		self.container.adaptLayout(False)						
--- a/clients/editor/plugins/ObjectSelector.py	Fri Aug 14 22:15:47 2009 +0000
+++ b/clients/editor/plugins/ObjectSelector.py	Sat Aug 15 00:42:23 2009 +0000
@@ -321,11 +321,11 @@
 
 		self.setPreview(obj)
 		
-		self.gui.adaptLayout()
+		self.gui.adaptLayout(False)
 		events.onObjectSelected.send(sender=self, object=obj)
 
-		self.objects.adaptLayout()
-		self.gui.adaptLayout()
+		self.objects.adaptLayout(False)
+		self.gui.adaptLayout(False)
 		
 	# Set preview image
 	def setPreview(self, object):
@@ -351,7 +351,7 @@
 		elif self.mode == 'preview':
 			self.fillPreviewList()
 
-		self.gui.adaptLayout()
+		self.gui.adaptLayout(False)
 
 	def _getImage(self, obj):
 		""" Returns an image for the given object.
--- a/clients/editor/scripts/gui/dockarea.py	Fri Aug 14 22:15:47 2009 +0000
+++ b/clients/editor/scripts/gui/dockarea.py	Sat Aug 15 00:42:23 2009 +0000
@@ -98,6 +98,7 @@
 			self.undockChild(child)
 			
 		tab[2].capture(undock, "mouseClicked")
+		self.adaptLayout()
 		
 	def undockChild(self, child, childIsCaller=False):
 		tabwidget = None
--- a/clients/editor/scripts/gui/faketabwidget.py	Fri Aug 14 22:15:47 2009 +0000
+++ b/clients/editor/scripts/gui/faketabwidget.py	Sat Aug 15 00:42:23 2009 +0000
@@ -72,6 +72,6 @@
 		tab[2].toggled = True
 		self.widgetarea.removeAllChildren()
 		self.widgetarea.addChild(tab[1])
-		self.widgetarea.adaptLayout()
+		self.adaptLayout(False)
 		
 	
\ No newline at end of file
--- a/clients/editor/scripts/gui/menubar.py	Fri Aug 14 22:15:47 2009 +0000
+++ b/clients/editor/scripts/gui/menubar.py	Sat Aug 15 00:42:23 2009 +0000
@@ -139,7 +139,7 @@
 					self.removeChild(b)
 					self._actionbuttons.remove(b)
 			
-		self.adaptLayout()
+		self.adaptLayout(False)
 		
 	def hasAction(self, action):
 		for a in self._actions:
@@ -161,7 +161,7 @@
 		position = self._actions.index(sender)
 		self.removeAction(sender)
 		self.insertAction(sender, position)
-		self.adaptLayout()
+		self.adaptLayout(False)
 		
 	def _insertButton(self, action, position):
 		actions = [action]
@@ -203,7 +203,7 @@
 		for action in actions:
 			self.addAction(action)
 
-		self.adaptLayout()
+		self.adaptLayout(False)
 		
 	def show(self):
 		self._update()
@@ -239,7 +239,7 @@
 		
 		self._action = action
 		self.update()
-		self.adaptLayout()
+		self.adaptLayout(False)
 		
 		self.initEvents()
 	
@@ -256,7 +256,7 @@
 		
 	def _actionChanged(self):
 		self.update()
-		self.adaptLayout()
+		self.adaptLayout(False)
 		
 	def update(self):
 		""" Sets up the button widget """
--- a/clients/editor/scripts/gui/toolbar.py	Fri Aug 14 22:15:47 2009 +0000
+++ b/clients/editor/scripts/gui/toolbar.py	Sat Aug 15 00:42:23 2009 +0000
@@ -59,7 +59,7 @@
 					self.gui.removeChild(b)
 					self._actionbuttons.remove(b)
 			
-		self.adaptLayout()
+		self.adaptLayout(False)
 		
 	def hasAction(self, action):
 		for a in self._actions:
@@ -81,7 +81,7 @@
 		position = self._actions.index(sender)
 		self.removeAction(sender)
 		self.insertAction(sender, position)
-		self.adaptLayout()
+		self.adaptLayout(False)
 		
 	def _insertButton(self, action, position):
 		actions = [action]
@@ -142,7 +142,7 @@
 		for action in actions:
 			self.addAction(action)
 
-		self.adaptLayout()
+		self.adaptLayout(False)
 		
 	def setOrientation(self, orientation):
 		if orientation == ToolBar.ORIENTATION['Vertical']:
@@ -227,7 +227,7 @@
 		
 		self._action = action
 		self.update()
-		self.adaptLayout()
+		self.adaptLayout(False)
 		
 		self.initEvents()
 	
@@ -255,7 +255,7 @@
 		
 	def _actionChanged(self):
 		self.update()
-		self.adaptLayout()
+		self.adaptLayout(False)
 		
 	def update(self):
 		""" Sets up the button widget """