openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #11786
[Merge] lp:~trb143/openlp/bug-fixes into lp:openlp
Tim Bentley has proposed merging lp:~trb143/openlp/bug-fixes into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Related bugs:
Bug #796195 in OpenLP: "Remote "Add to Service" opens "Missing x" dialog when image/presentation/media is missing"
https://bugs.launchpad.net/openlp/+bug/796195
Bug #800156 in OpenLP: "display if single screen display won't go away"
https://bugs.launchpad.net/openlp/+bug/800156
For more details, see:
https://code.launchpad.net/~trb143/openlp/bug-fixes/+merge/74289
Bypass the error message if triggered from the Remote interface. No action is taken though
Do not display the initial screen if there is only 1 display.
--
https://code.launchpad.net/~trb143/openlp/bug-fixes/+merge/74289
Your team OpenLP Core is requested to review the proposed merge of lp:~trb143/openlp/bug-fixes into lp:openlp.
=== modified file 'openlp/core/lib/mediamanageritem.py'
--- openlp/core/lib/mediamanageritem.py 2011-09-01 19:45:36 +0000
+++ openlp/core/lib/mediamanageritem.py 2011-09-06 19:37:25 +0000
@@ -485,7 +485,8 @@
"""
pass
- def generateSlideData(self, serviceItem, item=None, xmlVersion=False):
+ def generateSlideData(self, serviceItem, item=None, xmlVersion=False,
+ remote=False):
raise NotImplementedError(u'MediaManagerItem.generateSlideData needs '
u'to be defined by the plugin')
@@ -539,12 +540,12 @@
else:
self.goLive()
- def goLive(self, item_id=None):
+ def goLive(self, item_id=None, remote=False):
log.debug(u'%s Live requested', self.plugin.name)
item = None
if item_id:
item = self.createItemFromId(item_id)
- serviceItem = self.buildServiceItem(item)
+ serviceItem = self.buildServiceItem(item, remote=remote)
if serviceItem:
if not item_id:
serviceItem.from_plugin = True
@@ -574,8 +575,8 @@
for item in items:
self.addToService(item)
- def addToService(self, item=None, replace=None):
- serviceItem = self.buildServiceItem(item, True)
+ def addToService(self, item=None, replace=None, remote=False):
+ serviceItem = self.buildServiceItem(item, True, remote=remote)
if serviceItem:
serviceItem.from_plugin = False
self.plugin.serviceManager.addServiceItem(serviceItem,
@@ -608,13 +609,13 @@
unicode(translate('OpenLP.MediaManagerItem',
'You must select a %s service item.')) % self.title)
- def buildServiceItem(self, item=None, xmlVersion=False):
+ def buildServiceItem(self, item=None, xmlVersion=False, remote=False):
"""
Common method for generating a service item
"""
serviceItem = ServiceItem(self.plugin)
serviceItem.add_icon(self.plugin.icon_path)
- if self.generateSlideData(serviceItem, item, xmlVersion):
+ if self.generateSlideData(serviceItem, item, xmlVersion, remote):
return serviceItem
else:
return None
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py 2011-08-31 21:17:10 +0000
+++ openlp/core/ui/slidecontroller.py 2011-09-06 19:37:25 +0000
@@ -784,6 +784,8 @@
self.onBlankDisplay(True)
else:
Receiver.send_message(u'maindisplay_show')
+ else:
+ Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
def onSlideBlank(self):
"""
=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py 2011-09-02 19:04:07 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py 2011-09-06 19:37:25 +0000
@@ -788,7 +788,8 @@
items.append(bible_verse)
return items
- def generateSlideData(self, service_item, item=None, xmlVersion=False):
+ def generateSlideData(self, service_item, item=None, xmlVersion=False,
+ remote=False):
"""
Generates and formats the slides for the service item as well as the
service item's title.
=== modified file 'openlp/plugins/custom/lib/mediaitem.py'
--- openlp/plugins/custom/lib/mediaitem.py 2011-09-02 19:04:07 +0000
+++ openlp/plugins/custom/lib/mediaitem.py 2011-09-06 19:37:25 +0000
@@ -222,7 +222,8 @@
def onFocus(self):
self.searchTextEdit.setFocus()
- def generateSlideData(self, service_item, item=None, xmlVersion=False):
+ def generateSlideData(self, service_item, item=None, xmlVersion=False,
+ remote=False):
raw_footer = []
slide = None
theme = None
=== modified file 'openlp/plugins/images/lib/mediaitem.py'
--- openlp/plugins/images/lib/mediaitem.py 2011-08-31 07:49:57 +0000
+++ openlp/plugins/images/lib/mediaitem.py 2011-09-06 19:37:25 +0000
@@ -139,7 +139,8 @@
if not initialLoad:
self.plugin.formparent.finishedProgressBar()
- def generateSlideData(self, service_item, item=None, xmlVersion=False):
+ def generateSlideData(self, service_item, item=None, xmlVersion=False,
+ remote=False):
background = QtGui.QColor(QtCore.QSettings().value(self.settingsSection
+ u'/background color', QtCore.QVariant(u'#000000')))
if item:
@@ -166,11 +167,12 @@
items.remove(item)
# We cannot continue, as all images do not exist.
if not items:
- critical_error_message_box(
- translate('ImagePlugin.MediaItem', 'Missing Image(s)'),
- unicode(translate('ImagePlugin.MediaItem',
- 'The following image(s) no longer exist: %s')) %
- u'\n'.join(missing_items_filenames))
+ if not remote:
+ critical_error_message_box(
+ translate('ImagePlugin.MediaItem', 'Missing Image(s)'),
+ unicode(translate('ImagePlugin.MediaItem',
+ 'The following image(s) no longer exist: %s')) %
+ u'\n'.join(missing_items_filenames))
return False
# We have missing as well as existing images. We ask what to do.
elif missing_items and QtGui.QMessageBox.question(self,
=== modified file 'openlp/plugins/media/lib/mediaitem.py'
--- openlp/plugins/media/lib/mediaitem.py 2011-08-28 17:45:13 +0000
+++ openlp/plugins/media/lib/mediaitem.py 2011-09-06 19:37:25 +0000
@@ -129,18 +129,20 @@
'There was a problem replacing your background, '
'the media file "%s" no longer exists.')) % filename)
- def generateSlideData(self, service_item, item=None, xmlVersion=False):
+ def generateSlideData(self, service_item, item=None, xmlVersion=False,
+ remote=False):
if item is None:
item = self.listView.currentItem()
if item is None:
return False
filename = unicode(item.data(QtCore.Qt.UserRole).toString())
if not os.path.exists(filename):
- # File is no longer present
- critical_error_message_box(
- translate('MediaPlugin.MediaItem', 'Missing Media File'),
- unicode(translate('MediaPlugin.MediaItem',
- 'The file %s no longer exists.')) % filename)
+ if not remote:
+ # File is no longer present
+ critical_error_message_box(
+ translate('MediaPlugin.MediaItem', 'Missing Media File'),
+ unicode(translate('MediaPlugin.MediaItem',
+ 'The file %s no longer exists.')) % filename)
return False
self.mediaObject.stop()
self.mediaObject.clearQueue()
=== modified file 'openlp/plugins/presentations/lib/mediaitem.py'
--- openlp/plugins/presentations/lib/mediaitem.py 2011-08-28 17:45:13 +0000
+++ openlp/plugins/presentations/lib/mediaitem.py 2011-09-06 19:37:25 +0000
@@ -233,7 +233,8 @@
SettingsManager.set_list(self.settingsSection,
u'presentations', self.getFileList())
- def generateSlideData(self, service_item, item=None, xmlVersion=False):
+ def generateSlideData(self, service_item, item=None, xmlVersion=False,
+ remote=False):
"""
Load the relevant information for displaying the presentation
in the slidecontroller. In the case of powerpoints, an image
@@ -275,12 +276,13 @@
return True
else:
# File is no longer present
- critical_error_message_box(
- translate('PresentationPlugin.MediaItem',
- 'Missing Presentation'),
- unicode(translate('PresentationPlugin.MediaItem',
- 'The Presentation %s is incomplete,'
- ' please reload.')) % filename)
+ if not remote:
+ critical_error_message_box(
+ translate('PresentationPlugin.MediaItem',
+ 'Missing Presentation'),
+ unicode(translate('PresentationPlugin.MediaItem',
+ 'The Presentation %s is incomplete,'
+ ' please reload.')) % filename)
return False
else:
# File is no longer present
=== modified file 'openlp/plugins/remotes/lib/httpserver.py'
--- openlp/plugins/remotes/lib/httpserver.py 2011-07-27 18:12:54 +0000
+++ openlp/plugins/remotes/lib/httpserver.py 2011-09-06 19:37:25 +0000
@@ -528,7 +528,7 @@
id = json.loads(self.url_params[u'data'][0])[u'request'][u'id']
plugin = self.parent.plugin.pluginManager.get_plugin_by_name(type)
if plugin.status == PluginStatus.Active and plugin.mediaItem:
- plugin.mediaItem.goLive(id)
+ plugin.mediaItem.goLive(id, remote=True)
def add_to_service(self, type):
"""
@@ -538,7 +538,7 @@
plugin = self.parent.plugin.pluginManager.get_plugin_by_name(type)
if plugin.status == PluginStatus.Active and plugin.mediaItem:
item_id = plugin.mediaItem.createItemFromId(id)
- plugin.mediaItem.addToService(item_id)
+ plugin.mediaItem.addToService(item_id, remote=True)
def send_response(self, response):
http = u'HTTP/1.1 %s\r\n' % response.code
=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py 2011-09-02 19:04:07 +0000
+++ openlp/plugins/songs/lib/mediaitem.py 2011-09-06 19:37:25 +0000
@@ -411,7 +411,8 @@
self.plugin.manager.save_object(new_song)
self.onSongListLoad()
- def generateSlideData(self, service_item, item=None, xmlVersion=False):
+ def generateSlideData(self, service_item, item=None, xmlVersion=False,
+ remote=False):
log.debug(u'generateSlideData (%s:%s)' % (service_item, item))
item_id = self._getIdOfItemToGenerate(item, self.remoteSong)
service_item.add_capability(ItemCapabilities.CanEdit)
Follow ups