← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~trb143/openlp/bugfixes1 into lp:openlp

 

Tim Bentley has proposed merging lp:~trb143/openlp/bugfixes1 into lp:openlp.

Requested reviews:
  Jonathan Corwin (j-corwin)
Related bugs:
  #637547 Editing a song in a loaded service file crashes
  https://bugs.launchpad.net/bugs/637547
  #637886 Replacing live video background with nothing live causes crash
  https://bugs.launchpad.net/bugs/637886
  #641644 "blank" modes still not worrking correctly!
  https://bugs.launchpad.net/bugs/641644
  #642778 enchant.DictNotFoundError: Dictionary for language 'ja_JP' could not be found
  https://bugs.launchpad.net/bugs/642778


Bug fixes for spellchecking and hiding displays.

Fix silly bug with languages if no language files loaded.
-- 
https://code.launchpad.net/~trb143/openlp/bugfixes1/+merge/36173
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/renderer.py'
--- openlp/core/lib/renderer.py	2010-09-17 20:32:00 +0000
+++ openlp/core/lib/renderer.py	2010-09-21 17:39:40 +0000
@@ -87,7 +87,7 @@
         """
         log.debug(u'set_text_rectangle %s , %s' % (rect_main, rect_footer))
         self._rect = rect_main
-        self._rect_footer = rect_footer 
+        self._rect_footer = rect_footer
         self.page_width = self._rect.width()
         self.page_height = self._rect.height()
         if self._theme.display_shadow:
@@ -102,7 +102,7 @@
             u'*{margin: 0; padding: 0; border: 0;} '\
             u'#main {position:absolute; top:0px; %s %s}</style><body>' \
             u'<div id="main">' % \
-            (build_lyrics_format_css(self._theme, self.page_width, 
+            (build_lyrics_format_css(self._theme, self.page_width,
             self.page_height), build_lyrics_outline_css(self._theme))
 
     def set_frame_dest(self, frame_width, frame_height):
@@ -125,7 +125,7 @@
                 self.frame.width(), self.frame.height())
         if self._theme.background_type == u'image':
             self.bg_frame = QtGui.QImage(self.frame.width(),
-                self.frame.height(), 
+                self.frame.height(),
                 QtGui.QImage.Format_ARGB32_Premultiplied)
             painter = QtGui.QPainter()
             painter.begin(self.bg_frame)

=== modified file 'openlp/core/lib/spelltextedit.py'
--- openlp/core/lib/spelltextedit.py	2010-09-04 10:39:48 +0000
+++ openlp/core/lib/spelltextedit.py	2010-09-21 17:39:40 +0000
@@ -28,6 +28,7 @@
 import sys
 try:
     import enchant
+    from enchant import DictNotFoundError
     enchant_available = True
 except ImportError:
     enchant_available = False
@@ -42,10 +43,14 @@
     def __init__(self, *args):
         QtGui.QPlainTextEdit.__init__(self, *args)
         # Default dictionary based on the current locale.
-        if enchant_available:
-            self.dict = enchant.Dict()
-            self.highlighter = Highlighter(self.document())
-            self.highlighter.setDict(self.dict)
+        self.enchant_available = enchant_available
+        if self.enchant_available:
+            try:
+                self.dict = enchant.Dict()
+                self.highlighter = Highlighter(self.document())
+                self.highlighter.setDict(self.dict)
+            except DictNotFoundError:
+                self.enchant_available = False
 
     def mousePressEvent(self, event):
         if event.button() == QtCore.Qt.RightButton:
@@ -66,7 +71,7 @@
         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 self.enchant_available and self.textCursor().hasSelection():
             text = unicode(self.textCursor().selectedText())
             if not self.dict.check(text):
                 spell_menu = QtGui.QMenu(translate('OpenLP.SpellTextEdit',

=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py	2010-09-19 20:59:00 +0000
+++ openlp/core/ui/maindisplay.py	2010-09-21 17:39:40 +0000
@@ -122,12 +122,12 @@
             self.scene = QtGui.QGraphicsScene(self)
             self.setScene(self.scene)
             self.scene.addItem(self.webView)
-            self.webView.setGeometry(QtCore.QRectF(0, 0, 
+            self.webView.setGeometry(QtCore.QRectF(0, 0,
                 self.screen[u'size'].width(), self.screen[u'size'].height()))
         except AttributeError:
             #  QGraphicsWebView a recent addition, so fall back to QWebView
             self.webView = QtWebKit.QWebView(self)
-            self.webView.setGeometry(0, 0, 
+            self.webView.setGeometry(0, 0,
                 self.screen[u'size'].width(), self.screen[u'size'].height())
         self.page = self.webView.page()
         self.frame = self.page.mainFrame()
@@ -164,7 +164,7 @@
                     - splash_image.height()) / 2,
                 splash_image)
             serviceItem = ServiceItem()
-            serviceItem.bg_frame = initialFrame
+            serviceItem.bg_image_bytes = image_to_byte(initialFrame)
             self.webView.setHtml(build_html(serviceItem, self.screen,
                 self.parent.alertTab, self.isLive))
             self.initialFrame = True
@@ -326,8 +326,9 @@
         # Important otherwise first preview will miss the background !
         while not self.loaded:
             Receiver.send_message(u'openlp_process_events')
-        if self.isLive:
-            self.setVisible(True)
+        # if was hidden keep it hidden
+        if self.hide_mode and self.isLive:
+            self.hideDisplay(self.hide_mode)
         preview = QtGui.QImage(self.screen[u'size'].width(),
             self.screen[u'size'].height(),
             QtGui.QImage.Format_ARGB32_Premultiplied)
@@ -335,7 +336,6 @@
         painter.setRenderHint(QtGui.QPainter.Antialiasing)
         self.frame.render(painter)
         painter.end()
-        # Make display show up if in single screen mode
         return preview
 
     def buildHtml(self, serviceItem):

=== modified file 'openlp/core/utils/languagemanager.py'
--- openlp/core/utils/languagemanager.py	2010-09-16 20:40:12 +0000
+++ openlp/core/utils/languagemanager.py	2010-09-21 17:39:40 +0000
@@ -107,19 +107,20 @@
         ``action``
             The language menu option
         """
-        action_name = u'%s' % action.objectName()
-        qm_list = LanguageManager.get_qm_list()
-        if LanguageManager.auto_language:
-            language = u'[%s]' % qm_list[action_name]
-        else:
-            language = u'%s' % qm_list[action_name]
-        QtCore.QSettings().setValue(
-            u'general/language', QtCore.QVariant(language))
-        log.info(u'Language file: \'%s\' written to conf file' % language)
-        QtGui.QMessageBox.information(None,
-            translate('OpenLP.LanguageManager', 'Language'),
-            translate('OpenLP.LanguageManager',
-                'Please restart OpenLP to use your new language setting.'))
+        if action:
+            action_name = u'%s' % action.objectName()
+            qm_list = LanguageManager.get_qm_list()
+            if LanguageManager.auto_language:
+                language = u'[%s]' % qm_list[action_name]
+            else:
+                language = u'%s' % qm_list[action_name]
+            QtCore.QSettings().setValue(
+                u'general/language', QtCore.QVariant(language))
+            log.info(u'Language file: \'%s\' written to conf file' % language)
+            QtGui.QMessageBox.information(None,
+                translate('OpenLP.LanguageManager', 'Language'),
+                translate('OpenLP.LanguageManager',
+                    'Please restart OpenLP to use your new language setting.'))
 
     @staticmethod
     def init_qm_list():

=== modified file 'openlp/plugins/alerts/alertsplugin.py'
--- openlp/plugins/alerts/alertsplugin.py	2010-08-28 15:49:51 +0000
+++ openlp/plugins/alerts/alertsplugin.py	2010-09-21 17:39:40 +0000
@@ -40,7 +40,7 @@
     log.info(u'Alerts Plugin loaded')
 
     def __init__(self, plugin_helpers):
-        Plugin.__init__(self, u'Alerts', u'1.9.2', plugin_helpers)
+        Plugin.__init__(self, u'Alerts', u'1.9.3', plugin_helpers)
         self.weight = -3
         self.icon = build_icon(u':/plugins/plugin_alerts.png')
         self.alertsmanager = AlertsManager(self)

=== modified file 'openlp/plugins/bibles/bibleplugin.py'
--- openlp/plugins/bibles/bibleplugin.py	2010-07-31 00:05:27 +0000
+++ openlp/plugins/bibles/bibleplugin.py	2010-09-21 17:39:40 +0000
@@ -37,7 +37,7 @@
     log.info(u'Bible Plugin loaded')
 
     def __init__(self, plugin_helpers):
-        Plugin.__init__(self, u'Bibles', u'1.9.2', plugin_helpers)
+        Plugin.__init__(self, u'Bibles', u'1.9.3', plugin_helpers)
         self.weight = -9
         self.icon_path = u':/plugins/plugin_bibles.png'
         self.icon = build_icon(self.icon_path)

=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py	2010-09-14 14:21:44 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py	2010-09-21 17:39:40 +0000
@@ -376,9 +376,6 @@
     def onSearchProgressShow(self):
         self.SearchProgress.setVisible(True)
         Receiver.send_message(u'openlp_process_events')
-        #self.SearchProgress.setMinimum(0)
-        #self.SearchProgress.setMaximum(2)
-        #self.SearchProgress.setValue(1)
 
     def onSearchProgressHide(self):
         self.SearchProgress.setVisible(False)
@@ -414,6 +411,7 @@
     def onAdvancedToChapter(self):
         frm = unicode(self.AdvancedFromChapter.currentText())
         to = unicode(self.AdvancedToChapter.currentText())
+        print frm ,  to
         if frm != to:
             bible = unicode(self.AdvancedVersionComboBox.currentText())
             book = unicode(self.AdvancedBookComboBox.currentText())

=== modified file 'openlp/plugins/custom/customplugin.py'
--- openlp/plugins/custom/customplugin.py	2010-07-31 00:05:27 +0000
+++ openlp/plugins/custom/customplugin.py	2010-09-21 17:39:40 +0000
@@ -47,7 +47,7 @@
     log.info(u'Custom Plugin loaded')
 
     def __init__(self, plugin_helpers):
-        Plugin.__init__(self, u'Custom', u'1.9.2', plugin_helpers)
+        Plugin.__init__(self, u'Custom', u'1.9.3', plugin_helpers)
         self.weight = -5
         self.custommanager = Manager(u'custom', init_schema)
         self.edit_custom_form = EditCustomForm(self.custommanager)

=== modified file 'openlp/plugins/images/imageplugin.py'
--- openlp/plugins/images/imageplugin.py	2010-07-31 00:05:27 +0000
+++ openlp/plugins/images/imageplugin.py	2010-09-21 17:39:40 +0000
@@ -35,7 +35,7 @@
     log.info(u'Image Plugin loaded')
 
     def __init__(self, plugin_helpers):
-        Plugin.__init__(self, u'Images', u'1.9.2', plugin_helpers)
+        Plugin.__init__(self, u'Images', u'1.9.3', plugin_helpers)
         self.weight = -7
         self.icon_path = u':/plugins/plugin_images.png'
         self.icon = build_icon(self.icon_path)

=== modified file 'openlp/plugins/media/mediaplugin.py'
--- openlp/plugins/media/mediaplugin.py	2010-07-31 00:05:27 +0000
+++ openlp/plugins/media/mediaplugin.py	2010-09-21 17:39:40 +0000
@@ -37,7 +37,7 @@
     log.info(u'%s MediaPlugin loaded', __name__)
 
     def __init__(self, plugin_helpers):
-        Plugin.__init__(self, u'Media', u'1.9.2', plugin_helpers)
+        Plugin.__init__(self, u'Media', u'1.9.3', plugin_helpers)
         self.weight = -6
         self.icon_path = u':/plugins/plugin_media.png'
         self.icon = build_icon(self.icon_path)

=== modified file 'openlp/plugins/presentations/presentationplugin.py'
--- openlp/plugins/presentations/presentationplugin.py	2010-07-31 00:05:27 +0000
+++ openlp/plugins/presentations/presentationplugin.py	2010-09-21 17:39:40 +0000
@@ -51,7 +51,7 @@
         """
         log.debug(u'Initialised')
         self.controllers = {}
-        Plugin.__init__(self, u'Presentations', u'1.9.2', plugin_helpers)
+        Plugin.__init__(self, u'Presentations', u'1.9.3', plugin_helpers)
         self.weight = -8
         self.icon_path = u':/plugins/plugin_presentations.png'
         self.icon = build_icon(self.icon_path)

=== modified file 'openlp/plugins/remotes/remoteplugin.py'
--- openlp/plugins/remotes/remoteplugin.py	2010-07-30 22:12:04 +0000
+++ openlp/plugins/remotes/remoteplugin.py	2010-09-21 17:39:40 +0000
@@ -38,7 +38,7 @@
         """
         remotes constructor
         """
-        Plugin.__init__(self, u'Remotes', u'1.9.2', plugin_helpers)
+        Plugin.__init__(self, u'Remotes', u'1.9.3', plugin_helpers)
         self.icon = build_icon(u':/plugins/plugin_remote.png')
         self.weight = -1
         self.server = None

=== modified file 'openlp/plugins/songs/songsplugin.py'
--- openlp/plugins/songs/songsplugin.py	2010-08-26 19:45:09 +0000
+++ openlp/plugins/songs/songsplugin.py	2010-09-21 17:39:40 +0000
@@ -50,7 +50,7 @@
         """
         Create and set up the Songs plugin.
         """
-        Plugin.__init__(self, u'Songs', u'1.9.2', plugin_helpers)
+        Plugin.__init__(self, u'Songs', u'1.9.3', plugin_helpers)
         self.weight = -10
         self.manager = Manager(u'songs', init_schema)
         self.icon_path = u':/plugins/plugin_songs.png'

=== modified file 'openlp/plugins/songusage/songusageplugin.py'
--- openlp/plugins/songusage/songusageplugin.py	2010-08-02 19:05:40 +0000
+++ openlp/plugins/songusage/songusageplugin.py	2010-09-21 17:39:40 +0000
@@ -41,7 +41,7 @@
     log.info(u'SongUsage Plugin loaded')
 
     def __init__(self, plugin_helpers):
-        Plugin.__init__(self, u'SongUsage', u'1.9.2', plugin_helpers)
+        Plugin.__init__(self, u'SongUsage', u'1.9.3', plugin_helpers)
         self.weight = -4
         self.icon = build_icon(u':/plugins/plugin_songusage.png')
         self.songusagemanager = None


Follow ups