diff --git a/src/common/config.py b/src/common/config.py index 6482d7516..1f99ef702 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -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.')], diff --git a/src/roster_window.py b/src/roster_window.py index f99006f4e..f7a0044bf 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -2575,7 +2575,24 @@ class RosterWindow: connection.set_default_list('block') connection.get_privacy_list('block') - self.get_status_message('offline', on_continue, show_pep=False) + 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. ''' @@ -2828,7 +2845,7 @@ class RosterWindow: self.remove_groupchat(jid, account) def on_send_single_message_menuitem_activate(self, widget, account, - contact = None): + contact=None): if contact is None: dialogs.SingleMessageWindow(account, action='send') elif isinstance(contact, list): @@ -2878,7 +2895,7 @@ class RosterWindow: break def on_invite_to_room(self, widget, list_, room_jid, room_account, - resource = None): + resource=None): ''' resource parameter MUST NOT be used if more than one contact in list ''' for e in list_: