From c3c9eef415e24e08504e0b3029621b303af84ed2 Mon Sep 17 00:00:00 2001 From: Youness Alaoui Date: Thu, 21 Feb 2019 19:14:55 -0500 Subject: [PATCH] Do not default spellcheck to True for new editor views default spellcheck to the settings value instead. Otherwise any new editor tab will have spellcheck enabled regardless of setting. Fixes #474 --- manuskript/ui/editors/editorWidget.py | 2 +- manuskript/ui/views/MDEditView.py | 2 +- manuskript/ui/views/textEditView.py | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/manuskript/ui/editors/editorWidget.py b/manuskript/ui/editors/editorWidget.py index bd5a1654..c43eb34c 100644 --- a/manuskript/ui/editors/editorWidget.py +++ b/manuskript/ui/editors/editorWidget.py @@ -54,7 +54,7 @@ class editorWidget(QWidget, Ui_editorWidget_ui): self.dictChanged.connect(self.txtRedacText.setDict, AUC) self.txtRedacText.setHighlighting(True) self.currentDict = "" - self.spellcheck = True + self.spellcheck = settings.spellcheck self.folderView = "cork" self.mw = mainWindow() self._tabWidget = None # set by mainEditor on creation diff --git a/manuskript/ui/views/MDEditView.py b/manuskript/ui/views/MDEditView.py index 5ed2bd65..a0a15d8a 100644 --- a/manuskript/ui/views/MDEditView.py +++ b/manuskript/ui/views/MDEditView.py @@ -23,7 +23,7 @@ class MDEditView(textEditView): imageRegex = QRegExp("!\\[([^\n]*)\\]\\(([^\n]+)\\)") automaticLinkRegex = QRegExp("(<([a-zA-Z]+\\:[^\n]+)>)|(<([^\n]+@[^\n]+)>)") - def __init__(self, parent=None, index=None, html=None, spellcheck=True, + def __init__(self, parent=None, index=None, html=None, spellcheck=None, highlighting=False, dict="", autoResize=False): textEditView.__init__(self, parent, index, html, spellcheck, highlighting=True, dict=dict, diff --git a/manuskript/ui/views/textEditView.py b/manuskript/ui/views/textEditView.py index e5a2fa50..38983d2d 100644 --- a/manuskript/ui/views/textEditView.py +++ b/manuskript/ui/views/textEditView.py @@ -21,7 +21,7 @@ except ImportError: class textEditView(QTextEdit): - def __init__(self, parent=None, index=None, html=None, spellcheck=True, + def __init__(self, parent=None, index=None, html=None, spellcheck=None, highlighting=False, dict="", autoResize=False): QTextEdit.__init__(self, parent) self._column = Outline.text @@ -39,6 +39,9 @@ class textEditView(QTextEdit): self._themeData = None self._highlighterClass = BasicHighlighter + if spellcheck is None: + spellcheck = settings.spellcheck + self.spellcheck = spellcheck self.currentDict = dict if dict else settings.dict self._defaultFontSize = qApp.font().pointSize()