← Back to team overview

openlp-core team mailing list archive

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

 

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

Requested reviews:
  Raoul Snyman (raoul-snyman)


Cleanup time.
* Management of which display to use was fragmented so consolidated
* Default display screen to last screen if first time start up
* Option to not display output if in single screen
* Do not mess with save display unless done by a human.  The code will do temporary changes if 2nd screen missing.
* Remove service item flags and introduce Capabilities which are backward compatible across openlp versions.  Current design is limited. 
-- 
https://code.launchpad.net/~trb143/openlp/bugs1/+merge/22740
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/__init__.py'
--- openlp/core/lib/__init__.py	2010-03-22 23:50:32 +0000
+++ openlp/core/lib/__init__.py	2010-04-03 07:14:15 +0000
@@ -172,7 +172,7 @@
 from xmlrootclass import XmlRootClass
 from serviceitem import ServiceItem
 from serviceitem import ServiceItemType
-from serviceitem import ServiceItem
+from serviceitem import ItemCapabilities
 from toolbar import OpenLPToolbar
 from dockwidget import OpenLPDockWidget
 from songxmlhandler import SongXMLBuilder, SongXMLParser

=== modified file 'openlp/core/lib/eventreceiver.py'
--- openlp/core/lib/eventreceiver.py	2010-03-21 23:58:01 +0000
+++ openlp/core/lib/eventreceiver.py	2010-04-03 07:14:15 +0000
@@ -109,6 +109,12 @@
     ``presentation types``
         Informs all components of the presentation types supported.
 
+    ``blank_check``
+        Check to see if th eblank display message is required
+
+    ``version_check``
+        Version has changed so pop up window.
+
     """
     def __init__(self):
         """

=== modified file 'openlp/core/lib/rendermanager.py'
--- openlp/core/lib/rendermanager.py	2010-03-21 23:58:01 +0000
+++ openlp/core/lib/rendermanager.py	2010-04-03 07:14:15 +0000
@@ -49,7 +49,7 @@
     """
     log.info(u'RenderManager Loaded')
 
-    def __init__(self, theme_manager, screens, screen_number=0):
+    def __init__(self, theme_manager, screens):
         """
         Initialise the render manager.
         """
@@ -57,7 +57,6 @@
         self.screens = screens
         self.theme_manager = theme_manager
         self.renderer = Renderer()
-        self.screens.set_current_display(screen_number)
         self.calculate_default(self.screens.current[u'size'])
         self.theme = u''
         self.service_theme = u''
@@ -65,12 +64,9 @@
         self.override_background = None
         self.themedata = None
 
-    def update_display(self, screen_number):
+    def update_display(self):
         """
         Updates the render manager's information about the current screen.
-
-        ``screen_number``
-            The updated index of the output/display screen.
         """
         log.debug(u'Update Display')
         self.calculate_default(self.screens.current[u'size'])

=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py	2010-03-30 19:01:23 +0000
+++ openlp/core/lib/serviceitem.py	2010-04-03 07:14:15 +0000
@@ -42,6 +42,13 @@
     Image = 2
     Command = 3
 
+class ItemCapabilities(object):
+   AllowsPreview = 1
+   AllowsEdit = 2
+   AllowsMaintain = 3
+   RequiresMedia = 4
+
+
 class ServiceItem(object):
     """
     The service item is a base class for the plugins to use to interact with
@@ -67,14 +74,18 @@
         self.raw_footer = None
         self.theme = None
         self.service_item_type = None
-        self.edit_enabled = False
-        self.maintain_allowed = False
         self._raw_frames = []
         self._display_frames = []
         self._uuid = unicode(uuid.uuid1())
-        self.auto_preview_allowed = False
         self.notes = u''
         self.from_plugin = False
+        self.capabilities = []
+
+    def add_capability(self, capability):
+        self.capabilities.append(capability)
+
+    def is_capable(self, capability):
+        return capability in self.capabilities
 
     def addIcon(self, icon):
         """
@@ -207,10 +218,8 @@
             u'type':self.service_item_type,
             u'audit':self.audit,
             u'notes':self.notes,
-            u'preview':self.auto_preview_allowed,
-            u'edit':self.edit_enabled,
-            u'maintain':self.maintain_allowed,
-            u'from_plugin':self.from_plugin
+            u'from_plugin':self.from_plugin,
+            u'capabilities':self.capabilities
         }
         service_data = []
         if self.service_item_type == ServiceItemType.Text:
@@ -244,11 +253,9 @@
         self.addIcon(header[u'icon'])
         self.raw_footer = header[u'footer']
         self.audit = header[u'audit']
-        self.auto_preview_allowed = header[u'preview']
         self.notes = header[u'notes']
-        self.edit_enabled = header[u'edit']
-        self.maintain_allowed = header[u'maintain']
         self.from_plugin = header[u'from_plugin']
+        self.capabilities = header[u'capabilities']
         if self.service_item_type == ServiceItemType.Text:
             for slide in serviceitem[u'serviceitem'][u'data']:
                 self._raw_frames.append(slide)
@@ -284,11 +291,8 @@
         """
         return self._uuid != other._uuid
 
-    def is_song(self):
-        return self.name.lower() == u'songs'
-
     def is_media(self):
-        return self.name.lower() == u'media'
+        return ItemCapabilities.RequiresMedia in self.capabilities
 
     def is_command(self):
         return self.service_item_type == ServiceItemType.Command

=== modified file 'openlp/core/lib/settingstab.py'
--- openlp/core/lib/settingstab.py	2010-03-21 23:58:01 +0000
+++ openlp/core/lib/settingstab.py	2010-04-03 07:14:15 +0000
@@ -54,6 +54,7 @@
             self.config = PluginConfig(title)
         else:
             self.config = PluginConfig(section)
+        self.preLoad()
         self.load()
 
     def setupUi(self):
@@ -62,6 +63,12 @@
         """
         pass
 
+    def preLoad(self):
+        """
+        Setup the tab's interface.
+        """
+        pass
+
     def retranslateUi(self):
         """
         Setup the interface translation strings.

=== modified file 'openlp/core/ui/generaltab.py'
--- openlp/core/ui/generaltab.py	2010-03-21 23:58:01 +0000
+++ openlp/core/ui/generaltab.py	2010-04-03 07:14:15 +0000
@@ -25,16 +25,29 @@
 
 from PyQt4 import QtCore, QtGui
 
-from openlp.core.lib import SettingsTab, str_to_bool
+from openlp.core.lib import SettingsTab, str_to_bool, Receiver
 
 class GeneralTab(SettingsTab):
     """
     GeneralTab is the general settings tab in the settings dialog.
     """
-    def __init__(self, screen_list):
-        self.screen_list = screen_list
+    def __init__(self, screens):
+        self.screens = screens
         SettingsTab.__init__(self, u'General')
 
+    def preLoad(self):
+        """
+        Set up the display screen and set correct screen
+        values.
+        If not set before default to last screen.
+        """
+        self.MonitorNumber = int(self.config.get_config(u'monitor',
+                                                self.screens.monitor_number))
+        self.screens.set_current_display(self.MonitorNumber)
+        self.screens.monitor_number = self.MonitorNumber
+        self.DisplayOnMonitor = str_to_bool(self.config.get_config(u'display on monitor', u'True'))
+        self.screens.display = self.DisplayOnMonitor
+
     def setupUi(self):
         self.setObjectName(u'GeneralTab')
         self.tabTitleVisible = self.trUtf8('General')
@@ -60,6 +73,10 @@
         self.MonitorComboBox = QtGui.QComboBox(self.MonitorGroupBox)
         self.MonitorComboBox.setObjectName(u'MonitorComboBox')
         self.MonitorLayout.addWidget(self.MonitorComboBox)
+        self.MonitorLayout.addWidget(self.MonitorComboBox)
+        self.DisplayOnMonitorCheck = QtGui.QCheckBox(self.MonitorGroupBox)
+        self.DisplayOnMonitorCheck.setObjectName(u'MonitorComboBox')
+        self.MonitorLayout.addWidget(self.DisplayOnMonitorCheck)
         self.GeneralLeftLayout.addWidget(self.MonitorGroupBox)
         self.StartupGroupBox = QtGui.QGroupBox(self.GeneralLeftWidget)
         self.StartupGroupBox.setObjectName(u'StartupGroupBox')
@@ -133,6 +150,8 @@
         self.GeneralLayout.addWidget(self.GeneralRightWidget)
         QtCore.QObject.connect(self.MonitorComboBox,
             QtCore.SIGNAL(u'activated(int)'), self.onMonitorComboBoxChanged)
+        QtCore.QObject.connect(self.DisplayOnMonitorCheck,
+            QtCore.SIGNAL(u'stateChanged(int)'), self.onDisplayOnMonitorCheckChanged)
         QtCore.QObject.connect(self.WarningCheckBox,
             QtCore.SIGNAL(u'stateChanged(int)'), self.onWarningCheckBoxChanged)
         QtCore.QObject.connect(self.AutoOpenCheckBox,
@@ -153,6 +172,7 @@
     def retranslateUi(self):
         self.MonitorGroupBox.setTitle(self.trUtf8('Monitors'))
         self.MonitorLabel.setText(self.trUtf8('Select monitor for output display:'))
+        self.DisplayOnMonitorCheck.setText(self.trUtf8('Display if in single screen'))
         self.StartupGroupBox.setTitle(self.trUtf8('Application Startup'))
         self.WarningCheckBox.setText(self.trUtf8('Show blank screen warning'))
         self.AutoOpenCheckBox.setText(self.trUtf8('Automatically open the last service'))
@@ -168,6 +188,9 @@
     def onMonitorComboBoxChanged(self):
         self.MonitorNumber = self.MonitorComboBox.currentIndex()
 
+    def onDisplayOnMonitorCheckChanged(self, value):
+        self.DisplayOnMonitor = (value == QtCore.Qt.Checked)
+
     def onAutoOpenCheckBoxChanged(self, value):
         self.AutoOpen = (value == QtCore.Qt.Checked)
 
@@ -193,13 +216,12 @@
         self.Password = self.PasswordEdit.displayText()
 
     def load(self):
-        for screen in self.screen_list.screen_list:
+        for screen in self.screens.screen_list:
             screen_name = u'%s %d' % (self.trUtf8('Screen'), screen[u'number'] + 1)
             if screen[u'primary']:
                 screen_name = u'%s (%s)' % (screen_name, self.trUtf8('primary'))
             self.MonitorComboBox.addItem(screen_name)
         # Get the configs
-        self.MonitorNumber = int(self.config.get_config(u'monitor', u'0'))
         self.Warning = str_to_bool(self.config.get_config(u'blank warning', u'False'))
         self.AutoOpen = str_to_bool(self.config.get_config(u'auto open', u'False'))
         self.ShowSplash = str_to_bool(self.config.get_config(u'show splash', u'True'))
@@ -211,6 +233,7 @@
         self.SaveCheckServiceCheckBox.setChecked(self.PromptSaveService)
         # Set a few things up
         self.MonitorComboBox.setCurrentIndex(self.MonitorNumber)
+        self.DisplayOnMonitorCheck.setChecked(self.DisplayOnMonitor)
         self.WarningCheckBox.setChecked(self.Warning)
         self.AutoOpenCheckBox.setChecked(self.AutoOpen)
         self.ShowSplashCheckBox.setChecked(self.ShowSplash)
@@ -221,6 +244,7 @@
 
     def save(self):
         self.config.set_config(u'monitor', self.MonitorNumber)
+        self.config.set_config(u'display on monitor', self.DisplayOnMonitor)
         self.config.set_config(u'blank warning', self.Warning)
         self.config.set_config(u'auto open', self.AutoOpen)
         self.config.set_config(u'show splash', self.ShowSplash)
@@ -229,3 +253,9 @@
         self.config.set_config(u'ccli number', self.CCLINumber)
         self.config.set_config(u'songselect username', self.Username)
         self.config.set_config(u'songselect password', self.Password)
+        self.screens.display = self.DisplayOnMonitor
+        #Monitor Number has changed.
+        if self.screens.monitor_number != self.MonitorNumber:
+            self.screens.monitor_number = self.MonitorNumber
+            self.screens.set_current_display(self.MonitorNumber)
+            Receiver.send_message(u'screen_changed')

=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py	2010-03-28 15:56:49 +0000
+++ openlp/core/ui/maindisplay.py	2010-04-03 07:14:15 +0000
@@ -130,13 +130,15 @@
             QtCore.SIGNAL(u'media_pause'), self.onMediaPause)
         QtCore.QObject.connect(Receiver.get_receiver(),
             QtCore.SIGNAL(u'media_stop'), self.onMediaStop)
+        QtCore.QObject.connect(Receiver.get_receiver(),
+            QtCore.SIGNAL(u'update_config'), self.setup)
 
-    def setup(self, screenNumber):
+    def setup(self):
         """
         Sets up the screen on a particular screen.
-        @param (integer) screen This is the screen number.
         """
-        log.debug(u'Setup %s for %s ' %(self.screens, screenNumber))
+        log.debug(u'Setup %s for %s ' %(self.screens,
+                                         self.screens.monitor_number))
         self.setVisible(False)
         self.screen = self.screens.current
         #Sort out screen locations and sizes
@@ -183,7 +185,6 @@
         else:
             self.setVisible(False)
             self.primary = True
-        Receiver.send_message(u'screen_changed')
 
     def resetDisplay(self):
         Receiver.send_message(u'stop_display_loop')
@@ -247,7 +248,7 @@
                 else:
                     self.display_text.setPixmap(QtGui.QPixmap.fromImage(frame))
                 self.display_frame = frame
-            if not self.isVisible():
+            if not self.isVisible() and self.screens.display:
                 self.setVisible(True)
                 self.showFullScreen()
         else:
@@ -320,4 +321,4 @@
         self.video.setVisible(False)
         self.display_text.show()
         self.display_image.show()
-        self.blankDisplay(False, False)
\ No newline at end of file
+        self.blankDisplay(False, False)

=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py	2010-03-27 12:37:21 +0000
+++ openlp/core/ui/mainwindow.py	2010-04-03 07:14:15 +0000
@@ -496,6 +496,8 @@
             QtCore.SIGNAL(u'version_check'), self.versionCheck)
         QtCore.QObject.connect(Receiver.get_receiver(),
             QtCore.SIGNAL(u'blank_check'), self.blankCheck)
+        QtCore.QObject.connect(Receiver.get_receiver(),
+            QtCore.SIGNAL(u'screen_changed'), self.screenChanged)
         QtCore.QObject.connect(self.FileNewItem,
             QtCore.SIGNAL(u'triggered()'),
             self.ServiceManagerContents.onNewService)
@@ -512,7 +514,7 @@
         #RenderManager needs to call ThemeManager and
         #ThemeManager needs to call RenderManager
         self.RenderManager = RenderManager(self.ThemeManagerContents,
-            self.screens, self.getMonitorNumber())
+                                            self.screens)
         #Define the media Dock Manager
         self.mediaDockManager = MediaDockManager(self.MediaToolBox)
         log.info(u'Load Plugins')
@@ -563,24 +565,13 @@
             QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok),
             QtGui.QMessageBox.Ok)
 
-    def getMonitorNumber(self):
-        """
-        Set up the default behaviour of the monitor configuration in
-        here. Currently it is set to default to monitor 0 if the saved
-        monitor number does not exist.
-        """
-        screen_number = int(self.generalConfig.get_config(u'monitor', 0))
-        if not self.screens.screen_exists(screen_number):
-            screen_number = 0
-        return screen_number
-
     def show(self):
         """
         Show the main form, as well as the display form
         """
         self.showMaximized()
-        screen_number = self.getMonitorNumber()
-        self.mainDisplay.setup(screen_number)
+        #screen_number = self.getMonitorNumber()
+        self.mainDisplay.setup()
         if self.mainDisplay.isVisible():
             self.mainDisplay.setFocus()
         self.activateWindow()
@@ -598,7 +589,6 @@
                 QtGui.QMessageBox.Ok)
 
     def versionThread(self):
-        #app_version = self.applicationVersion[u'full']
         vT = VersionThread(self, self.applicationVersion, self.generalConfig)
         vT.start()
 
@@ -621,13 +611,10 @@
         Show the Settings dialog
         """
         self.settingsForm.exec_()
-        updated_display = self.getMonitorNumber()
-        if updated_display != self.screens.current_display:
-            self.screens.set_current_display(updated_display)
-            self.RenderManager.update_display(updated_display)
-            self.mainDisplay.setup(updated_display)
-        #Trigger after changes have been made
-        Receiver.send_message(u'config_updated')
+
+    def screenChanged(self):
+        self.RenderManager.update_display()
+        self.mainDisplay.setup()
         self.activateWindow()
 
     def closeEvent(self, event):

=== modified file 'openlp/core/ui/screen.py'
--- openlp/core/ui/screen.py	2010-03-21 23:58:01 +0000
+++ openlp/core/ui/screen.py	2010-04-03 07:14:15 +0000
@@ -37,14 +37,17 @@
         self.preview = None
         self.current = None
         self.screen_list = []
-        self.count = 0
+        self.display_count = 0
+        #actual display number
         self.current_display = 0
+        #save config display number
+        self.monitor_number = 0
 
     def add_screen(self, screen):
         if screen[u'primary']:
             self.current = screen
         self.screen_list.append(screen)
-        self.count += 1
+        self.display_count += 1
 
     def screen_exists(self, number):
         for screen in self.screen_list:
@@ -53,21 +56,15 @@
         return False
 
     def set_current_display(self, number):
-        if number + 1 > self.count:
+        """
+        Set up the current screen dimensions
+        """
+        if number + 1 > self.display_count:
             self.current = self.screen_list[0]
             self.current_display = 0
         else:
             self.current = self.screen_list[number]
             self.preview = self.current
             self.current_display = number
-        if self.count == 1:
+        if self.display_count == 1:
             self.preview = self.screen_list[0]
-
-#        if self.screen[u'number'] != screenNumber:
-#            # We will most probably never actually hit this bit, but just in
-#            # case the index in the list doesn't match the screen number, we
-#            # search for it.
-#            for scrn in self.screens:
-#                if scrn[u'number'] == screenNumber:
-#                    self.screen = scrn
-#                    break

=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py	2010-03-28 15:56:49 +0000
+++ openlp/core/ui/servicemanager.py	2010-04-03 07:14:15 +0000
@@ -33,7 +33,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import PluginConfig, OpenLPToolbar, ServiceItem, \
-    contextMenuAction, Receiver, str_to_bool, build_icon
+    contextMenuAction, Receiver, str_to_bool, build_icon, ItemCapabilities
 from openlp.core.ui import ServiceNoteForm, ServiceItemEditForm
 
 class ServiceManagerList(QtGui.QTreeWidget):
@@ -233,9 +233,9 @@
         self.editAction.setVisible(False)
         self.maintainAction.setVisible(False)
         self.notesAction.setVisible(False)
-        if serviceItem[u'service_item'].edit_enabled:
+        if serviceItem[u'service_item'].is_capable(ItemCapabilities.AllowsEdit):
             self.editAction.setVisible(True)
-        if serviceItem[u'service_item'].maintain_allowed:
+        if serviceItem[u'service_item'].is_capable(ItemCapabilities.AllowsMaintain):
             self.maintainAction.setVisible(True)
         if item.parent() is None:
             self.notesAction.setVisible(True)
@@ -713,7 +713,7 @@
                         get_config(u'auto preview', u'False')):
             item += 1
             if self.serviceItems and item < len(self.serviceItems) and \
-                self.serviceItems[item][u'service_item'].auto_preview_allowed:
+                serviceItem[u'service_item'].is_capable(ItemCapabilities.AllowsPreview):
                     self.parent.PreviewController.addServiceManagerItem(
                         self.serviceItems[item][u'service_item'], 0)
 
@@ -722,7 +722,7 @@
         Posts a remote edit message to a plugin to allow item to be edited.
         """
         item, count = self.findServiceItem()
-        if self.serviceItems[item][u'service_item'].edit_enabled:
+        if serviceItem[u'service_item'].is_capable(ItemCapabilities.AllowsEdit):
             self.remoteEditTriggered = True
             Receiver.send_message(u'%s_edit' %
                 self.serviceItems[item][u'service_item'].name, u'L:%s' %

=== modified file 'openlp/core/ui/settingsform.py'
--- openlp/core/ui/settingsform.py	2010-03-21 23:58:01 +0000
+++ openlp/core/ui/settingsform.py	2010-04-03 07:14:15 +0000
@@ -34,11 +34,11 @@
 
 class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
 
-    def __init__(self, screen_list, mainWindow, parent=None):
+    def __init__(self, screens, mainWindow, parent=None):
         QtGui.QDialog.__init__(self, parent)
         self.setupUi(self)
         # General tab
-        self.GeneralTab = GeneralTab(screen_list)
+        self.GeneralTab = GeneralTab(screens)
         self.addTab(u'General', self.GeneralTab)
         # Themes tab
         self.ThemesTab = ThemesTab(mainWindow)

=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py	2010-03-30 19:01:23 +0000
+++ openlp/core/ui/slidecontroller.py	2010-04-03 07:14:15 +0000
@@ -375,8 +375,7 @@
         self.Toolbar.makeWidgetsInvisible(self.image_list)
         if item.is_text():
             self.Toolbar.makeWidgetsInvisible(self.image_list)
-            if item.is_song() and \
-                str_to_bool(self.songsconfig.get_config(u'show songbar', True)) \
+            if str_to_bool(self.songsconfig.get_config(u'show songbar', True)) \
                 and len(self.slideList) > 0:
                 self.Toolbar.makeWidgetsVisible([u'Song Menu'])
         elif item.is_image():
@@ -395,7 +394,8 @@
         self.Toolbar.setVisible(True)
         self.Mediabar.setVisible(False)
         self.Toolbar.makeWidgetsInvisible(self.song_edit_list)
-        if item.edit_enabled and item.from_plugin:
+        if serviceItem[u'service_item'].is_capable(ItemCapabilities.AllowsEdit)\
+                            and item.from_plugin:
             self.Toolbar.makeWidgetsVisible(self.song_edit_list)
         elif item.is_media():
             self.Toolbar.setVisible(False)
@@ -494,7 +494,8 @@
                     bits = frame[u'verseTag'].split(u':')
                     tag = None
                     #If verse handle verse number else tag only
-                    if bits[0] == self.trUtf8('Verse'):
+                    if bits[0] == self.trUtf8('Verse') or \
+                        bits[0] == self.trUtf8('Chorus'):
                         tag = u'%s%s' % (bits[0][0], bits[1][0:] )
                         row = bits[1][0:]
                     else:
@@ -759,7 +760,7 @@
         else:
             self.mediaObject.stop()
             self.mediaObject.clearQueue()
-            file = os.path.join(item.service_item_path, item.get_frame_title())
+            file = os.path.join(item.get_frame_path(), item.get_frame_title())
             self.mediaObject.setCurrentSource(Phonon.MediaSource(file))
             self.onMediaPlay()
 

=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py	2010-03-28 15:56:49 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py	2010-04-03 07:14:15 +0000
@@ -29,7 +29,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import MediaManagerItem, Receiver, str_to_bool, \
-    BaseListWithDnD
+    BaseListWithDnD, ItemCapabilities
 from openlp.plugins.bibles.forms import ImportWizardForm
 
 log = logging.getLogger(__name__)
@@ -449,7 +449,7 @@
         raw_slides = []
         raw_footer = []
         bible_text = u''
-        service_item.auto_preview_allowed = True
+        service_item.add_capability(ItemCapabilities.AllowsPreview)
         #If we want to use a 2nd translation / version
         bible2 = u''
         if self.SearchTabWidget.currentIndex() == 0:
@@ -608,4 +608,4 @@
 
     def searchByReference(self, bible, search):
         log.debug(u'searchByReference %s, %s', bible, search)
-        self.search_results = self.parent.manager.get_verses(bible, search)
\ No newline at end of file
+        self.search_results = self.parent.manager.get_verses(bible, search)

=== modified file 'openlp/plugins/custom/lib/mediaitem.py'
--- openlp/plugins/custom/lib/mediaitem.py	2010-03-28 15:56:49 +0000
+++ openlp/plugins/custom/lib/mediaitem.py	2010-04-03 07:14:15 +0000
@@ -28,7 +28,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import MediaManagerItem, SongXMLParser, BaseListWithDnD,\
-Receiver, str_to_bool
+Receiver, str_to_bool, ItemCapabilities
 
 log = logging.getLogger(__name__)
 
@@ -144,11 +144,11 @@
             item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
         else:
             item_id = self.remoteCustom
-        service_item.auto_preview_allowed = True
+        service_item.add_capability(ItemCapabilities.AllowsEdit)
+        service_item.add_capability(ItemCapabilities.AllowsPreview)
         customSlide = self.parent.custommanager.get_custom(item_id)
         title = customSlide.title
         credit = customSlide.credits
-        service_item.edit_enabled = True
         service_item.editId = item_id
         theme = customSlide.theme_name
         if theme:
@@ -166,4 +166,4 @@
         else:
             raw_footer.append(u'')
         service_item.raw_footer = raw_footer
-        return True
\ No newline at end of file
+        return True

=== modified file 'openlp/plugins/images/lib/mediaitem.py'
--- openlp/plugins/images/lib/mediaitem.py	2010-03-28 21:57:54 +0000
+++ openlp/plugins/images/lib/mediaitem.py	2010-04-03 07:14:15 +0000
@@ -28,7 +28,7 @@
 
 from PyQt4 import QtCore, QtGui
 from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \
-    contextMenuAction
+    contextMenuAction, ItemCapabilities
 
 log = logging.getLogger(__name__)
 
@@ -140,8 +140,8 @@
         items = self.ListView.selectedIndexes()
         if items:
             service_item.title = self.trUtf8('Image(s)')
-            service_item.auto_preview_allowed = True
-            service_item.maintain_allowed = True
+            service_item.add_capability(ItemCapabilities.AllowsMaintain)
+            service_item.add_capability(ItemCapabilities.AllowsPreview)
             for item in items:
                 bitem = self.ListView.item(item.row())
                 filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString())

=== modified file 'openlp/plugins/media/lib/mediaitem.py'
--- openlp/plugins/media/lib/mediaitem.py	2010-03-21 23:58:01 +0000
+++ openlp/plugins/media/lib/mediaitem.py	2010-04-03 07:14:15 +0000
@@ -28,7 +28,8 @@
 
 from PyQt4 import QtCore, QtGui
 
-from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon
+from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \
+ItemCapabilities
 
 log = logging.getLogger(__name__)
 
@@ -82,6 +83,7 @@
         if len(items) > 1:
             return False
         service_item.title = unicode(self.trUtf8('Media'))
+        service_item.add_capability(ItemCapabilities.Requires_media)
         for item in items:
             bitem = self.ListView.item(item.row())
             filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString())

=== modified file 'openlp/plugins/presentations/lib/mediaitem.py'
--- openlp/plugins/presentations/lib/mediaitem.py	2010-03-23 19:41:54 +0000
+++ openlp/plugins/presentations/lib/mediaitem.py	2010-04-03 07:14:15 +0000
@@ -152,7 +152,6 @@
         service_item.title = unicode(self.DisplayTypeComboBox.currentText())
         service_item.shortname = unicode(self.DisplayTypeComboBox.currentText())
         shortname = service_item.shortname
-
         for item in items:
             bitem = self.ListView.item(item.row())
             filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString())

=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py	2010-03-28 15:56:49 +0000
+++ openlp/plugins/songs/lib/mediaitem.py	2010-04-03 07:14:15 +0000
@@ -28,7 +28,7 @@
 from PyQt4 import QtCore, QtGui
 
 from openlp.core.lib import MediaManagerItem, SongXMLParser, \
-    BaseListWithDnD, Receiver,  str_to_bool
+    BaseListWithDnD, Receiver,  str_to_bool, ItemCapabilities
 from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm
 
 log = logging.getLogger(__name__)
@@ -290,10 +290,10 @@
             item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
         else:
             item_id = self.remoteSong
-        service_item.auto_preview_allowed = True
+        service_item.add_capability(ItemCapabilities.AllowsEdit)
+        service_item.add_capability(ItemCapabilities.AllowsPreview)
         song = self.parent.songmanager.get_song(item_id)
         service_item.theme = song.theme_name
-        service_item.edit_enabled = True
         service_item.editId = item_id
         if song.lyrics.startswith(u'<?xml version='):
             songXML = SongXMLParser(song.lyrics)
@@ -310,7 +310,8 @@
                         break
                     for verse in verseList:
                         if verse[1]:
-                            if verse[0][u'type'] == "Verse":
+                            if verse[0][u'type'] == "Verse" \
+                                or verse[0][u'type'] == "Chorus":
                                 if verse[0][u'label'] == order[1:]:
                                     verseTag = u'%s:%s' % \
                                         (verse[0][u'type'], verse[0][u'label'])
@@ -345,4 +346,4 @@
         service_item.audit = [
             song.title, author_audit, song.copyright, song.ccli_number
         ]
-        return True
\ No newline at end of file
+        return True


Follow ups