From dd6c1126dfa0d1999306fa64f9c0adf2ed4ff39d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 30 Oct 2009 16:31:53 -0600 Subject: [PATCH] IGN:Sort list of builtin recipes for customization --- src/calibre/gui2/dialogs/user_profiles.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/calibre/gui2/dialogs/user_profiles.py b/src/calibre/gui2/dialogs/user_profiles.py index 08cb455997..86449a34e7 100644 --- a/src/calibre/gui2/dialogs/user_profiles.py +++ b/src/calibre/gui2/dialogs/user_profiles.py @@ -251,7 +251,7 @@ class %(classname)s(%(base_class)s): def add_builtin_recipe(self): from calibre.web.feeds.recipes.collection import \ 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'), @@ -259,15 +259,15 @@ class %(classname)s(%(base_class)s): if ok: title = unicode(title) profile = get_builtin_recipe_by_title(title) - if self._model.has_title(title): - if question_dialog(self, _('Replace recipe?'), - _('A custom recipe named %s already exists. Do you want to ' - 'replace it?')%title): - self._model.replace_by_title(title, profile) + if self._model.has_title(title): + if question_dialog(self, _('Replace recipe?'), + _('A custom recipe named %s already exists. Do you want to ' + 'replace it?')%title): + self._model.replace_by_title(title, profile) + else: + return else: - return - else: - self.model.add(title, profile) + self.model.add(title, profile) self.clear()