Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2b00831465 | |||
| ad34d45d0b | |||
| df77fb67c6 | |||
| e3168163c2 |
@@ -91,6 +91,18 @@ class GuiMainMenu(QMenuBar):
|
|||||||
"""Forward spell check check state to its action."""
|
"""Forward spell check check state to its action."""
|
||||||
self.aSpellCheck.setChecked(state)
|
self.aSpellCheck.setChecked(state)
|
||||||
|
|
||||||
|
@pyqtSlot()
|
||||||
|
def updateSpellCheckLanguages(self) -> None:
|
||||||
|
"""Update the list of available spell check languages."""
|
||||||
|
self.mSelectLanguage.clear()
|
||||||
|
languages = SHARED.spelling.listDictionaries()
|
||||||
|
languages.insert(0, ("None", self.tr("Default")))
|
||||||
|
for tag, language in languages:
|
||||||
|
aSpell = QAction(self.mSelectLanguage)
|
||||||
|
aSpell.setText(language)
|
||||||
|
aSpell.triggered.connect(qtLambda(self._changeSpelling, tag))
|
||||||
|
self.mSelectLanguage.addAction(aSpell)
|
||||||
|
|
||||||
##
|
##
|
||||||
# Private Slots
|
# Private Slots
|
||||||
##
|
##
|
||||||
@@ -944,13 +956,7 @@ class GuiMainMenu(QMenuBar):
|
|||||||
self.mainGui.addAction(self.aSpellCheck)
|
self.mainGui.addAction(self.aSpellCheck)
|
||||||
|
|
||||||
self.mSelectLanguage = qtAddMenu(self.toolsMenu, self.tr("Spell Check Language"))
|
self.mSelectLanguage = qtAddMenu(self.toolsMenu, self.tr("Spell Check Language"))
|
||||||
languages = SHARED.spelling.listDictionaries()
|
self.updateSpellCheckLanguages()
|
||||||
languages.insert(0, ("None", self.tr("Default")))
|
|
||||||
for tag, language in languages:
|
|
||||||
aSpell = QAction(self.mSelectLanguage)
|
|
||||||
aSpell.setText(language)
|
|
||||||
aSpell.triggered.connect(qtLambda(self._changeSpelling, tag))
|
|
||||||
self.mSelectLanguage.addAction(aSpell)
|
|
||||||
|
|
||||||
# Tools > Re-Run Spell Check
|
# Tools > Re-Run Spell Check
|
||||||
self.aReRunSpell = qtAddAction(self.toolsMenu, self.tr("Re-Run Spell Check"))
|
self.aReRunSpell = qtAddAction(self.toolsMenu, self.tr("Re-Run Spell Check"))
|
||||||
|
|||||||
@@ -824,12 +824,17 @@ class GuiMain(QMainWindow):
|
|||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def showDictionariesDialog(self) -> None:
|
def showDictionariesDialog(self) -> None:
|
||||||
"""Show the download dictionaries dialog."""
|
"""Show the download dictionaries dialog and update language
|
||||||
|
list when closed.
|
||||||
|
"""
|
||||||
dialog = GuiDictionaries(self)
|
dialog = GuiDictionaries(self)
|
||||||
dialog.activateDialog()
|
dialog.activateDialog()
|
||||||
if not dialog.initDialog():
|
if not dialog.initDialog():
|
||||||
dialog.close()
|
dialog.close()
|
||||||
SHARED.error(self.tr("Could not initialise the dialog."))
|
SHARED.error(self.tr("Could not initialise the dialog."))
|
||||||
|
return
|
||||||
|
|
||||||
|
dialog.finished.connect(self.mainMenu.updateSpellCheckLanguages)
|
||||||
|
|
||||||
##
|
##
|
||||||
# Main Window Actions
|
# Main Window Actions
|
||||||
|
|||||||
Reference in New Issue
Block a user