Don't ask twice if we want to leave a groupchat. Fix #3245.
This commit is contained in:
parent
a5e155792b
commit
786d63a430
|
@ -146,12 +146,15 @@ class MessageWindow:
|
||||||
|
|
||||||
def _on_window_delete(self, win, event):
|
def _on_window_delete(self, win, event):
|
||||||
# Make sure all controls are okay with being deleted
|
# Make sure all controls are okay with being deleted
|
||||||
|
ctrl_to_minimize = []
|
||||||
for ctrl in self.controls():
|
for ctrl in self.controls():
|
||||||
if ctrl.allow_shutdown(self.CLOSE_CLOSE_BUTTON) == 'no':
|
allow_shutdown = ctrl.allow_shutdown(self.CLOSE_CLOSE_BUTTON)
|
||||||
|
if allow_shutdown == 'no':
|
||||||
return True # halt the delete
|
return True # halt the delete
|
||||||
|
elif allow_shutdown == 'minimize':
|
||||||
|
ctrl_to_minimize.append(ctrl)
|
||||||
# If all are ok, minimize the one that need to be minimized
|
# If all are ok, minimize the one that need to be minimized
|
||||||
for ctrl in self.controls():
|
for ctrl in ctrl_to_minimize:
|
||||||
if ctrl.allow_shutdown(self.CLOSE_CLOSE_BUTTON) == 'minimize':
|
|
||||||
ctrl.minimize()
|
ctrl.minimize()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue