mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1894742 [[Enhancement] Show warning before closing Edit this recipe dialog](https://bugs.launchpad.net/calibre/+bug/1894742)
This commit is contained in:
parent
6c32ac44e6
commit
730fe50516
@ -14,6 +14,7 @@ from PyQt5.Qt import (
|
||||
QToolButton, QTreeView)
|
||||
|
||||
from calibre.gui2 import error_dialog, open_local_file, choose_files, choose_save_file
|
||||
from calibre.gui2.dialogs.confirm_delete import confirm as confirm_delete
|
||||
from calibre.gui2.widgets2 import Dialog
|
||||
from calibre.web.feeds.recipes import custom_recipes, compile_recipe
|
||||
from calibre.gui2.tweak_book.editor.text import TextEdit
|
||||
@ -607,7 +608,8 @@ class CustomRecipes(Dialog):
|
||||
def reject(self):
|
||||
idx = self.stack.currentIndex()
|
||||
if idx > 0:
|
||||
self.stack.setCurrentIndex(0)
|
||||
if confirm_delete(_('Are you sure? Any unsaved changes will be lost.'), 'confirm-cancel-edit-custom-recipe'):
|
||||
self.stack.setCurrentIndex(0)
|
||||
return
|
||||
Dialog.reject(self)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user