Fix #1926852 [[Enhancement] Warn before removing news source from the Add custom news sources window](https://bugs.launchpad.net/calibre/+bug/1926852)

This commit is contained in:
Kovid Goyal 2021-05-02 13:48:39 +05:30
parent 5d73aa715f
commit 7f21e3692e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -271,10 +271,11 @@ class RecipeList(QWidget): # {{{
def remove(self): def remove(self):
idx = self.view.currentIndex() idx = self.view.currentIndex()
if idx.isValid(): if idx.isValid():
self.model.remove((idx.row(),)) if confirm_delete(_('Are you sure you want to permanently remove this recipe?'), 'remove-custom-recipe', parent=self):
self.select_row() self.model.remove((idx.row(),))
if self.model.rowCount() == 0: self.select_row()
self.stacks.setCurrentIndex(0) if self.model.rowCount() == 0:
self.stacks.setCurrentIndex(0)
def download(self): def download(self):
idx = self.view.currentIndex() idx = self.view.currentIndex()