Update combobox in prefs window to reflect theme changes

This commit is contained in:
Stephan Erb 2007-07-16 22:20:08 +00:00
parent ecff92dfd8
commit 612e468c82
2 changed files with 15 additions and 10 deletions

View File

@ -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()

View File

@ -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):