mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Spell check: Improve performance of scrolling through the word list using arrow keys by not updating the list of suggestions immediately
This commit is contained in:
parent
54338df0b8
commit
1d4a0cd24b
@ -807,6 +807,9 @@ class SpellCheck(Dialog):
|
||||
self.thread = None
|
||||
self.cancel = False
|
||||
dictionaries.initialize()
|
||||
self.current_word_changed_timer = t = QTimer()
|
||||
t.timeout.connect(self.do_current_word_changed)
|
||||
t.setSingleShot(True), t.setInterval(100)
|
||||
Dialog.__init__(self, _('Check spelling'), 'spell-check', parent)
|
||||
self.work_finished.connect(self.work_done, type=Qt.QueuedConnection)
|
||||
self.setAttribute(Qt.WA_DeleteOnClose, False)
|
||||
@ -960,6 +963,9 @@ class SpellCheck(Dialog):
|
||||
self.user_dictionaries_missing_label.setVisible(not self.user_dictionaries.isVisible())
|
||||
|
||||
def current_word_changed(self, *args):
|
||||
self.current_word_changed_timer.start(self.current_word_changed_timer.interval())
|
||||
|
||||
def do_current_word_changed(self):
|
||||
try:
|
||||
b = self.ignore_button
|
||||
except AttributeError:
|
||||
|
Loading…
x
Reference in New Issue
Block a user