Fix closeEvent of MainWindow.

This commit is contained in:
Florian Bruhin 2014-10-05 23:09:04 +02:00
parent d260b26105
commit 180d6e45ef

View File

@ -319,18 +319,18 @@ class MainWindow(QWidget):
confirm_quit = config.get('ui', 'confirm-quit') confirm_quit = config.get('ui', 'confirm-quit')
count = self._tabbed_browser.count() count = self._tabbed_browser.count()
if confirm_quit == 'never': if confirm_quit == 'never':
e.accept() pass
elif confirm_quit == 'multiple-tabs' and count <= 1: elif confirm_quit == 'multiple-tabs' and count <= 1:
e.accept() pass
else: else:
text = "Close {} {}?".format( text = "Close {} {}?".format(
count, "tab" if count == 1 else "tabs") count, "tab" if count == 1 else "tabs")
confirmed = message.ask(self.win_id, text, confirmed = message.ask(self.win_id, text,
usertypes.PromptMode.yesno, default=True) usertypes.PromptMode.yesno, default=True)
if confirmed: if not confirmed:
e.accept()
else:
e.ignore() e.ignore()
return
e.accept()
mode_manager = objreg.get('mode-manager', scope='window', mode_manager = objreg.get('mode-manager', scope='window',
window=self.win_id) window=self.win_id)
log.destroy.debug("Removing eventfilter...") log.destroy.debug("Removing eventfilter...")