More stream stuff

This commit is contained in:
Tim Bentley 2019-01-20 21:54:26 +00:00
parent 469a888563
commit 77f84e2b95
4 changed files with 22 additions and 1 deletions

View File

@ -45,6 +45,7 @@ class BackgroundType(object):
Image = 2
Transparent = 3
Video = 4
Stream = 5
@staticmethod
def to_string(background_type):
@ -61,6 +62,8 @@ class BackgroundType(object):
return 'transparent'
elif background_type == BackgroundType.Video:
return 'video'
elif background_type == BackgroundType.Stream:
return 'stream'
@staticmethod
def from_string(type_string):
@ -77,6 +80,8 @@ class BackgroundType(object):
return BackgroundType.Transparent
elif type_string == 'video':
return BackgroundType.Video
elif type_string == 'stream':
return BackgroundType.Stream
class BackgroundGradientType(object):

View File

@ -60,17 +60,28 @@ class MediaTab(SettingsTab):
super(MediaTab, self).setupUi()
self.live_media_group_box = QtWidgets.QGroupBox(self.left_column)
self.live_media_group_box.setObjectName('live_media_group_box')
self.media_layout = QtWidgets.QVBoxLayout(self.live_media_group_box)
self.media_layout.setObjectName('live_media_layout')
self.auto_start_check_box = QtWidgets.QCheckBox(self.live_media_group_box)
self.auto_start_check_box.setObjectName('auto_start_check_box')
self.media_layout.addWidget(self.auto_start_check_box)
self.left_layout.addWidget(self.live_media_group_box)
self.stream_media_group_box = QtWidgets.QGroupBox(self.left_column)
self.stream_media_group_box.setObjectName('stream_media_group_box')
self.stream_edit_field = QtWidgets.QLineEdit(self.stream_media_group_box)
self.stream_edit_field.setObjectName('stream_edit_field')
self.media_layout.addWidget(self.stream_edit_field)
self.media_layout.addWidget(self.stream_media_group_box)
self.media_layout = QtWidgets.QVBoxLayout(self.stream_media_group_box)
self.media_layout.setObjectName('media_layout')
self.left_layout.addWidget(self.stream_media_group_box)
self.left_layout.addStretch()
self.right_layout.addStretch()
# self.background_color_group_box = QtWidgets.QGroupBox(self.left_column)

View File

@ -33,6 +33,7 @@ from openlp.core.common.registry import Registry
from openlp.core.lib.theme import BackgroundType, BackgroundGradientType
from openlp.core.lib.ui import critical_error_message_box
from openlp.core.ui.themelayoutform import ThemeLayoutForm
from openlp.core.ui.media.vlcplayer import VIDEO_EXT
from .themewizard import Ui_ThemeWizard
log = logging.getLogger(__name__)
@ -323,6 +324,8 @@ class ThemeForm(QtWidgets.QWizard, Ui_ThemeWizard, RegistryProperties):
self.video_color_button.color = self.theme.background_border_color
self.video_path_edit.path = self.theme.background_filename
self.setField('background_type', 4)
elif self.theme.background_type == BackgroundType.to_string(BackgroundType.Stream):
self.setField('background_type', 5)
elif self.theme.background_type == BackgroundType.to_string(BackgroundType.Transparent):
self.setField('background_type', 3)
if self.theme.background_direction == BackgroundGradientType.to_string(BackgroundGradientType.Horizontal):

View File

@ -64,7 +64,7 @@ class Ui_ThemeWizard(object):
self.background_label = QtWidgets.QLabel(self.background_page)
self.background_label.setObjectName('background_label')
self.background_combo_box = QtWidgets.QComboBox(self.background_page)
self.background_combo_box.addItems(['', '', '', '', ''])
self.background_combo_box.addItems(['', '', '', '', '', ''])
self.background_combo_box.setObjectName('background_combo_box')
self.background_type_layout.addRow(self.background_label, self.background_combo_box)
self.background_type_layout.setItem(1, QtWidgets.QFormLayout.LabelRole, self.spacer)
@ -410,6 +410,8 @@ class Ui_ThemeWizard(object):
self.background_combo_box.setItemText(BackgroundType.Video, UiStrings().Video)
self.background_combo_box.setItemText(BackgroundType.Transparent,
translate('OpenLP.ThemeWizard', 'Transparent'))
self.background_combo_box.setItemText(BackgroundType.Stream,
translate('OpenLP.ThemeWizard', 'Live Stream'))
self.color_label.setText(translate('OpenLP.ThemeWizard', 'color:'))
self.gradient_start_label.setText(translate('OpenLP.ThemeWizard', 'Starting color:'))
self.gradient_end_label.setText(translate('OpenLP.ThemeWizard', 'Ending color:'))