← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~trb143/openlp/bug-875798 into lp:openlp

 

Tim Bentley has proposed merging lp:~trb143/openlp/bug-875798 into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #875798 in OpenLP: "Alerts plugin's default settings are strange"
  https://bugs.launchpad.net/openlp/+bug/875798
  Bug #883414 in OpenLP: "Traceback when displaying an alert when the display screen is closed"
  https://bugs.launchpad.net/openlp/+bug/883414

For more details, see:
https://code.launchpad.net/~trb143/openlp/bug-875798/+merge/80729

Fix crash with alerts over video
Change default to bottom from middle
Remove unused from from previous merge
-- 
https://code.launchpad.net/~trb143/openlp/bug-875798/+merge/80729
Your team OpenLP Core is requested to review the proposed merge of lp:~trb143/openlp/bug-875798 into lp:openlp.
=== modified file 'openlp/core/lib/htmlbuilder.py'
--- openlp/core/lib/htmlbuilder.py	2011-10-16 08:25:27 +0000
+++ openlp/core/lib/htmlbuilder.py	2011-10-29 09:38:26 +0000
@@ -610,24 +610,3 @@
         theme.font_footer_size, theme.font_footer_color)
     return lyrics_html
 
-def build_alert_css(alertTab, width):
-    """
-    Build the display of the footer
-
-    ``alertTab``
-        Details from the Alert tab for fonts etc
-    """
-    style = u"""
-    width: %spx;
-    vertical-align: %s;
-    font-family: %s;
-    font-size: %spt;
-    color: %s;
-    background-color: %s;
-    """
-    if not alertTab:
-        return u''
-    align = VerticalType.Names[alertTab.location]
-    alert = style % (width, align, alertTab.font_face, alertTab.font_size,
-        alertTab.font_color, alertTab.bg_color)
-    return alert

=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py	2011-10-22 11:09:01 +0000
+++ openlp/core/ui/maindisplay.py	2011-10-29 09:38:26 +0000
@@ -213,7 +213,7 @@
         self.frame.evaluateJavaScript(u'show_text("%s")' %
             slide.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"'))
 
-    def alert(self, text):
+    def alert(self, text, location):
         """
         Display an alert.
 
@@ -241,10 +241,10 @@
                 alert_height = int(height.toString())
                 shrinkItem.resize(self.width(), alert_height)
                 shrinkItem.setVisible(True)
-                if self.alertTab.location == 1:
+                if location == 1:
                     shrinkItem.move(self.screen[u'size'].left(),
                     (self.screen[u'size'].height() - alert_height) / 2)
-                elif self.alertTab.location == 2:
+                elif location == 2:
                     shrinkItem.move(self.screen[u'size'].left(),
                         self.screen[u'size'].height() - alert_height)
             else:

=== modified file 'openlp/plugins/alerts/lib/alertsmanager.py'
--- openlp/plugins/alerts/lib/alertsmanager.py	2011-10-22 11:09:01 +0000
+++ openlp/plugins/alerts/lib/alertsmanager.py	2011-10-29 09:38:26 +0000
@@ -85,7 +85,7 @@
             return
         text = self.alertList.pop(0)
         alertTab = self.parent().settings_tab
-        self.parent().liveController.display.alert(text)
+        self.parent().liveController.display.alert(text, alertTab.location)
         # Check to see if we have a timer running.
         if self.timer_id == 0:
             self.timer_id = self.startTimer(int(alertTab.timeout) * 1000)
@@ -100,7 +100,8 @@
         """
         log.debug(u'timer event')
         if event.timerId() == self.timer_id:
-            self.parent().liveController.display.alert(u'')
+            alertTab = self.parent().settings_tab
+            self.parent().liveController.display.alert(u'', alertTab.location)
         self.killTimer(self.timer_id)
         self.timer_id = 0
         self.generateAlert()

=== modified file 'openlp/plugins/alerts/lib/alertstab.py'
--- openlp/plugins/alerts/lib/alertstab.py	2011-10-19 17:53:07 +0000
+++ openlp/plugins/alerts/lib/alertstab.py	2011-10-29 09:38:26 +0000
@@ -159,7 +159,7 @@
         self.font_face = unicode(settings.value(
             u'font face', QtCore.QVariant(QtGui.QFont().family())).toString())
         self.location = settings.value(
-            u'location', QtCore.QVariant(1)).toInt()[0]
+            u'location', QtCore.QVariant(2)).toInt()[0]
         settings.endGroup()
         self.fontSizeSpinBox.setValue(self.font_size)
         self.timeoutSpinBox.setValue(self.timeout)