From f8114d0b97edd650748b326843c625fcee7768a9 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Tue, 21 Apr 2015 22:49:22 +0100 Subject: [PATCH] Disable button for replacing live background if the webkit player is not available. --- openlp/core/common/uistrings.py | 2 ++ openlp/plugins/media/lib/mediaitem.py | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/openlp/core/common/uistrings.py b/openlp/core/common/uistrings.py index bebf4add0..8add1a35c 100644 --- a/openlp/core/common/uistrings.py +++ b/openlp/core/common/uistrings.py @@ -121,6 +121,8 @@ class UiStrings(object): self.Projectors = translate('OpenLP.Ui', 'Projectors', 'Plural') self.ReplaceBG = translate('OpenLP.Ui', 'Replace Background') self.ReplaceLiveBG = translate('OpenLP.Ui', 'Replace live background.') + self.ReplaceLiveBGDisabled = translate('OpenLP.Ui', 'Replace live background is not available on this ' + 'platform in this version of OpenLP.') self.ResetBG = translate('OpenLP.Ui', 'Reset Background') self.ResetLiveBG = translate('OpenLP.Ui', 'Reset live background.') self.Seconds = translate('OpenLP.Ui', 's', 'The abbreviated unit for seconds') diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index e3b8137eb..4fd1620f3 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -91,7 +91,10 @@ class MediaMediaItem(MediaManagerItem, RegistryProperties): """ self.on_new_prompt = translate('MediaPlugin.MediaItem', 'Select Media') self.replace_action.setText(UiStrings().ReplaceBG) - self.replace_action.setToolTip(UiStrings().ReplaceLiveBG) + if 'webkit' in get_media_players()[0]: + self.replace_action.setToolTip(UiStrings().ReplaceLiveBG) + else: + self.replace_action.setToolTip(UiStrings().ReplaceLiveBGDisabled) self.reset_action.setText(UiStrings().ResetBG) self.reset_action.setToolTip(UiStrings().ResetLiveBG) self.automatic = UiStrings().Automatic @@ -139,6 +142,8 @@ class MediaMediaItem(MediaManagerItem, RegistryProperties): # Replace backgrounds do not work at present so remove functionality. self.replace_action = self.toolbar.add_toolbar_action('replace_action', icon=':/slides/slide_blank.png', triggers=self.on_replace_click) + if 'webkit' not in get_media_players()[0]: + self.replace_action.setDisabled(True) self.reset_action = self.toolbar.add_toolbar_action('reset_action', icon=':/system/system_close.png', visible=False, triggers=self.on_reset_click) self.media_widget = QtGui.QWidget(self)