Author: jim++ Date: 2006-05-14 17:12:17 +0200 (Sun, 14 May 2006) New Revision: 6326
Modified: trunk/src/roster_window.py Log: When in merged account mode, if we drag and drop contacts from one account to another, show drop menu, allow to change group, inform user why creation of metacontact is not possible. Fixes #1383.
Modified: trunk/src/roster_window.py =================================================================== --- trunk/src/roster_window.py 2006-05-13 18:43:48 UTC (rev 6325) +++ trunk/src/roster_window.py 2006-05-14 15:12:17 UTC (rev 6326) @@ -3116,10 +3116,12 @@ if type_source != 'contact': # source is not a contact return source_account = model[iter_source][C_ACCOUNT].decode('utf-8') + disable_meta = False if account != source_account: # dropped in another account - if self.regroup and type_dest == 'group': - # on a group in merge mode is ok + if self.regroup: + # in merge mode it is ok to change group, but disable meta account = source_account + disable_meta = True else: return it = iter_source @@ -3188,15 +3190,21 @@ item.connect('activate', self.on_drop_in_group, account, c_source, grp_dest, context, etime, grp_source) menu.append(item) - c_dest = gajim.contacts.get_contact_with_highest_priority(account, - jid_dest) - item = gtk.MenuItem(_('Make %s and %s metacontacts') % (c_source.name, - c_dest.name)) - is_big_brother = False - if model.iter_has_child(iter_source): - is_big_brother = True - item.connect('activate', self.on_drop_in_contact, account, c_source, - c_dest, is_big_brother, context, etime) + if not disable_meta: + # source and dest account are the same, enable metacontacts + c_dest = gajim.contacts.get_contact_with_highest_priority(account, + jid_dest) + item = gtk.MenuItem(_('Make %s and %s metacontacts') % (c_source.name, + c_dest.name)) + is_big_brother = False + if model.iter_has_child(iter_source): + is_big_brother = True + item.connect('activate', self.on_drop_in_contact, account, c_source, + c_dest, is_big_brother, context, etime) + else: #source and dest account are not the same, disable meta + item = gtk.MenuItem(_('Can't create a metacontact with contacts from two different accounts')) + item.set_sensitive(False) + menu.append(item)
menu.attach_to_widget(self.tree, None)