class Ui_CustomSlideEditDialog(object): def setup_ui(self, custom_slide_edit_dialog): custom_slide_edit_dialog.setObjectName('custom_slide_edit_dialog') custom_slide_edit_dialog.setWindowIcon(UiIcons().main_icon) custom_slide_edit_dialog.resize(350, 300) self.dialog_layout = QtWidgets.QVBoxLayout(custom_slide_edit_dialog) self.slide_text_edit = SpellTextEdit(self) self.slide_text_edit.setObjectName('slide_text_edit') self.dialog_layout.addWidget(self.slide_text_edit) self.split_button = create_button(custom_slide_edit_dialog, 'splitButton', icon=UiIcons().add) self.insert_button = create_button(custom_slide_edit_dialog, 'insertButton', icon=UiIcons().add) self.button_box = create_button_box( custom_slide_edit_dialog, 'button_box', ['cancel', 'save'], [self.split_button, self.insert_button]) self.dialog_layout.addWidget(self.button_box) self.retranslate_ui(custom_slide_edit_dialog) def retranslate_ui(self, custom_slide_edit_dialog): custom_slide_edit_dialog.setWindowTitle( translate('CustomPlugin.EditVerseForm', 'Edit Slide')) self.split_button.setText(UiStrings().Split) self.split_button.setToolTip(UiStrings().SplitToolTip) self.insert_button.setText( translate('CustomPlugin.EditCustomForm', 'Insert Slide')) self.insert_button.setToolTip( translate('CustomPlugin.EditCustomForm', 'Split a slide into two by inserting a slide splitter.'))
def setup_ui(self, edit_verse_dialog): edit_verse_dialog.setObjectName('edit_verse_dialog') edit_verse_dialog.setWindowIcon(UiIcons().main_icon) edit_verse_dialog.resize(400, 400) edit_verse_dialog.setModal(True) self.dialog_layout = QtWidgets.QVBoxLayout(edit_verse_dialog) self.dialog_layout.setObjectName('dialog_layout') self.verse_text_edit = SpellTextEdit(edit_verse_dialog) self.verse_text_edit.setObjectName('verse_text_edit') self.dialog_layout.addWidget(self.verse_text_edit) self.verse_type_layout = QtWidgets.QHBoxLayout() self.verse_type_layout.setObjectName('verse_type_layout') self.forced_split_button = QtWidgets.QPushButton(edit_verse_dialog) self.forced_split_button.setIcon(UiIcons().add) self.forced_split_button.setObjectName('forced_split_button') self.verse_type_layout.addWidget(self.forced_split_button) self.overflow_split_button = QtWidgets.QPushButton(edit_verse_dialog) self.overflow_split_button.setIcon(UiIcons().add) self.overflow_split_button.setObjectName('overflow_split_button') self.verse_type_layout.addWidget(self.overflow_split_button) self.verse_type_label = QtWidgets.QLabel(edit_verse_dialog) self.verse_type_label.setObjectName('verse_type_label') self.verse_type_layout.addWidget(self.verse_type_label) self.verse_type_combo_box = QtWidgets.QComboBox(edit_verse_dialog) self.verse_type_combo_box.addItems(['', '', '', '', '', '', '']) self.verse_type_combo_box.setObjectName('verse_type_combo_box') self.verse_type_label.setBuddy(self.verse_type_combo_box) self.verse_type_layout.addWidget(self.verse_type_combo_box) self.verse_number_box = QtWidgets.QSpinBox(edit_verse_dialog) self.verse_number_box.setMinimum(1) self.verse_number_box.setObjectName('verse_number_box') self.verse_type_layout.addWidget(self.verse_number_box) self.insert_button = QtWidgets.QPushButton(edit_verse_dialog) self.insert_button.setIcon(UiIcons().add) self.insert_button.setObjectName('insert_button') self.verse_type_layout.addWidget(self.insert_button) self.verse_type_layout.addStretch() self.dialog_layout.addLayout(self.verse_type_layout) if Registry().get('settings').value('songs/enable chords'): self.transpose_layout = QtWidgets.QHBoxLayout() self.transpose_layout.setObjectName('transpose_layout') self.transpose_label = QtWidgets.QLabel(edit_verse_dialog) self.transpose_label.setObjectName('transpose_label') self.transpose_layout.addWidget(self.transpose_label) self.transpose_up_button = QtWidgets.QPushButton(edit_verse_dialog) self.transpose_up_button.setIcon(UiIcons().arrow_up) self.transpose_up_button.setObjectName('transpose_up') self.transpose_layout.addWidget(self.transpose_up_button) self.transpose_down_button = QtWidgets.QPushButton( edit_verse_dialog) self.transpose_down_button.setIcon(UiIcons().arrow_down) self.transpose_down_button.setObjectName('transpose_down') self.transpose_layout.addWidget(self.transpose_down_button) self.dialog_layout.addLayout(self.transpose_layout) self.button_box = create_button_box(edit_verse_dialog, 'button_box', ['cancel', 'ok']) self.dialog_layout.addWidget(self.button_box) self.retranslate_ui(edit_verse_dialog)
def setup_ui(self): """ Set up the UI of the dialog """ self.setObjectName('serviceNoteEdit') self.dialog_layout = QtWidgets.QVBoxLayout(self) self.dialog_layout.setContentsMargins(8, 8, 8, 8) self.dialog_layout.setSpacing(8) self.dialog_layout.setObjectName('vertical_layout') self.text_edit = SpellTextEdit(self, False) self.text_edit.setObjectName('textEdit') self.dialog_layout.addWidget(self.text_edit) self.button_box = create_button_box(self, 'button_box', ['cancel', 'save']) self.dialog_layout.addWidget(self.button_box)
class ServiceNoteForm(QtWidgets.QDialog, RegistryProperties): """ This is the form that is used to edit the verses of the song. """ def __init__(self): """ Constructor """ super(ServiceNoteForm, self).__init__( Registry().get('main_window'), QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) self.setup_ui() self.retranslate_ui() def exec(self): """ Execute the form and return the result. """ self.text_edit.setFocus() return QtWidgets.QDialog.exec(self) def setup_ui(self): """ Set up the UI of the dialog """ self.setObjectName('serviceNoteEdit') self.dialog_layout = QtWidgets.QVBoxLayout(self) self.dialog_layout.setContentsMargins(8, 8, 8, 8) self.dialog_layout.setSpacing(8) self.dialog_layout.setObjectName('vertical_layout') self.text_edit = SpellTextEdit(self, False) self.text_edit.setObjectName('textEdit') self.dialog_layout.addWidget(self.text_edit) self.button_box = create_button_box(self, 'button_box', ['cancel', 'save']) self.dialog_layout.addWidget(self.button_box) def retranslate_ui(self): """ Translate the UI on the fly """ self.setWindowTitle( translate('OpenLP.ServiceNoteForm', 'Service Item Notes'))
def setup_ui(self, custom_slide_edit_dialog): custom_slide_edit_dialog.setObjectName('custom_slide_edit_dialog') custom_slide_edit_dialog.setWindowIcon(UiIcons().main_icon) custom_slide_edit_dialog.resize(350, 300) self.dialog_layout = QtWidgets.QVBoxLayout(custom_slide_edit_dialog) self.slide_text_edit = SpellTextEdit(self) self.slide_text_edit.setObjectName('slide_text_edit') self.dialog_layout.addWidget(self.slide_text_edit) self.split_button = create_button(custom_slide_edit_dialog, 'splitButton', icon=UiIcons().add) self.insert_button = create_button(custom_slide_edit_dialog, 'insertButton', icon=UiIcons().add) self.button_box = create_button_box( custom_slide_edit_dialog, 'button_box', ['cancel', 'save'], [self.split_button, self.insert_button]) self.dialog_layout.addWidget(self.button_box) self.retranslate_ui(custom_slide_edit_dialog)
class Ui_EditVerseDialog(object): def setup_ui(self, edit_verse_dialog): edit_verse_dialog.setObjectName('edit_verse_dialog') edit_verse_dialog.setWindowIcon(UiIcons().main_icon) edit_verse_dialog.resize(400, 400) edit_verse_dialog.setModal(True) self.dialog_layout = QtWidgets.QVBoxLayout(edit_verse_dialog) self.dialog_layout.setObjectName('dialog_layout') self.verse_text_edit = SpellTextEdit(edit_verse_dialog) self.verse_text_edit.setObjectName('verse_text_edit') self.dialog_layout.addWidget(self.verse_text_edit) self.verse_type_layout = QtWidgets.QHBoxLayout() self.verse_type_layout.setObjectName('verse_type_layout') self.forced_split_button = QtWidgets.QPushButton(edit_verse_dialog) self.forced_split_button.setIcon(UiIcons().add) self.forced_split_button.setObjectName('forced_split_button') self.verse_type_layout.addWidget(self.forced_split_button) self.overflow_split_button = QtWidgets.QPushButton(edit_verse_dialog) self.overflow_split_button.setIcon(UiIcons().add) self.overflow_split_button.setObjectName('overflow_split_button') self.verse_type_layout.addWidget(self.overflow_split_button) self.verse_type_label = QtWidgets.QLabel(edit_verse_dialog) self.verse_type_label.setObjectName('verse_type_label') self.verse_type_layout.addWidget(self.verse_type_label) self.verse_type_combo_box = QtWidgets.QComboBox(edit_verse_dialog) self.verse_type_combo_box.addItems(['', '', '', '', '', '', '']) self.verse_type_combo_box.setObjectName('verse_type_combo_box') self.verse_type_label.setBuddy(self.verse_type_combo_box) self.verse_type_layout.addWidget(self.verse_type_combo_box) self.verse_number_box = QtWidgets.QSpinBox(edit_verse_dialog) self.verse_number_box.setMinimum(1) self.verse_number_box.setObjectName('verse_number_box') self.verse_type_layout.addWidget(self.verse_number_box) self.insert_button = QtWidgets.QPushButton(edit_verse_dialog) self.insert_button.setIcon(UiIcons().add) self.insert_button.setObjectName('insert_button') self.verse_type_layout.addWidget(self.insert_button) self.verse_type_layout.addStretch() self.dialog_layout.addLayout(self.verse_type_layout) if Registry().get('settings').value('songs/enable chords'): self.transpose_layout = QtWidgets.QHBoxLayout() self.transpose_layout.setObjectName('transpose_layout') self.transpose_label = QtWidgets.QLabel(edit_verse_dialog) self.transpose_label.setObjectName('transpose_label') self.transpose_layout.addWidget(self.transpose_label) self.transpose_up_button = QtWidgets.QPushButton(edit_verse_dialog) self.transpose_up_button.setIcon(UiIcons().arrow_up) self.transpose_up_button.setObjectName('transpose_up') self.transpose_layout.addWidget(self.transpose_up_button) self.transpose_down_button = QtWidgets.QPushButton( edit_verse_dialog) self.transpose_down_button.setIcon(UiIcons().arrow_down) self.transpose_down_button.setObjectName('transpose_down') self.transpose_layout.addWidget(self.transpose_down_button) self.dialog_layout.addLayout(self.transpose_layout) self.button_box = create_button_box(edit_verse_dialog, 'button_box', ['cancel', 'ok']) self.dialog_layout.addWidget(self.button_box) self.retranslate_ui(edit_verse_dialog) def retranslate_ui(self, edit_verse_dialog): edit_verse_dialog.setWindowTitle( translate('SongsPlugin.EditVerseForm', 'Edit Verse')) self.verse_type_label.setText( translate('SongsPlugin.EditVerseForm', '&Verse type:')) self.verse_type_combo_box.setItemText( VerseType.Verse, VerseType.translated_names[VerseType.Verse]) self.verse_type_combo_box.setItemText( VerseType.Chorus, VerseType.translated_names[VerseType.Chorus]) self.verse_type_combo_box.setItemText( VerseType.Bridge, VerseType.translated_names[VerseType.Bridge]) self.verse_type_combo_box.setItemText( VerseType.PreChorus, VerseType.translated_names[VerseType.PreChorus]) self.verse_type_combo_box.setItemText( VerseType.Intro, VerseType.translated_names[VerseType.Intro]) self.verse_type_combo_box.setItemText( VerseType.Ending, VerseType.translated_names[VerseType.Ending]) self.verse_type_combo_box.setItemText( VerseType.Other, VerseType.translated_names[VerseType.Other]) self.overflow_split_button.setText(UiStrings().Split) self.overflow_split_button.setToolTip(UiStrings().SplitToolTip) self.forced_split_button.setText( translate('SongsPlugin.EditVerseForm', '&Forced Split')) self.forced_split_button.setToolTip( translate( 'SongsPlugin.EditVerseForm', 'Split the verse when displayed ' 'regardless of the screen size.')) self.insert_button.setText( translate('SongsPlugin.EditVerseForm', '&Insert')) self.insert_button.setToolTip( translate('SongsPlugin.EditVerseForm', 'Split a slide into two by inserting a verse splitter.')) if Registry().get('settings').value('songs/enable chords'): self.transpose_label.setText( translate('SongsPlugin.EditVerseForm', 'Transpose:')) self.transpose_up_button.setText( translate('SongsPlugin.EditVerseForm', 'Up')) self.transpose_down_button.setText( translate('SongsPlugin.EditVerseForm', 'Down'))
def setup_ui(self, print_service_dialog): """ Set up the UI """ print_service_dialog.setObjectName('print_service_dialog') print_service_dialog.setWindowIcon(UiIcons().main_icon) print_service_dialog.resize(664, 594) self.main_layout = QtWidgets.QVBoxLayout(print_service_dialog) self.main_layout.setSpacing(0) self.main_layout.setContentsMargins(0, 0, 0, 0) self.main_layout.setObjectName('main_layout') self.toolbar = QtWidgets.QToolBar(print_service_dialog) self.toolbar.setIconSize(QtCore.QSize(22, 22)) self.toolbar.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) self.print_button = self.toolbar.addAction(UiIcons().print, translate('OpenLP.PrintServiceForm', 'Print')) self.options_button = QtWidgets.QToolButton(self.toolbar) self.options_button.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) self.options_button.setIcon(UiIcons().settings) self.options_button.setCheckable(True) self.toolbar.addWidget(self.options_button) self.toolbar.addSeparator() self.plain_copy = self.toolbar.addAction(UiIcons().clone, translate('OpenLP.PrintServiceForm', 'Copy as Text')) self.html_copy = self.toolbar.addAction(UiIcons().clone, translate('OpenLP.PrintServiceForm', 'Copy as HTML')) self.toolbar.addSeparator() self.zoom_in_button = QtWidgets.QToolButton(self.toolbar) self.zoom_in_button.setIcon(UiIcons().search_plus) self.zoom_in_button.setObjectName('zoom_in_button') self.zoom_in_button.setIconSize(QtCore.QSize(22, 22)) self.toolbar.addWidget(self.zoom_in_button) self.zoom_out_button = QtWidgets.QToolButton(self.toolbar) self.zoom_out_button.setIcon(UiIcons().search_minus) self.zoom_out_button.setObjectName('zoom_out_button') self.zoom_out_button.setIconSize(QtCore.QSize(22, 22)) self.toolbar.addWidget(self.zoom_out_button) self.zoom_original_button = QtWidgets.QToolButton(self.toolbar) self.zoom_original_button.setIcon(UiIcons().search) self.zoom_original_button.setObjectName('zoom_original_button') self.zoom_original_button.setIconSize(QtCore.QSize(22, 22)) self.toolbar.addWidget(self.zoom_original_button) self.zoom_combo_box = QtWidgets.QComboBox(print_service_dialog) self.zoom_combo_box.setObjectName('zoom_combo_box') self.toolbar.addWidget(self.zoom_combo_box) self.main_layout.addWidget(self.toolbar) self.preview_widget = QtPrintSupport.QPrintPreviewWidget(print_service_dialog) self.main_layout.addWidget(self.preview_widget) self.options_widget = QtWidgets.QWidget(print_service_dialog) self.options_widget.hide() self.options_widget.resize(400, 350) self.options_widget.setAutoFillBackground(True) self.options_layout = QtWidgets.QVBoxLayout(self.options_widget) self.options_layout.setContentsMargins(8, 8, 8, 8) self.title_label = QtWidgets.QLabel(self.options_widget) self.title_label.setObjectName('title_label') self.options_layout.addWidget(self.title_label) self.title_line_edit = QtWidgets.QLineEdit(self.options_widget) self.title_line_edit.setObjectName('title_line_edit') self.options_layout.addWidget(self.title_line_edit) self.footer_label = QtWidgets.QLabel(self.options_widget) self.footer_label.setObjectName('footer_label') self.options_layout.addWidget(self.footer_label) self.footer_text_edit = SpellTextEdit(self.options_widget, False) self.footer_text_edit.setObjectName('footer_text_edit') self.options_layout.addWidget(self.footer_text_edit) self.options_group_box = QtWidgets.QGroupBox() self.group_layout = QtWidgets.QVBoxLayout() self.slide_text_check_box = QtWidgets.QCheckBox() self.group_layout.addWidget(self.slide_text_check_box) self.page_break_after_text = QtWidgets.QCheckBox() self.group_layout.addWidget(self.page_break_after_text) self.notes_check_box = QtWidgets.QCheckBox() self.group_layout.addWidget(self.notes_check_box) self.meta_data_check_box = QtWidgets.QCheckBox() self.group_layout.addWidget(self.meta_data_check_box) self.show_chords_check_box = QtWidgets.QCheckBox() self.group_layout.addWidget(self.show_chords_check_box) self.group_layout.addStretch(1) self.options_group_box.setLayout(self.group_layout) self.options_layout.addWidget(self.options_group_box) self.retranslate_ui(print_service_dialog) self.options_button.toggled.connect(self.toggle_options)
class Ui_PrintServiceDialog(object): """ The UI of the print service dialog """ def setup_ui(self, print_service_dialog): """ Set up the UI """ print_service_dialog.setObjectName('print_service_dialog') print_service_dialog.setWindowIcon(UiIcons().main_icon) print_service_dialog.resize(664, 594) self.main_layout = QtWidgets.QVBoxLayout(print_service_dialog) self.main_layout.setSpacing(0) self.main_layout.setContentsMargins(0, 0, 0, 0) self.main_layout.setObjectName('main_layout') self.toolbar = QtWidgets.QToolBar(print_service_dialog) self.toolbar.setIconSize(QtCore.QSize(22, 22)) self.toolbar.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) self.print_button = self.toolbar.addAction(UiIcons().print, translate('OpenLP.PrintServiceForm', 'Print')) self.options_button = QtWidgets.QToolButton(self.toolbar) self.options_button.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon) self.options_button.setIcon(UiIcons().settings) self.options_button.setCheckable(True) self.toolbar.addWidget(self.options_button) self.toolbar.addSeparator() self.plain_copy = self.toolbar.addAction(UiIcons().clone, translate('OpenLP.PrintServiceForm', 'Copy as Text')) self.html_copy = self.toolbar.addAction(UiIcons().clone, translate('OpenLP.PrintServiceForm', 'Copy as HTML')) self.toolbar.addSeparator() self.zoom_in_button = QtWidgets.QToolButton(self.toolbar) self.zoom_in_button.setIcon(UiIcons().search_plus) self.zoom_in_button.setObjectName('zoom_in_button') self.zoom_in_button.setIconSize(QtCore.QSize(22, 22)) self.toolbar.addWidget(self.zoom_in_button) self.zoom_out_button = QtWidgets.QToolButton(self.toolbar) self.zoom_out_button.setIcon(UiIcons().search_minus) self.zoom_out_button.setObjectName('zoom_out_button') self.zoom_out_button.setIconSize(QtCore.QSize(22, 22)) self.toolbar.addWidget(self.zoom_out_button) self.zoom_original_button = QtWidgets.QToolButton(self.toolbar) self.zoom_original_button.setIcon(UiIcons().search) self.zoom_original_button.setObjectName('zoom_original_button') self.zoom_original_button.setIconSize(QtCore.QSize(22, 22)) self.toolbar.addWidget(self.zoom_original_button) self.zoom_combo_box = QtWidgets.QComboBox(print_service_dialog) self.zoom_combo_box.setObjectName('zoom_combo_box') self.toolbar.addWidget(self.zoom_combo_box) self.main_layout.addWidget(self.toolbar) self.preview_widget = QtPrintSupport.QPrintPreviewWidget(print_service_dialog) self.main_layout.addWidget(self.preview_widget) self.options_widget = QtWidgets.QWidget(print_service_dialog) self.options_widget.hide() self.options_widget.resize(400, 350) self.options_widget.setAutoFillBackground(True) self.options_layout = QtWidgets.QVBoxLayout(self.options_widget) self.options_layout.setContentsMargins(8, 8, 8, 8) self.title_label = QtWidgets.QLabel(self.options_widget) self.title_label.setObjectName('title_label') self.options_layout.addWidget(self.title_label) self.title_line_edit = QtWidgets.QLineEdit(self.options_widget) self.title_line_edit.setObjectName('title_line_edit') self.options_layout.addWidget(self.title_line_edit) self.footer_label = QtWidgets.QLabel(self.options_widget) self.footer_label.setObjectName('footer_label') self.options_layout.addWidget(self.footer_label) self.footer_text_edit = SpellTextEdit(self.options_widget, False) self.footer_text_edit.setObjectName('footer_text_edit') self.options_layout.addWidget(self.footer_text_edit) self.options_group_box = QtWidgets.QGroupBox() self.group_layout = QtWidgets.QVBoxLayout() self.slide_text_check_box = QtWidgets.QCheckBox() self.group_layout.addWidget(self.slide_text_check_box) self.page_break_after_text = QtWidgets.QCheckBox() self.group_layout.addWidget(self.page_break_after_text) self.notes_check_box = QtWidgets.QCheckBox() self.group_layout.addWidget(self.notes_check_box) self.meta_data_check_box = QtWidgets.QCheckBox() self.group_layout.addWidget(self.meta_data_check_box) self.show_chords_check_box = QtWidgets.QCheckBox() self.group_layout.addWidget(self.show_chords_check_box) self.group_layout.addStretch(1) self.options_group_box.setLayout(self.group_layout) self.options_layout.addWidget(self.options_group_box) self.retranslate_ui(print_service_dialog) self.options_button.toggled.connect(self.toggle_options) def retranslate_ui(self, print_service_dialog): """ Translate the UI on the fly """ print_service_dialog.setWindowTitle(UiStrings().PrintService) self.zoom_out_button.setToolTip(translate('OpenLP.PrintServiceForm', 'Zoom Out')) self.zoom_original_button.setToolTip(translate('OpenLP.PrintServiceForm', 'Zoom Original')) self.zoom_in_button.setToolTip(translate('OpenLP.PrintServiceForm', 'Zoom In')) self.options_button.setText(translate('OpenLP.PrintServiceForm', 'Options')) self.title_label.setText(translate('OpenLP.PrintServiceForm', 'Title:')) self.footer_label.setText(translate('OpenLP.PrintServiceForm', 'Service Note Text:')) self.options_group_box.setTitle(translate('OpenLP.PrintServiceForm', 'Other Options')) self.slide_text_check_box.setText(translate('OpenLP.PrintServiceForm', 'Include slide text if available')) self.page_break_after_text.setText(translate('OpenLP.PrintServiceForm', 'Add page break before each text item')) self.notes_check_box.setText(translate('OpenLP.PrintServiceForm', 'Include service item notes')) self.meta_data_check_box.setText(translate('OpenLP.PrintServiceForm', 'Include play length of media items')) self.show_chords_check_box.setText(translate('OpenLP.PrintServiceForm', 'Show chords')) self.title_line_edit.setText(translate('OpenLP.PrintServiceForm', 'Service Sheet')) # Do not change the order. self.zoom_combo_box.addItems([ translate('OpenLP.PrintServiceDialog', 'Fit Page'), translate('OpenLP.PrintServiceDialog', 'Fit Width'), '100%', '75%', '50%', '25%' ])