Fix checkbox toggles

This commit is contained in:
Kovid Goyal 2022-06-09 13:51:18 +05:30
parent 96190cd531
commit 57612b4536
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 3 deletions

View File

@ -339,13 +339,13 @@ class SearchInputPanel(QWidget):
' library screen. This means that any Virtual libraries or search results' ' library screen. This means that any Virtual libraries or search results'
' are applied.')) ' are applied.'))
r.setChecked(gprefs['fts_library_restrict_books']) 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')) self.related = rw = QCheckBox(_('&Match on related words'))
rw.setToolTip('<p>' + _( rw.setToolTip('<p>' + _(
'With this option searching for words will also match on any related words (supported in several languages). For' 'With this option searching for words will also match on any related words (supported in several languages). For'
' example, in the English language: <i>correction</i> matches <i>correcting</i> and <i>corrected</i> as well')) ' example, in the English language: <i>correction</i> matches <i>correcting</i> and <i>corrected</i> as well'))
rw.setChecked(gprefs['fts_library_use_stemmer']) 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) self.summary = s = QLabel(self)
h1.addWidget(r), h1.addWidget(rw), h1.addWidget(s), h1.addStretch() h1.addWidget(r), h1.addWidget(rw), h1.addWidget(s), h1.addStretch()

View File

@ -946,7 +946,7 @@ class AnnotationsBrowser(Dialog):
us.setToolTip('<p>' + _( us.setToolTip('<p>' + _(
'With this option searching for words will also match on any related words (supported in several languages). For' 'With this option searching for words will also match on any related words (supported in several languages). For'
' example, in the English language: <i>correction</i> matches <i>correcting</i> and <i>corrected</i> as well')) ' example, in the English language: <i>correction</i> matches <i>correcting</i> and <i>corrected</i> 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) l = QVBoxLayout(self)