From 3dd617a5f1d0da0b294f9f76e66add1d7b534754 Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Thu, 11 Mar 2021 14:32:32 +0000 Subject: [PATCH] Fix some dropdown lists in Preferences / Searching. --- src/calibre/gui2/preferences/look_feel.py | 1 - src/calibre/gui2/preferences/search.py | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/calibre/gui2/preferences/look_feel.py b/src/calibre/gui2/preferences/look_feel.py index 0f685d1cca..9f89128ea4 100644 --- a/src/calibre/gui2/preferences/look_feel.py +++ b/src/calibre/gui2/preferences/look_feel.py @@ -501,7 +501,6 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form): choices=sorted(choices, key=sort_key)) choices -= {'authors', 'publisher', 'formats', 'news', 'identifiers'} - self.opt_categories_using_hierarchy.update_items_cache(choices) r('categories_using_hierarchy', db.prefs, setting=CommaSeparatedList, choices=sorted(choices, key=sort_key)) diff --git a/src/calibre/gui2/preferences/search.py b/src/calibre/gui2/preferences/search.py index 928d9e37fb..9255c79851 100644 --- a/src/calibre/gui2/preferences/search.py +++ b/src/calibre/gui2/preferences/search.py @@ -6,7 +6,7 @@ __license__ = 'GPL v3' __copyright__ = '2010, Kovid Goyal ' __docformat__ = 'restructuredtext en' -from qt.core import QApplication +from qt.core import QApplication, QTimer from calibre.db.categories import find_categories from calibre.gui2.preferences import ConfigWidgetBase, test_widget, \ @@ -34,9 +34,8 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form): r('limit_search_columns', prefs) r('use_primary_find_in_search', prefs) r('case_sensitive', prefs) - r('limit_search_columns_to', prefs, setting=CommaSeparatedList) fl = db.field_metadata.get_search_terms() - self.opt_limit_search_columns_to.update_items_cache(fl) + r('limit_search_columns_to', prefs, setting=CommaSeparatedList, choices=fl) self.clear_history_button.clicked.connect(self.clear_histories) self.gst_explanation.setText('

' + _( @@ -71,7 +70,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form): fm = db.new_api.field_metadata categories = [x[0] for x in find_categories(fm) if fm[x[0]]['search_terms']] self.gst_value.update_items_cache(categories) - self.fill_gst_box(select=None) + QTimer.singleShot(0, self.fill_gst_box) self.user_category_layout.setContentsMargins(0, 30, 0, 0) self.gst_names.lineEdit().setPlaceholderText(