mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
IGN:Sort list of builtin recipes for customization
This commit is contained in:
parent
2f3fbbc377
commit
dd6c1126df
@ -251,7 +251,7 @@ class %(classname)s(%(base_class)s):
|
|||||||
def add_builtin_recipe(self):
|
def add_builtin_recipe(self):
|
||||||
from calibre.web.feeds.recipes.collection import \
|
from calibre.web.feeds.recipes.collection import \
|
||||||
get_builtin_recipe_by_title, get_builtin_recipe_titles
|
get_builtin_recipe_by_title, get_builtin_recipe_titles
|
||||||
items = get_builtin_recipe_titles()
|
items = sorted(get_builtin_recipe_titles())
|
||||||
|
|
||||||
|
|
||||||
title, ok = QInputDialog.getItem(self, _('Pick recipe'), _('Pick the recipe to customize'),
|
title, ok = QInputDialog.getItem(self, _('Pick recipe'), _('Pick the recipe to customize'),
|
||||||
@ -259,15 +259,15 @@ class %(classname)s(%(base_class)s):
|
|||||||
if ok:
|
if ok:
|
||||||
title = unicode(title)
|
title = unicode(title)
|
||||||
profile = get_builtin_recipe_by_title(title)
|
profile = get_builtin_recipe_by_title(title)
|
||||||
if self._model.has_title(title):
|
if self._model.has_title(title):
|
||||||
if question_dialog(self, _('Replace recipe?'),
|
if question_dialog(self, _('Replace recipe?'),
|
||||||
_('A custom recipe named %s already exists. Do you want to '
|
_('A custom recipe named %s already exists. Do you want to '
|
||||||
'replace it?')%title):
|
'replace it?')%title):
|
||||||
self._model.replace_by_title(title, profile)
|
self._model.replace_by_title(title, profile)
|
||||||
|
else:
|
||||||
|
return
|
||||||
else:
|
else:
|
||||||
return
|
self.model.add(title, profile)
|
||||||
else:
|
|
||||||
self.model.add(title, profile)
|
|
||||||
|
|
||||||
self.clear()
|
self.clear()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user