← Back to team overview

openlp-core team mailing list archive

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

 

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

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #707725 in OpenLP: "Live mode, down arrow loops within service items"
  https://bugs.launchpad.net/openlp/+bug/707725
  Bug #730160 in OpenLP: ""Display if a single screen" does not work"
  https://bugs.launchpad.net/openlp/+bug/730160
  Bug #730474 in OpenLP: "Does not add big media to OOS"
  https://bugs.launchpad.net/openlp/+bug/730474

For more details, see:
https://code.launchpad.net/~trb143/openlp/general/+merge/53512

Various fixes:
Allow ServiceManager to use Cursor keys correctly and and Expand/Collapse to get at leaves.
Add "Display if Single " Fix.
Block Start / End time for files over 50 Meg. 
-- 
https://code.launchpad.net/~trb143/openlp/general/+merge/53512
Your team OpenLP Core is requested to review the proposed merge of lp:~trb143/openlp/general into lp:openlp.
=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py	2011-03-13 15:01:01 +0000
+++ openlp/core/lib/serviceitem.py	2011-03-15 20:07:31 +0000
@@ -62,7 +62,7 @@
     AddIfNewItem = 9
     ProvidesOwnDisplay = 10
     AllowsDetailedTitleDisplay = 11
-    AllowsVarableStartTime = 12
+    AllowsVariableStartTime = 12
 
 
 class ServiceItem(object):
@@ -447,4 +447,4 @@
         elif not start and end:
             return end
         else:
-            return u'%s : %s' % (start, end)
+            return u'%s : %s' % (start, end)
\ No newline at end of file

=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py	2011-03-15 19:23:05 +0000
+++ openlp/core/ui/maindisplay.py	2011-03-15 20:07:31 +0000
@@ -153,7 +153,7 @@
             self.initialFrame = QtGui.QImage(
                 self.screens.current[u'size'].width(),
                 self.screens.current[u'size'].height(),
-                QtGui.QImage.Format_ARGB32_Premultiplied)            
+                QtGui.QImage.Format_ARGB32_Premultiplied)
             painter_image = QtGui.QPainter()
             painter_image.begin(self.initialFrame)
             painter_image.fillRect(self.initialFrame.rect(), background_color)
@@ -166,7 +166,7 @@
             serviceItem.bg_image_bytes = image_to_byte(self.initialFrame)
             self.webView.setHtml(build_html(serviceItem, self.screen,
                 self.alertTab, self.isLive, None))
-            self.__hideMouse()  
+            self.__hideMouse()
             # To display or not to display?
             if not self.screen[u'primary']:
                 self.show()
@@ -199,7 +199,7 @@
         `slide`
             The slide text to be displayed
         """
-        log.debug(u'alert to display')  
+        log.debug(u'alert to display')
         if self.height() != self.screen[u'size'].height() \
             or not self.isVisible() or self.videoWidget.isVisible():
             shrink = True
@@ -434,7 +434,14 @@
             if self.hideMode:
                 self.hideDisplay(self.hideMode)
             else:
-                self.setVisible(True)
+                # Single screen active
+                if self.screens.monitor_number == 0:
+                    # Only make visible if setting enabled
+                    if QtCore.QSettings().value(u'general/display on monitor',
+                        QtCore.QVariant(True)).toBool():
+                        self.setVisible(True)
+                else:
+                    self.setVisible(True)
         preview = QtGui.QImage(self.screen[u'size'].width(),
             self.screen[u'size'].height(),
             QtGui.QImage.Format_ARGB32_Premultiplied)

=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py	2011-03-10 18:31:34 +0000
+++ openlp/core/ui/servicemanager.py	2011-03-15 20:07:31 +0000
@@ -49,6 +49,19 @@
         QtGui.QTreeWidget.__init__(self, parent)
         self.mainwindow = mainwindow
 
+    def keyPressEvent(self, event):
+        if isinstance(event, QtGui.QKeyEvent):
+            # here accept the event and do something
+            if event.key() == QtCore.Qt.Key_Up:
+                self.mainwindow.onMoveSelectionUp()
+                event.accept()
+            elif event.key() == QtCore.Qt.Key_Down:
+                self.mainwindow.onMoveSelectionDown()
+                event.accept()
+            event.ignore()
+        else:
+            event.ignore()
+
     def mouseMoveEvent(self, event):
         """
         Drag and drop event does not care what data is selected
@@ -197,13 +210,13 @@
             u':/services/service_expand_all.png',
             translate('OpenLP.ServiceManager',
             'Expand all the service items.'),
-            self.onExpandAll)
+            self.onExpandAll, shortcut=QtCore.Qt.Key_Plus)
         self.serviceManagerList.collapse = self.orderToolbar.addToolbarButton(
             translate('OpenLP.ServiceManager', '&Collapse all'),
             u':/services/service_collapse_all.png',
             translate('OpenLP.ServiceManager',
             'Collapse all the service items.'),
-            self.onCollapseAll)
+            self.onCollapseAll, shortcut=QtCore.Qt.Key_Minus)
         self.orderToolbar.addSeparator()
         self.serviceManagerList.makeLive = self.orderToolbar.addToolbarButton(
             translate('OpenLP.ServiceManager', 'Go Live'),
@@ -293,7 +306,9 @@
             self.serviceManagerList.moveTop,
             self.serviceManagerList.moveBottom,
             self.serviceManagerList.up,
-            self.serviceManagerList.down
+            self.serviceManagerList.down,
+            self.serviceManagerList.expand,
+            self.serviceManagerList.collapse
             ])
         self.configUpdated()
 
@@ -306,6 +321,9 @@
         actionList.add_action(self.serviceManagerList.makeLive, u'Service')
         actionList.add_action(self.serviceManagerList.up, u'Service')
         actionList.add_action(self.serviceManagerList.down, u'Service')
+        actionList.add_action(self.serviceManagerList.expand, u'Service')
+        actionList.add_action(self.serviceManagerList.collapse, u'Service')
+
 
     def setModified(self, modified=True):
         """
@@ -600,7 +618,7 @@
         if item.parent() is None:
             self.notesAction.setVisible(True)
         if serviceItem[u'service_item']\
-            .is_capable(ItemCapabilities.AllowsVarableStartTime):
+            .is_capable(ItemCapabilities.AllowsVariableStartTime):
             self.timeAction.setVisible(True)
         self.themeMenu.menuAction().setVisible(False)
         if serviceItem[u'service_item'].is_text():
@@ -887,7 +905,7 @@
                 child.setText(0, text[:40])
                 child.setData(0, QtCore.Qt.UserRole, QtCore.QVariant(count))
                 if item[u'service_item'] \
-                    .is_capable(ItemCapabilities.AllowsVarableStartTime):
+                    .is_capable(ItemCapabilities.AllowsVariableStartTime):
                     tip = item[u'service_item'].get_media_time()
                     if tip:
                         child.setToolTip(0, tip)
@@ -1238,4 +1256,4 @@
         Print a Service Order Sheet.
         """
         settingDialog = PrintServiceForm(self.mainwindow, self)
-        settingDialog.exec_()
+        settingDialog.exec_()
\ No newline at end of file

=== modified file 'openlp/plugins/media/lib/mediaitem.py'
--- openlp/plugins/media/lib/mediaitem.py	2011-02-24 05:47:38 +0000
+++ openlp/plugins/media/lib/mediaitem.py	2011-03-15 20:07:31 +0000
@@ -132,14 +132,18 @@
             self.mediaObject.play()
             service_item.title = unicode(self.plugin.nameStrings[u'singular'])
             service_item.add_capability(ItemCapabilities.RequiresMedia)
-            service_item.add_capability(ItemCapabilities.AllowsVarableStartTime)
             # force a nonexistent theme
             service_item.theme = -1
             frame = u':/media/image_clapperboard.png'
             (path, name) = os.path.split(filename)
-            while not self.mediaState:
-                Receiver.send_message(u'openlp_process_events')
-            service_item.media_length = self.mediaLength
+            file_size = os.path.getsize(filename)
+            # File too big for processing
+            if file_size <= 52428800: # 50MiB
+                while not self.mediaState:
+                    Receiver.send_message(u'openlp_process_events')
+                service_item.media_length = self.mediaLength
+                service_item.add_capability(
+                    ItemCapabilities.AllowsVariableStartTime)
             service_item.add_from_command(path, name, frame)
             return True
         else:
@@ -185,4 +189,4 @@
         if newState == Phonon.PlayingState:
             self.mediaState = newState
             self.mediaLength = self.mediaObject.totalTime()/1000
-            self.mediaObject.stop()
+            self.mediaObject.stop()
\ No newline at end of file