forked from openlp/openlp
Fix local variable issues
This commit is contained in:
parent
fe6a3af42c
commit
5675eba314
@ -43,13 +43,14 @@ class SpellTextEdit(QtGui.QPlainTextEdit):
|
|||||||
def __init__(self, *args):
|
def __init__(self, *args):
|
||||||
QtGui.QPlainTextEdit.__init__(self, *args)
|
QtGui.QPlainTextEdit.__init__(self, *args)
|
||||||
# Default dictionary based on the current locale.
|
# Default dictionary based on the current locale.
|
||||||
if enchant_available:
|
self.enchant_available = enchant_available
|
||||||
|
if self.enchant_available:
|
||||||
try:
|
try:
|
||||||
self.dict = enchant.Dict()
|
self.dict = enchant.Dict()
|
||||||
self.highlighter = Highlighter(self.document())
|
self.highlighter = Highlighter(self.document())
|
||||||
self.highlighter.setDict(self.dict)
|
self.highlighter.setDict(self.dict)
|
||||||
except DictNotFoundError:
|
except DictNotFoundError:
|
||||||
enchant_available = False
|
self.enchant_available = False
|
||||||
|
|
||||||
def mousePressEvent(self, event):
|
def mousePressEvent(self, event):
|
||||||
if event.button() == QtCore.Qt.RightButton:
|
if event.button() == QtCore.Qt.RightButton:
|
||||||
@ -70,7 +71,7 @@ class SpellTextEdit(QtGui.QPlainTextEdit):
|
|||||||
self.setTextCursor(cursor)
|
self.setTextCursor(cursor)
|
||||||
# Check if the selected word is misspelled and offer spelling
|
# Check if the selected word is misspelled and offer spelling
|
||||||
# suggestions if it is.
|
# suggestions if it is.
|
||||||
if enchant_available and self.textCursor().hasSelection():
|
if self.enchant_available and self.textCursor().hasSelection():
|
||||||
text = unicode(self.textCursor().selectedText())
|
text = unicode(self.textCursor().selectedText())
|
||||||
if not self.dict.check(text):
|
if not self.dict.check(text):
|
||||||
spell_menu = QtGui.QMenu(translate('OpenLP.SpellTextEdit',
|
spell_menu = QtGui.QMenu(translate('OpenLP.SpellTextEdit',
|
||||||
|
Loading…
Reference in New Issue
Block a user