small fixes

This commit is contained in:
Wesley Stout 2011-04-13 17:10:07 -05:00
commit d8b1313e22
2 changed files with 9 additions and 5 deletions

View File

@ -23,7 +23,7 @@
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
import logging
import re
try:
import enchant
@ -38,20 +38,24 @@ except ImportError:
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate, DisplayTags
log = logging.getLogger(__name__)
class SpellTextEdit(QtGui.QPlainTextEdit):
"""
Spell checking widget based on QPlanTextEdit.
"""
def __init__(self, *args):
global ENCHANT_AVAILABLE
QtGui.QPlainTextEdit.__init__(self, *args)
# Default dictionary based on the current locale.
if ENCHANT_AVAILABLE:
try:
self.dictionary = enchant.Dict()
self.highlighter = Highlighter(self.document())
self.highlighter.spellingDictionary = self.dictionary
except DictNotFoundError:
self.dictionary = enchant.Dict(u'en_US')
self.highlighter = Highlighter(self.document())
self.highlighter.spellingDictionary = self.dictionary
ENCHANT_AVAILABLE = False
log.debug(u'Could not load default dictionary')
def mousePressEvent(self, event):
"""

View File

@ -105,7 +105,7 @@ class PresentationDocument(object):
Loads the presentation and starts it
``presentation``
The file name of the presentations to the run.
The file name of the presentations to the run.
Returns False if the file could not be opened
"""