# HG changeset patch # User prock@33b003aa-7bff-0310-803a-e67f0ece8222 # Date 1286204157 0 # Node ID 01994b7e505a2b554e921b9a2c2572bbb7dafee6 # Parent 92290efadab7da13ca7406c5200e72c58ff57393 * 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. diff -r 92290efadab7 -r 01994b7e505a engine/python/fife/extensions/fife_settings.py --- 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"""