[Dicson] Do not display dialog confirm_metacontacts when using Make CONTACT first contact. Fixes #7576

This commit is contained in:
Yann Leboulanger 2013-11-30 10:33:04 +01:00
parent fbf8fd7ca0
commit d3e6e22166
1 changed files with 11 additions and 5 deletions

View File

@ -4571,8 +4571,12 @@ class RosterWindow:
self.draw_account(account_source) self.draw_account(account_source)
context.finish(True, True, etime) context.finish(True, True, etime)
dest_family = gajim.contacts.get_metacontacts_family(account_dest,
c_dest.jid)
source_family = gajim.contacts.get_metacontacts_family(account_source,
c_source.jid)
confirm_metacontacts = gajim.config.get('confirm_metacontacts') confirm_metacontacts = gajim.config.get('confirm_metacontacts')
if confirm_metacontacts == 'no': if confirm_metacontacts == 'no' or dest_family == source_family:
merge_contacts() merge_contacts()
return return
pritext = _('You are about to create a metacontact. Are you sure you ' pritext = _('You are about to create a metacontact. Are you sure you '
@ -4846,8 +4850,9 @@ class RosterWindow:
# c_dest is None if jid_dest doesn't belong to account # c_dest is None if jid_dest doesn't belong to account
return return
menu = Gtk.Menu() menu = Gtk.Menu()
item = Gtk.MenuItem(_('Send %s to %s') % (c_source.get_shown_name(), item = Gtk.MenuItem(_('Send %s to %s') % (
c_dest.get_shown_name())) c_source.get_shown_name(), c_dest.get_shown_name()),
use_underline=False)
item.connect('activate', self.on_drop_rosterx, account_source, item.connect('activate', self.on_drop_rosterx, account_source,
c_source, account_dest, c_dest, is_big_brother, context, etime) c_source, account_dest, c_dest, is_big_brother, context, etime)
menu.append(item) menu.append(item)
@ -4858,10 +4863,11 @@ class RosterWindow:
account_source, c_source.jid) account_source, c_source.jid)
if dest_family == source_family and dest_family: if dest_family == source_family and dest_family:
item = Gtk.MenuItem(_('Make %s first contact') % ( item = Gtk.MenuItem(_('Make %s first contact') % (
c_source.get_shown_name())) c_source.get_shown_name()), use_underline=False)
else: else:
item = Gtk.MenuItem(_('Make %s and %s metacontacts') % ( item = Gtk.MenuItem(_('Make %s and %s metacontacts') % (
c_source.get_shown_name(), c_dest.get_shown_name())) c_source.get_shown_name(), c_dest.get_shown_name()),
use_underline=False)
item.connect('activate', self.on_drop_in_contact, account_source, item.connect('activate', self.on_drop_in_contact, account_source,
c_source, account_dest, c_dest, is_big_brother, context, etime) c_source, account_dest, c_dest, is_big_brother, context, etime)