Don't ask twice if we want to leave a groupchat. Fix #3245.

This commit is contained in:
Julien Pivotto 2007-06-17 15:59:46 +00:00
parent a5e155792b
commit 786d63a430
1 changed files with 7 additions and 4 deletions

View File

@ -146,13 +146,16 @@ class MessageWindow:
def _on_window_delete(self, win, event):
# Make sure all controls are okay with being deleted
ctrl_to_minimize = []
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
elif allow_shutdown == 'minimize':
ctrl_to_minimize.append(ctrl)
# If all are ok, minimize the one that need to be minimized
for ctrl in self.controls():
if ctrl.allow_shutdown(self.CLOSE_CLOSE_BUTTON) == 'minimize':
ctrl.minimize()
for ctrl in ctrl_to_minimize:
ctrl.minimize()
return False
def _on_window_destroy(self, win):