# HG changeset patch # User nihathrael@33b003aa-7bff-0310-803a-e67f0ece8222 # Date 1276805448 0 # Node ID 63226105ac4547c930b02420c51a7ec20aa72e9a # Parent 9b549d42f9ea8d9330974e4aaf4d79ade89a7b69 Load the changes_gui_xml correcty, even if it is set to a file Stylize the changes require restart dialog diff -r 9b549d42f9ea -r 63226105ac45 engine/python/fife/extensions/fife_settings.py --- a/engine/python/fife/extensions/fife_settings.py Thu Jun 17 15:28:46 2010 +0000 +++ b/engine/python/fife/extensions/fife_settings.py Thu Jun 17 20:10:48 2010 +0000 @@ -421,10 +421,7 @@ self.changesRequireRestart = False self.isSetToDefault = False - if os.path.isfile(self._settings_gui_xml): - self.OptionsDlg = pychan.loadXML(self._settings_gui_xml) - else: - self.OptionsDlg = pychan.loadXML(StringIO(self._settings_gui_xml)) + self.OptionsDlg = self._loadWidget(self._settings_gui_xml) self.OptionsDlg.stylize(self._gui_style) self.fillWidgets() self.OptionsDlg.mapEvents({ @@ -434,6 +431,14 @@ }) self.OptionsDlg.show() + def _loadWidget(self, dialog): + """Loads a widget. Can load both files and pure xml strings""" + if os.path.isfile(self._settings_gui_xml): + return pychan.loadXML(dialog) + else: + return pychan.loadXML(StringIO(dialog)) + + def fillWidgets(self): for module in self._entries.itervalues(): for entry in module.itervalues(): @@ -479,7 +484,8 @@ def _showChangeRequireRestartDialog(self): """Shows a dialog that informes the user that a restart is required to perform the changes.""" - RestartDlg = pychan.loadXML(StringIO(self._changes_gui_xml)) + RestartDlg = self._loadWidget(self._changes_gui_xml) + RestartDlg.stylize(self._gui_style) RestartDlg.mapEvents({ 'closeButton' : RestartDlg.hide }) RestartDlg.show()