yes_default = pref('prompts.defaults.contacts.del_contact', type = bool, default = True)
more_flags = wx.NO_DEFAULT * (not yes_default)
if wx.YES == wx.MessageBox(_('Are you sure you want to delete contact %s?') % contact.name, _('Delete Contact'), style = wx.YES_NO | more_flags):
do_remove()
def remove_group(group, do_remove):
try:
s = u'group "%s"' % group.name
except:
s = u'this group'
yes_default = pref('prompts.defaults.contacts.del_group', type = bool, default = True)
more_flags = wx.NO_DEFAULT * (not yes_default)
if wx.YES == wx.MessageBox(_('WARNING!\n\nAll your contacts in this group will be deleted locally AND on the server.\n\nAre you sure you want to remove %s?') % s, _('Delete Group'), style = wx.YES_NO | wx.ICON_ERROR | more_flags):
do_remove()
def add_group():
group = GetTextFromUser(_('Please enter a group name:'), _('Add Group'))
if group is None or not group.strip():
return None
protos = [ acct.connection for acct in profile.account_manager.connected_accounts ]
for proto in protos:
traceguard.__enter__()
try:
proto.add_group(group)
finally:
pass
def block_buddy(buddy, do_block):
yes_default = pref('prompts.defaults.contacts.block', type = bool, default = True)
more_flags = wx.NO_DEFAULT * (not yes_default)
if wx.YES == wx.MessageBox(_('Are you sure you want to block %s?') % buddy.name, _('Block Buddy'), style = wx.YES_NO | more_flags):