Show a confirmation dialog first time we block a contact. Fixes #3646
This commit is contained in:
parent
17e03edfd7
commit
a7c3451e1d
|
@ -249,6 +249,8 @@ class Config:
|
|||
'gc_nicknames_colors': [ opt_str, '#a34526:#c000ff:#0012ff:#388a99:#045723:#7c7c7c:#ff8a00:#94452d:#244b5a:#32645a', _('List of colors, separated by ":", that will be used to color nicknames in group chats.'), True ],
|
||||
'ctrl_tab_go_to_next_composing': [opt_bool, True, _('Ctrl-Tab go to next composing tab when none is unread.')],
|
||||
'confirm_metacontacts': [ opt_str, '', _('Should we show the confirm metacontacts creation dialog or not? Empty string means we never show the dialog.')],
|
||||
'confirm_block': [ opt_str, '', _('Should we show the confirm block contact dialog or not? Empty string means we never show the dialog.')],
|
||||
'confirm_custom_status': [ opt_str, '', _('Should we show the confirm custom status dialog or not? Empty string means we never show the dialog.')],
|
||||
'enable_negative_priority': [ opt_bool, False, _('If True, you will be able to set a negative priority to your account in account modification window. BE CAREFUL, when you are logged in with a negative priority, you will NOT receive any message from your server.')],
|
||||
'use_gnomekeyring': [opt_bool, True, _('If True, Gajim will use Gnome Keyring (if available) to store account passwords.')],
|
||||
'use_kwalletcli': [opt_bool, True, _('If True, Gajim will use KDE Wallet (if kwalletcli is available) to store account passwords.')],
|
||||
|
|
|
@ -2575,8 +2575,25 @@ class RosterWindow:
|
|||
connection.set_default_list('block')
|
||||
connection.get_privacy_list('block')
|
||||
|
||||
def _block_it(is_checked=None):
|
||||
if is_checked is not None: # dialog has been shown
|
||||
if is_checked: # user does not want to be asked again
|
||||
gajim.config.set('confirm_block', 'no')
|
||||
else:
|
||||
gajim.config.set('confirm_block', 'yes')
|
||||
self.get_status_message('offline', on_continue, show_pep=False)
|
||||
|
||||
confirm_block = gajim.config.get('confirm_block')
|
||||
if confirm_block == 'no':
|
||||
_block_it()
|
||||
return
|
||||
pritext = _('You are about to block a contact. Are you sure you want'
|
||||
' to continue?')
|
||||
sectext = _('This contact will see you offline and you will not receive '
|
||||
'messages he will send you.')
|
||||
dlg = dialogs.ConfirmationDialogCheck(pritext, sectext,
|
||||
_('Do _not ask me again'), on_response_ok=_block_it)
|
||||
|
||||
def on_unblock(self, widget, list_, group=None):
|
||||
''' When clicked on the 'unblock' button in context menu. '''
|
||||
accounts = []
|
||||
|
|
Loading…
Reference in New Issue