From 57612b4536337e0a63c559064e0837d0c4b315ec Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 9 Jun 2022 13:51:18 +0530 Subject: [PATCH] Fix checkbox toggles --- src/calibre/gui2/fts/search.py | 4 ++-- src/calibre/gui2/library/annotations.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/fts/search.py b/src/calibre/gui2/fts/search.py index 37e98b4e49..a71d8b8fc5 100644 --- a/src/calibre/gui2/fts/search.py +++ b/src/calibre/gui2/fts/search.py @@ -339,13 +339,13 @@ class SearchInputPanel(QWidget): ' library screen. This means that any Virtual libraries or search results' ' are applied.')) r.setChecked(gprefs['fts_library_restrict_books']) - r.stateChanged.connect(lambda state: gprefs.set('fts_library_restrict_books', state != Qt.CheckState.Unchecked)) + r.stateChanged.connect(lambda state: gprefs.set('fts_library_restrict_books', state != Qt.CheckState.Unchecked.value)) self.related = rw = QCheckBox(_('&Match on related words')) rw.setToolTip('

' + _( 'With this option searching for words will also match on any related words (supported in several languages). For' ' example, in the English language: correction matches correcting and corrected as well')) rw.setChecked(gprefs['fts_library_use_stemmer']) - rw.stateChanged.connect(lambda state: gprefs.set('fts_library_use_stemmer', state != Qt.CheckState.Unchecked)) + rw.stateChanged.connect(lambda state: gprefs.set('fts_library_use_stemmer', state != Qt.CheckState.Unchecked.value)) self.summary = s = QLabel(self) h1.addWidget(r), h1.addWidget(rw), h1.addWidget(s), h1.addStretch() diff --git a/src/calibre/gui2/library/annotations.py b/src/calibre/gui2/library/annotations.py index 52898cfefb..08af59130a 100644 --- a/src/calibre/gui2/library/annotations.py +++ b/src/calibre/gui2/library/annotations.py @@ -946,7 +946,7 @@ class AnnotationsBrowser(Dialog): us.setToolTip('

' + _( 'With this option searching for words will also match on any related words (supported in several languages). For' ' example, in the English language: correction matches correcting and corrected as well')) - us.stateChanged.connect(lambda state: gprefs.set('browse_annots_use_stemmer', state != Qt.CheckState.Unchecked)) + us.stateChanged.connect(lambda state: gprefs.set('browse_annots_use_stemmer', state != Qt.CheckState.Unchecked.value)) l = QVBoxLayout(self)