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
1 changed files with 9 additions and 17 deletions
|
@ -76,7 +76,7 @@ class PrivateChatControl(ChatControl):
|
||||||
if not message:
|
if not message:
|
||||||
return
|
return
|
||||||
|
|
||||||
# We need to make sure that we can still send through the room and that the
|
# We need to make sure that we can still send through the room and that the
|
||||||
# recipient did not go away
|
# recipient did not go away
|
||||||
contact = gajim.contacts.get_first_contact_from_jid(self.account, self.contact.jid)
|
contact = gajim.contacts.get_first_contact_from_jid(self.account, self.contact.jid)
|
||||||
if contact is None:
|
if contact is None:
|
||||||
|
@ -249,7 +249,7 @@ class GroupchatControl(ChatControlBase):
|
||||||
(new_label_str, color)
|
(new_label_str, color)
|
||||||
either of which can be None
|
either of which can be None
|
||||||
if chatstate is given that means we have HE SENT US a chatstate'''
|
if chatstate is given that means we have HE SENT US a chatstate'''
|
||||||
|
|
||||||
has_focus = self.parent_win.window.get_property('has-toplevel-focus')
|
has_focus = self.parent_win.window.get_property('has-toplevel-focus')
|
||||||
current_tab = self.parent_win.get_active_control() == self
|
current_tab = self.parent_win.get_active_control() == self
|
||||||
color = None
|
color = None
|
||||||
|
@ -767,7 +767,7 @@ class GroupchatControl(ChatControlBase):
|
||||||
|
|
||||||
if command == 'me':
|
if command == 'me':
|
||||||
return False # This is not really a command
|
return False # This is not really a command
|
||||||
|
|
||||||
if command == 'nick':
|
if command == 'nick':
|
||||||
# example: /nick foo
|
# example: /nick foo
|
||||||
if len(message_array):
|
if len(message_array):
|
||||||
|
@ -1042,29 +1042,21 @@ class GroupchatControl(ChatControlBase):
|
||||||
def allow_shutdown(self):
|
def allow_shutdown(self):
|
||||||
retval = True
|
retval = True
|
||||||
# whether to ask for comfirmation before closing muc
|
# whether to ask for comfirmation before closing muc
|
||||||
if not gajim.config.get('confirm_close_muc'):
|
if gajim.config.get('confirm_close_muc'):
|
||||||
gajim.config.set('noconfirm_close_muc_rooms', '')
|
if gajim.gc_connected[self.account][self.room_jid]:
|
||||||
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:
|
|
||||||
pritext = _('Are you sure you want to leave room "%s"?') % self.name
|
pritext = _('Are you sure you want to leave room "%s"?') % self.name
|
||||||
sectext = _('If you close this window, you will be disconnected '
|
sectext = _('If you close this window, you will be disconnected '
|
||||||
'from this room.')
|
'from this room.')
|
||||||
|
|
||||||
escaped_name = gtkgui_helpers.escape_underscore(self.name)
|
|
||||||
dialog = dialogs.ConfirmationDialogCheck(pritext, sectext,
|
dialog = dialogs.ConfirmationDialogCheck(pritext, sectext,
|
||||||
_('Do _not ask me about closing "%s" again' %\
|
_('Do _not ask me again'))
|
||||||
escaped_name))
|
|
||||||
|
|
||||||
if dialog.get_response() != gtk.RESPONSE_OK:
|
if dialog.get_response() != gtk.RESPONSE_OK:
|
||||||
retval = False
|
retval = False
|
||||||
|
|
||||||
if dialog.is_checked():
|
if dialog.is_checked(): # user does not want to be asked again
|
||||||
excludes = gajim.config.get('noconfirm_close_muc_rooms')
|
gajim.config.set('confirm_close_muc', False)
|
||||||
excludes += ' %s' % self.room_jid
|
|
||||||
gajim.config.set('noconfirm_close_muc_rooms', excludes)
|
|
||||||
dialog.destroy()
|
dialog.destroy()
|
||||||
|
|
||||||
return retval
|
return retval
|
||||||
|
|
Loading…
Add table
Reference in a new issue