From 612e468c8216c14f2be3a5198aa2ba3082474562 Mon Sep 17 00:00:00 2001 From: Stephan Erb Date: Mon, 16 Jul 2007 22:20:08 +0000 Subject: [PATCH] Update combobox in prefs window to reflect theme changes --- src/config.py | 23 +++++++++++++---------- src/gajim_themes_window.py | 2 ++ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/config.py b/src/config.py index 61936e1ce..bf04797fb 100644 --- a/src/config.py +++ b/src/config.py @@ -207,16 +207,7 @@ class PreferencesWindow: cell = gtk.CellRendererText() theme_combobox.pack_start(cell, True) theme_combobox.add_attribute(cell, 'text', 0) - model = gtk.ListStore(str) - theme_combobox.set_model(model) - - i = 0 - for config_theme in gajim.config.get_per('themes'): - theme = config_theme.replace('_', ' ') - model.append([theme]) - if gajim.config.get('roster_theme') == config_theme: - theme_combobox.set_active(i) - i += 1 + self.update_theme_list() # use speller if os.name == 'nt': @@ -645,6 +636,18 @@ class PreferencesWindow: gajim.interface.roster.change_roster_style(None) gajim.interface.save_config() + def update_theme_list(self): + theme_combobox = self.xml.get_widget('theme_combobox') + model = gtk.ListStore(str) + theme_combobox.set_model(model) + i = 0 + for config_theme in gajim.config.get_per('themes'): + theme = config_theme.replace('_', ' ') + model.append([theme]) + if gajim.config.get('roster_theme') == config_theme: + theme_combobox.set_active(i) + i += 1 + def on_open_advanced_notifications_button_clicked(self, widget): dialogs.AdvancedNotificationsWindow() diff --git a/src/gajim_themes_window.py b/src/gajim_themes_window.py index a4fe39184..3454ee79f 100644 --- a/src/gajim_themes_window.py +++ b/src/gajim_themes_window.py @@ -83,6 +83,8 @@ class GajimThemesWindow: return True # do NOT destroy the window def on_close_button_clicked(self, widget): + if gajim.interface.instances.has_key('preferences'): + gajim.interface.instances['preferences'].update_theme_list() self.window.hide() def on_theme_cell_edited(self, cell, row, new_name):