From 229fe3e4d2c32830367d8ec5b2dc66bd567f0900 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 20 Jan 2011 23:58:22 -0700 Subject: [PATCH] Add a confirmation when closing the add a custom news source dialog. Fixes #8460 (Add custom new source interface) --- src/calibre/gui2/dialogs/user_profiles.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/calibre/gui2/dialogs/user_profiles.py b/src/calibre/gui2/dialogs/user_profiles.py index 04c41f0c5e..fe64deb430 100644 --- a/src/calibre/gui2/dialogs/user_profiles.py +++ b/src/calibre/gui2/dialogs/user_profiles.py @@ -356,6 +356,13 @@ class %(classname)s(%(base_class)s): self.populate_options(AutomaticNewsRecipe) self.source_code.setText('') + def reject(self): + if question_dialog(self, _('Are you sure?'), + _('You will lose any unsaved changes. To save your' + ' changes, click the Add/Update recipe button.' + ' Continue?'), show_copy_button=False): + ResizableDialog.reject(self) + if __name__ == '__main__': from calibre.gui2 import is_ok_to_use_qt is_ok_to_use_qt()