add 2 advanced options: confirm_close_muc_rooms and noconfirm_close_muc_rooms. Fixes #1622

This commit is contained in:
Yann Leboulanger 2006-03-07 13:13:36 +00:00
parent bc7d9a2943
commit e6200b599a
2 changed files with 17 additions and 12 deletions

View File

@ -143,6 +143,8 @@ class Config:
'autodetect_browser_mailer': [opt_bool, False, '', True],
'print_ichat_every_foo_minutes': [opt_int, 5],
'confirm_close_muc': [opt_bool, True, _('Ask before closing a group chat tab/window.')],
'confirm_close_muc_rooms': [opt_str, True, _('Always ask before closing group chat tab/window in this space separated list of room jids.')],
'noconfirm_close_muc_rooms': [opt_str, True, _('Never ask before closing group chat tab/window in this space separated list of room jids.')],
'notify_on_file_complete': [opt_bool, True],
'file_transfers_port': [opt_int, 28011],
'ft_override_host_to_send': [opt_str, '', _('Overrides the host we send for File Transfer in case of address translation/port forwarding.')],

View File

@ -1040,9 +1040,12 @@ class GroupchatControl(ChatControlBase):
def allow_shutdown(self):
retval = True
includes = gajim.config.get('confirm_close_muc_rooms').split(' ')
excludes = gajim.config.get('noconfirm_close_muc_rooms').split(' ')
# whether to ask for comfirmation before closing muc
if gajim.config.get('confirm_close_muc'):
if gajim.gc_connected[self.account][self.room_jid]:
if (gajim.config.get('confirm_close_muc') or self.room_jid in inclides) \
and gajim.gc_connected[self.account][self.room_jid] and self.room_jid not\
in excludes:
pritext = _('Are you sure you want to leave room "%s"?') % self.name
sectext = _('If you close this window, you will be disconnected '
'from this room.')