def setupUi(self): self.setObjectName('ImagesTab') super(ImageTab, self).setupUi() self.background_color_group_box = QtWidgets.QGroupBox(self.left_column) self.background_color_group_box.setObjectName( 'background_color_group_box') self.form_layout = QtWidgets.QFormLayout( self.background_color_group_box) self.form_layout.setObjectName('form_layout') self.color_layout = QtWidgets.QHBoxLayout() self.background_color_label = QtWidgets.QLabel( self.background_color_group_box) self.background_color_label.setObjectName('background_color_label') self.color_layout.addWidget(self.background_color_label) self.background_color_button = ColorButton( self.background_color_group_box) self.background_color_button.setObjectName('background_color_button') self.color_layout.addWidget(self.background_color_button) self.form_layout.addRow(self.color_layout) self.information_label = QtWidgets.QLabel( self.background_color_group_box) self.information_label.setObjectName('information_label') self.information_label.setWordWrap(True) self.form_layout.addRow(self.information_label) self.left_layout.addWidget(self.background_color_group_box) self.left_layout.addStretch() self.right_column.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred) self.right_layout.addStretch() # Signals and slots self.background_color_button.colorChanged.connect( self.on_background_color_changed)
def test_color_setter(self): """ Test that the color property setter method sets the color """ # GIVEN: An instance of ColorButton, with a mocked __init__ widget = ColorButton() # WHEN: Setting the color property widget.color = '#000000' # THEN: Then change_color should have been called with the value we set self.mocked_change_color.assert_called_with('#000000')
def test_color(self): """ Test that the color property method returns the set color """ # GIVEN: An instance of ColorButton, with a set _color attribute widget = ColorButton() widget._color = '#000000' # WHEN: Accesing the color property value = widget.color # THEN: The value set in _color should be returned assert value == '#000000', 'The value returned should be equal to the one we set'
def test_constructor(self, mocked_set_tool_tip): """ Test that constructing a ColorButton object works correctly """ # GIVEN: The ColorButton class, a mocked change_color, setToolTip methods and clicked signal # WHEN: The ColorButton object is instantiated widget = ColorButton() # THEN: The widget __init__ method should have the correct properties and methods called assert widget.parent is None, 'The parent should be the same as the one that the class was instianted with' self.mocked_change_color.assert_called_once_with('#ffffff') mocked_set_tool_tip.assert_called_once_with('Tool Tip Text') self.mocked_clicked.connect.assert_called_once_with(widget.on_clicked)
def test_change_color(self, mocked_set_style_sheet): """ Test that change_color sets the new color and the stylesheet """ self.change_color_patcher.stop() # GIVEN: An instance of the ColorButton object, and a mocked out setStyleSheet widget = ColorButton() # WHEN: Changing the color widget.change_color('#000000') # THEN: The _color attribute should be set to #000000 and setStyleSheet should have been called twice assert widget._color == '#000000', '_color should have been set to #000000' mocked_set_style_sheet.assert_has_calls( [call('background-color: #ffffff'), call('background-color: #000000')]) self.mocked_change_color = self.change_color_patcher.start()
def test_on_clicked_new_color(self): """ Test the on_click method when a new color has been chosen and is valid """ # GIVEN: An instance of ColorButton, and a set _color attribute widget = ColorButton() self.mocked_change_color.reset_mock() self.mocked_color_changed.reset_mock() widget._color = '#000000' # WHEN: The on_clicked method is called, and the color is valid, and different to the existing color self.mocked_qt_widgets.QColorDialog.getColor.return_value = MagicMock( **{'isValid.return_value': True, 'name.return_value': '#ffffff'}) widget.on_clicked() # THEN: change_color should have been called and the colorChanged signal should have been emitted self.mocked_change_color.assert_called_once_with('#ffffff') self.mocked_color_changed.emit.assert_called_once_with('#ffffff')
def test_on_clicked_invalid_color(self): """ Test the on_click method when an invalid color has been supplied """ # GIVEN: An instance of ColorButton, and a set _color attribute widget = ColorButton() self.mocked_change_color.reset_mock() self.mocked_color_changed.reset_mock() widget._color = '#000000' # WHEN: The on_clicked method is called, and the color is invalid self.mocked_qt_widgets.QColorDialog.getColor.return_value = MagicMock(**{'isValid.return_value': False}) widget.on_clicked() # THEN: change_color should not have been called and the colorChanged signal should not have been emitted assert self.mocked_change_color.called is False, \ 'change_color should not have been called with an invalid color' assert self.mocked_color_changed.emit.called is False, \ 'colorChange signal should not have been emitted with an invalid color'
def test_on_clicked_same_color(self): """ Test the on_click method when a new color has not been chosen """ # GIVEN: An instance of ColorButton, and a set _color attribute widget = ColorButton() self.mocked_change_color.reset_mock() self.mocked_color_changed.reset_mock() widget._color = '#000000' # WHEN: The on_clicked method is called, and the color is valid, but the same as the existing color self.mocked_qt_widgets.QColorDialog.getColor.return_value = MagicMock( **{'isValid.return_value': True, 'name.return_value': '#000000'}) widget.on_clicked() # THEN: change_color should not have been called and the colorChanged signal should not have been emitted assert self.mocked_change_color.called is False, \ 'change_color should not have been called when the color has not changed' assert self.mocked_color_changed.emit.called is False, \ 'colorChange signal should not have been emitted when the color has not changed'
def setupUi(self): """ Set up the UI """ self.setObjectName('MediaTab') super(PlayerTab, self).setupUi() self.background_color_group_box = QtWidgets.QGroupBox(self.left_column) self.background_color_group_box.setObjectName( 'background_color_group_box') self.form_layout = QtWidgets.QFormLayout( self.background_color_group_box) self.form_layout.setObjectName('form_layout') self.color_layout = QtWidgets.QHBoxLayout() self.background_color_label = QtWidgets.QLabel( self.background_color_group_box) self.background_color_label.setObjectName('background_color_label') self.color_layout.addWidget(self.background_color_label) self.background_color_button = ColorButton( self.background_color_group_box) self.background_color_button.setObjectName('background_color_button') self.color_layout.addWidget(self.background_color_button) self.form_layout.addRow(self.color_layout) self.information_label = QtWidgets.QLabel( self.background_color_group_box) self.information_label.setObjectName('information_label') self.information_label.setWordWrap(True) self.form_layout.addRow(self.information_label) self.left_layout.addWidget(self.background_color_group_box) self.right_column.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred) self.media_player_group_box = QtWidgets.QGroupBox(self.left_column) self.media_player_group_box.setObjectName('media_player_group_box') self.media_player_layout = QtWidgets.QVBoxLayout( self.media_player_group_box) self.media_player_layout.setObjectName('media_player_layout') self.player_check_boxes = {} self.left_layout.addWidget(self.media_player_group_box) self.player_order_group_box = QtWidgets.QGroupBox(self.left_column) self.player_order_group_box.setObjectName('player_order_group_box') self.player_order_layout = QtWidgets.QHBoxLayout( self.player_order_group_box) self.player_order_layout.setObjectName('player_order_layout') self.player_order_list_widget = QtWidgets.QListWidget( self.player_order_group_box) size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) size_policy.setHorizontalStretch(0) size_policy.setVerticalStretch(0) size_policy.setHeightForWidth( self.player_order_list_widget.sizePolicy().hasHeightForWidth()) self.player_order_list_widget.setSizePolicy(size_policy) self.player_order_list_widget.setVerticalScrollBarPolicy( QtCore.Qt.ScrollBarAsNeeded) self.player_order_list_widget.setHorizontalScrollBarPolicy( QtCore.Qt.ScrollBarAlwaysOff) self.player_order_list_widget.setEditTriggers( QtWidgets.QAbstractItemView.NoEditTriggers) self.player_order_list_widget.setObjectName('player_order_list_widget') self.player_order_layout.addWidget(self.player_order_list_widget) self.ordering_button_layout = QtWidgets.QVBoxLayout() self.ordering_button_layout.setObjectName('ordering_button_layout') self.ordering_button_layout.addStretch(1) self.ordering_up_button = create_button( self, 'ordering_up_button', role='up', click=self.on_up_button_clicked) self.ordering_down_button = create_button( self, 'ordering_down_button', role='down', click=self.on_down_button_clicked) self.ordering_button_layout.addWidget(self.ordering_up_button) self.ordering_button_layout.addWidget(self.ordering_down_button) self.ordering_button_layout.addStretch(1) self.player_order_layout.addLayout(self.ordering_button_layout) self.left_layout.addWidget(self.player_order_group_box) self.left_layout.addStretch() self.right_layout.addStretch() # Signals and slots self.background_color_button.colorChanged.connect( self.on_background_color_changed)
def setupUi(self): """ Create the user interface for the general settings tab """ self.setObjectName('GeneralTab') super(GeneralTab, self).setupUi() self.tab_layout.setStretch(1, 1) # Monitors self.monitor_group_box = QtWidgets.QGroupBox(self.left_column) self.monitor_group_box.setObjectName('monitor_group_box') self.monitor_layout = QtWidgets.QGridLayout(self.monitor_group_box) self.monitor_layout.setObjectName('monitor_layout') self.monitor_radio_button = QtWidgets.QRadioButton( self.monitor_group_box) self.monitor_radio_button.setObjectName('monitor_radio_button') self.monitor_layout.addWidget(self.monitor_radio_button, 0, 0, 1, 5) self.monitor_combo_box = QtWidgets.QComboBox(self.monitor_group_box) self.monitor_combo_box.setObjectName('monitor_combo_box') self.monitor_layout.addWidget(self.monitor_combo_box, 1, 1, 1, 4) # Display Position self.override_radio_button = QtWidgets.QRadioButton( self.monitor_group_box) self.override_radio_button.setObjectName('override_radio_button') self.monitor_layout.addWidget(self.override_radio_button, 2, 0, 1, 5) # Custom position self.custom_x_label = QtWidgets.QLabel(self.monitor_group_box) self.custom_x_label.setObjectName('custom_x_label') self.monitor_layout.addWidget(self.custom_x_label, 3, 1) self.custom_X_value_edit = QtWidgets.QSpinBox(self.monitor_group_box) self.custom_X_value_edit.setObjectName('custom_X_value_edit') self.custom_X_value_edit.setRange(-9999, 9999) self.monitor_layout.addWidget(self.custom_X_value_edit, 4, 1) self.custom_y_label = QtWidgets.QLabel(self.monitor_group_box) self.custom_y_label.setObjectName('custom_y_label') self.monitor_layout.addWidget(self.custom_y_label, 3, 2) self.custom_Y_value_edit = QtWidgets.QSpinBox(self.monitor_group_box) self.custom_Y_value_edit.setObjectName('custom_Y_value_edit') self.custom_Y_value_edit.setRange(-9999, 9999) self.monitor_layout.addWidget(self.custom_Y_value_edit, 4, 2) self.custom_width_label = QtWidgets.QLabel(self.monitor_group_box) self.custom_width_label.setObjectName('custom_width_label') self.monitor_layout.addWidget(self.custom_width_label, 3, 3) self.custom_width_value_edit = QtWidgets.QSpinBox( self.monitor_group_box) self.custom_width_value_edit.setObjectName('custom_width_value_edit') self.custom_width_value_edit.setRange(1, 9999) self.monitor_layout.addWidget(self.custom_width_value_edit, 4, 3) self.custom_height_label = QtWidgets.QLabel(self.monitor_group_box) self.custom_height_label.setObjectName('custom_height_label') self.monitor_layout.addWidget(self.custom_height_label, 3, 4) self.custom_height_value_edit = QtWidgets.QSpinBox( self.monitor_group_box) self.custom_height_value_edit.setObjectName('custom_height_value_edit') self.custom_height_value_edit.setRange(1, 9999) self.monitor_layout.addWidget(self.custom_height_value_edit, 4, 4) self.display_on_monitor_check = QtWidgets.QCheckBox( self.monitor_group_box) self.display_on_monitor_check.setObjectName('monitor_combo_box') self.monitor_layout.addWidget(self.display_on_monitor_check, 5, 0, 1, 5) # Set up the stretchiness of each column, so that the first column # less stretchy (and therefore smaller) than the others self.monitor_layout.setColumnStretch(0, 1) self.monitor_layout.setColumnStretch(1, 3) self.monitor_layout.setColumnStretch(2, 3) self.monitor_layout.setColumnStretch(3, 3) self.monitor_layout.setColumnStretch(4, 3) self.left_layout.addWidget(self.monitor_group_box) # CCLI Details self.ccli_group_box = QtWidgets.QGroupBox(self.left_column) self.ccli_group_box.setObjectName('ccli_group_box') self.ccli_layout = QtWidgets.QFormLayout(self.ccli_group_box) self.ccli_layout.setObjectName('ccli_layout') self.number_label = QtWidgets.QLabel(self.ccli_group_box) self.number_label.setObjectName('number_label') self.number_edit = QtWidgets.QLineEdit(self.ccli_group_box) self.number_edit.setValidator(QtGui.QIntValidator()) self.number_edit.setObjectName('number_edit') self.ccli_layout.addRow(self.number_label, self.number_edit) self.username_label = QtWidgets.QLabel(self.ccli_group_box) self.username_label.setObjectName('username_label') self.username_edit = QtWidgets.QLineEdit(self.ccli_group_box) self.username_edit.setObjectName('username_edit') self.ccli_layout.addRow(self.username_label, self.username_edit) self.password_label = QtWidgets.QLabel(self.ccli_group_box) self.password_label.setObjectName('password_label') self.password_edit = QtWidgets.QLineEdit(self.ccli_group_box) self.password_edit.setEchoMode(QtWidgets.QLineEdit.Password) self.password_edit.setObjectName('password_edit') self.ccli_layout.addRow(self.password_label, self.password_edit) self.left_layout.addWidget(self.ccli_group_box) # Background audio self.audio_group_box = QtWidgets.QGroupBox(self.left_column) self.audio_group_box.setObjectName('audio_group_box') self.audio_layout = QtWidgets.QVBoxLayout(self.audio_group_box) self.audio_layout.setObjectName('audio_layout') self.start_paused_check_box = QtWidgets.QCheckBox(self.audio_group_box) self.start_paused_check_box.setObjectName('start_paused_check_box') self.audio_layout.addWidget(self.start_paused_check_box) self.repeat_list_check_box = QtWidgets.QCheckBox(self.audio_group_box) self.repeat_list_check_box.setObjectName('repeat_list_check_box') self.audio_layout.addWidget(self.repeat_list_check_box) self.left_layout.addWidget(self.audio_group_box) self.left_layout.addStretch() # Application Startup self.startup_group_box = QtWidgets.QGroupBox(self.right_column) self.startup_group_box.setObjectName('startup_group_box') self.startup_layout = QtWidgets.QVBoxLayout(self.startup_group_box) self.startup_layout.setObjectName('startup_layout') self.warning_check_box = QtWidgets.QCheckBox(self.startup_group_box) self.warning_check_box.setObjectName('warning_check_box') self.startup_layout.addWidget(self.warning_check_box) self.auto_open_check_box = QtWidgets.QCheckBox(self.startup_group_box) self.auto_open_check_box.setObjectName('auto_open_check_box') self.startup_layout.addWidget(self.auto_open_check_box) self.show_splash_check_box = QtWidgets.QCheckBox( self.startup_group_box) self.show_splash_check_box.setObjectName('show_splash_check_box') self.startup_layout.addWidget(self.show_splash_check_box) self.check_for_updates_check_box = QtWidgets.QCheckBox( self.startup_group_box) self.check_for_updates_check_box.setObjectName( 'check_for_updates_check_box') self.startup_layout.addWidget(self.check_for_updates_check_box) self.right_layout.addWidget(self.startup_group_box) # Logo self.logo_group_box = QtWidgets.QGroupBox(self.right_column) self.logo_group_box.setObjectName('logo_group_box') self.logo_layout = QtWidgets.QFormLayout(self.logo_group_box) self.logo_layout.setObjectName('logo_layout') self.logo_file_label = QtWidgets.QLabel(self.logo_group_box) self.logo_file_label.setObjectName('logo_file_label') self.logo_file_path_edit = PathEdit( self.logo_group_box, default_path=Path(':/graphics/openlp-splash-screen.png')) self.logo_layout.addRow(self.logo_file_label, self.logo_file_path_edit) self.logo_color_label = QtWidgets.QLabel(self.logo_group_box) self.logo_color_label.setObjectName('logo_color_label') self.logo_color_button = ColorButton(self.logo_group_box) self.logo_color_button.setObjectName('logo_color_button') self.logo_layout.addRow(self.logo_color_label, self.logo_color_button) self.logo_hide_on_startup_check_box = QtWidgets.QCheckBox( self.logo_group_box) self.logo_hide_on_startup_check_box.setObjectName( 'logo_hide_on_startup_check_box') self.logo_layout.addRow(self.logo_hide_on_startup_check_box) self.right_layout.addWidget(self.logo_group_box) self.logo_color_button.colorChanged.connect( self.on_logo_background_color_changed) # Application Settings self.settings_group_box = QtWidgets.QGroupBox(self.right_column) self.settings_group_box.setObjectName('settings_group_box') self.settings_layout = QtWidgets.QFormLayout(self.settings_group_box) self.settings_layout.setObjectName('settings_layout') self.save_check_service_check_box = QtWidgets.QCheckBox( self.settings_group_box) self.save_check_service_check_box.setObjectName( 'save_check_service_check_box') self.settings_layout.addRow(self.save_check_service_check_box) self.auto_unblank_check_box = QtWidgets.QCheckBox( self.settings_group_box) self.auto_unblank_check_box.setObjectName('auto_unblank_check_box') self.settings_layout.addRow(self.auto_unblank_check_box) self.click_live_slide_to_unblank_check_box = QtWidgets.QCheckBox( self.settings_group_box) self.click_live_slide_to_unblank_check_box.setObjectName( 'click_live_slide_to_unblank') self.settings_layout.addRow(self.click_live_slide_to_unblank_check_box) self.auto_preview_check_box = QtWidgets.QCheckBox( self.settings_group_box) self.auto_preview_check_box.setObjectName('auto_preview_check_box') self.settings_layout.addRow(self.auto_preview_check_box) # Moved here from image tab self.timeout_label = QtWidgets.QLabel(self.settings_group_box) self.timeout_label.setObjectName('timeout_label') self.timeout_spin_box = QtWidgets.QSpinBox(self.settings_group_box) self.timeout_spin_box.setObjectName('timeout_spin_box') self.timeout_spin_box.setRange(1, 180) self.settings_layout.addRow(self.timeout_label, self.timeout_spin_box) self.right_layout.addWidget(self.settings_group_box) self.right_layout.addStretch() # Signals and slots self.override_radio_button.toggled.connect( self.on_override_radio_button_pressed) self.custom_height_value_edit.valueChanged.connect( self.on_display_changed) self.custom_width_value_edit.valueChanged.connect( self.on_display_changed) self.custom_Y_value_edit.valueChanged.connect(self.on_display_changed) self.custom_X_value_edit.valueChanged.connect(self.on_display_changed) self.monitor_combo_box.currentIndexChanged.connect( self.on_display_changed) # Reload the tab, as the screen resolution/count may have changed. Registry().register_function('config_screen_changed', self.load) # Remove for now self.username_label.setVisible(False) self.username_edit.setVisible(False) self.password_label.setVisible(False) self.password_edit.setVisible(False)
def setup_ui(self): """ Set up the ui """ # background type self.background_label = FormLabel(self) self.background_label.setObjectName('background_label') self.layout.addWidget(self.background_label, 0, 0) self.background_combo_box = QtWidgets.QComboBox(self) self.background_combo_box.addItems(['', '', '', '', '', '']) self.background_combo_box.setObjectName('background_combo_box') self.layout.addWidget(self.background_combo_box, 0, 1, 1, 3) # color self.color_label = FormLabel(self) self.color_label.setObjectName('color_label') self.layout.addWidget(self.color_label, 1, 0) self.color_button = ColorButton(self) self.color_button.setObjectName('color_button') self.layout.addWidget(self.color_button, 1, 1) self.color_widgets = [self.color_label, self.color_button] # gradient self.gradient_type_label = FormLabel(self) self.gradient_type_label.setObjectName('gradient_type_label') self.layout.addWidget(self.gradient_type_label, 2, 0) self.gradient_combo_box = QtWidgets.QComboBox(self) self.gradient_combo_box.setObjectName('gradient_combo_box') self.gradient_combo_box.addItems(['', '', '', '', '']) self.layout.addWidget(self.gradient_combo_box, 2, 1, 1, 3) self.gradient_start_label = FormLabel(self) self.gradient_start_label.setObjectName('gradient_start_label') self.layout.addWidget(self.gradient_start_label, 3, 0) self.gradient_start_button = ColorButton(self) self.gradient_start_button.setObjectName('gradient_start_button') self.layout.addWidget(self.gradient_start_button, 3, 1) self.gradient_end_label = FormLabel(self) self.gradient_end_label.setObjectName('gradient_end_label') self.layout.addWidget(self.gradient_end_label, 3, 2) self.gradient_end_button = ColorButton(self) self.gradient_end_button.setObjectName('gradient_end_button') self.layout.addWidget(self.gradient_end_button, 3, 3) self.gradient_widgets = [ self.gradient_type_label, self.gradient_combo_box, self.gradient_start_label, self.gradient_start_button, self.gradient_end_label, self.gradient_end_button ] # image self.image_label = FormLabel(self) self.image_label.setObjectName('image_label') self.layout.addWidget(self.image_label, 4, 0) self.image_path_edit = PathEdit(self, dialog_caption=translate( 'OpenLP.ThemeWizard', 'Select Image'), show_revert=False) self.layout.addWidget(self.image_path_edit, 4, 1, 1, 3) self.image_color_label = FormLabel(self) self.image_color_label.setObjectName('image_color_label') self.layout.addWidget(self.image_color_label, 5, 0) self.image_color_button = ColorButton(self) self.image_color_button.color = '#000000' self.image_color_button.setObjectName('image_color_button') self.layout.addWidget(self.image_color_button, 5, 1) self.image_widgets = [ self.image_label, self.image_path_edit, self.image_color_label, self.image_color_button ] # video self.video_label = FormLabel(self) self.video_label.setObjectName('video_label') self.layout.addWidget(self.video_label, 6, 0) self.video_path_edit = PathEdit(self, dialog_caption=translate( 'OpenLP.ThemeWizard', 'Select Video'), show_revert=False) self.layout.addWidget(self.video_path_edit, 6, 1, 1, 3) self.video_color_label = FormLabel(self) self.video_color_label.setObjectName('video_color_label') self.layout.addWidget(self.video_color_label, 7, 0) self.video_color_button = ColorButton(self) self.video_color_button.color = '#000000' self.video_color_button.setObjectName('video_color_button') self.layout.addWidget(self.video_color_button, 7, 1) self.video_widgets = [ self.video_label, self.video_path_edit, self.video_color_label, self.video_color_button ] # Force everything up self.layout_spacer = QtWidgets.QSpacerItem(1, 1) self.layout.addItem(self.layout_spacer, 8, 0, 1, 4) # Connect slots self.background_combo_box.currentIndexChanged.connect( self._on_background_type_index_changed) # Force the first set of widgets to show self._on_background_type_index_changed(0)
def setup_ui(self): # Font name self.font_name_label = FormLabel(self) self.font_name_label.setObjectName('font_name_label') self.layout.addWidget(self.font_name_label, 0, 0) self.font_name_combobox = QtWidgets.QFontComboBox(self) self.font_name_combobox.setObjectName('font_name_combobox') self.layout.addWidget(self.font_name_combobox, 0, 1, 1, 3) # Font color self.font_color_label = FormLabel(self) self.font_color_label.setObjectName('font_color_label') self.layout.addWidget(self.font_color_label, 1, 0) self.font_color_button = ColorButton(self) self.font_color_button.setObjectName('font_color_button') self.layout.addWidget(self.font_color_button, 1, 1) # Font style self.font_style_label = FormLabel(self) self.font_style_label.setObjectName('font_style_label') self.layout.addWidget(self.font_style_label, 1, 2) self.style_layout = QtWidgets.QHBoxLayout() self.style_bold_button = QtWidgets.QToolButton(self) self.style_bold_button.setCheckable(True) self.style_bold_button.setIcon(UiIcons().bold) self.style_bold_button.setShortcut( QtGui.QKeySequence(QtGui.QKeySequence.Bold)) self.style_bold_button.setObjectName('style_bold_button') self.style_layout.addWidget(self.style_bold_button) self.style_italic_button = QtWidgets.QToolButton(self) self.style_italic_button.setCheckable(True) self.style_italic_button.setIcon(UiIcons().italic) self.style_italic_button.setShortcut( QtGui.QKeySequence(QtGui.QKeySequence.Italic)) self.style_italic_button.setObjectName('style_italic_button') self.style_layout.addWidget(self.style_italic_button) self.style_layout.addStretch(1) self.layout.addLayout(self.style_layout, 1, 3) # Font size self.font_size_label = FormLabel(self) self.font_size_label.setObjectName('font_size_label') self.layout.addWidget(self.font_size_label, 2, 0) self.font_size_spinbox = QtWidgets.QSpinBox(self) self.font_size_spinbox.setMaximum(999) self.font_size_spinbox.setValue(16) self.font_size_spinbox.setObjectName('font_size_spinbox') self.layout.addWidget(self.font_size_spinbox, 2, 1) # Line spacing self.line_spacing_label = FormLabel(self) self.line_spacing_label.setObjectName('line_spacing_label') self.layout.addWidget(self.line_spacing_label, 2, 2) self.line_spacing_spinbox = QtWidgets.QSpinBox(self) self.line_spacing_spinbox.setMinimum(-250) self.line_spacing_spinbox.setMaximum(250) self.line_spacing_spinbox.setObjectName('line_spacing_spinbox') self.layout.addWidget(self.line_spacing_spinbox, 2, 3) # Outline self.outline_groupbox = QtWidgets.QGroupBox(self) self.outline_groupbox.setCheckable(True) self.outline_groupbox.setChecked(False) self.outline_groupbox.setObjectName('outline_groupbox') self.outline_layout = QtWidgets.QGridLayout(self.outline_groupbox) self.layout.addWidget(self.outline_groupbox, 3, 0, 1, 2) # Outline colour self.outline_color_label = FormLabel(self.outline_groupbox) self.outline_color_label.setObjectName('outline_color_label') self.outline_layout.addWidget(self.outline_color_label, 0, 0) self.outline_color_button = ColorButton(self.outline_groupbox) self.outline_color_button.setObjectName('outline_color_button') self.outline_layout.addWidget(self.outline_color_button, 0, 1) # Outline size self.outline_size_label = FormLabel(self.outline_groupbox) self.outline_size_label.setObjectName('outline_size_label') self.outline_layout.addWidget(self.outline_size_label, 1, 0) self.outline_size_spinbox = QtWidgets.QSpinBox(self.outline_groupbox) self.outline_size_spinbox.setMaximum(9999) self.outline_size_spinbox.setObjectName('outline_size_spinbox') self.outline_layout.addWidget(self.outline_size_spinbox, 1, 1) # Shadow self.shadow_groupbox = QtWidgets.QGroupBox(self) self.shadow_groupbox.setCheckable(True) self.shadow_groupbox.setChecked(False) self.shadow_groupbox.setObjectName('shadow_groupbox') self.shadow_layout = QtWidgets.QGridLayout(self.shadow_groupbox) self.layout.addWidget(self.shadow_groupbox, 3, 2, 1, 2) # Shadow color self.shadow_color_label = FormLabel(self.shadow_groupbox) self.shadow_color_label.setObjectName('shadow_color_label') self.shadow_layout.addWidget(self.shadow_color_label, 0, 0) self.shadow_color_button = ColorButton(self.shadow_groupbox) self.shadow_color_button.setObjectName('shadow_color_button') self.shadow_layout.addWidget(self.shadow_color_button, 0, 1) # Shadow size self.shadow_size_label = FormLabel(self.shadow_groupbox) self.shadow_size_label.setObjectName('shadow_size_label') self.shadow_layout.addWidget(self.shadow_size_label, 1, 0) self.shadow_size_spinbox = QtWidgets.QSpinBox(self.shadow_groupbox) self.shadow_size_spinbox.setMaximum(9999) self.shadow_size_spinbox.setObjectName('shadow_size_spinbox') self.shadow_layout.addWidget(self.shadow_size_spinbox, 1, 1) # Connect all the signals self.font_name_combobox.activated.connect(self._on_font_name_changed) self.font_color_button.colorChanged.connect( self._on_font_color_changed) self.style_bold_button.toggled.connect(self._on_style_bold_toggled) self.style_italic_button.toggled.connect(self._on_style_italic_toggled) self.font_size_spinbox.valueChanged.connect(self._on_font_size_changed) self.line_spacing_spinbox.valueChanged.connect( self._on_line_spacing_changed) self.outline_groupbox.toggled.connect(self._on_outline_toggled) self.outline_color_button.colorChanged.connect( self._on_outline_color_changed) self.outline_size_spinbox.valueChanged.connect( self._on_outline_size_changed) self.shadow_groupbox.toggled.connect(self._on_shadow_toggled) self.shadow_color_button.colorChanged.connect( self._on_shadow_color_changed) self.shadow_size_spinbox.valueChanged.connect( self._on_shadow_size_changed)
def setupUi(self): self.setObjectName('AlertsTab') super(AlertsTab, self).setupUi() self.font_group_box = QtWidgets.QGroupBox(self.left_column) self.font_group_box.setObjectName('font_group_box') self.font_layout = QtWidgets.QFormLayout(self.font_group_box) self.font_layout.setObjectName('font_layout') self.font_label = QtWidgets.QLabel(self.font_group_box) self.font_label.setObjectName('font_label') self.font_combo_box = QtWidgets.QFontComboBox(self.font_group_box) self.font_combo_box.setObjectName('font_combo_box') self.font_layout.addRow(self.font_label, self.font_combo_box) self.font_color_label = QtWidgets.QLabel(self.font_group_box) self.font_color_label.setObjectName('font_color_label') self.color_layout = QtWidgets.QHBoxLayout() self.color_layout.setObjectName('color_layout') self.font_color_button = ColorButton(self.font_group_box) self.font_color_button.setObjectName('font_color_button') self.color_layout.addWidget(self.font_color_button) self.color_layout.addSpacing(20) self.background_color_label = QtWidgets.QLabel(self.font_group_box) self.background_color_label.setObjectName('background_color_label') self.color_layout.addWidget(self.background_color_label) self.background_color_button = ColorButton(self.font_group_box) self.background_color_button.setObjectName('background_color_button') self.color_layout.addWidget(self.background_color_button) self.font_layout.addRow(self.font_color_label, self.color_layout) self.font_size_label = QtWidgets.QLabel(self.font_group_box) self.font_size_label.setObjectName('font_size_label') self.font_size_spin_box = QtWidgets.QSpinBox(self.font_group_box) self.font_size_spin_box.setObjectName('font_size_spin_box') self.font_layout.addRow(self.font_size_label, self.font_size_spin_box) self.timeout_label = QtWidgets.QLabel(self.font_group_box) self.timeout_label.setObjectName('timeout_label') self.timeout_spin_box = QtWidgets.QSpinBox(self.font_group_box) self.timeout_spin_box.setMaximum(180) self.timeout_spin_box.setObjectName('timeout_spin_box') self.font_layout.addRow(self.timeout_label, self.timeout_spin_box) self.vertical_label, self.vertical_combo_box = create_valign_selection_widgets( self.font_group_box) self.vertical_label.setObjectName('vertical_label') self.vertical_combo_box.setObjectName('vertical_combo_box') self.font_layout.addRow(self.vertical_label, self.vertical_combo_box) self.left_layout.addWidget(self.font_group_box) self.left_layout.addStretch() self.preview_group_box = QtWidgets.QGroupBox(self.right_column) self.preview_group_box.setObjectName('preview_group_box') self.preview_layout = QtWidgets.QVBoxLayout(self.preview_group_box) self.preview_layout.setObjectName('preview_layout') self.font_preview = QtWidgets.QLineEdit(self.preview_group_box) self.font_preview.setObjectName('font_preview') self.preview_layout.addWidget(self.font_preview) self.right_layout.addWidget(self.preview_group_box) self.right_layout.addStretch() # Signals and slots self.background_color_button.colorChanged.connect( self.on_background_color_changed) self.font_color_button.colorChanged.connect(self.on_font_color_changed) self.font_combo_box.activated.connect(self.on_font_combo_box_clicked) self.timeout_spin_box.valueChanged.connect( self.on_timeout_spin_box_changed) self.font_size_spin_box.valueChanged.connect( self.on_font_size_spin_box_changed)
def setupUi(self, theme_wizard): """ Set up the UI """ theme_wizard.setObjectName('OpenLP.ThemeWizard') theme_wizard.setWindowIcon(UiIcons().main_icon) theme_wizard.setModal(True) theme_wizard.setOptions(QtWidgets.QWizard.IndependentPages | QtWidgets.QWizard.NoBackButtonOnStartPage | QtWidgets.QWizard.HaveCustomButton1) theme_wizard.setFixedWidth(640) if is_macosx(): theme_wizard.setPixmap( QtWidgets.QWizard.BackgroundPixmap, QtGui.QPixmap(':/wizards/openlp-osx-wizard.png')) else: theme_wizard.setWizardStyle(QtWidgets.QWizard.ModernStyle) self.spacer = QtWidgets.QSpacerItem(10, 0, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) # Welcome Page add_welcome_page(theme_wizard, ':/wizards/wizard_createtheme.bmp') # Background Page self.background_page = QtWidgets.QWizardPage() self.background_page.setObjectName('background_page') self.background_layout = QtWidgets.QVBoxLayout(self.background_page) self.background_layout.setObjectName('background_layout') self.background_type_layout = QtWidgets.QFormLayout() self.background_type_layout.setObjectName('background_type_layout') 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.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) self.background_layout.addLayout(self.background_type_layout) self.background_stack = QtWidgets.QStackedLayout() self.background_stack.setObjectName('background_stack') self.color_widget = QtWidgets.QWidget(self.background_page) self.color_widget.setObjectName('color_widget') self.color_layout = QtWidgets.QFormLayout(self.color_widget) self.color_layout.setContentsMargins(0, 0, 0, 0) self.color_layout.setObjectName('color_layout') self.color_label = QtWidgets.QLabel(self.color_widget) self.color_label.setObjectName('color_label') self.color_button = ColorButton(self.color_widget) self.color_button.setObjectName('color_button') self.color_layout.addRow(self.color_label, self.color_button) self.color_layout.setItem(1, QtWidgets.QFormLayout.LabelRole, self.spacer) self.background_stack.addWidget(self.color_widget) self.gradient_widget = QtWidgets.QWidget(self.background_page) self.gradient_widget.setObjectName('Gradient_widget') self.gradient_layout = QtWidgets.QFormLayout(self.gradient_widget) self.gradient_layout.setContentsMargins(0, 0, 0, 0) self.gradient_layout.setObjectName('gradient_layout') self.gradient_start_label = QtWidgets.QLabel(self.gradient_widget) self.gradient_start_label.setObjectName('gradient_start_label') self.gradient_start_button = ColorButton(self.gradient_widget) self.gradient_start_button.setObjectName('gradient_start_button') self.gradient_layout.addRow(self.gradient_start_label, self.gradient_start_button) self.gradient_end_label = QtWidgets.QLabel(self.gradient_widget) self.gradient_end_label.setObjectName('gradient_end_label') self.gradient_end_button = ColorButton(self.gradient_widget) self.gradient_end_button.setObjectName('gradient_end_button') self.gradient_layout.addRow(self.gradient_end_label, self.gradient_end_button) self.gradient_type_label = QtWidgets.QLabel(self.gradient_widget) self.gradient_type_label.setObjectName('Gradient_type_label') self.gradient_combo_box = QtWidgets.QComboBox(self.gradient_widget) self.gradient_combo_box.setObjectName('gradient_combo_box') self.gradient_combo_box.addItems(['', '', '', '', '']) self.gradient_layout.addRow(self.gradient_type_label, self.gradient_combo_box) self.gradient_layout.setItem(3, QtWidgets.QFormLayout.LabelRole, self.spacer) self.background_stack.addWidget(self.gradient_widget) self.image_widget = QtWidgets.QWidget(self.background_page) self.image_widget.setObjectName('image_widget') self.image_layout = QtWidgets.QFormLayout(self.image_widget) self.image_layout.setContentsMargins(0, 0, 0, 0) self.image_layout.setObjectName('image_layout') self.image_color_label = QtWidgets.QLabel(self.color_widget) self.image_color_label.setObjectName('image_color_label') self.image_color_button = ColorButton(self.color_widget) self.image_color_button.setObjectName('image_color_button') self.image_layout.addRow(self.image_color_label, self.image_color_button) self.image_label = QtWidgets.QLabel(self.image_widget) self.image_label.setObjectName('image_label') self.image_path_edit = PathEdit(self.image_widget, dialog_caption=translate( 'OpenLP.ThemeWizard', 'Select Image'), show_revert=False) self.image_layout.addRow(self.image_label, self.image_path_edit) self.image_layout.setItem(2, QtWidgets.QFormLayout.LabelRole, self.spacer) self.background_stack.addWidget(self.image_widget) self.transparent_widget = QtWidgets.QWidget(self.background_page) self.transparent_widget.setObjectName('TransparentWidget') self.transparent_layout = QtWidgets.QFormLayout( self.transparent_widget) self.transparent_layout.setContentsMargins(0, 0, 0, 0) self.transparent_layout.setObjectName('Transparent_layout') self.background_stack.addWidget(self.transparent_widget) self.background_layout.addLayout(self.background_stack) self.video_widget = QtWidgets.QWidget(self.background_page) self.video_widget.setObjectName('video_widget') self.video_layout = QtWidgets.QFormLayout(self.video_widget) self.video_layout.setContentsMargins(0, 0, 0, 0) self.video_layout.setObjectName('video_layout') self.video_color_label = QtWidgets.QLabel(self.color_widget) self.video_color_label.setObjectName('video_color_label') self.video_color_button = ColorButton(self.color_widget) self.video_color_button.setObjectName('video_color_button') self.video_layout.addRow(self.video_color_label, self.video_color_button) self.video_label = QtWidgets.QLabel(self.video_widget) self.video_label.setObjectName('video_label') self.video_path_edit = PathEdit(self.video_widget, dialog_caption=translate( 'OpenLP.ThemeWizard', 'Select Video'), show_revert=False) self.video_layout.addRow(self.video_label, self.video_path_edit) self.video_layout.setItem(2, QtWidgets.QFormLayout.LabelRole, self.spacer) self.background_stack.addWidget(self.video_widget) theme_wizard.addPage(self.background_page) # Main Area Page self.main_area_page = QtWidgets.QWizardPage() self.main_area_page.setObjectName('main_area_page') self.main_area_layout = QtWidgets.QFormLayout(self.main_area_page) self.main_area_layout.setObjectName('main_area_layout') self.main_font_label = QtWidgets.QLabel(self.main_area_page) self.main_font_label.setObjectName('main_font_label') self.main_font_combo_box = QtWidgets.QFontComboBox(self.main_area_page) self.main_font_combo_box.setObjectName('main_font_combo_box') self.main_area_layout.addRow(self.main_font_label, self.main_font_combo_box) self.main_color_label = QtWidgets.QLabel(self.main_area_page) self.main_color_label.setObjectName('main_color_label') self.main_properties_layout = QtWidgets.QHBoxLayout() self.main_properties_layout.setObjectName('main_properties_layout') self.main_color_button = ColorButton(self.main_area_page) self.main_color_button.setObjectName('main_color_button') self.main_properties_layout.addWidget(self.main_color_button) self.main_properties_layout.addSpacing(20) self.main_bold_check_box = QtWidgets.QCheckBox(self.main_area_page) self.main_bold_check_box.setObjectName('main_bold_check_box') self.main_properties_layout.addWidget(self.main_bold_check_box) self.main_properties_layout.addSpacing(20) self.main_italics_check_box = QtWidgets.QCheckBox(self.main_area_page) self.main_italics_check_box.setObjectName('MainItalicsCheckBox') self.main_properties_layout.addWidget(self.main_italics_check_box) self.main_area_layout.addRow(self.main_color_label, self.main_properties_layout) self.main_size_label = QtWidgets.QLabel(self.main_area_page) self.main_size_label.setObjectName('main_size_label') self.main_size_layout = QtWidgets.QHBoxLayout() self.main_size_layout.setObjectName('main_size_layout') self.main_size_spin_box = QtWidgets.QSpinBox(self.main_area_page) self.main_size_spin_box.setMaximum(999) self.main_size_spin_box.setValue(16) self.main_size_spin_box.setObjectName('main_size_spin_box') self.main_size_layout.addWidget(self.main_size_spin_box) self.main_line_count_label = QtWidgets.QLabel(self.main_area_page) self.main_line_count_label.setObjectName('main_line_count_label') self.main_size_layout.addWidget(self.main_line_count_label) self.main_area_layout.addRow(self.main_size_label, self.main_size_layout) self.line_spacing_label = QtWidgets.QLabel(self.main_area_page) self.line_spacing_label.setObjectName('line_spacing_label') self.line_spacing_spin_box = QtWidgets.QSpinBox(self.main_area_page) self.line_spacing_spin_box.setMinimum(-250) self.line_spacing_spin_box.setMaximum(250) self.line_spacing_spin_box.setObjectName('line_spacing_spin_box') self.main_area_layout.addRow(self.line_spacing_label, self.line_spacing_spin_box) self.outline_check_box = QtWidgets.QCheckBox(self.main_area_page) self.outline_check_box.setObjectName('outline_check_box') self.outline_layout = QtWidgets.QHBoxLayout() self.outline_layout.setObjectName('outline_layout') self.outline_color_button = ColorButton(self.main_area_page) self.outline_color_button.setEnabled(False) self.outline_color_button.setObjectName('Outline_color_button') self.outline_layout.addWidget(self.outline_color_button) self.outline_layout.addSpacing(20) self.outline_size_label = QtWidgets.QLabel(self.main_area_page) self.outline_size_label.setObjectName('outline_size_label') self.outline_layout.addWidget(self.outline_size_label) self.outline_size_spin_box = QtWidgets.QSpinBox(self.main_area_page) self.outline_size_spin_box.setEnabled(False) self.outline_size_spin_box.setObjectName('outline_size_spin_box') self.outline_layout.addWidget(self.outline_size_spin_box) self.main_area_layout.addRow(self.outline_check_box, self.outline_layout) self.shadow_check_box = QtWidgets.QCheckBox(self.main_area_page) self.shadow_check_box.setObjectName('shadow_check_box') self.shadow_layout = QtWidgets.QHBoxLayout() self.shadow_layout.setObjectName('shadow_layout') self.shadow_color_button = ColorButton(self.main_area_page) self.shadow_color_button.setEnabled(False) self.shadow_color_button.setObjectName('shadow_color_button') self.shadow_layout.addWidget(self.shadow_color_button) self.shadow_layout.addSpacing(20) self.shadow_size_label = QtWidgets.QLabel(self.main_area_page) self.shadow_size_label.setObjectName('shadow_size_label') self.shadow_layout.addWidget(self.shadow_size_label) self.shadow_size_spin_box = QtWidgets.QSpinBox(self.main_area_page) self.shadow_size_spin_box.setEnabled(False) self.shadow_size_spin_box.setObjectName('shadow_size_spin_box') self.shadow_layout.addWidget(self.shadow_size_spin_box) self.main_area_layout.addRow(self.shadow_check_box, self.shadow_layout) theme_wizard.addPage(self.main_area_page) # Footer Area Page self.footer_area_page = QtWidgets.QWizardPage() self.footer_area_page.setObjectName('footer_area_page') self.footer_area_layout = QtWidgets.QFormLayout(self.footer_area_page) self.footer_area_layout.setObjectName('footer_area_layout') self.footer_font_label = QtWidgets.QLabel(self.footer_area_page) self.footer_font_label.setObjectName('FooterFontLabel') self.footer_font_combo_box = QtWidgets.QFontComboBox( self.footer_area_page) self.footer_font_combo_box.setObjectName('footer_font_combo_box') self.footer_area_layout.addRow(self.footer_font_label, self.footer_font_combo_box) self.footer_color_label = QtWidgets.QLabel(self.footer_area_page) self.footer_color_label.setObjectName('footer_color_label') self.footer_color_button = ColorButton(self.footer_area_page) self.footer_color_button.setObjectName('footer_color_button') self.footer_area_layout.addRow(self.footer_color_label, self.footer_color_button) self.footer_size_label = QtWidgets.QLabel(self.footer_area_page) self.footer_size_label.setObjectName('footer_size_label') self.footer_size_spin_box = QtWidgets.QSpinBox(self.footer_area_page) self.footer_size_spin_box.setMaximum(999) self.footer_size_spin_box.setValue(10) self.footer_size_spin_box.setObjectName('FooterSizeSpinBox') self.footer_area_layout.addRow(self.footer_size_label, self.footer_size_spin_box) self.footer_area_layout.setItem(3, QtWidgets.QFormLayout.LabelRole, self.spacer) theme_wizard.addPage(self.footer_area_page) # Alignment Page self.alignment_page = QtWidgets.QWizardPage() self.alignment_page.setObjectName('alignment_page') self.alignment_layout = QtWidgets.QFormLayout(self.alignment_page) self.alignment_layout.setObjectName('alignment_layout') self.horizontal_label = QtWidgets.QLabel(self.alignment_page) self.horizontal_label.setObjectName('horizontal_label') self.horizontal_combo_box = QtWidgets.QComboBox(self.alignment_page) self.horizontal_combo_box.addItems(['', '', '', '']) self.horizontal_combo_box.setObjectName('horizontal_combo_box') self.alignment_layout.addRow(self.horizontal_label, self.horizontal_combo_box) self.vertical_label, self.vertical_combo_box = create_valign_selection_widgets( self.alignment_page) self.vertical_label.setObjectName('vertical_label') self.vertical_combo_box.setObjectName('vertical_combo_box') self.alignment_layout.addRow(self.vertical_label, self.vertical_combo_box) self.transitions_label = QtWidgets.QLabel(self.alignment_page) self.transitions_label.setObjectName('transitions_label') self.transitions_check_box = QtWidgets.QCheckBox(self.alignment_page) self.transitions_check_box.setObjectName('transitions_check_box') self.alignment_layout.addRow(self.transitions_label, self.transitions_check_box) self.alignment_layout.setItem(3, QtWidgets.QFormLayout.LabelRole, self.spacer) theme_wizard.addPage(self.alignment_page) # Area Position Page self.area_position_page = QtWidgets.QWizardPage() self.area_position_page.setObjectName('area_position_page') self.area_position_layout = QtWidgets.QHBoxLayout( self.area_position_page) self.area_position_layout.setObjectName('area_position_layout') self.main_position_group_box = QtWidgets.QGroupBox( self.area_position_page) self.main_position_group_box.setObjectName('main_position_group_box') self.main_position_layout = QtWidgets.QFormLayout( self.main_position_group_box) self.main_position_layout.setObjectName('main_position_layout') self.main_position_check_box = QtWidgets.QCheckBox( self.main_position_group_box) self.main_position_check_box.setObjectName('main_position_check_box') self.main_position_layout.addRow(self.main_position_check_box) self.main_x_label = QtWidgets.QLabel(self.main_position_group_box) self.main_x_label.setObjectName('main_x_label') self.main_x_spin_box = QtWidgets.QSpinBox(self.main_position_group_box) self.main_x_spin_box.setMaximum(9999) self.main_x_spin_box.setObjectName('main_x_spin_box') self.main_position_layout.addRow(self.main_x_label, self.main_x_spin_box) self.main_y_label = QtWidgets.QLabel(self.main_position_group_box) self.main_y_label.setObjectName('main_y_label') self.main_y_spin_box = QtWidgets.QSpinBox(self.main_position_group_box) self.main_y_spin_box.setMaximum(9999) self.main_y_spin_box.setObjectName('main_y_spin_box') self.main_position_layout.addRow(self.main_y_label, self.main_y_spin_box) self.main_width_label = QtWidgets.QLabel(self.main_position_group_box) self.main_width_label.setObjectName('main_width_label') self.main_width_spin_box = QtWidgets.QSpinBox( self.main_position_group_box) self.main_width_spin_box.setMaximum(9999) self.main_width_spin_box.setObjectName('main_width_spin_box') self.main_position_layout.addRow(self.main_width_label, self.main_width_spin_box) self.main_height_label = QtWidgets.QLabel(self.main_position_group_box) self.main_height_label.setObjectName('main_height_label') self.main_height_spin_box = QtWidgets.QSpinBox( self.main_position_group_box) self.main_height_spin_box.setMaximum(9999) self.main_height_spin_box.setObjectName('main_height_spin_box') self.main_position_layout.addRow(self.main_height_label, self.main_height_spin_box) self.area_position_layout.addWidget(self.main_position_group_box) self.footer_position_group_box = QtWidgets.QGroupBox( self.area_position_page) self.footer_position_group_box.setObjectName( 'footer_position_group_box') self.footer_position_layout = QtWidgets.QFormLayout( self.footer_position_group_box) self.footer_position_layout.setObjectName('footer_position_layout') self.footer_position_check_box = QtWidgets.QCheckBox( self.footer_position_group_box) self.footer_position_check_box.setObjectName( 'footer_position_check_box') self.footer_position_layout.addRow(self.footer_position_check_box) self.footer_x_label = QtWidgets.QLabel(self.footer_position_group_box) self.footer_x_label.setObjectName('footer_x_label') self.footer_x_spin_box = QtWidgets.QSpinBox( self.footer_position_group_box) self.footer_x_spin_box.setMaximum(9999) self.footer_x_spin_box.setObjectName('footer_x_spin_box') self.footer_position_layout.addRow(self.footer_x_label, self.footer_x_spin_box) self.footer_y_label = QtWidgets.QLabel(self.footer_position_group_box) self.footer_y_label.setObjectName('footer_y_label') self.footer_y_spin_box = QtWidgets.QSpinBox( self.footer_position_group_box) self.footer_y_spin_box.setMaximum(9999) self.footer_y_spin_box.setObjectName('footer_y_spin_box') self.footer_position_layout.addRow(self.footer_y_label, self.footer_y_spin_box) self.footer_width_label = QtWidgets.QLabel( self.footer_position_group_box) self.footer_width_label.setObjectName('footer_width_label') self.footer_width_spin_box = QtWidgets.QSpinBox( self.footer_position_group_box) self.footer_width_spin_box.setMaximum(9999) self.footer_width_spin_box.setObjectName('footer_width_spin_box') self.footer_position_layout.addRow(self.footer_width_label, self.footer_width_spin_box) self.footer_height_label = QtWidgets.QLabel( self.footer_position_group_box) self.footer_height_label.setObjectName('footer_height_label') self.footer_height_spin_box = QtWidgets.QSpinBox( self.footer_position_group_box) self.footer_height_spin_box.setMaximum(9999) self.footer_height_spin_box.setObjectName('footer_height_spin_box') self.footer_position_layout.addRow(self.footer_height_label, self.footer_height_spin_box) self.area_position_layout.addWidget(self.footer_position_group_box) theme_wizard.addPage(self.area_position_page) # Preview Page self.preview_page = QtWidgets.QWizardPage() self.preview_page.setObjectName('preview_page') self.preview_layout = QtWidgets.QVBoxLayout(self.preview_page) self.preview_layout.setObjectName('preview_layout') self.theme_name_layout = QtWidgets.QFormLayout() self.theme_name_layout.setObjectName('theme_name_layout') self.theme_name_label = QtWidgets.QLabel(self.preview_page) self.theme_name_label.setObjectName('theme_name_label') self.theme_name_edit = QtWidgets.QLineEdit(self.preview_page) self.theme_name_edit.setValidator( QtGui.QRegExpValidator(QtCore.QRegExp(r'[^/\\?*|<>\[\]":<>+%]+'), self)) self.theme_name_edit.setObjectName('ThemeNameEdit') self.theme_name_layout.addRow(self.theme_name_label, self.theme_name_edit) self.preview_layout.addLayout(self.theme_name_layout) self.preview_area = QtWidgets.QWidget(self.preview_page) self.preview_area.setObjectName('PreviewArea') self.preview_area_layout = QtWidgets.QGridLayout(self.preview_area) self.preview_area_layout.setContentsMargins(0, 0, 0, 0) self.preview_area_layout.setColumnStretch(0, 1) self.preview_area_layout.setRowStretch(0, 1) self.preview_area_layout.setObjectName('preview_area_layout') self.preview_box_label = QtWidgets.QLabel(self.preview_area) self.preview_box_label.setFrameShape(QtWidgets.QFrame.Box) self.preview_box_label.setScaledContents(True) self.preview_box_label.setObjectName('preview_box_label') self.preview_area_layout.addWidget(self.preview_box_label) self.preview_layout.addWidget(self.preview_area) theme_wizard.addPage(self.preview_page) self.retranslateUi(theme_wizard) self.background_combo_box.currentIndexChanged.connect( self.background_stack.setCurrentIndex) self.outline_check_box.toggled.connect( self.outline_color_button.setEnabled) self.outline_check_box.toggled.connect( self.outline_size_spin_box.setEnabled) self.shadow_check_box.toggled.connect( self.shadow_color_button.setEnabled) self.shadow_check_box.toggled.connect( self.shadow_size_spin_box.setEnabled) self.main_position_check_box.toggled.connect( self.main_x_spin_box.setDisabled) self.main_position_check_box.toggled.connect( self.main_y_spin_box.setDisabled) self.main_position_check_box.toggled.connect( self.main_width_spin_box.setDisabled) self.main_position_check_box.toggled.connect( self.main_height_spin_box.setDisabled) self.footer_position_check_box.toggled.connect( self.footer_x_spin_box.setDisabled) self.footer_position_check_box.toggled.connect( self.footer_y_spin_box.setDisabled) self.footer_position_check_box.toggled.connect( self.footer_width_spin_box.setDisabled) self.footer_position_check_box.toggled.connect( self.footer_height_spin_box.setDisabled)
def setup_ui(self): """ Create the user interface for the general settings tab """ self.setObjectName('GeneralTab') super(GeneralTab, self).setup_ui() self.tab_layout.setStretch(1, 1) # CCLI Details self.ccli_group_box = QtWidgets.QGroupBox(self.left_column) self.ccli_group_box.setObjectName('ccli_group_box') self.ccli_layout = QtWidgets.QFormLayout(self.ccli_group_box) self.ccli_layout.setObjectName('ccli_layout') self.number_label = QtWidgets.QLabel(self.ccli_group_box) self.number_label.setObjectName('number_label') self.number_edit = QtWidgets.QLineEdit(self.ccli_group_box) self.number_edit.setValidator(QtGui.QIntValidator()) self.number_edit.setObjectName('number_edit') self.ccli_layout.addRow(self.number_label, self.number_edit) self.username_label = QtWidgets.QLabel(self.ccli_group_box) self.username_label.setObjectName('username_label') self.username_edit = QtWidgets.QLineEdit(self.ccli_group_box) self.username_edit.setObjectName('username_edit') self.ccli_layout.addRow(self.username_label, self.username_edit) self.password_label = QtWidgets.QLabel(self.ccli_group_box) self.password_label.setObjectName('password_label') self.password_edit = QtWidgets.QLineEdit(self.ccli_group_box) self.password_edit.setEchoMode(QtWidgets.QLineEdit.Password) self.password_edit.setObjectName('password_edit') self.ccli_layout.addRow(self.password_label, self.password_edit) self.left_layout.addWidget(self.ccli_group_box) self.left_layout.addStretch() # Application Startup self.startup_group_box = QtWidgets.QGroupBox(self.right_column) self.startup_group_box.setObjectName('startup_group_box') self.startup_layout = QtWidgets.QVBoxLayout(self.startup_group_box) self.startup_layout.setObjectName('startup_layout') self.warning_check_box = QtWidgets.QCheckBox(self.startup_group_box) self.warning_check_box.setObjectName('warning_check_box') self.startup_layout.addWidget(self.warning_check_box) self.auto_open_check_box = QtWidgets.QCheckBox(self.startup_group_box) self.auto_open_check_box.setObjectName('auto_open_check_box') self.startup_layout.addWidget(self.auto_open_check_box) self.show_splash_check_box = QtWidgets.QCheckBox( self.startup_group_box) self.show_splash_check_box.setObjectName('show_splash_check_box') self.startup_layout.addWidget(self.show_splash_check_box) self.check_for_updates_check_box = QtWidgets.QCheckBox( self.startup_group_box) self.check_for_updates_check_box.setObjectName( 'check_for_updates_check_box') self.startup_layout.addWidget(self.check_for_updates_check_box) self.right_layout.addWidget(self.startup_group_box) # Logo self.logo_group_box = QtWidgets.QGroupBox(self.right_column) self.logo_group_box.setObjectName('logo_group_box') self.logo_layout = QtWidgets.QFormLayout(self.logo_group_box) self.logo_layout.setObjectName('logo_layout') self.logo_file_label = QtWidgets.QLabel(self.logo_group_box) self.logo_file_label.setObjectName('logo_file_label') self.logo_file_path_edit = PathEdit( self.logo_group_box, default_path=Path(':/graphics/openlp-splash-screen.png')) self.logo_layout.addRow(self.logo_file_label, self.logo_file_path_edit) self.logo_color_label = QtWidgets.QLabel(self.logo_group_box) self.logo_color_label.setObjectName('logo_color_label') self.logo_color_button = ColorButton(self.logo_group_box) self.logo_color_button.setObjectName('logo_color_button') self.logo_layout.addRow(self.logo_color_label, self.logo_color_button) self.logo_hide_on_startup_check_box = QtWidgets.QCheckBox( self.logo_group_box) self.logo_hide_on_startup_check_box.setObjectName( 'logo_hide_on_startup_check_box') self.logo_layout.addRow(self.logo_hide_on_startup_check_box) self.right_layout.addWidget(self.logo_group_box) self.logo_color_button.colorChanged.connect( self.on_logo_background_color_changed) # Application Settings self.settings_group_box = QtWidgets.QGroupBox(self.right_column) self.settings_group_box.setObjectName('settings_group_box') self.settings_layout = QtWidgets.QFormLayout(self.settings_group_box) self.settings_layout.setObjectName('settings_layout') self.save_check_service_check_box = QtWidgets.QCheckBox( self.settings_group_box) self.save_check_service_check_box.setObjectName( 'save_check_service_check_box') self.settings_layout.addRow(self.save_check_service_check_box) self.auto_unblank_check_box = QtWidgets.QCheckBox( self.settings_group_box) self.auto_unblank_check_box.setObjectName('auto_unblank_check_box') self.settings_layout.addRow(self.auto_unblank_check_box) self.click_live_slide_to_unblank_check_box = QtWidgets.QCheckBox( self.settings_group_box) self.click_live_slide_to_unblank_check_box.setObjectName( 'click_live_slide_to_unblank') self.settings_layout.addRow(self.click_live_slide_to_unblank_check_box) self.auto_preview_check_box = QtWidgets.QCheckBox( self.settings_group_box) self.auto_preview_check_box.setObjectName('auto_preview_check_box') self.settings_layout.addRow(self.auto_preview_check_box) # Moved here from image tab self.timeout_label = QtWidgets.QLabel(self.settings_group_box) self.timeout_label.setObjectName('timeout_label') self.timeout_spin_box = QtWidgets.QSpinBox(self.settings_group_box) self.timeout_spin_box.setObjectName('timeout_spin_box') self.timeout_spin_box.setRange(1, 180) self.settings_layout.addRow(self.timeout_label, self.timeout_spin_box) self.right_layout.addWidget(self.settings_group_box) self.right_layout.addStretch() # Remove for now self.username_label.setVisible(False) self.username_edit.setVisible(False) self.password_label.setVisible(False) self.password_edit.setVisible(False)