Allow pressing return in the change word box to trigger the change

This commit is contained in:
Kovid Goyal 2014-04-20 09:35:18 +05:30
parent 8acc2c4da1
commit 0a755a2b66

View File

@ -860,6 +860,7 @@ class SpellCheck(Dialog):
self.suggested_word = sw = LineEdit(self)
sw.set_separator(None)
sw.setPlaceholderText(_('The replacement word'))
sw.returnPressed.connect(self.change_word)
l.addWidget(sw)
self.suggested_list = sl = QListWidget(self)
sl.currentItemChanged.connect(self.current_suggestion_changed)
@ -878,6 +879,12 @@ class SpellCheck(Dialog):
self.summary = s = QLabel('')
self.main.l.addLayout(h), h.addWidget(s), h.addWidget(om), h.addWidget(cs), h.addStretch(1)
def keyPressEvent(self, ev):
if ev.key() in (Qt.Key_Enter, Qt.Key_Return):
ev.accept()
return
return Dialog.keyPressEvent(self, ev)
def sort_type_changed(self):
tprefs['spell_check_case_sensitive_sort'] = bool(self.case_sensitive_sort.isChecked())
if self.words_model.sort_on[0] == 0: