changeset 626:01994b7e505a

* Applied GreyGhosts patch to fife_settings. Allows the user to load the gui XML whenever they want. Also returns a reference to the dialog so it can be worked with outside of fife_settings.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Mon, 04 Oct 2010 14:55:57 +0000
parents 92290efadab7
children 79257869a6e9
files engine/python/fife/extensions/fife_settings.py
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/engine/python/fife/extensions/fife_settings.py	Fri Oct 01 21:27:37 2010 +0000
+++ b/engine/python/fife/extensions/fife_settings.py	Mon Oct 04 14:55:57 2010 +0000
@@ -113,6 +113,7 @@
 		self._default_settings_file = default_settings_file
 		self._settings_gui_xml = settings_gui_xml
 		self._changes_gui_xml = changes_gui_xml
+		self.OptionsDlg = None
 
 		# Holds SettingEntries
 		self._entries = {}
@@ -261,16 +262,23 @@
 		"""
 		self.changesRequireRestart = False
 		self.isSetToDefault = False
+		if not self.OptionsDlg:
+			self.loadSettingsDialog()
+		self.fillWidgets()
+		self.OptionsDlg.show()
 
+	def loadSettingsDialog(self):
+		"""
+		Load up the settings xml and return the widget.
+		"""
 		self.OptionsDlg = self._loadWidget(self._settings_gui_xml)
 		self.OptionsDlg.stylize(self._gui_style)
-		self.fillWidgets()
 		self.OptionsDlg.mapEvents({
 			'okButton' : self.applySettings,
 			'cancelButton' : self.OptionsDlg.hide,
 			'defaultButton' : self.setDefaults
 		})
-		self.OptionsDlg.show()
+		return self.OptionsDlg
 
 	def _loadWidget(self, dialog):
 		"""Loads a widget. Can load both files and pure xml strings"""