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])

........
This commit is contained in:
Travis Shirk 2006-01-08 20:32:39 +00:00
parent e53e786182
commit 460ac48ec4
5 changed files with 11 additions and 45 deletions

View File

@ -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)

View File

@ -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')

View File

@ -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()

View File

@ -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 = '<b>' + str(num_unread) + label_str + '</b>'
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

View File

@ -6208,26 +6208,6 @@ Custom</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="notify_gmail_checkbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Notify on new _Gmail e-mail (GoogleTalk users)</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_notify_gmail_checkbutton_toggled" last_modification_time="Wed, 06 Apr 2005 14:43:56 GMT"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>