noconfirm_close_muc_rooms is too much customizability exposed to user which only ends up confusing him. fixes #1622
This commit is contained in:
parent
492a64d10e
commit
9859d34781
|
@ -1042,29 +1042,21 @@ class GroupchatControl(ChatControlBase):
|
|||
def allow_shutdown(self):
|
||||
retval = True
|
||||
# whether to ask for comfirmation before closing muc
|
||||
if not gajim.config.get('confirm_close_muc'):
|
||||
gajim.config.set('noconfirm_close_muc_rooms', '')
|
||||
else:
|
||||
excludes = gajim.config.get('noconfirm_close_muc_rooms')
|
||||
excludes = excludes.split(' ')
|
||||
if gajim.gc_connected[self.account][self.room_jid] and \
|
||||
self.room_jid not in excludes:
|
||||
if gajim.config.get('confirm_close_muc'):
|
||||
if gajim.gc_connected[self.account][self.room_jid]:
|
||||
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.')
|
||||
|
||||
escaped_name = gtkgui_helpers.escape_underscore(self.name)
|
||||
dialog = dialogs.ConfirmationDialogCheck(pritext, sectext,
|
||||
_('Do _not ask me about closing "%s" again' %\
|
||||
escaped_name))
|
||||
_('Do _not ask me again'))
|
||||
|
||||
if dialog.get_response() != gtk.RESPONSE_OK:
|
||||
retval = False
|
||||
|
||||
if dialog.is_checked():
|
||||
excludes = gajim.config.get('noconfirm_close_muc_rooms')
|
||||
excludes += ' %s' % self.room_jid
|
||||
gajim.config.set('noconfirm_close_muc_rooms', excludes)
|
||||
if dialog.is_checked(): # user does not want to be asked again
|
||||
gajim.config.set('confirm_close_muc', False)
|
||||
|
||||
dialog.destroy()
|
||||
|
||||
return retval
|
||||
|
|
Loading…
Reference in New Issue