From 7f21e3692e88dcbb5e84acc095a06d69305487aa Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 2 May 2021 13:48:39 +0530 Subject: [PATCH] Fix #1926852 [[Enhancement] Warn before removing news source from the Add custom news sources window](https://bugs.launchpad.net/calibre/+bug/1926852) --- src/calibre/gui2/dialogs/custom_recipes.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/calibre/gui2/dialogs/custom_recipes.py b/src/calibre/gui2/dialogs/custom_recipes.py index ba9bc2ddab..597ea8843c 100644 --- a/src/calibre/gui2/dialogs/custom_recipes.py +++ b/src/calibre/gui2/dialogs/custom_recipes.py @@ -271,10 +271,11 @@ class RecipeList(QWidget): # {{{ def remove(self): idx = self.view.currentIndex() if idx.isValid(): - self.model.remove((idx.row(),)) - self.select_row() - if self.model.rowCount() == 0: - self.stacks.setCurrentIndex(0) + if confirm_delete(_('Are you sure you want to permanently remove this recipe?'), 'remove-custom-recipe', parent=self): + self.model.remove((idx.row(),)) + self.select_row() + if self.model.rowCount() == 0: + self.stacks.setCurrentIndex(0) def download(self): idx = self.view.currentIndex()