From 1c09951eb287321602ba60a094f898dbaa676eff Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Mon, 20 Nov 2006 08:03:05 +0000 Subject: [PATCH] put just_connected_bg_color and just_disconnected_bg_color in ACE. fixes #2677 --- src/common/config.py | 2 ++ src/roster_window.py | 24 +++++++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/common/config.py b/src/common/config.py index 3457992b5..12eaa9f2a 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -195,6 +195,8 @@ class Config: 'print_status_in_chats': [opt_bool, True, _('If False, Gajim will no longer print status line in chats when a contact changes his or her status and/or his or her status message.')], 'print_status_in_muc': [opt_str, 'in_and_out', _('can be "none", "all" or "in_and_out". If "none", Gajim will no longer print status line in groupchats when a member changes his or her status and/or his or her status message. If "all" Gajim will print all status messages. If "in_and_out", gajim will only print FOO enters/leaves group chat.')], 'log_contact_status_changes': [opt_bool, False], + 'just_connected_bg_color': [opt_str, '#adc3c6', _('Background color of contacts when they just signed in.')], + 'just_disconnected_bg_color': [opt_str, '#ab6161', _('Background color of contacts when they just signed out.')], 'restored_messages_color': [opt_str, 'grey'], 'restored_messages_small': [opt_bool, True, _('If True, restored messages will use a smaller font than the default one.')], 'hide_avatar_of_transport': [opt_bool, False, _('Don\'t show avatar for the transport itself.')], diff --git a/src/roster_window.py b/src/roster_window.py index 6e5aa65aa..f2be22ccf 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -583,9 +583,9 @@ class RosterWindow: # escape markup entities and make them small italic and fg color color = gtkgui_helpers._get_fade_color(self.tree, selected, focus) colorstring = "#%04x%04x%04x" % (color.red, color.green, color.blue) - name += '\n%s' + \ - '' % (colorstring, gtkgui_helpers.escape_for_pango_markup( - status)) + name += \ + '\n%s' \ + % (colorstring, gtkgui_helpers.escape_for_pango_markup(status)) iter = iters[0] # choose the icon with the first iter icon_name = helpers.get_icon_name_to_show(contact, account) @@ -3677,9 +3677,11 @@ class RosterWindow: jid = model[iter][C_JID].decode('utf-8') account = model[iter][C_ACCOUNT].decode('utf-8') if jid in gajim.newly_added[account]: - renderer.set_property('cell-background', '#adc3c6') + renderer.set_property('cell-background', gajim.config.get( + 'just_connected_bg_color')) elif jid in gajim.to_be_removed[account]: - renderer.set_property('cell-background', '#ab6161') + renderer.set_property('cell-background', gajim.config.get( + 'just_disconnected_bg_color')) else: color = gajim.config.get_per('themes', theme, 'contactbgcolor') if color: @@ -3738,9 +3740,11 @@ class RosterWindow: else: renderer.set_property('foreground', None) if jid in gajim.newly_added[account]: - renderer.set_property('cell-background', '#adc3c6') + renderer.set_property('cell-background', gajim.config.get( + 'just_connected_bg_color')) elif jid in gajim.to_be_removed[account]: - renderer.set_property('cell-background', '#ab6161') + renderer.set_property('cell-background', gajim.config.get( + 'just_disconnected_bg_color')) else: color = gajim.config.get_per('themes', theme, 'contactbgcolor') if color: @@ -3780,9 +3784,11 @@ class RosterWindow: jid = model[iter][C_JID].decode('utf-8') account = model[iter][C_ACCOUNT].decode('utf-8') if jid in gajim.newly_added[account]: - renderer.set_property('cell-background', '#adc3c6') + renderer.set_property('cell-background', gajim.config.get( + 'just_connected_bg_color')) elif jid in gajim.to_be_removed[account]: - renderer.set_property('cell-background', '#ab6161') + renderer.set_property('cell-background', gajim.config.get( + 'just_disconnected_bg_color')) else: color = gajim.config.get_per('themes', theme, 'contactbgcolor') if color: