Merged revisions 4987-4989,4991-4996,4999,5003 via svnmerge from
svn://svn.gajim.org/gajim/trunk ........ r4987 | nk | 2006-01-03 04:00:51 -0700 (Tue, 03 Jan 2006) | 1 line commit 48x48 transport online/offline imgs by Grenshad (I pngcrushed them) ........ r4988 | nk | 2006-01-03 04:32:01 -0700 (Tue, 03 Jan 2006) | 1 line icon in notification window not always jabber now. MSN if he uses msn etc. thanks stian barmen for helping me test ........ r4989 | nk | 2006-01-03 04:40:44 -0700 (Tue, 03 Jan 2006) | 1 line all strings I got report about them, are not translatable; pot/po update ........ r4991 | asterix | 2006-01-03 08:08:21 -0700 (Tue, 03 Jan 2006) | 2 lines don't remove the jid entry in _contacts[account] when we remove a contact ........ r4992 | asterix | 2006-01-03 08:18:30 -0700 (Tue, 03 Jan 2006) | 2 lines fix logic ........ r4993 | asterix | 2006-01-03 09:04:14 -0700 (Tue, 03 Jan 2006) | 2 lines a GC_Contact can have a resource if we knoe his real JID ........ r4994 | asterix | 2006-01-03 09:32:58 -0700 (Tue, 03 Jan 2006) | 2 lines missing argument in create_gc_contact ........ r4995 | asterix | 2006-01-03 10:36:41 -0700 (Tue, 03 Jan 2006) | 2 lines we save gc_contact vcard instance in instances[self.account]['infos'][Fake_jid] ........ r4996 | asterix | 2006-01-03 11:17:43 -0700 (Tue, 03 Jan 2006) | 2 lines in DataForm, a field of type 'list-single' can have no <value> element. Create a default one in such a case to prevent TB ........ r4999 | asterix | 2006-01-04 05:52:26 -0700 (Wed, 04 Jan 2006) | 2 lines prevent TB when we move a contact that was in no group ........ r5003 | asterix | 2006-01-04 09:03:42 -0700 (Wed, 04 Jan 2006) | 2 lines handle correctly unlabeled option values in DataForms ........
BIN
data/pixmaps/events/aim_offline.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
data/pixmaps/events/aim_online.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
data/pixmaps/events/icq_offline.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
data/pixmaps/events/icq_online.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
BIN
data/pixmaps/events/msn_offline.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
data/pixmaps/events/msn_online.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
data/pixmaps/events/yahoo_offline.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
data/pixmaps/events/yahoo_online.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
1458
po/gajim.pot
|
@ -1238,13 +1238,16 @@ class Connection:
|
|||
for option_tag in option_tags:
|
||||
dic[i]['options'][j] = {}
|
||||
label = option_tag.getAttr('label')
|
||||
if label:
|
||||
dic[i]['options'][j]['label'] = label
|
||||
tags = option_tag.getTags('value')
|
||||
dic[i]['options'][j]['values'] = []
|
||||
for tag in tags:
|
||||
dic[i]['options'][j]['values'].append(tag.getData())
|
||||
j += 1
|
||||
if not label:
|
||||
label = dic[i]['options'][j]['values'][0]
|
||||
dic[i]['options'][j]['label'] = label
|
||||
if not dic[i].has_key('values'):
|
||||
dic[i]['values'] = [dic[i]['options'][0]['values'][0]]
|
||||
i += 1
|
||||
return dic
|
||||
|
||||
|
|
|
@ -66,11 +66,12 @@ class Contact(ContactBase):
|
|||
class GC_Contact(ContactBase):
|
||||
'''Information concerning each groupchat contact'''
|
||||
def __init__(self, room_jid='', name='', show='', status='', role='',
|
||||
affiliation='', jid = ''):
|
||||
affiliation='', jid = '', resource = ''):
|
||||
ContactBase.__init__(self, jid = jid, name = name, status = status, show = show)
|
||||
self.room_jid = room_jid
|
||||
self.role = role
|
||||
self.affiliation = affiliation
|
||||
self.resource = resource
|
||||
|
||||
def get_full_jid(self):
|
||||
return self.room_jid + '/' + self.name
|
||||
|
@ -135,10 +136,7 @@ class Contacts:
|
|||
return
|
||||
if contact in self._contacts[account][contact.jid]:
|
||||
self._contacts[account][contact.jid].remove(contact)
|
||||
# It was the last resource of this contact ?
|
||||
if not len(self._contacts[account][contact.jid]):
|
||||
del self._contacts[account][contact.jid]
|
||||
|
||||
|
||||
def remove_jid(self, account, jid):
|
||||
'''Removes all contacts for a given jid'''
|
||||
if not self._contacts.has_key(account):
|
||||
|
@ -235,8 +233,9 @@ class Contacts:
|
|||
sub = 'none')
|
||||
|
||||
def create_gc_contact(self, room_jid='', name='', show='', status='',
|
||||
role='', affiliation='', jid=''):
|
||||
return GC_Contact(room_jid, name, show, status, role, affiliation, jid)
|
||||
role='', affiliation='', jid='', resource=''):
|
||||
return GC_Contact(room_jid, name, show, status, role, affiliation, jid,
|
||||
resource)
|
||||
|
||||
def add_gc_contact(self, account, gc_contact):
|
||||
# No such account before ?
|
||||
|
|
|
@ -189,7 +189,8 @@ def get_number_of_accounts():
|
|||
return len(connections.keys())
|
||||
|
||||
def get_transport_name_from_jid(jid, use_config_setting = True):
|
||||
'''returns 'aim', 'gg', 'irc' etc'''
|
||||
'''returns 'aim', 'gg', 'irc' etc
|
||||
if JID is not from transport returns None'''
|
||||
#FIXME: jid can be None! one TB I saw had this problem:
|
||||
# in the code block # it is a groupchat presence in handle_event_notify
|
||||
# jid was None. Yann why?
|
||||
|
|
|
@ -1429,12 +1429,13 @@ class Interface:
|
|||
def test_migration(migration):
|
||||
if not migration.PROCESSING:
|
||||
dialog = gtk.Dialog()
|
||||
#FIXME: translate these strings after 0.9
|
||||
dialog = gtk.MessageDialog(None,
|
||||
gtk.DIALOG_DESTROY_WITH_PARENT | gtk.DIALOG_MODAL,
|
||||
gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, message_format = 'GUI Migration failed')
|
||||
gtk.MESSAGE_ERROR, gtk.BUTTONS_OK,
|
||||
message_format = _('GUI Migration failed'))
|
||||
|
||||
dialog.format_secondary_text('Logs migration through graphical interface failed. The migration process will start in the background. Please wait a few minutes for Gajim to start.')
|
||||
dialog.format_secondary_text(
|
||||
_('Logs migration through graphical interface failed. The migration process will start in the background. Please wait a few minutes for Gajim to start.'))
|
||||
dialog.run()
|
||||
dialog.destroy()
|
||||
gtk.main_quit()
|
||||
|
|
|
@ -356,14 +356,18 @@ class GroupchatWindow(chat.Chat):
|
|||
if model.iter_n_children(parent_iter) == 0:
|
||||
model.remove(parent_iter)
|
||||
|
||||
def add_contact_to_roster(self, room_jid, nick, show, role, jid, affiliation, status):
|
||||
def add_contact_to_roster(self, room_jid, nick, show, role, affiliation, status, jid = ''):
|
||||
model = self.list_treeview[room_jid].get_model()
|
||||
role_name = helpers.get_uf_role(role, plural = True)
|
||||
|
||||
resource = ''
|
||||
if jid:
|
||||
jid = jid.split('/', 1)[0]
|
||||
jids = jid.split('/', 1)
|
||||
j = jids[0]
|
||||
if len(jids) > 1:
|
||||
resource = jids[1]
|
||||
else:
|
||||
jid = ''
|
||||
j = ''
|
||||
|
||||
name = nick
|
||||
|
||||
|
@ -376,7 +380,7 @@ class GroupchatWindow(chat.Chat):
|
|||
if not nick in gajim.contacts.get_nick_list(self.account, room_jid):
|
||||
gc_contact = gajim.contacts.create_gc_contact(room_jid = room_jid,
|
||||
name = nick, show = show, status = status, role = role,
|
||||
affiliation = affiliation, jid = jid)
|
||||
affiliation = affiliation, jid = j, resource = resource)
|
||||
gajim.contacts.add_gc_contact(self.account, gc_contact)
|
||||
self.draw_contact(room_jid, nick)
|
||||
if nick == self.nicks[room_jid]: # we became online
|
||||
|
@ -420,8 +424,8 @@ class GroupchatWindow(chat.Chat):
|
|||
for nick in gajim.contacts.get_nick_list(self.account, room_jid):
|
||||
gc_contact = gajim.contacts.get_gc_contact(self.account, room_jid, nick)
|
||||
self.add_contact_to_roster(room_jid, nick, gc_contact.show,
|
||||
gc_contact.role, gc_contact.jid, gc_contact.affiliation,
|
||||
gc_contact.status)
|
||||
gc_contact.role, gc_contact.affiliation, gc_contact.status,
|
||||
gc_contact.jid)
|
||||
|
||||
def get_role(self, room_jid, nick):
|
||||
gc_contact = gajim.contacts.get_gc_contact(self.account, room_jid, nick)
|
||||
|
@ -486,14 +490,14 @@ class GroupchatWindow(chat.Chat):
|
|||
else:
|
||||
iter = self.get_contact_iter(room_jid, nick)
|
||||
if not iter:
|
||||
iter = self.add_contact_to_roster(room_jid, nick, show, role, jid,
|
||||
affiliation, status)
|
||||
iter = self.add_contact_to_roster(room_jid, nick, show, role,
|
||||
affiliation, status, jid)
|
||||
else:
|
||||
actual_role = self.get_role(room_jid, nick)
|
||||
if role != actual_role:
|
||||
self.remove_contact(room_jid, nick)
|
||||
self.add_contact_to_roster(room_jid, nick, show, role, jid,
|
||||
affiliation, status)
|
||||
self.add_contact_to_roster(room_jid, nick, show, role,
|
||||
affiliation, status, jid)
|
||||
else:
|
||||
c = gajim.contacts.get_gc_contact(self.account, room_jid, nick)
|
||||
if c.show == show and c.status == status and \
|
||||
|
@ -1155,17 +1159,11 @@ current room topic.') % command, room_jid)
|
|||
def on_info(self, widget, room_jid, nick):
|
||||
'''Call vcard_information_window class to display user's information'''
|
||||
c = gajim.contacts.get_gc_contact(self.account, room_jid, nick)
|
||||
if c.jid and c.resource:
|
||||
# on GC, we know resource only if we're mod and up
|
||||
jid = c.jid
|
||||
fjid = c.jid + '/' + c.resource
|
||||
else:
|
||||
fjid = gajim.construct_fjid(room_jid, nick)
|
||||
jid = fjid
|
||||
jid = c.get_full_jid()
|
||||
if gajim.interface.instances[self.account]['infos'].has_key(jid):
|
||||
gajim.interface.instances[self.account]['infos'][jid].window.present()
|
||||
else:
|
||||
# we copy contact because c.jid must contain the fakeJid for vcard
|
||||
# we create a Contact instance
|
||||
c2 = gajim.contacts.contact_from_gc_contact(c)
|
||||
gajim.interface.instances[self.account]['infos'][jid] = \
|
||||
vcard.VcardWindow(c2, self.account, False)
|
||||
|
|
|
@ -56,7 +56,7 @@ def notify(event_type, jid, account, msg_type = '', file_props = None):
|
|||
DesktopNotification(event_type, jid, account, msg_type, file_props)
|
||||
return
|
||||
except dbus.dbus_bindings.DBusException, e:
|
||||
# Connection to DBus failed, try popup
|
||||
# Connection to D-Bus failed, try popup
|
||||
gajim.log.debug(str(e))
|
||||
except TypeError, e:
|
||||
# This means that we sent the message incorrectly
|
||||
|
@ -112,12 +112,30 @@ class DesktopNotification:
|
|||
actor = jid
|
||||
|
||||
txt = actor # default value of txt
|
||||
transport_name = gajim.get_transport_name_from_jid(jid)
|
||||
|
||||
if transport_name in ('aim', 'icq', 'msn', 'yahoo'):
|
||||
prefix = transport_name
|
||||
else:
|
||||
prefix = 'jabber'
|
||||
'''
|
||||
if transport_name == 'aim':
|
||||
prefix = 'aim'
|
||||
elif transport_name == 'icq':
|
||||
prefix = 'icq'
|
||||
elif transport_name == 'msn':
|
||||
prefix = 'msn'
|
||||
elif transport_name == 'yahoo':
|
||||
prefix = 'yahoo'
|
||||
else:
|
||||
prefix = 'jabber'
|
||||
'''
|
||||
|
||||
if event_type == _('Contact Signed In'):
|
||||
img = 'contact_online.png'
|
||||
img = prefix + '_online.png'
|
||||
ntype = 'presence.online'
|
||||
elif event_type == _('Contact Signed Out'):
|
||||
img = 'contact_offline.png'
|
||||
img = prefix + '_offline.png'
|
||||
ntype = 'presence.offline'
|
||||
elif event_type in (_('New Message'), _('New Single Message'),
|
||||
_('New Private Message')):
|
||||
|
|
|
@ -708,10 +708,15 @@ class RosterWindow:
|
|||
contact.status = status
|
||||
if show in ('offline', 'error') and \
|
||||
not gajim.awaiting_events[account].has_key(contact.jid):
|
||||
if len(contact_instances) > 1 or not showOffline:
|
||||
# if multiple resources or we don't show offline contacts
|
||||
if len(contact_instances) > 1:
|
||||
# if multiple resources
|
||||
gajim.contacts.remove_contact(account, contact)
|
||||
self.draw_contact(contact.jid, account)
|
||||
self.draw_contact(contact.jid, account)
|
||||
elif not showOffline:
|
||||
# we don't show offline contacts
|
||||
self.remove_contact(contact, account)
|
||||
else:
|
||||
self.draw_contact(contact.jid, account)
|
||||
else:
|
||||
if not self.get_contact_iter(contact.jid, account):
|
||||
self.add_contact_to_roster(contact.jid, account)
|
||||
|
@ -2500,7 +2505,9 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
|||
# user1.groups
|
||||
c = gajim.contacts.get_first_contact_from_jid(account, data)
|
||||
if context.action != gtk.gdk.ACTION_COPY:
|
||||
c.groups.remove(grp_source)
|
||||
if grp_source in c.groups:
|
||||
# Make sure contact was in a group
|
||||
c.groups.remove(grp_source)
|
||||
if model.iter_n_children(iter_group_source) == 1:
|
||||
# this was the only child
|
||||
model.remove(iter_group_source)
|
||||
|
|
|
@ -452,8 +452,7 @@ class VcardWindow:
|
|||
|
||||
def change_to_vcard(self):
|
||||
self.xml.get_widget('information_notebook').remove_page(0)
|
||||
#FIXME: make this string translatable for .10 [thanks Stian]
|
||||
self.xml.get_widget('nickname_label').set_text('Personal details')
|
||||
self.xml.get_widget('nickname_label').set_text(_('Personal details'))
|
||||
|
||||
self.publish_button.show()
|
||||
self.retrieve_button.show()
|
||||
|
|