From 460ac48ec4d170cd7fe486f988dba4160e36c9e0 Mon Sep 17 00:00:00 2001 From: Travis Shirk Date: Sun, 8 Jan 2006 20:32:39 +0000 Subject: [PATCH] Chatstate fixes and merged revisions 5054,5059-5060 via svnmerge from svn://svn.gajim.org/gajim/trunk ........ r5054 | nicfit | 2006-01-07 22:06:08 -0700 (Sat, 07 Jan 2006) | 2 lines typo fix ........ r5059 | asterix | 2006-01-08 10:03:32 -0700 (Sun, 08 Jan 2006) | 2 lines remove the Gmail option from GUI, it's only in ACE. fixes #883 ........ r5060 | asterix | 2006-01-08 12:14:19 -0700 (Sun, 08 Jan 2006) | 2 lines the Contact.jid returned by contact_from_gc_contact() function is the fake jid, even if we know the real jid. this means pm windows are index by the fake jid (gajim.interface.instances[account]['chats'][FAKE_JID]) ........ --- src/chat_control.py | 8 ++++---- src/common/contacts.py | 9 ++------- src/config.py | 7 ------- src/groupchat_control.py | 12 +++++------- src/gtkgui.glade | 20 -------------------- 5 files changed, 11 insertions(+), 45 deletions(-) diff --git a/src/chat_control.py b/src/chat_control.py index 4b8500bd4..272bef622 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -470,6 +470,7 @@ class ChatControlBase(MessageControl): self.account, self.type_id) self.msg_textview.grab_focus() + self.parent_win.redraw_tab(self.contact, 'active') def bring_scroll_to_end(self, textview, diff_y = 0): ''' scrolls to the end of textview if end is not visible ''' @@ -1006,13 +1007,12 @@ class ChatControl(ChatControlBase): color = gajim.config.get_per('themes', theme, 'state_active_color') if color: - color = gtk.gdk.colormap_get_system().alloc_color(color) # We set the color for when it's the current tab or not - # FIXME: why was this only happening for inactive or gone - #if chatstate in ('inactive', 'gone'): + color = gtk.gdk.colormap_get_system().alloc_color(color) # In inactive tab color to be lighter against the darker inactive # background - if self.parent_win.get_active_control() != self: + if chatstate in ('inactive', 'gone') and\ + self.parent_win.get_active_control() != self: color = self.lighten_color(color) label_str = gtkgui_helpers.escape_for_pango_markup(self.contact.name) diff --git a/src/common/contacts.py b/src/common/contacts.py index 03fa0d6a5..b17747dea 100644 --- a/src/common/contacts.py +++ b/src/common/contacts.py @@ -229,13 +229,8 @@ class Contacts: def contact_from_gc_contact(self, gc_contact): '''Create a Contact instance from a GC_Contact instance''' - if gc_contact.jid: - jid = gc_contact.jid - resource = gc_contact.resource - else: - jid = gc_contact.get_full_jid() - resource = '' - return Contact(jid = jid, resource = resource, name = gc_contact.name, + jid = gc_contact.get_full_jid() + return Contact(jid = jid, resource = '', name = gc_contact.name, groups = ['none'], show = gc_contact.show, status = gc_contact.status, sub = 'none') diff --git a/src/config.py b/src/config.py index 7eac99021..b509b9655 100644 --- a/src/config.py +++ b/src/config.py @@ -416,10 +416,6 @@ class PreferencesWindow: st = gajim.config.get('send_os_info') self.xml.get_widget('send_os_info_checkbutton').set_active(st) - # Notify user of new gmail e-mail messages - st = gajim.config.get('notify_on_new_gmail_email') - self.xml.get_widget('notify_gmail_checkbutton').set_active(st) - self.xml.signal_autoconnect(self) self.sound_tree.get_model().connect('row-changed', @@ -873,9 +869,6 @@ class PreferencesWindow: def on_send_os_info_checkbutton_toggled(self, widget): self.on_checkbutton_toggled(widget, 'send_os_info') - def on_notify_gmail_checkbutton_toggled(self, widget): - self.on_checkbutton_toggled(widget, 'notify_on_new_gmail_email') - def fill_msg_treeview(self): self.xml.get_widget('delete_msg_button').set_sensitive(False) model = self.msg_tree.get_model() diff --git a/src/groupchat_control.py b/src/groupchat_control.py index d361152f4..73c145e2a 100644 --- a/src/groupchat_control.py +++ b/src/groupchat_control.py @@ -243,12 +243,12 @@ class GroupchatControl(ChatControlBase): color = None theme = gajim.config.get('roster_theme') if chatstate == 'attention' and (not has_focus or not current_tab): - attention_flag = True + self.attention_flag = True color = gajim.config.get_per('themes', theme, 'state_muc_directed_msg') elif chatstate: if chatstate == 'active' or (current_tab and has_focus): - attention_flag = False + self.attention_flag = False color = gajim.config.get_per('themes', theme, 'state_active_color') elif chatstate == 'newmsg' and (not has_focus or not current_tab) and\ @@ -256,12 +256,8 @@ class GroupchatControl(ChatControlBase): color = gajim.config.get_per('themes', theme, 'state_muc_msg') if color: color = gtk.gdk.colormap_get_system().alloc_color(color) - if self.parent_win.get_active_control() != self: - color = self.lighten_color(color) label_str = self.name - if num_unread: # if unread, text in the label becomes bold - label_str = '' + str(num_unread) + label_str + '' return (label_str, color) def get_tab_image(self): @@ -380,7 +376,8 @@ class GroupchatControl(ChatControlBase): # highlighting and sounds (highlight, sound) = self.highlighting_for_message(text, tim) if highlight: - self.redraw_tab(self.contact, 'attention') # muc-specific chatstate + # muc-specific chatstate + self.parent_win.redraw_tab(self.contact, 'attention') other_tags_for_name.append('bold') other_tags_for_text.append('marked') if sound == 'received': @@ -1051,6 +1048,7 @@ class GroupchatControl(ChatControlBase): return retval def set_control_active(self, state): + self.attention_flag = False ChatControlBase.set_control_active(self, state) if not state: # add the focus-out line to the tab we are leaving diff --git a/src/gtkgui.glade b/src/gtkgui.glade index 552477baa..a7cac5e31 100644 --- a/src/gtkgui.glade +++ b/src/gtkgui.glade @@ -6208,26 +6208,6 @@ Custom False - - - - True - True - Notify on new _Gmail e-mail (GoogleTalk users) - True - GTK_RELIEF_NORMAL - True - False - False - True - - - - 0 - False - False - -