diff options
author | Yann Leboulanger <asterix@lagaule.org> | 2006-03-19 01:40:26 +0300 |
---|---|---|
committer | Yann Leboulanger <asterix@lagaule.org> | 2006-03-19 01:40:26 +0300 |
commit | 96dcb1bd0c28061b7f63f29197cbe987e9da621c (patch) | |
tree | 796ce96ce6557bfc54e9a3c8ea45e75256bcd763 /src | |
parent | df395ab6ef288ab09276b578721c72a5f4e01058 (diff) |
chatstate colors are now configurable in manage theme window. Fixes #1568
Diffstat (limited to 'src')
-rw-r--r-- | src/common/config.py | 4 | ||||
-rw-r--r-- | src/gajim_themes_window.py | 46 | ||||
-rw-r--r-- | src/gtkgui.glade | 395 |
3 files changed, 441 insertions, 4 deletions
diff --git a/src/common/config.py b/src/common/config.py index 778f61653..8d3ca6b21 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -278,8 +278,8 @@ class Config: 'state_gone_color': [ opt_color, 'grey' ], # MUC chat states - 'state_muc_msg': [ opt_color, 'mediumblue' ], - 'state_muc_directed_msg': [ opt_color, 'red2' ], + 'state_muc_msg_color': [ opt_color, 'mediumblue' ], + 'state_muc_directed_msg_color': [ opt_color, 'red2' ], }, {}), } diff --git a/src/gajim_themes_window.py b/src/gajim_themes_window.py index 38cae4966..0fd9f0205 100644 --- a/src/gajim_themes_window.py +++ b/src/gajim_themes_window.py @@ -58,6 +58,11 @@ class GajimThemesWindow: self.italic_togglebutton = self.xml.get_widget('italic_togglebutton') self.themes_tree = self.xml.get_widget('themes_treeview') self.theme_options_vbox = self.xml.get_widget('theme_options_vbox') + self.colorbuttons = {} + for chatstate in ('active', 'inactive', 'composing', 'paused', 'gone', + 'muc_msg', 'muc_directed_msg'): + self.colorbuttons[chatstate] = self.xml.get_widget(chatstate + \ + '_colorbutton') model = gtk.ListStore(str) self.themes_tree.set_model(model) col = gtk.TreeViewColumn(_('Theme')) @@ -203,6 +208,12 @@ class GajimThemesWindow: self.text_fontbutton.set_sensitive(state) self.no_update = False gajim.interface.roster.change_roster_style(None) + + for chatstate in ('active', 'inactive', 'composing', 'paused', 'gone', + 'muc_msg', 'muc_directed_msg'): + color = gajim.config.get_per('themes', theme, 'state_' + chatstate + \ + '_color') + self.colorbuttons[chatstate].set_color(gtk.gdk.color_parse(color)) def on_textcolor_checkbutton_toggled(self, widget): state = widget.get_active() @@ -329,3 +340,38 @@ class GajimThemesWindow: if font_description.get_style() != pango.STYLE_ITALIC: font_props[1] = True return font_props + + def on_active_colorbutton_color_set(self, widget): + self.no_update = True + self._set_color(True, widget, 'state_active_color') + self.no_update = False + + def on_inactive_colorbutton_color_set(self, widget): + self.no_update = True + self._set_color(True, widget, 'state_inactive_color') + self.no_update = False + + def on_composing_colorbutton_color_set(self, widget): + self.no_update = True + self._set_color(True, widget, 'state_composing_color') + self.no_update = False + + def on_paused_colorbutton_color_set(self, widget): + self.no_update = True + self._set_color(True, widget, 'state_paused_color') + self.no_update = False + + def on_gone_colorbutton_color_set(self, widget): + self.no_update = True + self._set_color(True, widget, 'state_gone_color') + self.no_update = False + + def on_muc_msg_colorbutton_color_set(self, widget): + self.no_update = True + self._set_color(True, widget, 'state_muc_msg_color') + self.no_update = False + + def on_muc_directed_msg_colorbutton_color_set(self, widget): + self.no_update = True + self._set_color(True, widget, 'state_muc_directed_msg_color') + self.no_update = False diff --git a/src/gtkgui.glade b/src/gtkgui.glade index 71cec8896..50df46280 100644 --- a/src/gtkgui.glade +++ b/src/gtkgui.glade @@ -14351,7 +14351,6 @@ Please wait...</property> <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> <property name="focus_on_map">True</property> - <signal name="destroy_event" handler="on_gajim_themes_window_destroy_event" last_modification_time="Sun, 18 Sep 2005 09:19:54 GMT"/> <child> <widget class="GtkVBox" id="vbox97"> @@ -14392,7 +14391,6 @@ Please wait...</property> <property name="fixed_height_mode">False</property> <property name="hover_selection">False</property> <property name="hover_expand">False</property> - <signal name="cursor_changed" handler="on_themes_treeview_cursor_changed" last_modification_time="Sat, 06 Aug 2005 18:27:22 GMT"/> </widget> </child> </widget> @@ -14731,6 +14729,399 @@ Banner</property> <property name="fill">True</property> </packing> </child> + + <child> + <widget class="GtkVSeparator" id="vseparator7"> + <property name="visible">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkTable" id="table36"> + <property name="visible">True</property> + <property name="n_rows">9</property> + <property name="n_columns">2</property> + <property name="homogeneous">False</property> + <property name="row_spacing">6</property> + <property name="column_spacing">6</property> + + <child> + <widget class="GtkLabel" id="label391"> + <property name="visible">True</property> + <property name="label" translatable="yes">Paused</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkColorButton" id="paused_colorbutton"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="use_alpha">False</property> + <property name="focus_on_click">True</property> + <signal name="color_set" handler="on_paused_colorbutton_color_set" last_modification_time="Sat, 18 Mar 2006 22:36:56 GMT"/> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkColorButton" id="composing_colorbutton"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="use_alpha">False</property> + <property name="focus_on_click">True</property> + <signal name="color_set" handler="on_composing_colorbutton_color_set" last_modification_time="Sat, 18 Mar 2006 22:34:24 GMT"/> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label390"> + <property name="visible">True</property> + <property name="label" translatable="yes">Composing</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label389"> + <property name="visible">True</property> + <property name="label" translatable="yes">Inactive</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkColorButton" id="inactive_colorbutton"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="use_alpha">False</property> + <property name="focus_on_click">True</property> + <signal name="color_set" handler="on_inactive_colorbutton_color_set" last_modification_time="Sat, 18 Mar 2006 22:34:20 GMT"/> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label388"> + <property name="visible">True</property> + <property name="label" translatable="yes">Active</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkColorButton" id="active_colorbutton"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="use_alpha">False</property> + <property name="focus_on_click">True</property> + <signal name="color_set" handler="on_active_colorbutton_color_set" last_modification_time="Sat, 18 Mar 2006 22:34:13 GMT"/> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label393"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Chatstate Tab Colors</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">5</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label394"> + <property name="visible">True</property> + <property name="label" translatable="yes">Gone</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkColorButton" id="gone_colorbutton"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="use_alpha">False</property> + <property name="focus_on_click">True</property> + <signal name="color_set" handler="on_gone_colorbutton_color_set" last_modification_time="Sat, 18 Mar 2006 22:34:33 GMT"/> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label392"> + <property name="visible">True</property> + <property name="label" translatable="yes">MUC +Messages</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">7</property> + <property name="bottom_attach">8</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkColorButton" id="muc_msg_colorbutton"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="use_alpha">False</property> + <property name="focus_on_click">True</property> + <signal name="color_set" handler="on_muc_msg_colorbutton_color_set" last_modification_time="Sat, 18 Mar 2006 22:34:37 GMT"/> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">7</property> + <property name="bottom_attach">8</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkHSeparator" id="hseparator16"> + <property name="visible">True</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">2</property> + <property name="top_attach">6</property> + <property name="bottom_attach">7</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label395"> + <property name="visible">True</property> + <property name="label" translatable="yes">MUC Directed +Messages</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">8</property> + <property name="bottom_attach">9</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkColorButton" id="muc_directed_msg_colorbutton"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="use_alpha">False</property> + <property name="focus_on_click">True</property> + <signal name="color_set" handler="on_muc_directed_msg_colorbutton_color_set" last_modification_time="Sat, 18 Mar 2006 22:34:41 GMT"/> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">8</property> + <property name="bottom_attach">9</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> </widget> <packing> <property name="padding">0</property> |