← Back to team overview

openlp-core team mailing list archive

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

 

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

Requested reviews:
  Raoul Snyman (raoul-snyman)
  Andreas Preikschat (googol)
Related bugs:
  Bug #752374 in OpenLP: "zipping through service with arrows"
  https://bugs.launchpad.net/openlp/+bug/752374
  Bug #763583 in OpenLP: "Songs should be able to be Cloned"
  https://bugs.launchpad.net/openlp/+bug/763583
  Bug #795980 in OpenLP: ""Replace Background" is reset when sending an item live but there has not been sent an item live before"
  https://bugs.launchpad.net/openlp/+bug/795980

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

Add ability to clone a song with a full copy of it.
Add missing build_icon and line wrap error.

Slow down event generation to stop flood of messages which crash the system.  UI does not notice the change.

Changes for 795980 also included
-- 
https://code.launchpad.net/~trb143/openlp/fbeta3/+merge/66898
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/mediamanageritem.py'
--- openlp/core/lib/mediamanageritem.py	2011-06-12 16:02:52 +0000
+++ openlp/core/lib/mediamanageritem.py	2011-07-05 13:04:31 +0000
@@ -288,6 +288,7 @@
                 self.listView, u':/general/general_add.png',
                 translate('OpenLP.MediaManagerItem',
                 '&Add to selected Service Item'), self.onAddEditClick)
+        self.addCustomContextActions()
         # Create the context menu and add all actions from the listView.
         self.menu = QtGui.QMenu()
         self.menu.addActions(self.listView.actions())
@@ -301,6 +302,13 @@
             QtCore.SIGNAL('customContextMenuRequested(QPoint)'),
             self.contextMenu)
 
+    def addCustomContextActions(self):
+        """
+        Implement this method in your descendent media manager item to
+        add any context menu items. This method is called automatically.
+        """
+        pass
+
     def initialise(self):
         """
         Implement this method in your descendent media manager item to

=== modified file 'openlp/core/resources.py'
--- openlp/core/resources.py	2011-06-12 16:02:52 +0000
+++ openlp/core/resources.py	2011-07-05 13:04:31 +0000
@@ -81732,6 +81732,41 @@
 \xce\x01\x59\x40\xf1\xfb\xc4\xc0\x91\x88\xc4\x30\x9e\x9f\xaf\xc9\
 \x06\x51\x54\x9d\xd3\x94\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\
 \x60\x82\
+\x00\x00\x02\x0f\
+\x89\
+\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
+\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xff\x61\
+\x00\x00\x00\x04\x73\x42\x49\x54\x08\x08\x08\x08\x7c\x08\x64\x88\
+\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x01\xbb\x00\x00\x01\xbb\
+\x01\x3a\xec\xe3\xe2\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\
+\x74\x77\x61\x72\x65\x00\x77\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\
+\x70\x65\x2e\x6f\x72\x67\x9b\xee\x3c\x1a\x00\x00\x01\x8c\x49\x44\
+\x41\x54\x38\x8d\x8d\x92\xbb\x4e\x2b\x41\x0c\x86\x3f\xdb\x2b\x85\
+\x02\xf2\x04\x48\x34\xa7\xa0\xe2\x0d\xd8\x77\x80\xbc\x09\x05\x20\
+\x85\xee\x34\xa7\x3d\x05\x3d\x12\x75\x24\xa0\x41\x88\x9a\x0e\x9a\
+\x40\x09\x81\x2a\x0a\x2b\xa2\x54\x89\x94\xcd\xc5\x14\x7b\xc9\x64\
+\x97\x82\x91\xac\xd1\x78\xc7\x9f\xff\xf9\xbd\x02\xfc\x01\xf6\xf8\
+\xdd\xea\xba\xfb\x6b\x98\x88\x80\xbd\xcf\x24\xe9\xb8\x83\x99\xa2\
+\x22\x88\x2a\x22\x92\x05\x80\x08\xaa\xca\xd6\xe6\x66\x0b\xa8\x01\
+\xc8\xef\x00\x90\x24\x09\xbd\xf7\x77\x34\x4f\x88\x48\x06\xc8\xce\
+\xbb\x22\xb2\x1f\xd4\x7f\x44\x00\x66\x06\xee\xa8\x2a\xdd\x6e\x97\
+\x38\x8e\x11\x35\xcc\x56\x4a\x54\x84\xd1\x68\xf4\x57\x44\xbc\xe8\
+\x78\xd6\x6e\xff\x8b\x8a\x2e\xa2\x8a\xe6\xd2\x1d\x50\xa1\x54\x10\
+\x84\x12\x3c\xab\xd9\x6c\x36\x22\xa0\x2c\xd4\x1c\x62\x66\x98\x59\
+\xe9\x47\xf9\x3d\x07\x15\x0a\x44\x84\x35\x80\x05\x80\x02\xa6\xba\
+\x32\xb6\x0a\x28\x4d\x54\x55\x24\xdf\xab\x61\xa1\x02\xd5\xda\x5c\
+\x33\x0f\xa0\x1c\x1d\x80\xe6\x97\x2d\x00\x49\xd0\x3d\xdc\x4b\x13\
+\x35\xe8\x50\xc8\xad\x16\x57\x01\x2b\x05\xe1\xdb\x02\x05\x95\x09\
+\xd4\xee\xad\xfd\x48\xe1\x2a\x67\xff\x03\xc4\xdd\x49\xd3\x94\x69\
+\x9a\xfa\xf3\xcb\x73\x3f\x02\x1c\x11\x57\x55\x09\x25\x86\x9d\xc2\
+\xe2\x7e\xbf\x4f\xa3\xb1\xc1\xff\xf3\xf3\xfb\xeb\xab\xeb\x4b\x80\
+\x1d\xe0\x00\x38\x04\x0e\xf7\xe3\xf8\x62\x32\x99\xf8\x74\x3a\xf5\
+\x34\x4d\x7d\x3e\x9f\xfb\x62\xb1\xf0\xe5\x72\xe9\xe3\xf1\xd8\x07\
+\x83\x81\x1f\x9d\x9c\x3e\x00\xdb\xee\x0e\xee\xbe\x16\xad\x56\xeb\
+\xa8\x00\xcc\x66\xb3\x35\xc0\xd7\x70\xb8\x3c\x6e\x9f\xdd\x01\xdb\
+\x90\xd5\xd6\x3c\xe8\x74\x3a\xb7\x00\x66\x56\x1b\xfa\x5b\xaf\x37\
+\x7c\x7a\x7c\xbc\x71\xf7\x61\x91\xfb\x06\x81\x94\x9d\xac\xac\xe0\
+\x78\xdb\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82\
 "
 
 qt_resource_name = "\
@@ -82335,25 +82370,30 @@
 \x0d\x5b\xec\x87\
 \x00\x67\
 \x00\x65\x00\x6e\x00\x65\x00\x72\x00\x61\x00\x6c\x00\x5f\x00\x6e\x00\x65\x00\x77\x00\x2e\x00\x70\x00\x6e\x00\x67\
+\x00\x11\
+\x07\xff\xf0\x07\
+\x00\x67\
+\x00\x65\x00\x6e\x00\x65\x00\x72\x00\x61\x00\x6c\x00\x5f\x00\x63\x00\x6c\x00\x6f\x00\x6e\x00\x65\x00\x2e\x00\x70\x00\x6e\x00\x67\
+\
 "
 
 qt_resource_struct = "\
 \x00\x00\x00\x00\x00\x02\x00\x00\x00\x10\x00\x00\x00\x01\
-\x00\x00\x00\x98\x00\x02\x00\x00\x00\x06\x00\x00\x00\x7e\
-\x00\x00\x00\x3a\x00\x02\x00\x00\x00\x04\x00\x00\x00\x7a\
-\x00\x00\x01\x06\x00\x02\x00\x00\x00\x03\x00\x00\x00\x77\
-\x00\x00\x00\x5e\x00\x02\x00\x00\x00\x14\x00\x00\x00\x63\
-\x00\x00\x00\x4e\x00\x02\x00\x00\x00\x02\x00\x00\x00\x61\
-\x00\x00\x00\xe2\x00\x02\x00\x00\x00\x05\x00\x00\x00\x5c\
-\x00\x00\x00\x84\x00\x02\x00\x00\x00\x09\x00\x00\x00\x53\
-\x00\x00\x00\x14\x00\x02\x00\x00\x00\x0b\x00\x00\x00\x48\
-\x00\x00\x00\xa6\x00\x02\x00\x00\x00\x03\x00\x00\x00\x45\
-\x00\x00\x00\xf4\x00\x02\x00\x00\x00\x10\x00\x00\x00\x35\
-\x00\x00\x00\x6e\x00\x02\x00\x00\x00\x03\x00\x00\x00\x32\
-\x00\x00\x01\x16\x00\x02\x00\x00\x00\x03\x00\x00\x00\x2f\
-\x00\x00\x00\xcc\x00\x02\x00\x00\x00\x08\x00\x00\x00\x27\
-\x00\x00\x00\x26\x00\x02\x00\x00\x00\x01\x00\x00\x00\x26\
-\x00\x00\x00\x00\x00\x02\x00\x00\x00\x10\x00\x00\x00\x16\
+\x00\x00\x00\x98\x00\x02\x00\x00\x00\x06\x00\x00\x00\x7f\
+\x00\x00\x00\x3a\x00\x02\x00\x00\x00\x04\x00\x00\x00\x7b\
+\x00\x00\x01\x06\x00\x02\x00\x00\x00\x03\x00\x00\x00\x78\
+\x00\x00\x00\x5e\x00\x02\x00\x00\x00\x14\x00\x00\x00\x64\
+\x00\x00\x00\x4e\x00\x02\x00\x00\x00\x02\x00\x00\x00\x62\
+\x00\x00\x00\xe2\x00\x02\x00\x00\x00\x05\x00\x00\x00\x5d\
+\x00\x00\x00\x84\x00\x02\x00\x00\x00\x09\x00\x00\x00\x54\
+\x00\x00\x00\x14\x00\x02\x00\x00\x00\x0b\x00\x00\x00\x49\
+\x00\x00\x00\xa6\x00\x02\x00\x00\x00\x03\x00\x00\x00\x46\
+\x00\x00\x00\xf4\x00\x02\x00\x00\x00\x10\x00\x00\x00\x36\
+\x00\x00\x00\x6e\x00\x02\x00\x00\x00\x03\x00\x00\x00\x33\
+\x00\x00\x01\x16\x00\x02\x00\x00\x00\x03\x00\x00\x00\x30\
+\x00\x00\x00\xcc\x00\x02\x00\x00\x00\x08\x00\x00\x00\x28\
+\x00\x00\x00\x26\x00\x02\x00\x00\x00\x01\x00\x00\x00\x27\
+\x00\x00\x00\x00\x00\x02\x00\x00\x00\x11\x00\x00\x00\x16\
 \x00\x00\x00\xb8\x00\x02\x00\x00\x00\x05\x00\x00\x00\x11\
 \x00\x00\x08\x52\x00\x00\x00\x00\x00\x01\x00\x0d\xd8\xc3\
 \x00\x00\x07\x90\x00\x00\x00\x00\x00\x01\x00\x03\x55\x3b\
@@ -82368,6 +82408,7 @@
 \x00\x00\x12\x26\x00\x00\x00\x00\x00\x01\x00\x13\xb1\x32\
 \x00\x00\x14\x6e\x00\x00\x00\x00\x00\x01\x00\x13\xdd\x95\
 \x00\x00\x13\x66\x00\x00\x00\x00\x00\x01\x00\x13\xc8\x84\
+\x00\x00\x14\xbc\x00\x00\x00\x00\x00\x01\x00\x13\xe2\xc1\
 \x00\x00\x12\x50\x00\x00\x00\x00\x00\x01\x00\x13\xb3\xd0\
 \x00\x00\x14\x48\x00\x00\x00\x00\x00\x01\x00\x13\xda\xc1\
 \x00\x00\x13\xf2\x00\x00\x00\x00\x00\x01\x00\x13\xd5\x16\
@@ -82485,4 +82526,3 @@
     """
     QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name,
         qt_resource_data)
-

=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py	2011-06-21 21:08:30 +0000
+++ openlp/core/ui/maindisplay.py	2011-07-05 13:04:31 +0000
@@ -233,10 +233,12 @@
         API for replacement backgrounds so Images are added directly to cache
         """
         self.image_manager.add_image(name, path)
-        self.image(name)
         if hasattr(self, u'serviceItem'):
             self.override[u'image'] = name
             self.override[u'theme'] = self.serviceItem.themedata.theme_name
+            self.image(name)
+            return True
+        return False
 
     def image(self, name):
         """
@@ -349,6 +351,9 @@
         """
         Loads and starts a video to run with the option of sound
         """
+        # We request a background video but have no service Item
+        if isBackground and not hasattr(self, u'serviceItem'):
+            return None
         if not self.mediaObject:
             self.createMediaObject()
         log.debug(u'video')

=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py	2011-07-01 08:26:26 +0000
+++ openlp/core/ui/servicemanager.py	2011-07-05 13:04:31 +0000
@@ -48,18 +48,18 @@
     """
     Set up key bindings and mouse behaviour for the service list
     """
-    def __init__(self, mainwindow, parent=None, name=None):
+    def __init__(self, serviceManager, parent=None, name=None):
         QtGui.QTreeWidget.__init__(self, parent)
-        self.mainwindow = mainwindow
+        self.serviceManager = serviceManager
 
     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()
+                self.serviceManager.onMoveSelectionUp()
                 event.accept()
             elif event.key() == QtCore.Qt.Key_Down:
-                self.mainwindow.onMoveSelectionDown()
+                self.serviceManager.onMoveSelectionDown()
                 event.accept()
             event.ignore()
         else:

=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py	2011-06-24 06:53:56 +0000
+++ openlp/core/ui/slidecontroller.py	2011-07-05 13:04:31 +0000
@@ -27,6 +27,7 @@
 
 import logging
 import os
+import time
 
 from PyQt4 import QtCore, QtGui
 from PyQt4.phonon import Phonon
@@ -412,9 +413,11 @@
         self.display.videoStop()
 
     def servicePrevious(self):
+        time.sleep(0.1)
         Receiver.send_message('servicemanager_previous_item')
 
     def serviceNext(self):
+        time.sleep(0.1)
         Receiver.send_message('servicemanager_next_item')
 
     def screenSizeChanged(self):

=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py	2011-06-12 17:56:11 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py	2011-07-05 13:04:31 +0000
@@ -34,7 +34,8 @@
     translate
 from openlp.core.lib.searchedit import SearchEdit
 from openlp.core.lib.ui import UiStrings, add_widget_completer, \
-    media_item_combo_box, critical_error_message_box, find_and_set_in_combo_box
+    media_item_combo_box, critical_error_message_box, \
+    find_and_set_in_combo_box, build_icon
 from openlp.plugins.bibles.forms import BibleImportForm
 from openlp.plugins.bibles.lib import LayoutStyle, DisplayStyle, \
     VerseReferenceList, get_reference_match
@@ -57,8 +58,8 @@
 
     def __init__(self, parent, plugin, icon):
         self.IconPath = u'songs/song'
-        self.lockIcon = QtGui.QIcon(u':/bibles/bibles_search_lock.png')
-        self.unlockIcon = QtGui.QIcon(u':/bibles/bibles_search_unlock.png')
+        self.lockIcon = build_icon(u':/bibles/bibles_search_lock.png')
+        self.unlockIcon = build_icon(u':/bibles/bibles_search_unlock.png')
         MediaManagerItem.__init__(self, parent, plugin, icon)
         # Place to store the search results for both bibles.
         self.settings = self.plugin.settings_tab
@@ -983,7 +984,8 @@
         Search for some Bible verses (by reference).
         """
         bible = unicode(self.quickVersionComboBox.currentText())
-        search_results = self.plugin.manager.get_verses(bible, string, False, False)
+        search_results = self.plugin.manager.get_verses(bible, string, False,
+            False)
         if search_results:
             versetext = u' '.join([verse.text for verse in search_results])
             return [[string, versetext]]

=== modified file 'openlp/plugins/images/lib/mediaitem.py'
--- openlp/plugins/images/lib/mediaitem.py	2011-06-12 17:56:11 +0000
+++ openlp/plugins/images/lib/mediaitem.py	2011-07-05 13:04:31 +0000
@@ -208,8 +208,13 @@
             filename = unicode(bitem.data(QtCore.Qt.UserRole).toString())
             if os.path.exists(filename):
                 (path, name) = os.path.split(filename)
-                self.plugin.liveController.display.directImage(name, filename)
-                self.resetAction.setVisible(True)
+                if self.plugin.liveController.display.directImage(name,
+                    filename):
+                    self.resetAction.setVisible(True)
+                else:
+                    critical_error_message_box(UiStrings().LiveBGError,
+                        translate('ImagePlugin.MediaItem',
+                        'There was no display item to amend.'))
             else:
                 critical_error_message_box(UiStrings().LiveBGError,
                     unicode(translate('ImagePlugin.MediaItem',

=== modified file 'openlp/plugins/media/lib/mediaitem.py'
--- openlp/plugins/media/lib/mediaitem.py	2011-06-12 17:56:11 +0000
+++ openlp/plugins/media/lib/mediaitem.py	2011-07-05 13:04:31 +0000
@@ -114,8 +114,12 @@
             filename = unicode(item.data(QtCore.Qt.UserRole).toString())
             if os.path.exists(filename):
                 (path, name) = os.path.split(filename)
-                self.plugin.liveController.display.video(filename, 0, True)
-                self.resetAction.setVisible(True)
+                if self.plugin.liveController.display.video(filename, 0, True):
+                    self.resetAction.setVisible(True)
+                else:
+                    critical_error_message_box(UiStrings().LiveBGError,
+                        translate('MediaPlugin.MediaItem',
+                        'There was no display item to amend.'))
             else:
                 critical_error_message_box(UiStrings().LiveBGError,
                     unicode(translate('MediaPlugin.MediaItem',

=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py	2011-06-29 06:53:15 +0000
+++ openlp/plugins/songs/lib/mediaitem.py	2011-07-05 13:04:31 +0000
@@ -35,7 +35,8 @@
 from openlp.core.lib import MediaManagerItem, Receiver, ItemCapabilities, \
     translate, check_item_selected, PluginStatus
 from openlp.core.lib.searchedit import SearchEdit
-from openlp.core.lib.ui import UiStrings
+from openlp.core.lib.ui import UiStrings, context_menu_action, \
+    context_menu_separator
 from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \
     SongImportForm, SongExportForm
 from openlp.plugins.songs.lib import OpenLyrics, SongXML, VerseType, \
@@ -128,6 +129,13 @@
             QtCore.SIGNAL(u'searchTypeChanged(int)'),
             self.onSearchTextButtonClick)
 
+    def addCustomContextActions(self):
+        context_menu_separator(self.listView)
+        context_menu_action(
+            self.listView, u':/general/general_clone.png',
+            translate('OpenLP.MediaManagerItem',
+            '&Clone'), self.onCloneClick)
+
     def onFocus(self):
         self.searchTextEdit.setFocus()
 
@@ -366,6 +374,23 @@
                 self.plugin.manager.delete_object(Song, item_id)
             self.onSearchTextButtonClick()
 
+    def onCloneClick(self):
+        """
+        Clone a Song
+        """
+        log.debug(u'onCloneClick')
+        if check_item_selected(self.listView, UiStrings().SelectEdit):
+            self.editItem = self.listView.currentItem()
+            item_id = (self.editItem.data(QtCore.Qt.UserRole)).toInt()[0]
+            old_song = self.plugin.manager.get_object(Song, item_id)
+            song_xml = self.openLyrics.song_to_xml(old_song)
+            new_song_id = self.openLyrics.xml_to_song(song_xml)
+            new_song = self.plugin.manager.get_object(Song, new_song_id)
+            new_song.title = u'%s <%s>' % (new_song.title,
+                translate('SongsPlugin.MediaItem', 'copy'))
+            self.plugin.manager.save_object(new_song)
+        self.onSongListLoad()
+
     def generateSlideData(self, service_item, item=None, xmlVersion=False):
         log.debug(u'generateSlideData (%s:%s)' % (service_item, item))
         item_id = self._getIdOfItemToGenerate(item, self.remoteSong)

=== added file 'resources/images/general_clone.png'
Binary files resources/images/general_clone.png	1970-01-01 00:00:00 +0000 and resources/images/general_clone.png	2011-07-05 13:04:31 +0000 differ
=== modified file 'resources/images/openlp-2.qrc'
--- resources/images/openlp-2.qrc	2011-05-25 14:29:16 +0000
+++ resources/images/openlp-2.qrc	2011-07-05 13:04:31 +0000
@@ -56,6 +56,7 @@
     <file>general_save.png</file>
     <file>general_email.png</file>
     <file>general_revert.png</file>
+    <file>general_clone.png</file>
   </qresource>
   <qresource prefix="slides">
     <file>slide_close.png</file>


Follow ups