diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index b544efab9..8f33720c6 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -124,6 +124,7 @@ class UiStrings(object): self.Themes = translate('OpenLP.Ui', 'Themes', 'Plural') self.Tools = translate('OpenLP.Ui', 'Tools') self.Top = translate('OpenLP.Ui', 'Top') + self.UnsupportedFile = translate('OpenLP.Ui', 'Unsupported File') self.VersePerSlide = translate('OpenLP.Ui', 'Verse Per Slide') self.VersePerLine = translate('OpenLP.Ui', 'Verse Per Line') self.Version = translate('OpenLP.Ui', 'Version') diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index e494b9e5e..3bfd5b773 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -138,10 +138,8 @@ class MediaMediaItem(MediaManagerItem): if not self.mediaStateWait(Phonon.StoppedState): # Due to string freeze, borrow a message from presentations # This will be corrected in 1.9.6 - critical_error_message_box( - translate('PresentationPlugin.MediaItem', 'Unsupported File'), - unicode(translate('PresentationPlugin.MediaItem', - 'Unsupported File'))) + critical_error_message_box(UiStrings().UnsupportedFile, + UiStrings().UnsupportedFile) return False # File too big for processing if os.path.getsize(filename) <= 52428800: # 50MiB @@ -152,15 +150,12 @@ class MediaMediaItem(MediaManagerItem): # Due to string freeze, borrow a message from presentations # This will be corrected in 1.9.6 self.mediaObject.stop() - critical_error_message_box( - translate('PresentationPlugin.MediaItem', - 'Unsupported File'), - unicode(translate('PresentationPlugin.MediaItem', - 'Unsupported File'))) + critical_error_message_box(UiStrings().UnsupportedFile, + UiStrings().UnsupportedFile) return False - self.mediaLength = self.mediaObject.totalTime() / 1000 + #self.mediaLength = self.mediaObject.totalTime() / 1000 self.mediaObject.stop() - service_item.media_length = self.mediaLength + service_item.media_length = self.mediaObject.totalTime() / 1000 service_item.add_capability( ItemCapabilities.AllowsVariableStartTime) service_item.title = unicode(self.plugin.nameStrings[u'singular']) diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 22db8f39f..bc4241b18 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -193,9 +193,7 @@ class PresentationMediaItem(MediaManagerItem): if initialLoad: icon = build_icon(u':/general/general_delete.png') else: - critical_error_message_box( - translate('PresentationPlugin.MediaItem', - 'Unsupported File'), + critical_error_message_box(UiStrings().UnsupportedFile, translate('PresentationPlugin.MediaItem', 'This type of presentation is not supported.')) continue