Update combobox in prefs window to reflect theme changes
This commit is contained in:
parent
ecff92dfd8
commit
612e468c82
2 changed files with 15 additions and 10 deletions
|
@ -207,16 +207,7 @@ class PreferencesWindow:
|
||||||
cell = gtk.CellRendererText()
|
cell = gtk.CellRendererText()
|
||||||
theme_combobox.pack_start(cell, True)
|
theme_combobox.pack_start(cell, True)
|
||||||
theme_combobox.add_attribute(cell, 'text', 0)
|
theme_combobox.add_attribute(cell, 'text', 0)
|
||||||
model = gtk.ListStore(str)
|
self.update_theme_list()
|
||||||
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
|
|
||||||
|
|
||||||
# use speller
|
# use speller
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
|
@ -645,6 +636,18 @@ class PreferencesWindow:
|
||||||
gajim.interface.roster.change_roster_style(None)
|
gajim.interface.roster.change_roster_style(None)
|
||||||
gajim.interface.save_config()
|
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):
|
def on_open_advanced_notifications_button_clicked(self, widget):
|
||||||
dialogs.AdvancedNotificationsWindow()
|
dialogs.AdvancedNotificationsWindow()
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,8 @@ class GajimThemesWindow:
|
||||||
return True # do NOT destroy the window
|
return True # do NOT destroy the window
|
||||||
|
|
||||||
def on_close_button_clicked(self, widget):
|
def on_close_button_clicked(self, widget):
|
||||||
|
if gajim.interface.instances.has_key('preferences'):
|
||||||
|
gajim.interface.instances['preferences'].update_theme_list()
|
||||||
self.window.hide()
|
self.window.hide()
|
||||||
|
|
||||||
def on_theme_cell_edited(self, cell, row, new_name):
|
def on_theme_cell_edited(self, cell, row, new_name):
|
||||||
|
|
Loading…
Add table
Reference in a new issue