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
This commit is contained in:
Youness Alaoui 2019-02-21 19:14:55 -05:00 committed by Curtis Gedak
parent 84d0979ffb
commit c3c9eef415
3 changed files with 6 additions and 3 deletions

View file

@ -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

View file

@ -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,

View file

@ -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()