openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #07823
[Merge] lp:~googol-hush/openlp/fixes into lp:openlp
Andreas Preikschat has proposed merging lp:~googol-hush/openlp/fixes into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Related bugs:
Bug #598393 in OpenLP: "After adding a new image to a selected (image) item in the service manager it is not selected anymore"
https://bugs.launchpad.net/openlp/+bug/598393
Bug #719102 in OpenLP: "editing author after editing song causes traceback"
https://bugs.launchpad.net/openlp/+bug/719102
Bug #730979 in OpenLP: "Song export crashes"
https://bugs.launchpad.net/openlp/+bug/730979
Bug #747206 in OpenLP: "Missing dictionary for spell check prevents program start"
https://bugs.launchpad.net/openlp/+bug/747206
For more details, see:
https://code.launchpad.net/~googol-hush/openlp/fixes/+merge/56808
Hello,
- do not try to load en_US if enchant.Dict() failed (bug #747206)
I think in the future, we should add a setting where we list all available dicts and let the user decide himself. Maybe also on a per session basis.
--
https://code.launchpad.net/~googol-hush/openlp/fixes/+merge/56808
Your team OpenLP Core is requested to review the proposed merge of lp:~googol-hush/openlp/fixes into lp:openlp.
=== modified file 'openlp/core/lib/spelltextedit.py'
--- openlp/core/lib/spelltextedit.py 2011-03-24 19:04:02 +0000
+++ openlp/core/lib/spelltextedit.py 2011-04-07 17:39:29 +0000
@@ -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,6 +38,8 @@
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.
@@ -48,10 +50,10 @@
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
+ log.debug(u'Could not load default dictionary')
def mousePressEvent(self, event):
"""
@@ -78,7 +80,8 @@
self.setTextCursor(cursor)
# Check if the selected word is misspelled and offer spelling
# suggestions if it is.
- if ENCHANT_AVAILABLE and self.textCursor().hasSelection():
+ if ENCHANT_AVAILABLE and hasattr(self, u'dictionary') and \
+ self.textCursor().hasSelection():
text = unicode(self.textCursor().selectedText())
if not self.dictionary.check(text):
spell_menu = QtGui.QMenu(translate('OpenLP.SpellTextEdit',
=== modified file 'openlp/plugins/presentations/lib/presentationcontroller.py'
--- openlp/plugins/presentations/lib/presentationcontroller.py 2011-03-24 19:04:02 +0000
+++ openlp/plugins/presentations/lib/presentationcontroller.py 2011-04-07 17:39:29 +0000
@@ -105,7 +105,7 @@
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
"""
Follow ups