forked from openlp/openlp
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
|
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):
|
def get_frame_path(self, row=0):
|
||||||
"""
|
"""
|
||||||
Returns the path of the raw frame
|
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()
|
doc.load_presentation()
|
||||||
i = 1
|
i = 1
|
||||||
img = doc.get_thumbnail_path(i, True)
|
img = doc.get_thumbnail_path(i, True)
|
||||||
while img:
|
if img:
|
||||||
service_item.add_from_command(path, name, img)
|
while img:
|
||||||
i = i + 1
|
service_item.add_from_command(path, name, img)
|
||||||
img = doc.get_thumbnail_path(i, True)
|
i = i + 1
|
||||||
doc.close_presentation()
|
img = doc.get_thumbnail_path(i, True)
|
||||||
return 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:
|
else:
|
||||||
# File is no longer present
|
# File is no longer present
|
||||||
criticalErrorMessageBox(
|
criticalErrorMessageBox(
|
||||||
|
Loading…
Reference in New Issue
Block a user