From 12718e6785bb9855ec143552e86511e13fd4c488 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 16 Oct 2013 21:16:26 +0530 Subject: [PATCH] Confirm on quit if unsaved changes present --- src/calibre/gui2/tweak_book/boss.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/calibre/gui2/tweak_book/boss.py b/src/calibre/gui2/tweak_book/boss.py index 575978bdc3..053cea151e 100644 --- a/src/calibre/gui2/tweak_book/boss.py +++ b/src/calibre/gui2/tweak_book/boss.py @@ -150,6 +150,12 @@ class Boss(QObject): 'The current book is being saved in the background, quitting will abort' ' the save process, are you sure?'), default_yes=False): return False + if self.gui.action_save.isEnabled(): + if not question_dialog( + self.gui, _('Are you sure?'), _( + 'The current book has unsaved changes, you will lose them if you quit,' + ' are you sure?'), default_yes=False): + return False return True