mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1360 (Error when cancelling "Load recipie from file" in add custom news source window)
This commit is contained in:
parent
acf525d22d
commit
d1b5076360
@ -228,16 +228,16 @@ class %(classname)s(%(base_class)s):
|
||||
error_dialog(self, _('Invalid input'),
|
||||
_('<p>Could not create recipe. Error:<br>%s')%str(err)).exec_()
|
||||
return
|
||||
try:
|
||||
self.available_profiles.add_item(title, (title, src), replace=False)
|
||||
except ValueError:
|
||||
d = question_dialog(self, _('Replace recipe?'),
|
||||
_('A custom recipe named %s already exists. Do you want to replace it?')%title)
|
||||
if d.exec_() == QMessageBox.Yes:
|
||||
self.available_profiles.add_item(title, (title, src), replace=True)
|
||||
else:
|
||||
return
|
||||
self.clear()
|
||||
try:
|
||||
self.available_profiles.add_item(title, (title, src), replace=False)
|
||||
except ValueError:
|
||||
d = question_dialog(self, _('Replace recipe?'),
|
||||
_('A custom recipe named %s already exists. Do you want to replace it?')%title)
|
||||
if d.exec_() == QMessageBox.Yes:
|
||||
self.available_profiles.add_item(title, (title, src), replace=True)
|
||||
else:
|
||||
return
|
||||
self.clear()
|
||||
|
||||
def populate_options(self, profile):
|
||||
self.oldest_article.setValue(profile.oldest_article)
|
||||
|
Loading…
x
Reference in New Issue
Block a user