select active theme when we re-open gajim theme window. fixes #2778
This commit is contained in:
parent
9a8862099e
commit
8af6e19a1f
|
@ -622,6 +622,7 @@ class PreferencesWindow:
|
||||||
self.theme_preferences = dialogs.GajimThemesWindow()
|
self.theme_preferences = dialogs.GajimThemesWindow()
|
||||||
else:
|
else:
|
||||||
self.theme_preferences.window.present()
|
self.theme_preferences.window.present()
|
||||||
|
self.theme_preferences.select_active_theme()
|
||||||
|
|
||||||
def on_theme_combobox_changed(self, widget):
|
def on_theme_combobox_changed(self, widget):
|
||||||
model = widget.get_model()
|
model = widget.get_model()
|
||||||
|
|
|
@ -121,7 +121,20 @@ class GajimThemesWindow:
|
||||||
self.themes_tree.get_selection().select_iter(iter)
|
self.themes_tree.get_selection().select_iter(iter)
|
||||||
self.xml.get_widget('remove_button').set_sensitive(True)
|
self.xml.get_widget('remove_button').set_sensitive(True)
|
||||||
self.theme_options_vbox.set_sensitive(True)
|
self.theme_options_vbox.set_sensitive(True)
|
||||||
|
|
||||||
|
def select_active_theme(self):
|
||||||
|
model = self.themes_tree.get_model()
|
||||||
|
iter = model.get_iter_root()
|
||||||
|
active_theme = gajim.config.get('roster_theme')
|
||||||
|
while iter:
|
||||||
|
theme = model[iter][0]
|
||||||
|
if theme == active_theme:
|
||||||
|
self.themes_tree.get_selection().select_iter(iter)
|
||||||
|
self.xml.get_widget('remove_button').set_sensitive(True)
|
||||||
|
self.theme_options_vbox.set_sensitive(True)
|
||||||
|
break
|
||||||
|
iter = model.iter_next(iter)
|
||||||
|
|
||||||
def selection_changed(self, widget = None):
|
def selection_changed(self, widget = None):
|
||||||
(model, iter) = self.themes_tree.get_selection().get_selected()
|
(model, iter) = self.themes_tree.get_selection().get_selected()
|
||||||
selected = self.themes_tree.get_selection().get_selected_rows()
|
selected = self.themes_tree.get_selection().get_selected_rows()
|
||||||
|
|
Loading…
Reference in New Issue