mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-06-13 16:34:34 +12:00
spellcheck: show 'add to dictionary' even if a word has no suggestions
This commit is contained in:
parent
f9b181ff67
commit
5c33ce54f3
|
@ -464,16 +464,16 @@ class textEditView(QTextEdit):
|
||||||
action = self.SpellAction(word, spell_menu)
|
action = self.SpellAction(word, spell_menu)
|
||||||
action.correct.connect(self.correctWord)
|
action.correct.connect(self.correctWord)
|
||||||
spell_menu.addAction(action)
|
spell_menu.addAction(action)
|
||||||
|
popup_menu.insertSeparator(popup_menu.actions()[0])
|
||||||
|
# Adds: add to dictionary
|
||||||
|
addAction = QAction(self.tr("&Add to dictionary"), popup_menu)
|
||||||
|
addAction.setIcon(QIcon.fromTheme("list-add"))
|
||||||
|
addAction.triggered.connect(self.addWordToDict)
|
||||||
|
addAction.setData(selectedWord)
|
||||||
|
popup_menu.insertAction(popup_menu.actions()[0], addAction)
|
||||||
# Only add the spelling suggests to the menu if there are
|
# Only add the spelling suggests to the menu if there are
|
||||||
# suggestions.
|
# suggestions.
|
||||||
if len(spell_menu.actions()) != 0:
|
if len(spell_menu.actions()) != 0:
|
||||||
popup_menu.insertSeparator(popup_menu.actions()[0])
|
|
||||||
# Adds: add to dictionary
|
|
||||||
addAction = QAction(self.tr("&Add to dictionary"), popup_menu)
|
|
||||||
addAction.setIcon(QIcon.fromTheme("list-add"))
|
|
||||||
addAction.triggered.connect(self.addWordToDict)
|
|
||||||
addAction.setData(selectedWord)
|
|
||||||
popup_menu.insertAction(popup_menu.actions()[0], addAction)
|
|
||||||
# Adds: suggestions
|
# Adds: suggestions
|
||||||
popup_menu.insertMenu(popup_menu.actions()[0], spell_menu)
|
popup_menu.insertMenu(popup_menu.actions()[0], spell_menu)
|
||||||
# popup_menu.insertSeparator(popup_menu.actions()[0])
|
# popup_menu.insertSeparator(popup_menu.actions()[0])
|
||||||
|
|
Loading…
Reference in a new issue