mirror of https://gitlab.com/openlp/openlp.git
Presentation guards against missing images
This commit is contained in:
parent
ac28cb5183
commit
52367323b0
|
@ -392,10 +392,16 @@ class ServiceItem(object):
|
|||
"""
|
||||
Returns the title of the raw frame
|
||||
"""
|
||||
return self._raw_frames[row][u'title']
|
||||
try:
|
||||
return self._raw_frames[row][u'title']
|
||||
except:
|
||||
return u''
|
||||
|
||||
def get_frame_path(self, row=0):
|
||||
"""
|
||||
Returns the path of the raw frame
|
||||
"""
|
||||
return self._raw_frames[row][u'path']
|
||||
try:
|
||||
return self._raw_frames[row][u'path']
|
||||
except:
|
||||
return u''
|
||||
|
|
|
@ -268,12 +268,22 @@ class PresentationMediaItem(MediaManagerItem):
|
|||
doc.load_presentation()
|
||||
i = 1
|
||||
img = doc.get_thumbnail_path(i, True)
|
||||
while img:
|
||||
service_item.add_from_command(path, name, img)
|
||||
i = i + 1
|
||||
img = doc.get_thumbnail_path(i, True)
|
||||
doc.close_presentation()
|
||||
return True
|
||||
if img:
|
||||
while img:
|
||||
service_item.add_from_command(path, name, img)
|
||||
i = i + 1
|
||||
img = doc.get_thumbnail_path(i, True)
|
||||
doc.close_presentation()
|
||||
return True
|
||||
else:
|
||||
# File is no longer present
|
||||
criticalErrorMessageBox(
|
||||
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
|
||||
criticalErrorMessageBox(
|
||||
|
|
Loading…
Reference in New Issue