From 8af6e19a1f57e2e1d456db67a7005760c366e7a5 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Wed, 13 Dec 2006 13:15:06 +0000 Subject: [PATCH] select active theme when we re-open gajim theme window. fixes #2778 --- src/config.py | 1 + src/gajim_themes_window.py | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/config.py b/src/config.py index 8040f8ced..6225b896d 100644 --- a/src/config.py +++ b/src/config.py @@ -622,6 +622,7 @@ class PreferencesWindow: self.theme_preferences = dialogs.GajimThemesWindow() else: self.theme_preferences.window.present() + self.theme_preferences.select_active_theme() def on_theme_combobox_changed(self, widget): model = widget.get_model() diff --git a/src/gajim_themes_window.py b/src/gajim_themes_window.py index 93e979cda..6b0200ecb 100644 --- a/src/gajim_themes_window.py +++ b/src/gajim_themes_window.py @@ -121,7 +121,20 @@ class GajimThemesWindow: self.themes_tree.get_selection().select_iter(iter) self.xml.get_widget('remove_button').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): (model, iter) = self.themes_tree.get_selection().get_selected() selected = self.themes_tree.get_selection().get_selected_rows()