← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~j-corwin/openlp/general into lp:openlp

 

Jonathan Corwin has proposed merging lp:~j-corwin/openlp/general into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #634771 in OpenLP: "OpenLP 1.9.2+bzr1016-0ubuntu1~lucid1 does not start"
  https://bugs.launchpad.net/openlp/+bug/634771
  Bug #646718 in OpenLP: "Songbook, Number will not loaded, Title will not be saved"
  https://bugs.launchpad.net/openlp/+bug/646718
  Bug #696013 in OpenLP: "song import from powerpoint crashes every second time"
  https://bugs.launchpad.net/openlp/+bug/696013
  Bug #696021 in OpenLP: "presentation loader does not work fine in Windows using Powerpoint Viewer 2007"
  https://bugs.launchpad.net/openlp/+bug/696021
  Bug #696637 in OpenLP: "Alert not positioned correctly in single screen"
  https://bugs.launchpad.net/openlp/+bug/696637
  Bug #727732 in OpenLP: "Openlp 1.9.?? crashes on start"
  https://bugs.launchpad.net/openlp/+bug/727732
  Bug #735039 in OpenLP: "Cannot import PowerPoint Presentations with PowerPoint 2010"
  https://bugs.launchpad.net/openlp/+bug/735039

For more details, see:
https://code.launchpad.net/~j-corwin/openlp/general/+merge/60324

Attempt to fix the incorrect hostname appearing in remotetab
Change remote api so it returns just text without tags. (Bug 779553)
New html element that returns it all.
-- 
https://code.launchpad.net/~j-corwin/openlp/general/+merge/60324
Your team OpenLP Core is requested to review the proposed merge of lp:~j-corwin/openlp/general into lp:openlp.
=== modified file 'openlp/plugins/remotes/html/openlp.js'
--- openlp/plugins/remotes/html/openlp.js	2011-05-07 08:27:43 +0000
+++ openlp/plugins/remotes/html/openlp.js	2011-05-08 19:44:23 +0000
@@ -63,8 +63,10 @@
         var ul = $("#slide-controller > div[data-role=content] > ul[data-role=listview]");
         ul.html("");
         for (idx in data.results.slides) {
+          var text = data.results.slides[idx]["text"];
+          text = text.replace(/\n/g, '<br />');
           var li = $("<li data-icon=\"false\">").append(
-            $("<a href=\"#\">").attr("value", parseInt(idx, 10)).html(data.results.slides[idx]["text"]));
+            $("<a href=\"#\">").attr("value", parseInt(idx, 10)).html(text));
           if (data.results.slides[idx]["selected"]) {
             li.attr("data-theme", "e");
           }

=== modified file 'openlp/plugins/remotes/html/stage.js'
--- openlp/plugins/remotes/html/stage.js	2011-05-07 08:18:02 +0000
+++ openlp/plugins/remotes/html/stage.js	2011-05-08 19:44:23 +0000
@@ -65,10 +65,15 @@
   updateSlide: function() {
     $("#verseorder span").removeClass("currenttag");
     $("#tag" + OpenLP.currentSlide).addClass("currenttag");
-    $("#currentslide").html(OpenLP.currentSlides[OpenLP.currentSlide]["text"]);
-    if (OpenLP.currentSlide < OpenLP.currentSlides.length - 1) 
-      $("#nextslide").html(OpenLP.currentSlides[OpenLP.currentSlide + 1]["text"]);
-    else 
+    var text = OpenLP.currentSlides[OpenLP.currentSlide]["text"];
+    text = text.replace(/\n/g, '<br />');
+    $("#currentslide").html(text);
+    if (OpenLP.currentSlide < OpenLP.currentSlides.length - 1) {
+      text = OpenLP.currentSlides[OpenLP.currentSlide + 1]["text"];
+      text = text.replace(/\n/g, '<br />');
+      $("#nextslide").html(text);
+    }
+    else
       $("#nextslide").html("Next: " + OpenLP.nextSong);
   },
   updateClock: function() {

=== modified file 'openlp/plugins/remotes/lib/httpserver.py'
--- openlp/plugins/remotes/lib/httpserver.py	2011-05-07 08:18:02 +0000
+++ openlp/plugins/remotes/lib/httpserver.py	2011-05-08 19:44:23 +0000
@@ -115,6 +115,7 @@
 import urlparse
 import re
 from pprint import pformat
+from lxml import html
 
 try:
     import json
@@ -402,10 +403,13 @@
                     item = {}
                     if current_item.is_text():
                         item[u'tag'] = unicode(frame[u'verseTag'])
-                        item[u'text'] = unicode(frame[u'html'])
+                        text = unicode(frame[u'html'].replace('<br>', '\n'))
+                        item[u'text'] = html.fromstring(text).text_content()
+                        item[u'html'] = unicode(frame[u'html'])
                     else:
                         item[u'tag'] = unicode(index)
                         item[u'text'] = u''
+                        item[u'html'] = u''
                     item[u'selected'] = (self.parent.current_slide == index)
                     data.append(item)
             json_data = {u'results': {u'slides': data}}

=== modified file 'openlp/plugins/remotes/lib/remotetab.py'
--- openlp/plugins/remotes/lib/remotetab.py	2011-05-07 22:19:42 +0000
+++ openlp/plugins/remotes/lib/remotetab.py	2011-05-08 19:44:23 +0000
@@ -93,24 +93,23 @@
             'Stage view URL:'))
 
     def setUrls(self):
-        ipAddress = None
+        ipAddress = u'localhost'
         if self.addressEdit.text() == ZERO_URL:
-            for ip in QtNetwork.QNetworkInterface.allAddresses():
-                if ip.protocol() == 0 and ip != QtNetwork.QHostAddress.LocalHost:
-                    ipAddress = ip.toString()
-                    break
+            ifaces = QtNetwork.QNetworkInterface.allInterfaces()
+            for iface in ifaces:
+                if not iface.isValid():
+                    continue
+                if not (iface.flags() & (QtNetwork.QNetworkInterface.IsUp |
+                    QtNetwork.QNetworkInterface.IsRunning)):
+                    continue
+                for addr in iface.addressEntries():
+                    ip = addr.ip()
+                    if ip.protocol() == 0 and \
+                        ip != QtNetwork.QHostAddress.LocalHost:
+                        ipAddress = ip.toString()
+                        break
         else:
             ipAddress = self.addressEdit.text()
-        if not ipAddress:
-            self.remoteUrlLabel.setVisible(False)
-            self.remoteUrl.setVisible(False)
-            self.stageUrlLabel.setVisible(False)
-            self.stageUrl.setVisible(False)
-            return
-        self.remoteUrlLabel.setVisible(True)
-        self.remoteUrl.setVisible(True)
-        self.stageUrlLabel.setVisible(True)
-        self.stageUrl.setVisible(True)
         url = u'http://%s:%s/' % (ipAddress, self.portSpinBox.value())
         self.remoteUrl.setText(u'<a href="%s">%s</a>' % (url, url))
         url = url + u'stage'


Follow ups