Example #1
0
def test_single_col_widget_create():
    """
    Test creating the SingleColumnTableWidget object
    """
    # GIVEN: the SingleColumnTableWidget class
    # WHEN: An object is created
    widget = SingleColumnTableWidget(None)

    # THEN: The object should have 1 column and no visible header
    assert widget.columnCount() == 1, 'There should be only 1 column'
    assert widget.horizontalHeader().isVisible(
    ) is False, 'The horizontal header should not be visible'
Example #2
0
def test_single_col_widget_resize_event(MockQTableWidget):
    """
    Test that the resizeEvent method does the right thing
    """
    # GIVEN: An instance of a SingleColumnTableWidget and a mocked event
    widget = SingleColumnTableWidget(None)
    mocked_event = MagicMock()
    mocked_event.size.return_value.width.return_value = 10

    # WHEN: resizeEvent() is called
    with patch.object(widget, 'columnCount') as mocked_column_count, \
            patch.object(widget, 'setColumnWidth') as mocked_set_column_width, \
            patch.object(widget, 'resizeRowsToContents') as mocked_resize_rows_to_contents:
        mocked_column_count.return_value = 1
        widget.resizeEvent(mocked_event)

    # THEN: The correct calls should have been made
    MockQTableWidget.resizeEvent.assert_called_once_with(widget, mocked_event)
    mocked_column_count.assert_called_once_with()
    mocked_set_column_width.assert_called_once_with(0, 10)
    mocked_resize_rows_to_contents.assert_called_once_with()
Example #3
0
 def setupUi(self, edit_song_dialog):
     edit_song_dialog.setObjectName('edit_song_dialog')
     edit_song_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg'))
     edit_song_dialog.resize(900, 600)
     edit_song_dialog.setModal(True)
     self.dialog_layout = QtWidgets.QVBoxLayout(edit_song_dialog)
     self.dialog_layout.setSpacing(8)
     self.dialog_layout.setContentsMargins(8, 8, 8, 8)
     self.dialog_layout.setObjectName('dialog_layout')
     self.song_tab_widget = QtWidgets.QTabWidget(edit_song_dialog)
     self.song_tab_widget.setObjectName('song_tab_widget')
     # lyrics tab
     self.lyrics_tab = QtWidgets.QWidget()
     self.lyrics_tab.setObjectName('lyrics_tab')
     self.lyrics_tab_layout = QtWidgets.QGridLayout(self.lyrics_tab)
     self.lyrics_tab_layout.setObjectName('lyrics_tab_layout')
     self.title_label = QtWidgets.QLabel(self.lyrics_tab)
     self.title_label.setObjectName('title_label')
     self.lyrics_tab_layout.addWidget(self.title_label, 0, 0)
     self.title_edit = QtWidgets.QLineEdit(self.lyrics_tab)
     self.title_edit.setObjectName('title_edit')
     self.title_label.setBuddy(self.title_edit)
     self.lyrics_tab_layout.addWidget(self.title_edit, 0, 1, 1, 2)
     self.alternative_title_label = QtWidgets.QLabel(self.lyrics_tab)
     self.alternative_title_label.setObjectName('alternative_title_label')
     self.lyrics_tab_layout.addWidget(self.alternative_title_label, 1, 0)
     self.alternative_edit = QtWidgets.QLineEdit(self.lyrics_tab)
     self.alternative_edit.setObjectName('alternative_edit')
     self.alternative_title_label.setBuddy(self.alternative_edit)
     self.lyrics_tab_layout.addWidget(self.alternative_edit, 1, 1, 1, 2)
     self.lyrics_label = QtWidgets.QLabel(self.lyrics_tab)
     self.lyrics_label.setFixedHeight(self.title_edit.sizeHint().height())
     self.lyrics_label.setObjectName('lyrics_label')
     self.lyrics_tab_layout.addWidget(self.lyrics_label, 2, 0,
                                      QtCore.Qt.AlignTop)
     self.verse_list_widget = SingleColumnTableWidget(self.lyrics_tab)
     self.verse_list_widget.setAlternatingRowColors(True)
     self.verse_list_widget.setSelectionBehavior(
         QtWidgets.QAbstractItemView.SelectRows)
     self.verse_list_widget.setSelectionMode(
         QtWidgets.QAbstractItemView.SingleSelection)
     self.verse_list_widget.setEditTriggers(
         QtWidgets.QAbstractItemView.NoEditTriggers)
     self.verse_list_widget.setObjectName('verse_list_widget')
     self.lyrics_label.setBuddy(self.verse_list_widget)
     self.lyrics_tab_layout.addWidget(self.verse_list_widget, 2, 1)
     self.verse_order_label = QtWidgets.QLabel(self.lyrics_tab)
     self.verse_order_label.setObjectName('verse_order_label')
     self.lyrics_tab_layout.addWidget(self.verse_order_label, 3, 0)
     self.verse_order_edit = QtWidgets.QLineEdit(self.lyrics_tab)
     self.verse_order_edit.setObjectName('verse_order_edit')
     self.verse_order_label.setBuddy(self.verse_order_edit)
     self.lyrics_tab_layout.addWidget(self.verse_order_edit, 3, 1, 1, 2)
     self.verse_buttons_layout = QtWidgets.QVBoxLayout()
     self.verse_buttons_layout.setObjectName('verse_buttons_layout')
     self.verse_add_button = QtWidgets.QPushButton(self.lyrics_tab)
     self.verse_add_button.setObjectName('verse_add_button')
     self.verse_buttons_layout.addWidget(self.verse_add_button)
     self.verse_edit_button = QtWidgets.QPushButton(self.lyrics_tab)
     self.verse_edit_button.setObjectName('verse_edit_button')
     self.verse_buttons_layout.addWidget(self.verse_edit_button)
     self.verse_edit_all_button = QtWidgets.QPushButton(self.lyrics_tab)
     self.verse_edit_all_button.setObjectName('verse_edit_all_button')
     self.verse_buttons_layout.addWidget(self.verse_edit_all_button)
     self.verse_delete_button = QtWidgets.QPushButton(self.lyrics_tab)
     self.verse_delete_button.setObjectName('verse_delete_button')
     self.verse_buttons_layout.addWidget(self.verse_delete_button)
     self.verse_buttons_layout.addStretch()
     self.lyrics_tab_layout.addLayout(self.verse_buttons_layout, 2, 2)
     self.song_tab_widget.addTab(self.lyrics_tab, '')
     # authors tab
     self.authors_tab = QtWidgets.QWidget()
     self.authors_tab.setObjectName('authors_tab')
     self.authors_tab_layout = QtWidgets.QHBoxLayout(self.authors_tab)
     self.authors_tab_layout.setObjectName('authors_tab_layout')
     self.authors_left_layout = QtWidgets.QVBoxLayout()
     self.authors_left_layout.setObjectName('authors_left_layout')
     self.authors_group_box = QtWidgets.QGroupBox(self.authors_tab)
     self.authors_group_box.setObjectName('authors_group_box')
     self.authors_layout = QtWidgets.QVBoxLayout(self.authors_group_box)
     self.authors_layout.setObjectName('authors_layout')
     self.author_add_layout = QtWidgets.QVBoxLayout()
     self.author_add_layout.setObjectName('author_add_layout')
     self.author_type_layout = QtWidgets.QHBoxLayout()
     self.author_type_layout.setObjectName('author_type_layout')
     self.authors_combo_box = create_combo_box(self.authors_group_box,
                                               'authors_combo_box')
     self.author_add_layout.addWidget(self.authors_combo_box)
     self.author_types_combo_box = create_combo_box(
         self.authors_group_box, 'author_types_combo_box', editable=False)
     self.author_type_layout.addWidget(self.author_types_combo_box)
     self.author_add_button = QtWidgets.QPushButton(self.authors_group_box)
     self.author_add_button.setObjectName('author_add_button')
     self.author_type_layout.addWidget(self.author_add_button)
     self.author_add_layout.addLayout(self.author_type_layout)
     self.authors_layout.addLayout(self.author_add_layout)
     self.authors_list_view = QtWidgets.QListWidget(self.authors_group_box)
     self.authors_list_view.setAlternatingRowColors(True)
     self.authors_list_view.setObjectName('authors_list_view')
     self.authors_layout.addWidget(self.authors_list_view)
     self.author_remove_layout = QtWidgets.QHBoxLayout()
     self.author_remove_layout.setObjectName('author_remove_layout')
     self.author_remove_layout.addStretch()
     self.author_edit_button = QtWidgets.QPushButton(self.authors_group_box)
     self.author_edit_button.setObjectName('author_edit_button')
     self.author_remove_layout.addWidget(self.author_edit_button)
     self.author_remove_button = QtWidgets.QPushButton(
         self.authors_group_box)
     self.author_remove_button.setObjectName('author_remove_button')
     self.author_remove_layout.addWidget(self.author_remove_button)
     self.authors_layout.addLayout(self.author_remove_layout)
     self.authors_left_layout.addWidget(self.authors_group_box)
     self.maintenance_layout = QtWidgets.QHBoxLayout()
     self.maintenance_layout.setObjectName('maintenance_layout')
     self.maintenance_button = QtWidgets.QPushButton(self.authors_tab)
     self.maintenance_button.setObjectName('maintenance_button')
     self.maintenance_layout.addWidget(self.maintenance_button)
     self.maintenance_layout.addStretch()
     self.authors_left_layout.addLayout(self.maintenance_layout)
     self.authors_tab_layout.addLayout(self.authors_left_layout)
     self.authors_right_layout = QtWidgets.QVBoxLayout()
     self.authors_right_layout.setObjectName('authors_right_layout')
     self.topics_group_box = QtWidgets.QGroupBox(self.authors_tab)
     self.topics_group_box.setObjectName('topics_group_box')
     self.topics_layout = QtWidgets.QVBoxLayout(self.topics_group_box)
     self.topics_layout.setObjectName('topics_layout')
     self.topic_add_layout = QtWidgets.QHBoxLayout()
     self.topic_add_layout.setObjectName('topic_add_layout')
     self.topics_combo_box = create_combo_box(self.topics_group_box,
                                              'topics_combo_box')
     self.topic_add_layout.addWidget(self.topics_combo_box)
     self.topic_add_button = QtWidgets.QPushButton(self.topics_group_box)
     self.topic_add_button.setObjectName('topic_add_button')
     self.topic_add_layout.addWidget(self.topic_add_button)
     self.topics_layout.addLayout(self.topic_add_layout)
     self.topics_list_view = QtWidgets.QListWidget(self.topics_group_box)
     self.topics_list_view.setAlternatingRowColors(True)
     self.topics_list_view.setObjectName('topics_list_view')
     self.topics_layout.addWidget(self.topics_list_view)
     self.topic_remove_layout = QtWidgets.QHBoxLayout()
     self.topic_remove_layout.setObjectName('topic_remove_layout')
     self.topic_remove_layout.addStretch()
     self.topic_remove_button = QtWidgets.QPushButton(self.topics_group_box)
     self.topic_remove_button.setObjectName('topic_remove_button')
     self.topic_remove_layout.addWidget(self.topic_remove_button)
     self.topics_layout.addLayout(self.topic_remove_layout)
     self.authors_right_layout.addWidget(self.topics_group_box)
     self.songbook_group_box = QtWidgets.QGroupBox(self.authors_tab)
     self.songbook_group_box.setObjectName('songbook_group_box')
     self.songbooks_layout = QtWidgets.QVBoxLayout(self.songbook_group_box)
     self.songbooks_layout.setObjectName('songbooks_layout')
     self.songbook_add_layout = QtWidgets.QHBoxLayout()
     self.songbook_add_layout.setObjectName('songbook_add_layout')
     self.songbooks_combo_box = create_combo_box(self.songbook_group_box,
                                                 'songbooks_combo_box')
     self.songbook_add_layout.addWidget(self.songbooks_combo_box)
     self.songbook_entry_edit = QtWidgets.QLineEdit(self.songbook_group_box)
     self.songbook_entry_edit.setMaximumWidth(100)
     self.songbook_add_layout.addWidget(self.songbook_entry_edit)
     self.songbook_add_button = QtWidgets.QPushButton(
         self.songbook_group_box)
     self.songbook_add_button.setObjectName('songbook_add_button')
     self.songbook_add_layout.addWidget(self.songbook_add_button)
     self.songbooks_layout.addLayout(self.songbook_add_layout)
     self.songbooks_list_view = QtWidgets.QListWidget(
         self.songbook_group_box)
     self.songbooks_list_view.setAlternatingRowColors(True)
     self.songbooks_list_view.setObjectName('songbooks_list_view')
     self.songbooks_layout.addWidget(self.songbooks_list_view)
     self.songbook_remove_layout = QtWidgets.QHBoxLayout()
     self.songbook_remove_layout.setObjectName('songbook_remove_layout')
     self.songbook_remove_layout.addStretch()
     self.songbook_remove_button = QtWidgets.QPushButton(
         self.songbook_group_box)
     self.songbook_remove_button.setObjectName('songbook_remove_button')
     self.songbook_remove_layout.addWidget(self.songbook_remove_button)
     self.songbooks_layout.addLayout(self.songbook_remove_layout)
     self.authors_right_layout.addWidget(self.songbook_group_box)
     self.authors_tab_layout.addLayout(self.authors_right_layout)
     self.song_tab_widget.addTab(self.authors_tab, '')
     # theme tab
     self.theme_tab = QtWidgets.QWidget()
     self.theme_tab.setObjectName('theme_tab')
     self.theme_tab_layout = QtWidgets.QHBoxLayout(self.theme_tab)
     self.theme_tab_layout.setObjectName('theme_tab_layout')
     self.theme_left_layout = QtWidgets.QVBoxLayout()
     self.theme_left_layout.setObjectName('theme_left_layout')
     self.theme_group_box = QtWidgets.QGroupBox(self.theme_tab)
     self.theme_group_box.setObjectName('theme_group_box')
     self.theme_layout = QtWidgets.QHBoxLayout(self.theme_group_box)
     self.theme_layout.setObjectName('theme_layout')
     self.theme_combo_box = create_combo_box(self.theme_group_box,
                                             'theme_combo_box')
     self.theme_layout.addWidget(self.theme_combo_box)
     self.theme_add_button = QtWidgets.QPushButton(self.theme_group_box)
     self.theme_add_button.setObjectName('theme_add_button')
     self.theme_layout.addWidget(self.theme_add_button)
     self.theme_left_layout.addWidget(self.theme_group_box)
     self.rights_group_box = QtWidgets.QGroupBox(self.theme_tab)
     self.rights_group_box.setObjectName('rights_group_box')
     self.rights_layout = QtWidgets.QVBoxLayout(self.rights_group_box)
     self.rights_layout.setObjectName('rights_layout')
     self.copyright_layout = QtWidgets.QHBoxLayout()
     self.copyright_layout.setObjectName('copyright_layout')
     self.copyright_edit = QtWidgets.QLineEdit(self.rights_group_box)
     self.copyright_edit.setObjectName('copyright_edit')
     self.copyright_layout.addWidget(self.copyright_edit)
     self.copyright_insert_button = QtWidgets.QToolButton(
         self.rights_group_box)
     self.copyright_insert_button.setObjectName('copyright_insert_button')
     self.copyright_layout.addWidget(self.copyright_insert_button)
     self.rights_layout.addLayout(self.copyright_layout)
     self.ccli_layout = QtWidgets.QHBoxLayout()
     self.ccli_layout.setObjectName('ccli_layout')
     self.ccli_label = QtWidgets.QLabel(self.rights_group_box)
     self.ccli_label.setObjectName('ccli_label')
     self.ccli_layout.addWidget(self.ccli_label)
     self.ccli_number_edit = QtWidgets.QLineEdit(self.rights_group_box)
     self.ccli_number_edit.setValidator(QtGui.QIntValidator())
     self.ccli_number_edit.setObjectName('ccli_number_edit')
     self.ccli_layout.addWidget(self.ccli_number_edit)
     self.rights_layout.addLayout(self.ccli_layout)
     self.theme_left_layout.addWidget(self.rights_group_box)
     self.theme_left_layout.addStretch()
     self.theme_tab_layout.addLayout(self.theme_left_layout)
     self.comments_group_box = QtWidgets.QGroupBox(self.theme_tab)
     self.comments_group_box.setObjectName('comments_group_box')
     self.comments_layout = QtWidgets.QVBoxLayout(self.comments_group_box)
     self.comments_layout.setObjectName('comments_layout')
     self.comments_edit = QtWidgets.QTextEdit(self.comments_group_box)
     self.comments_edit.setObjectName('comments_edit')
     self.comments_layout.addWidget(self.comments_edit)
     self.theme_tab_layout.addWidget(self.comments_group_box)
     self.song_tab_widget.addTab(self.theme_tab, '')
     # audio tab
     self.audio_tab = QtWidgets.QWidget()
     self.audio_tab.setObjectName('audio_tab')
     self.audio_layout = QtWidgets.QHBoxLayout(self.audio_tab)
     self.audio_layout.setObjectName('audio_layout')
     self.audio_list_widget = QtWidgets.QListWidget(self.audio_tab)
     self.audio_list_widget.setObjectName('audio_list_widget')
     self.audio_layout.addWidget(self.audio_list_widget)
     self.audio_buttons_layout = QtWidgets.QVBoxLayout()
     self.audio_buttons_layout.setObjectName('audio_buttons_layout')
     self.from_file_button = QtWidgets.QPushButton(self.audio_tab)
     self.from_file_button.setObjectName('from_file_button')
     self.audio_buttons_layout.addWidget(self.from_file_button)
     self.from_media_button = QtWidgets.QPushButton(self.audio_tab)
     self.from_media_button.setObjectName('from_media_button')
     self.audio_buttons_layout.addWidget(self.from_media_button)
     self.audio_remove_button = QtWidgets.QPushButton(self.audio_tab)
     self.audio_remove_button.setObjectName('audio_remove_button')
     self.audio_buttons_layout.addWidget(self.audio_remove_button)
     self.audio_remove_all_button = QtWidgets.QPushButton(self.audio_tab)
     self.audio_remove_all_button.setObjectName('audio_remove_all_button')
     self.audio_buttons_layout.addWidget(self.audio_remove_all_button)
     self.audio_buttons_layout.addStretch(1)
     self.up_button = create_button(self,
                                    'up_button',
                                    role='up',
                                    click=self.on_up_button_clicked)
     self.down_button = create_button(self,
                                      'down_button',
                                      role='down',
                                      click=self.on_down_button_clicked)
     self.audio_buttons_layout.addWidget(self.up_button)
     self.audio_buttons_layout.addWidget(self.down_button)
     self.audio_layout.addLayout(self.audio_buttons_layout)
     self.song_tab_widget.addTab(self.audio_tab, '')
     # Last few bits
     self.dialog_layout.addWidget(self.song_tab_widget)
     self.bottom_layout = QtWidgets.QHBoxLayout()
     self.bottom_layout.setObjectName('bottom_layout')
     self.warning_label = QtWidgets.QLabel(edit_song_dialog)
     self.warning_label.setObjectName('warning_label')
     self.bottom_layout.addWidget(self.warning_label)
     self.button_box = create_button_box(edit_song_dialog, 'button_box',
                                         ['cancel', 'save'])
     self.bottom_layout.addWidget(self.button_box)
     self.dialog_layout.addLayout(self.bottom_layout)
     self.retranslateUi(edit_song_dialog)
Example #4
0
class Ui_EditSongDialog(object):
    """
    The :class:`~openlp.plugins.songs.forms.editsongdialog.Ui_EditSongDialog` class defines the user interface for the
    EditSongForm dialog.
    """
    def setupUi(self, edit_song_dialog):
        edit_song_dialog.setObjectName('edit_song_dialog')
        edit_song_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg'))
        edit_song_dialog.resize(900, 600)
        edit_song_dialog.setModal(True)
        self.dialog_layout = QtWidgets.QVBoxLayout(edit_song_dialog)
        self.dialog_layout.setSpacing(8)
        self.dialog_layout.setContentsMargins(8, 8, 8, 8)
        self.dialog_layout.setObjectName('dialog_layout')
        self.song_tab_widget = QtWidgets.QTabWidget(edit_song_dialog)
        self.song_tab_widget.setObjectName('song_tab_widget')
        # lyrics tab
        self.lyrics_tab = QtWidgets.QWidget()
        self.lyrics_tab.setObjectName('lyrics_tab')
        self.lyrics_tab_layout = QtWidgets.QGridLayout(self.lyrics_tab)
        self.lyrics_tab_layout.setObjectName('lyrics_tab_layout')
        self.title_label = QtWidgets.QLabel(self.lyrics_tab)
        self.title_label.setObjectName('title_label')
        self.lyrics_tab_layout.addWidget(self.title_label, 0, 0)
        self.title_edit = QtWidgets.QLineEdit(self.lyrics_tab)
        self.title_edit.setObjectName('title_edit')
        self.title_label.setBuddy(self.title_edit)
        self.lyrics_tab_layout.addWidget(self.title_edit, 0, 1, 1, 2)
        self.alternative_title_label = QtWidgets.QLabel(self.lyrics_tab)
        self.alternative_title_label.setObjectName('alternative_title_label')
        self.lyrics_tab_layout.addWidget(self.alternative_title_label, 1, 0)
        self.alternative_edit = QtWidgets.QLineEdit(self.lyrics_tab)
        self.alternative_edit.setObjectName('alternative_edit')
        self.alternative_title_label.setBuddy(self.alternative_edit)
        self.lyrics_tab_layout.addWidget(self.alternative_edit, 1, 1, 1, 2)
        self.lyrics_label = QtWidgets.QLabel(self.lyrics_tab)
        self.lyrics_label.setFixedHeight(self.title_edit.sizeHint().height())
        self.lyrics_label.setObjectName('lyrics_label')
        self.lyrics_tab_layout.addWidget(self.lyrics_label, 2, 0,
                                         QtCore.Qt.AlignTop)
        self.verse_list_widget = SingleColumnTableWidget(self.lyrics_tab)
        self.verse_list_widget.setAlternatingRowColors(True)
        self.verse_list_widget.setSelectionBehavior(
            QtWidgets.QAbstractItemView.SelectRows)
        self.verse_list_widget.setSelectionMode(
            QtWidgets.QAbstractItemView.SingleSelection)
        self.verse_list_widget.setEditTriggers(
            QtWidgets.QAbstractItemView.NoEditTriggers)
        self.verse_list_widget.setObjectName('verse_list_widget')
        self.lyrics_label.setBuddy(self.verse_list_widget)
        self.lyrics_tab_layout.addWidget(self.verse_list_widget, 2, 1)
        self.verse_order_label = QtWidgets.QLabel(self.lyrics_tab)
        self.verse_order_label.setObjectName('verse_order_label')
        self.lyrics_tab_layout.addWidget(self.verse_order_label, 3, 0)
        self.verse_order_edit = QtWidgets.QLineEdit(self.lyrics_tab)
        self.verse_order_edit.setObjectName('verse_order_edit')
        self.verse_order_label.setBuddy(self.verse_order_edit)
        self.lyrics_tab_layout.addWidget(self.verse_order_edit, 3, 1, 1, 2)
        self.verse_buttons_layout = QtWidgets.QVBoxLayout()
        self.verse_buttons_layout.setObjectName('verse_buttons_layout')
        self.verse_add_button = QtWidgets.QPushButton(self.lyrics_tab)
        self.verse_add_button.setObjectName('verse_add_button')
        self.verse_buttons_layout.addWidget(self.verse_add_button)
        self.verse_edit_button = QtWidgets.QPushButton(self.lyrics_tab)
        self.verse_edit_button.setObjectName('verse_edit_button')
        self.verse_buttons_layout.addWidget(self.verse_edit_button)
        self.verse_edit_all_button = QtWidgets.QPushButton(self.lyrics_tab)
        self.verse_edit_all_button.setObjectName('verse_edit_all_button')
        self.verse_buttons_layout.addWidget(self.verse_edit_all_button)
        self.verse_delete_button = QtWidgets.QPushButton(self.lyrics_tab)
        self.verse_delete_button.setObjectName('verse_delete_button')
        self.verse_buttons_layout.addWidget(self.verse_delete_button)
        self.verse_buttons_layout.addStretch()
        self.lyrics_tab_layout.addLayout(self.verse_buttons_layout, 2, 2)
        self.song_tab_widget.addTab(self.lyrics_tab, '')
        # authors tab
        self.authors_tab = QtWidgets.QWidget()
        self.authors_tab.setObjectName('authors_tab')
        self.authors_tab_layout = QtWidgets.QHBoxLayout(self.authors_tab)
        self.authors_tab_layout.setObjectName('authors_tab_layout')
        self.authors_left_layout = QtWidgets.QVBoxLayout()
        self.authors_left_layout.setObjectName('authors_left_layout')
        self.authors_group_box = QtWidgets.QGroupBox(self.authors_tab)
        self.authors_group_box.setObjectName('authors_group_box')
        self.authors_layout = QtWidgets.QVBoxLayout(self.authors_group_box)
        self.authors_layout.setObjectName('authors_layout')
        self.author_add_layout = QtWidgets.QVBoxLayout()
        self.author_add_layout.setObjectName('author_add_layout')
        self.author_type_layout = QtWidgets.QHBoxLayout()
        self.author_type_layout.setObjectName('author_type_layout')
        self.authors_combo_box = create_combo_box(self.authors_group_box,
                                                  'authors_combo_box')
        self.author_add_layout.addWidget(self.authors_combo_box)
        self.author_types_combo_box = create_combo_box(
            self.authors_group_box, 'author_types_combo_box', editable=False)
        self.author_type_layout.addWidget(self.author_types_combo_box)
        self.author_add_button = QtWidgets.QPushButton(self.authors_group_box)
        self.author_add_button.setObjectName('author_add_button')
        self.author_type_layout.addWidget(self.author_add_button)
        self.author_add_layout.addLayout(self.author_type_layout)
        self.authors_layout.addLayout(self.author_add_layout)
        self.authors_list_view = QtWidgets.QListWidget(self.authors_group_box)
        self.authors_list_view.setAlternatingRowColors(True)
        self.authors_list_view.setObjectName('authors_list_view')
        self.authors_layout.addWidget(self.authors_list_view)
        self.author_remove_layout = QtWidgets.QHBoxLayout()
        self.author_remove_layout.setObjectName('author_remove_layout')
        self.author_remove_layout.addStretch()
        self.author_edit_button = QtWidgets.QPushButton(self.authors_group_box)
        self.author_edit_button.setObjectName('author_edit_button')
        self.author_remove_layout.addWidget(self.author_edit_button)
        self.author_remove_button = QtWidgets.QPushButton(
            self.authors_group_box)
        self.author_remove_button.setObjectName('author_remove_button')
        self.author_remove_layout.addWidget(self.author_remove_button)
        self.authors_layout.addLayout(self.author_remove_layout)
        self.authors_left_layout.addWidget(self.authors_group_box)
        self.maintenance_layout = QtWidgets.QHBoxLayout()
        self.maintenance_layout.setObjectName('maintenance_layout')
        self.maintenance_button = QtWidgets.QPushButton(self.authors_tab)
        self.maintenance_button.setObjectName('maintenance_button')
        self.maintenance_layout.addWidget(self.maintenance_button)
        self.maintenance_layout.addStretch()
        self.authors_left_layout.addLayout(self.maintenance_layout)
        self.authors_tab_layout.addLayout(self.authors_left_layout)
        self.authors_right_layout = QtWidgets.QVBoxLayout()
        self.authors_right_layout.setObjectName('authors_right_layout')
        self.topics_group_box = QtWidgets.QGroupBox(self.authors_tab)
        self.topics_group_box.setObjectName('topics_group_box')
        self.topics_layout = QtWidgets.QVBoxLayout(self.topics_group_box)
        self.topics_layout.setObjectName('topics_layout')
        self.topic_add_layout = QtWidgets.QHBoxLayout()
        self.topic_add_layout.setObjectName('topic_add_layout')
        self.topics_combo_box = create_combo_box(self.topics_group_box,
                                                 'topics_combo_box')
        self.topic_add_layout.addWidget(self.topics_combo_box)
        self.topic_add_button = QtWidgets.QPushButton(self.topics_group_box)
        self.topic_add_button.setObjectName('topic_add_button')
        self.topic_add_layout.addWidget(self.topic_add_button)
        self.topics_layout.addLayout(self.topic_add_layout)
        self.topics_list_view = QtWidgets.QListWidget(self.topics_group_box)
        self.topics_list_view.setAlternatingRowColors(True)
        self.topics_list_view.setObjectName('topics_list_view')
        self.topics_layout.addWidget(self.topics_list_view)
        self.topic_remove_layout = QtWidgets.QHBoxLayout()
        self.topic_remove_layout.setObjectName('topic_remove_layout')
        self.topic_remove_layout.addStretch()
        self.topic_remove_button = QtWidgets.QPushButton(self.topics_group_box)
        self.topic_remove_button.setObjectName('topic_remove_button')
        self.topic_remove_layout.addWidget(self.topic_remove_button)
        self.topics_layout.addLayout(self.topic_remove_layout)
        self.authors_right_layout.addWidget(self.topics_group_box)
        self.songbook_group_box = QtWidgets.QGroupBox(self.authors_tab)
        self.songbook_group_box.setObjectName('songbook_group_box')
        self.songbooks_layout = QtWidgets.QVBoxLayout(self.songbook_group_box)
        self.songbooks_layout.setObjectName('songbooks_layout')
        self.songbook_add_layout = QtWidgets.QHBoxLayout()
        self.songbook_add_layout.setObjectName('songbook_add_layout')
        self.songbooks_combo_box = create_combo_box(self.songbook_group_box,
                                                    'songbooks_combo_box')
        self.songbook_add_layout.addWidget(self.songbooks_combo_box)
        self.songbook_entry_edit = QtWidgets.QLineEdit(self.songbook_group_box)
        self.songbook_entry_edit.setMaximumWidth(100)
        self.songbook_add_layout.addWidget(self.songbook_entry_edit)
        self.songbook_add_button = QtWidgets.QPushButton(
            self.songbook_group_box)
        self.songbook_add_button.setObjectName('songbook_add_button')
        self.songbook_add_layout.addWidget(self.songbook_add_button)
        self.songbooks_layout.addLayout(self.songbook_add_layout)
        self.songbooks_list_view = QtWidgets.QListWidget(
            self.songbook_group_box)
        self.songbooks_list_view.setAlternatingRowColors(True)
        self.songbooks_list_view.setObjectName('songbooks_list_view')
        self.songbooks_layout.addWidget(self.songbooks_list_view)
        self.songbook_remove_layout = QtWidgets.QHBoxLayout()
        self.songbook_remove_layout.setObjectName('songbook_remove_layout')
        self.songbook_remove_layout.addStretch()
        self.songbook_remove_button = QtWidgets.QPushButton(
            self.songbook_group_box)
        self.songbook_remove_button.setObjectName('songbook_remove_button')
        self.songbook_remove_layout.addWidget(self.songbook_remove_button)
        self.songbooks_layout.addLayout(self.songbook_remove_layout)
        self.authors_right_layout.addWidget(self.songbook_group_box)
        self.authors_tab_layout.addLayout(self.authors_right_layout)
        self.song_tab_widget.addTab(self.authors_tab, '')
        # theme tab
        self.theme_tab = QtWidgets.QWidget()
        self.theme_tab.setObjectName('theme_tab')
        self.theme_tab_layout = QtWidgets.QHBoxLayout(self.theme_tab)
        self.theme_tab_layout.setObjectName('theme_tab_layout')
        self.theme_left_layout = QtWidgets.QVBoxLayout()
        self.theme_left_layout.setObjectName('theme_left_layout')
        self.theme_group_box = QtWidgets.QGroupBox(self.theme_tab)
        self.theme_group_box.setObjectName('theme_group_box')
        self.theme_layout = QtWidgets.QHBoxLayout(self.theme_group_box)
        self.theme_layout.setObjectName('theme_layout')
        self.theme_combo_box = create_combo_box(self.theme_group_box,
                                                'theme_combo_box')
        self.theme_layout.addWidget(self.theme_combo_box)
        self.theme_add_button = QtWidgets.QPushButton(self.theme_group_box)
        self.theme_add_button.setObjectName('theme_add_button')
        self.theme_layout.addWidget(self.theme_add_button)
        self.theme_left_layout.addWidget(self.theme_group_box)
        self.rights_group_box = QtWidgets.QGroupBox(self.theme_tab)
        self.rights_group_box.setObjectName('rights_group_box')
        self.rights_layout = QtWidgets.QVBoxLayout(self.rights_group_box)
        self.rights_layout.setObjectName('rights_layout')
        self.copyright_layout = QtWidgets.QHBoxLayout()
        self.copyright_layout.setObjectName('copyright_layout')
        self.copyright_edit = QtWidgets.QLineEdit(self.rights_group_box)
        self.copyright_edit.setObjectName('copyright_edit')
        self.copyright_layout.addWidget(self.copyright_edit)
        self.copyright_insert_button = QtWidgets.QToolButton(
            self.rights_group_box)
        self.copyright_insert_button.setObjectName('copyright_insert_button')
        self.copyright_layout.addWidget(self.copyright_insert_button)
        self.rights_layout.addLayout(self.copyright_layout)
        self.ccli_layout = QtWidgets.QHBoxLayout()
        self.ccli_layout.setObjectName('ccli_layout')
        self.ccli_label = QtWidgets.QLabel(self.rights_group_box)
        self.ccli_label.setObjectName('ccli_label')
        self.ccli_layout.addWidget(self.ccli_label)
        self.ccli_number_edit = QtWidgets.QLineEdit(self.rights_group_box)
        self.ccli_number_edit.setValidator(QtGui.QIntValidator())
        self.ccli_number_edit.setObjectName('ccli_number_edit')
        self.ccli_layout.addWidget(self.ccli_number_edit)
        self.rights_layout.addLayout(self.ccli_layout)
        self.theme_left_layout.addWidget(self.rights_group_box)
        self.theme_left_layout.addStretch()
        self.theme_tab_layout.addLayout(self.theme_left_layout)
        self.comments_group_box = QtWidgets.QGroupBox(self.theme_tab)
        self.comments_group_box.setObjectName('comments_group_box')
        self.comments_layout = QtWidgets.QVBoxLayout(self.comments_group_box)
        self.comments_layout.setObjectName('comments_layout')
        self.comments_edit = QtWidgets.QTextEdit(self.comments_group_box)
        self.comments_edit.setObjectName('comments_edit')
        self.comments_layout.addWidget(self.comments_edit)
        self.theme_tab_layout.addWidget(self.comments_group_box)
        self.song_tab_widget.addTab(self.theme_tab, '')
        # audio tab
        self.audio_tab = QtWidgets.QWidget()
        self.audio_tab.setObjectName('audio_tab')
        self.audio_layout = QtWidgets.QHBoxLayout(self.audio_tab)
        self.audio_layout.setObjectName('audio_layout')
        self.audio_list_widget = QtWidgets.QListWidget(self.audio_tab)
        self.audio_list_widget.setObjectName('audio_list_widget')
        self.audio_layout.addWidget(self.audio_list_widget)
        self.audio_buttons_layout = QtWidgets.QVBoxLayout()
        self.audio_buttons_layout.setObjectName('audio_buttons_layout')
        self.from_file_button = QtWidgets.QPushButton(self.audio_tab)
        self.from_file_button.setObjectName('from_file_button')
        self.audio_buttons_layout.addWidget(self.from_file_button)
        self.from_media_button = QtWidgets.QPushButton(self.audio_tab)
        self.from_media_button.setObjectName('from_media_button')
        self.audio_buttons_layout.addWidget(self.from_media_button)
        self.audio_remove_button = QtWidgets.QPushButton(self.audio_tab)
        self.audio_remove_button.setObjectName('audio_remove_button')
        self.audio_buttons_layout.addWidget(self.audio_remove_button)
        self.audio_remove_all_button = QtWidgets.QPushButton(self.audio_tab)
        self.audio_remove_all_button.setObjectName('audio_remove_all_button')
        self.audio_buttons_layout.addWidget(self.audio_remove_all_button)
        self.audio_buttons_layout.addStretch(1)
        self.up_button = create_button(self,
                                       'up_button',
                                       role='up',
                                       click=self.on_up_button_clicked)
        self.down_button = create_button(self,
                                         'down_button',
                                         role='down',
                                         click=self.on_down_button_clicked)
        self.audio_buttons_layout.addWidget(self.up_button)
        self.audio_buttons_layout.addWidget(self.down_button)
        self.audio_layout.addLayout(self.audio_buttons_layout)
        self.song_tab_widget.addTab(self.audio_tab, '')
        # Last few bits
        self.dialog_layout.addWidget(self.song_tab_widget)
        self.bottom_layout = QtWidgets.QHBoxLayout()
        self.bottom_layout.setObjectName('bottom_layout')
        self.warning_label = QtWidgets.QLabel(edit_song_dialog)
        self.warning_label.setObjectName('warning_label')
        self.bottom_layout.addWidget(self.warning_label)
        self.button_box = create_button_box(edit_song_dialog, 'button_box',
                                            ['cancel', 'save'])
        self.bottom_layout.addWidget(self.button_box)
        self.dialog_layout.addLayout(self.bottom_layout)
        self.retranslateUi(edit_song_dialog)

    def retranslateUi(self, edit_song_dialog):
        """
        Translate the UI on the fly.
        """
        edit_song_dialog.setWindowTitle(
            translate('SongsPlugin.EditSongForm', 'Song Editor'))
        self.title_label.setText(
            translate('SongsPlugin.EditSongForm', '&Title:'))
        self.alternative_title_label.setText(
            translate('SongsPlugin.EditSongForm', 'Alt&ernate title:'))
        self.lyrics_label.setText(
            translate('SongsPlugin.EditSongForm', '&Lyrics:'))
        self.verse_order_label.setText(
            translate('SongsPlugin.EditSongForm', '&Verse order:'))
        self.verse_add_button.setText(UiStrings().Add)
        self.verse_edit_button.setText(UiStrings().Edit)
        self.verse_edit_all_button.setText(
            translate('SongsPlugin.EditSongForm', 'Ed&it All'))
        self.verse_delete_button.setText(UiStrings().Delete)
        self.song_tab_widget.setTabText(
            self.song_tab_widget.indexOf(self.lyrics_tab),
            translate('SongsPlugin.EditSongForm', 'Title && Lyrics'))
        self.authors_group_box.setTitle(SongStrings.Authors)
        self.author_add_button.setText(
            translate('SongsPlugin.EditSongForm', '&Add to Song'))
        self.author_edit_button.setText(
            translate('SongsPlugin.EditSongForm', '&Edit Author Type'))
        self.author_remove_button.setText(
            translate('SongsPlugin.EditSongForm', '&Remove'))
        self.maintenance_button.setText(
            translate('SongsPlugin.EditSongForm',
                      '&Manage Authors, Topics, Songbooks'))
        self.topics_group_box.setTitle(SongStrings.Topics)
        self.topic_add_button.setText(
            translate('SongsPlugin.EditSongForm', 'A&dd to Song'))
        self.topic_remove_button.setText(
            translate('SongsPlugin.EditSongForm', 'R&emove'))
        self.songbook_group_box.setTitle(SongStrings.SongBooks)
        self.songbook_add_button.setText(
            translate('SongsPlugin.EditSongForm', 'Add &to Song'))
        self.songbook_remove_button.setText(
            translate('SongsPlugin.EditSongForm', 'Re&move'))
        self.song_tab_widget.setTabText(
            self.song_tab_widget.indexOf(self.authors_tab),
            translate('SongsPlugin.EditSongForm',
                      'Authors, Topics && Songbooks'))
        self.theme_group_box.setTitle(UiStrings().Theme)
        self.theme_add_button.setText(
            translate('SongsPlugin.EditSongForm', 'New &Theme'))
        self.rights_group_box.setTitle(
            translate('SongsPlugin.EditSongForm', 'Copyright Information'))
        self.copyright_insert_button.setText(SongStrings.CopyrightSymbol)
        self.ccli_label.setText(UiStrings().CCLISongNumberLabel)
        self.comments_group_box.setTitle(
            translate('SongsPlugin.EditSongForm', 'Comments'))
        self.song_tab_widget.setTabText(
            self.song_tab_widget.indexOf(self.theme_tab),
            translate('SongsPlugin.EditSongForm',
                      'Theme, Copyright Info && Comments'))
        self.song_tab_widget.setTabText(
            self.song_tab_widget.indexOf(self.audio_tab),
            translate('SongsPlugin.EditSongForm', 'Linked Audio'))
        self.from_file_button.setText(
            translate('SongsPlugin.EditSongForm', 'Add &File(s)'))
        self.from_media_button.setText(
            translate('SongsPlugin.EditSongForm', 'Add &Media'))
        self.audio_remove_button.setText(
            translate('SongsPlugin.EditSongForm', '&Remove'))
        self.audio_remove_all_button.setText(
            translate('SongsPlugin.EditSongForm', 'Remove &All'))
        self.not_all_verses_used_warning = \
            translate('SongsPlugin.EditSongForm', '<strong>Warning:</strong> Not all of the verses are in use.')
        self.no_verse_order_entered_warning =  \
            translate('SongsPlugin.EditSongForm', '<strong>Warning:</strong> You have not entered a verse order.')
Example #5
0
    def setupUi(self, edit_song_dialog):
        edit_song_dialog.setObjectName('edit_song_dialog')
        edit_song_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg'))
        edit_song_dialog.resize(650, 400)
        edit_song_dialog.setModal(True)
        self.dialog_layout = QtGui.QVBoxLayout(edit_song_dialog)
        self.dialog_layout.setSpacing(8)
        self.dialog_layout.setContentsMargins(8, 8, 8, 8)
        self.dialog_layout.setObjectName('dialog_layout')
        self.song_tab_widget = QtGui.QTabWidget(edit_song_dialog)
        self.song_tab_widget.setObjectName('song_tab_widget')
        # lyrics tab
        self.lyrics_tab = QtGui.QWidget()
        self.lyrics_tab.setObjectName('lyrics_tab')
        self.lyrics_tab_layout = QtGui.QGridLayout(self.lyrics_tab)
        self.lyrics_tab_layout.setObjectName('lyrics_tab_layout')
        self.title_label = QtGui.QLabel(self.lyrics_tab)
        self.title_label.setObjectName('title_label')
        self.lyrics_tab_layout.addWidget(self.title_label, 0, 0)
        self.title_edit = QtGui.QLineEdit(self.lyrics_tab)
        self.title_edit.setObjectName('title_edit')
        self.title_label.setBuddy(self.title_edit)
        self.lyrics_tab_layout.addWidget(self.title_edit, 0, 1, 1, 2)
        self.alternative_title_label = QtGui.QLabel(self.lyrics_tab)
        self.alternative_title_label.setObjectName('alternative_title_label')
        self.lyrics_tab_layout.addWidget(self.alternative_title_label, 1, 0)
        self.alternative_edit = QtGui.QLineEdit(self.lyrics_tab)
        self.alternative_edit.setObjectName('alternative_edit')
        self.alternative_title_label.setBuddy(self.alternative_edit)
        self.lyrics_tab_layout.addWidget(self.alternative_edit, 1, 1, 1, 2)
        self.lyrics_label = QtGui.QLabel(self.lyrics_tab)
        self.lyrics_label.setFixedHeight(self.title_edit.sizeHint().height())
        self.lyrics_label.setObjectName('lyrics_label')
        self.lyrics_tab_layout.addWidget(self.lyrics_label, 2, 0, QtCore.Qt.AlignTop)
        self.verse_list_widget = SingleColumnTableWidget(self.lyrics_tab)
        self.verse_list_widget.setAlternatingRowColors(True)
        self.verse_list_widget.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
        self.verse_list_widget.setSelectionMode(QtGui.QAbstractItemView.SingleSelection)
        self.verse_list_widget.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers)
        self.verse_list_widget.setObjectName('verse_list_widget')
        self.lyrics_label.setBuddy(self.verse_list_widget)
        self.lyrics_tab_layout.addWidget(self.verse_list_widget, 2, 1)
        self.verse_order_label = QtGui.QLabel(self.lyrics_tab)
        self.verse_order_label.setObjectName('verse_order_label')
        self.lyrics_tab_layout.addWidget(self.verse_order_label, 3, 0)
        self.verse_order_edit = QtGui.QLineEdit(self.lyrics_tab)
        self.verse_order_edit.setObjectName('verse_order_edit')
        self.verse_order_label.setBuddy(self.verse_order_edit)
        self.lyrics_tab_layout.addWidget(self.verse_order_edit, 3, 1, 1, 2)

        self.verse_buttons_layout = QtGui.QVBoxLayout()
        self.verse_buttons_layout.setObjectName('verse_buttons_layout')
        self.verse_add_button = QtGui.QPushButton(self.lyrics_tab)
        self.verse_add_button.setObjectName('verse_add_button')
        self.verse_buttons_layout.addWidget(self.verse_add_button)
        #self.verse_edit_button = QtGui.QPushButton(self.lyrics_tab)
        #self.verse_edit_button.setObjectName('verse_edit_button')
        #self.verse_buttons_layout.addWidget(self.verse_edit_button)
        #self.verse_edit_all_button = QtGui.QPushButton(self.lyrics_tab)
        #self.verse_edit_all_button.setObjectName('verse_edit_all_button')
        #self.verse_buttons_layout.addWidget(self.verse_edit_all_button)
        self.verse_edit_chords_button = QtGui.QPushButton(self.lyrics_tab)
        self.verse_edit_chords_button.setObjectName('verse_edit_chords_button')
        self.verse_buttons_layout.addWidget(self.verse_edit_chords_button)
        self.verse_edit_all_chords_button = QtGui.QPushButton(self.lyrics_tab)
        self.verse_edit_all_chords_button.setObjectName('verse_edit_all_chords_button')
        self.verse_buttons_layout.addWidget(self.verse_edit_all_chords_button)
        self.verse_delete_button = QtGui.QPushButton(self.lyrics_tab)
        self.verse_delete_button.setObjectName('verse_delete_button')
        self.verse_buttons_layout.addWidget(self.verse_delete_button)
        self.verse_buttons_layout.addStretch()
        self.lyrics_tab_layout.addLayout(self.verse_buttons_layout, 2, 2)

        # key and chords area
        self.song_key_label = QtGui.QLabel(self.lyrics_tab)
        self.song_key_label.setObjectName('song_key_label')
        self.lyrics_tab_layout.addWidget(self.song_key_label, 4, 0)
        self.key_area_layout = QtGui.QGridLayout()
        self.key_area_layout.setObjectName('key_area_layout')
        self.song_key_edit = QtGui.QComboBox(self.lyrics_tab)
        self.song_key_edit.setEditable(False)
        self.song_key_edit.addItems(Chords.key_list)
        self.song_key_edit.setObjectName('song_key_edit')
        self.song_key_label.setBuddy(self.song_key_edit)
        self.key_area_layout.addWidget(self.song_key_edit, 0, 1, 1, 1)
        self.transpose_label = QtGui.QLabel(self.lyrics_tab)
        self.transpose_label.setObjectName('transpose_label')
        self.key_area_layout.addWidget(self.transpose_label, 0, 2)
        self.transpose_edit = QtGui.QSpinBox(self.lyrics_tab)
        self.transpose_edit.setRange(-11, 11)
        self.transpose_edit.setObjectName('transpose_edit')
        self.transpose_label.setBuddy(self.transpose_edit)
        self.key_area_layout.addWidget(self.transpose_edit, 0, 3, 1, 1)
        self.transposed_key_label = QtGui.QLabel(self.lyrics_tab)
        self.transposed_key_label.setObjectName('transposed_key_label')
        self.key_area_layout.addWidget(self.transposed_key_label, 0, 4, 1, 1)
        self.lyrics_tab_layout.addLayout(self.key_area_layout, 4, 1, 1, 3)

        self.song_tab_widget.addTab(self.lyrics_tab, '')


        # authors tab
        self.authors_tab = QtGui.QWidget()
        self.authors_tab.setObjectName('authors_tab')
        self.authors_tab_layout = QtGui.QHBoxLayout(self.authors_tab)
        self.authors_tab_layout.setObjectName('authors_tab_layout')
        self.authors_left_layout = QtGui.QVBoxLayout()
        self.authors_left_layout.setObjectName('authors_left_layout')
        self.authors_group_box = QtGui.QGroupBox(self.authors_tab)
        self.authors_group_box.setObjectName('authors_group_box')
        self.authors_layout = QtGui.QVBoxLayout(self.authors_group_box)
        self.authors_layout.setObjectName('authors_layout')
        self.author_add_layout = QtGui.QVBoxLayout()
        self.author_add_layout.setObjectName('author_add_layout')
        self.author_type_layout = QtGui.QHBoxLayout()
        self.author_type_layout.setObjectName('author_type_layout')
        self.authors_combo_box = create_combo_box(self.authors_group_box, 'authors_combo_box')
        self.author_add_layout.addWidget(self.authors_combo_box)
        self.author_types_combo_box = create_combo_box(self.authors_group_box, 'author_types_combo_box', editable=False)
        self.author_type_layout.addWidget(self.author_types_combo_box)
        self.author_add_button = QtGui.QPushButton(self.authors_group_box)
        self.author_add_button.setObjectName('author_add_button')
        self.author_type_layout.addWidget(self.author_add_button)
        self.author_add_layout.addLayout(self.author_type_layout)
        self.authors_layout.addLayout(self.author_add_layout)
        self.authors_list_view = QtGui.QListWidget(self.authors_group_box)
        self.authors_list_view.setAlternatingRowColors(True)
        self.authors_list_view.setObjectName('authors_list_view')
        self.authors_layout.addWidget(self.authors_list_view)
        self.author_remove_layout = QtGui.QHBoxLayout()
        self.author_remove_layout.setObjectName('author_remove_layout')
        self.author_remove_layout.addStretch()
        self.author_edit_button = QtGui.QPushButton(self.authors_group_box)
        self.author_edit_button.setObjectName('author_edit_button')
        self.author_remove_layout.addWidget(self.author_edit_button)
        self.author_remove_button = QtGui.QPushButton(self.authors_group_box)
        self.author_remove_button.setObjectName('author_remove_button')
        self.author_remove_layout.addWidget(self.author_remove_button)
        self.authors_layout.addLayout(self.author_remove_layout)
        self.authors_left_layout.addWidget(self.authors_group_box)
        self.maintenance_layout = QtGui.QHBoxLayout()
        self.maintenance_layout.setObjectName('maintenance_layout')
        self.maintenance_button = QtGui.QPushButton(self.authors_tab)
        self.maintenance_button.setObjectName('maintenance_button')
        self.maintenance_layout.addWidget(self.maintenance_button)
        self.maintenance_layout.addStretch()
        self.authors_left_layout.addLayout(self.maintenance_layout)
        self.authors_tab_layout.addLayout(self.authors_left_layout)
        self.authors_right_layout = QtGui.QVBoxLayout()
        self.authors_right_layout.setObjectName('authors_right_layout')
        self.topics_group_box = QtGui.QGroupBox(self.authors_tab)
        self.topics_group_box.setObjectName('topics_group_box')
        self.topics_layout = QtGui.QVBoxLayout(self.topics_group_box)
        self.topics_layout.setObjectName('topics_layout')
        self.topic_add_layout = QtGui.QHBoxLayout()
        self.topic_add_layout.setObjectName('topic_add_layout')
        self.topics_combo_box = create_combo_box(self.topics_group_box, 'topics_combo_box')
        self.topic_add_layout.addWidget(self.topics_combo_box)
        self.topic_add_button = QtGui.QPushButton(self.topics_group_box)
        self.topic_add_button.setObjectName('topic_add_button')
        self.topic_add_layout.addWidget(self.topic_add_button)
        self.topics_layout.addLayout(self.topic_add_layout)
        self.topics_list_view = QtGui.QListWidget(self.topics_group_box)
        self.topics_list_view.setAlternatingRowColors(True)
        self.topics_list_view.setObjectName('topics_list_view')
        self.topics_layout.addWidget(self.topics_list_view)
        self.topic_remove_layout = QtGui.QHBoxLayout()
        self.topic_remove_layout.setObjectName('topic_remove_layout')
        self.topic_remove_layout.addStretch()
        self.topic_remove_button = QtGui.QPushButton(self.topics_group_box)
        self.topic_remove_button.setObjectName('topic_remove_button')
        self.topic_remove_layout.addWidget(self.topic_remove_button)
        self.topics_layout.addLayout(self.topic_remove_layout)
        self.authors_right_layout.addWidget(self.topics_group_box)
        self.song_book_group_box = QtGui.QGroupBox(self.authors_tab)
        self.song_book_group_box.setObjectName('song_book_group_box')
        self.song_book_layout = QtGui.QFormLayout(self.song_book_group_box)
        self.song_book_layout.setObjectName('song_book_layout')
        self.song_book_name_label = QtGui.QLabel(self.song_book_group_box)
        self.song_book_name_label.setObjectName('song_book_name_label')
        self.song_book_combo_box = create_combo_box(self.song_book_group_box, 'song_book_combo_box')
        self.song_book_name_label.setBuddy(self.song_book_combo_box)
        self.song_book_layout.addRow(self.song_book_name_label, self.song_book_combo_box)
        self.song_book_number_label = QtGui.QLabel(self.song_book_group_box)
        self.song_book_number_label.setObjectName('song_book_number_label')
        self.song_book_number_edit = QtGui.QLineEdit(self.song_book_group_box)
        self.song_book_number_edit.setObjectName('song_book_number_edit')
        self.song_book_number_label.setBuddy(self.song_book_number_edit)
        self.song_book_layout.addRow(self.song_book_number_label, self.song_book_number_edit)
        self.authors_right_layout.addWidget(self.song_book_group_box)
        self.authors_tab_layout.addLayout(self.authors_right_layout)
        self.song_tab_widget.addTab(self.authors_tab, '')
        # theme tab
        self.theme_tab = QtGui.QWidget()
        self.theme_tab.setObjectName('theme_tab')
        self.theme_tab_layout = QtGui.QHBoxLayout(self.theme_tab)
        self.theme_tab_layout.setObjectName('theme_tab_layout')
        self.theme_left_layout = QtGui.QVBoxLayout()
        self.theme_left_layout.setObjectName('theme_left_layout')
        self.theme_group_box = QtGui.QGroupBox(self.theme_tab)
        self.theme_group_box.setObjectName('theme_group_box')
        self.theme_layout = QtGui.QHBoxLayout(self.theme_group_box)
        self.theme_layout.setObjectName('theme_layout')
        self.theme_combo_box = create_combo_box(self.theme_group_box, 'theme_combo_box')
        self.theme_layout.addWidget(self.theme_combo_box)
        self.theme_add_button = QtGui.QPushButton(self.theme_group_box)
        self.theme_add_button.setObjectName('theme_add_button')
        self.theme_layout.addWidget(self.theme_add_button)
        self.theme_left_layout.addWidget(self.theme_group_box)
        self.rights_group_box = QtGui.QGroupBox(self.theme_tab)
        self.rights_group_box.setObjectName('rights_group_box')
        self.rights_layout = QtGui.QVBoxLayout(self.rights_group_box)
        self.rights_layout.setObjectName('rights_layout')
        self.copyright_layout = QtGui.QHBoxLayout()
        self.copyright_layout.setObjectName('copyright_layout')
        self.copyright_edit = QtGui.QLineEdit(self.rights_group_box)
        self.copyright_edit.setObjectName('copyright_edit')
        self.copyright_layout.addWidget(self.copyright_edit)
        self.copyright_insert_button = QtGui.QToolButton(self.rights_group_box)
        self.copyright_insert_button.setObjectName('copyright_insert_button')
        self.copyright_layout.addWidget(self.copyright_insert_button)
        self.rights_layout.addLayout(self.copyright_layout)
        self.ccli_layout = QtGui.QHBoxLayout()
        self.ccli_layout.setObjectName('ccli_layout')
        self.ccli_label = QtGui.QLabel(self.rights_group_box)
        self.ccli_label.setObjectName('ccli_label')
        self.ccli_layout.addWidget(self.ccli_label)
        self.ccli_number_edit = QtGui.QLineEdit(self.rights_group_box)
        self.ccli_number_edit.setValidator(QtGui.QIntValidator())
        self.ccli_number_edit.setObjectName('ccli_number_edit')
        self.ccli_layout.addWidget(self.ccli_number_edit)
        self.rights_layout.addLayout(self.ccli_layout)
        self.theme_left_layout.addWidget(self.rights_group_box)
        self.theme_left_layout.addStretch()
        self.theme_tab_layout.addLayout(self.theme_left_layout)
        self.comments_group_box = QtGui.QGroupBox(self.theme_tab)
        self.comments_group_box.setObjectName('comments_group_box')
        self.comments_layout = QtGui.QVBoxLayout(self.comments_group_box)
        self.comments_layout.setObjectName('comments_layout')
        self.comments_edit = QtGui.QTextEdit(self.comments_group_box)
        self.comments_edit.setObjectName('comments_edit')
        self.comments_layout.addWidget(self.comments_edit)
        self.theme_tab_layout.addWidget(self.comments_group_box)
        self.song_tab_widget.addTab(self.theme_tab, '')
        # audio tab
        self.audio_tab = QtGui.QWidget()
        self.audio_tab.setObjectName('audio_tab')
        self.audio_layout = QtGui.QHBoxLayout(self.audio_tab)
        self.audio_layout.setObjectName('audio_layout')
        self.audio_list_widget = QtGui.QListWidget(self.audio_tab)
        self.audio_list_widget.setObjectName('audio_list_widget')
        self.audio_layout.addWidget(self.audio_list_widget)
        self.audio_buttons_layout = QtGui.QVBoxLayout()
        self.audio_buttons_layout.setObjectName('audio_buttons_layout')
        self.from_file_button = QtGui.QPushButton(self.audio_tab)
        self.from_file_button.setObjectName('from_file_button')
        self.audio_buttons_layout.addWidget(self.from_file_button)
        self.from_media_button = QtGui.QPushButton(self.audio_tab)
        self.from_media_button.setObjectName('from_media_button')
        self.audio_buttons_layout.addWidget(self.from_media_button)
        self.audio_remove_button = QtGui.QPushButton(self.audio_tab)
        self.audio_remove_button.setObjectName('audio_remove_button')
        self.audio_buttons_layout.addWidget(self.audio_remove_button)
        self.audio_remove_all_button = QtGui.QPushButton(self.audio_tab)
        self.audio_remove_all_button.setObjectName('audio_remove_all_button')
        self.audio_buttons_layout.addWidget(self.audio_remove_all_button)
        self.audio_buttons_layout.addStretch(1)
        self.up_button = create_button(self, 'up_button', role='up', click=self.on_up_button_clicked)
        self.down_button = create_button(self, 'down_button', role='down', click=self.on_down_button_clicked)
        self.audio_buttons_layout.addWidget(self.up_button)
        self.audio_buttons_layout.addWidget(self.down_button)
        self.audio_layout.addLayout(self.audio_buttons_layout)
        self.song_tab_widget.addTab(self.audio_tab, '')
        # Last few bits
        self.dialog_layout.addWidget(self.song_tab_widget)
        self.bottom_layout = QtGui.QHBoxLayout()
        self.bottom_layout.setObjectName('bottom_layout')
        self.warning_label = QtGui.QLabel(edit_song_dialog)
        self.warning_label.setObjectName('warning_label')
        self.bottom_layout.addWidget(self.warning_label)
        self.button_box = create_button_box(edit_song_dialog, 'button_box', ['cancel', 'save'])
        self.bottom_layout.addWidget(self.button_box)
        self.dialog_layout.addLayout(self.bottom_layout)
        self.retranslateUi(edit_song_dialog)
Example #6
0
class Ui_EditSongDialog(object):
    """
    The :class:`~openlp.plugins.songs.forms.editsongdialog.Ui_EditSongDialog` class defines the user interface for the
    EditSongForm dialog.
    """

    def setupUi(self, edit_song_dialog):
        edit_song_dialog.setObjectName('edit_song_dialog')
        edit_song_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg'))
        edit_song_dialog.resize(650, 400)
        edit_song_dialog.setModal(True)
        self.dialog_layout = QtGui.QVBoxLayout(edit_song_dialog)
        self.dialog_layout.setSpacing(8)
        self.dialog_layout.setContentsMargins(8, 8, 8, 8)
        self.dialog_layout.setObjectName('dialog_layout')
        self.song_tab_widget = QtGui.QTabWidget(edit_song_dialog)
        self.song_tab_widget.setObjectName('song_tab_widget')
        # lyrics tab
        self.lyrics_tab = QtGui.QWidget()
        self.lyrics_tab.setObjectName('lyrics_tab')
        self.lyrics_tab_layout = QtGui.QGridLayout(self.lyrics_tab)
        self.lyrics_tab_layout.setObjectName('lyrics_tab_layout')
        self.title_label = QtGui.QLabel(self.lyrics_tab)
        self.title_label.setObjectName('title_label')
        self.lyrics_tab_layout.addWidget(self.title_label, 0, 0)
        self.title_edit = QtGui.QLineEdit(self.lyrics_tab)
        self.title_edit.setObjectName('title_edit')
        self.title_label.setBuddy(self.title_edit)
        self.lyrics_tab_layout.addWidget(self.title_edit, 0, 1, 1, 2)
        self.alternative_title_label = QtGui.QLabel(self.lyrics_tab)
        self.alternative_title_label.setObjectName('alternative_title_label')
        self.lyrics_tab_layout.addWidget(self.alternative_title_label, 1, 0)
        self.alternative_edit = QtGui.QLineEdit(self.lyrics_tab)
        self.alternative_edit.setObjectName('alternative_edit')
        self.alternative_title_label.setBuddy(self.alternative_edit)
        self.lyrics_tab_layout.addWidget(self.alternative_edit, 1, 1, 1, 2)
        self.lyrics_label = QtGui.QLabel(self.lyrics_tab)
        self.lyrics_label.setFixedHeight(self.title_edit.sizeHint().height())
        self.lyrics_label.setObjectName('lyrics_label')
        self.lyrics_tab_layout.addWidget(self.lyrics_label, 2, 0, QtCore.Qt.AlignTop)
        self.verse_list_widget = SingleColumnTableWidget(self.lyrics_tab)
        self.verse_list_widget.setAlternatingRowColors(True)
        self.verse_list_widget.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
        self.verse_list_widget.setSelectionMode(QtGui.QAbstractItemView.SingleSelection)
        self.verse_list_widget.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers)
        self.verse_list_widget.setObjectName('verse_list_widget')
        self.lyrics_label.setBuddy(self.verse_list_widget)
        self.lyrics_tab_layout.addWidget(self.verse_list_widget, 2, 1)
        self.verse_order_label = QtGui.QLabel(self.lyrics_tab)
        self.verse_order_label.setObjectName('verse_order_label')
        self.lyrics_tab_layout.addWidget(self.verse_order_label, 3, 0)
        self.verse_order_edit = QtGui.QLineEdit(self.lyrics_tab)
        self.verse_order_edit.setObjectName('verse_order_edit')
        self.verse_order_label.setBuddy(self.verse_order_edit)
        self.lyrics_tab_layout.addWidget(self.verse_order_edit, 3, 1, 1, 2)

        self.verse_buttons_layout = QtGui.QVBoxLayout()
        self.verse_buttons_layout.setObjectName('verse_buttons_layout')
        self.verse_add_button = QtGui.QPushButton(self.lyrics_tab)
        self.verse_add_button.setObjectName('verse_add_button')
        self.verse_buttons_layout.addWidget(self.verse_add_button)
        #self.verse_edit_button = QtGui.QPushButton(self.lyrics_tab)
        #self.verse_edit_button.setObjectName('verse_edit_button')
        #self.verse_buttons_layout.addWidget(self.verse_edit_button)
        #self.verse_edit_all_button = QtGui.QPushButton(self.lyrics_tab)
        #self.verse_edit_all_button.setObjectName('verse_edit_all_button')
        #self.verse_buttons_layout.addWidget(self.verse_edit_all_button)
        self.verse_edit_chords_button = QtGui.QPushButton(self.lyrics_tab)
        self.verse_edit_chords_button.setObjectName('verse_edit_chords_button')
        self.verse_buttons_layout.addWidget(self.verse_edit_chords_button)
        self.verse_edit_all_chords_button = QtGui.QPushButton(self.lyrics_tab)
        self.verse_edit_all_chords_button.setObjectName('verse_edit_all_chords_button')
        self.verse_buttons_layout.addWidget(self.verse_edit_all_chords_button)
        self.verse_delete_button = QtGui.QPushButton(self.lyrics_tab)
        self.verse_delete_button.setObjectName('verse_delete_button')
        self.verse_buttons_layout.addWidget(self.verse_delete_button)
        self.verse_buttons_layout.addStretch()
        self.lyrics_tab_layout.addLayout(self.verse_buttons_layout, 2, 2)

        # key and chords area
        self.song_key_label = QtGui.QLabel(self.lyrics_tab)
        self.song_key_label.setObjectName('song_key_label')
        self.lyrics_tab_layout.addWidget(self.song_key_label, 4, 0)
        self.key_area_layout = QtGui.QGridLayout()
        self.key_area_layout.setObjectName('key_area_layout')
        self.song_key_edit = QtGui.QComboBox(self.lyrics_tab)
        self.song_key_edit.setEditable(False)
        self.song_key_edit.addItems(Chords.key_list)
        self.song_key_edit.setObjectName('song_key_edit')
        self.song_key_label.setBuddy(self.song_key_edit)
        self.key_area_layout.addWidget(self.song_key_edit, 0, 1, 1, 1)
        self.transpose_label = QtGui.QLabel(self.lyrics_tab)
        self.transpose_label.setObjectName('transpose_label')
        self.key_area_layout.addWidget(self.transpose_label, 0, 2)
        self.transpose_edit = QtGui.QSpinBox(self.lyrics_tab)
        self.transpose_edit.setRange(-11, 11)
        self.transpose_edit.setObjectName('transpose_edit')
        self.transpose_label.setBuddy(self.transpose_edit)
        self.key_area_layout.addWidget(self.transpose_edit, 0, 3, 1, 1)
        self.transposed_key_label = QtGui.QLabel(self.lyrics_tab)
        self.transposed_key_label.setObjectName('transposed_key_label')
        self.key_area_layout.addWidget(self.transposed_key_label, 0, 4, 1, 1)
        self.lyrics_tab_layout.addLayout(self.key_area_layout, 4, 1, 1, 3)

        self.song_tab_widget.addTab(self.lyrics_tab, '')


        # authors tab
        self.authors_tab = QtGui.QWidget()
        self.authors_tab.setObjectName('authors_tab')
        self.authors_tab_layout = QtGui.QHBoxLayout(self.authors_tab)
        self.authors_tab_layout.setObjectName('authors_tab_layout')
        self.authors_left_layout = QtGui.QVBoxLayout()
        self.authors_left_layout.setObjectName('authors_left_layout')
        self.authors_group_box = QtGui.QGroupBox(self.authors_tab)
        self.authors_group_box.setObjectName('authors_group_box')
        self.authors_layout = QtGui.QVBoxLayout(self.authors_group_box)
        self.authors_layout.setObjectName('authors_layout')
        self.author_add_layout = QtGui.QVBoxLayout()
        self.author_add_layout.setObjectName('author_add_layout')
        self.author_type_layout = QtGui.QHBoxLayout()
        self.author_type_layout.setObjectName('author_type_layout')
        self.authors_combo_box = create_combo_box(self.authors_group_box, 'authors_combo_box')
        self.author_add_layout.addWidget(self.authors_combo_box)
        self.author_types_combo_box = create_combo_box(self.authors_group_box, 'author_types_combo_box', editable=False)
        self.author_type_layout.addWidget(self.author_types_combo_box)
        self.author_add_button = QtGui.QPushButton(self.authors_group_box)
        self.author_add_button.setObjectName('author_add_button')
        self.author_type_layout.addWidget(self.author_add_button)
        self.author_add_layout.addLayout(self.author_type_layout)
        self.authors_layout.addLayout(self.author_add_layout)
        self.authors_list_view = QtGui.QListWidget(self.authors_group_box)
        self.authors_list_view.setAlternatingRowColors(True)
        self.authors_list_view.setObjectName('authors_list_view')
        self.authors_layout.addWidget(self.authors_list_view)
        self.author_remove_layout = QtGui.QHBoxLayout()
        self.author_remove_layout.setObjectName('author_remove_layout')
        self.author_remove_layout.addStretch()
        self.author_edit_button = QtGui.QPushButton(self.authors_group_box)
        self.author_edit_button.setObjectName('author_edit_button')
        self.author_remove_layout.addWidget(self.author_edit_button)
        self.author_remove_button = QtGui.QPushButton(self.authors_group_box)
        self.author_remove_button.setObjectName('author_remove_button')
        self.author_remove_layout.addWidget(self.author_remove_button)
        self.authors_layout.addLayout(self.author_remove_layout)
        self.authors_left_layout.addWidget(self.authors_group_box)
        self.maintenance_layout = QtGui.QHBoxLayout()
        self.maintenance_layout.setObjectName('maintenance_layout')
        self.maintenance_button = QtGui.QPushButton(self.authors_tab)
        self.maintenance_button.setObjectName('maintenance_button')
        self.maintenance_layout.addWidget(self.maintenance_button)
        self.maintenance_layout.addStretch()
        self.authors_left_layout.addLayout(self.maintenance_layout)
        self.authors_tab_layout.addLayout(self.authors_left_layout)
        self.authors_right_layout = QtGui.QVBoxLayout()
        self.authors_right_layout.setObjectName('authors_right_layout')
        self.topics_group_box = QtGui.QGroupBox(self.authors_tab)
        self.topics_group_box.setObjectName('topics_group_box')
        self.topics_layout = QtGui.QVBoxLayout(self.topics_group_box)
        self.topics_layout.setObjectName('topics_layout')
        self.topic_add_layout = QtGui.QHBoxLayout()
        self.topic_add_layout.setObjectName('topic_add_layout')
        self.topics_combo_box = create_combo_box(self.topics_group_box, 'topics_combo_box')
        self.topic_add_layout.addWidget(self.topics_combo_box)
        self.topic_add_button = QtGui.QPushButton(self.topics_group_box)
        self.topic_add_button.setObjectName('topic_add_button')
        self.topic_add_layout.addWidget(self.topic_add_button)
        self.topics_layout.addLayout(self.topic_add_layout)
        self.topics_list_view = QtGui.QListWidget(self.topics_group_box)
        self.topics_list_view.setAlternatingRowColors(True)
        self.topics_list_view.setObjectName('topics_list_view')
        self.topics_layout.addWidget(self.topics_list_view)
        self.topic_remove_layout = QtGui.QHBoxLayout()
        self.topic_remove_layout.setObjectName('topic_remove_layout')
        self.topic_remove_layout.addStretch()
        self.topic_remove_button = QtGui.QPushButton(self.topics_group_box)
        self.topic_remove_button.setObjectName('topic_remove_button')
        self.topic_remove_layout.addWidget(self.topic_remove_button)
        self.topics_layout.addLayout(self.topic_remove_layout)
        self.authors_right_layout.addWidget(self.topics_group_box)
        self.song_book_group_box = QtGui.QGroupBox(self.authors_tab)
        self.song_book_group_box.setObjectName('song_book_group_box')
        self.song_book_layout = QtGui.QFormLayout(self.song_book_group_box)
        self.song_book_layout.setObjectName('song_book_layout')
        self.song_book_name_label = QtGui.QLabel(self.song_book_group_box)
        self.song_book_name_label.setObjectName('song_book_name_label')
        self.song_book_combo_box = create_combo_box(self.song_book_group_box, 'song_book_combo_box')
        self.song_book_name_label.setBuddy(self.song_book_combo_box)
        self.song_book_layout.addRow(self.song_book_name_label, self.song_book_combo_box)
        self.song_book_number_label = QtGui.QLabel(self.song_book_group_box)
        self.song_book_number_label.setObjectName('song_book_number_label')
        self.song_book_number_edit = QtGui.QLineEdit(self.song_book_group_box)
        self.song_book_number_edit.setObjectName('song_book_number_edit')
        self.song_book_number_label.setBuddy(self.song_book_number_edit)
        self.song_book_layout.addRow(self.song_book_number_label, self.song_book_number_edit)
        self.authors_right_layout.addWidget(self.song_book_group_box)
        self.authors_tab_layout.addLayout(self.authors_right_layout)
        self.song_tab_widget.addTab(self.authors_tab, '')
        # theme tab
        self.theme_tab = QtGui.QWidget()
        self.theme_tab.setObjectName('theme_tab')
        self.theme_tab_layout = QtGui.QHBoxLayout(self.theme_tab)
        self.theme_tab_layout.setObjectName('theme_tab_layout')
        self.theme_left_layout = QtGui.QVBoxLayout()
        self.theme_left_layout.setObjectName('theme_left_layout')
        self.theme_group_box = QtGui.QGroupBox(self.theme_tab)
        self.theme_group_box.setObjectName('theme_group_box')
        self.theme_layout = QtGui.QHBoxLayout(self.theme_group_box)
        self.theme_layout.setObjectName('theme_layout')
        self.theme_combo_box = create_combo_box(self.theme_group_box, 'theme_combo_box')
        self.theme_layout.addWidget(self.theme_combo_box)
        self.theme_add_button = QtGui.QPushButton(self.theme_group_box)
        self.theme_add_button.setObjectName('theme_add_button')
        self.theme_layout.addWidget(self.theme_add_button)
        self.theme_left_layout.addWidget(self.theme_group_box)
        self.rights_group_box = QtGui.QGroupBox(self.theme_tab)
        self.rights_group_box.setObjectName('rights_group_box')
        self.rights_layout = QtGui.QVBoxLayout(self.rights_group_box)
        self.rights_layout.setObjectName('rights_layout')
        self.copyright_layout = QtGui.QHBoxLayout()
        self.copyright_layout.setObjectName('copyright_layout')
        self.copyright_edit = QtGui.QLineEdit(self.rights_group_box)
        self.copyright_edit.setObjectName('copyright_edit')
        self.copyright_layout.addWidget(self.copyright_edit)
        self.copyright_insert_button = QtGui.QToolButton(self.rights_group_box)
        self.copyright_insert_button.setObjectName('copyright_insert_button')
        self.copyright_layout.addWidget(self.copyright_insert_button)
        self.rights_layout.addLayout(self.copyright_layout)
        self.ccli_layout = QtGui.QHBoxLayout()
        self.ccli_layout.setObjectName('ccli_layout')
        self.ccli_label = QtGui.QLabel(self.rights_group_box)
        self.ccli_label.setObjectName('ccli_label')
        self.ccli_layout.addWidget(self.ccli_label)
        self.ccli_number_edit = QtGui.QLineEdit(self.rights_group_box)
        self.ccli_number_edit.setValidator(QtGui.QIntValidator())
        self.ccli_number_edit.setObjectName('ccli_number_edit')
        self.ccli_layout.addWidget(self.ccli_number_edit)
        self.rights_layout.addLayout(self.ccli_layout)
        self.theme_left_layout.addWidget(self.rights_group_box)
        self.theme_left_layout.addStretch()
        self.theme_tab_layout.addLayout(self.theme_left_layout)
        self.comments_group_box = QtGui.QGroupBox(self.theme_tab)
        self.comments_group_box.setObjectName('comments_group_box')
        self.comments_layout = QtGui.QVBoxLayout(self.comments_group_box)
        self.comments_layout.setObjectName('comments_layout')
        self.comments_edit = QtGui.QTextEdit(self.comments_group_box)
        self.comments_edit.setObjectName('comments_edit')
        self.comments_layout.addWidget(self.comments_edit)
        self.theme_tab_layout.addWidget(self.comments_group_box)
        self.song_tab_widget.addTab(self.theme_tab, '')
        # audio tab
        self.audio_tab = QtGui.QWidget()
        self.audio_tab.setObjectName('audio_tab')
        self.audio_layout = QtGui.QHBoxLayout(self.audio_tab)
        self.audio_layout.setObjectName('audio_layout')
        self.audio_list_widget = QtGui.QListWidget(self.audio_tab)
        self.audio_list_widget.setObjectName('audio_list_widget')
        self.audio_layout.addWidget(self.audio_list_widget)
        self.audio_buttons_layout = QtGui.QVBoxLayout()
        self.audio_buttons_layout.setObjectName('audio_buttons_layout')
        self.from_file_button = QtGui.QPushButton(self.audio_tab)
        self.from_file_button.setObjectName('from_file_button')
        self.audio_buttons_layout.addWidget(self.from_file_button)
        self.from_media_button = QtGui.QPushButton(self.audio_tab)
        self.from_media_button.setObjectName('from_media_button')
        self.audio_buttons_layout.addWidget(self.from_media_button)
        self.audio_remove_button = QtGui.QPushButton(self.audio_tab)
        self.audio_remove_button.setObjectName('audio_remove_button')
        self.audio_buttons_layout.addWidget(self.audio_remove_button)
        self.audio_remove_all_button = QtGui.QPushButton(self.audio_tab)
        self.audio_remove_all_button.setObjectName('audio_remove_all_button')
        self.audio_buttons_layout.addWidget(self.audio_remove_all_button)
        self.audio_buttons_layout.addStretch(1)
        self.up_button = create_button(self, 'up_button', role='up', click=self.on_up_button_clicked)
        self.down_button = create_button(self, 'down_button', role='down', click=self.on_down_button_clicked)
        self.audio_buttons_layout.addWidget(self.up_button)
        self.audio_buttons_layout.addWidget(self.down_button)
        self.audio_layout.addLayout(self.audio_buttons_layout)
        self.song_tab_widget.addTab(self.audio_tab, '')
        # Last few bits
        self.dialog_layout.addWidget(self.song_tab_widget)
        self.bottom_layout = QtGui.QHBoxLayout()
        self.bottom_layout.setObjectName('bottom_layout')
        self.warning_label = QtGui.QLabel(edit_song_dialog)
        self.warning_label.setObjectName('warning_label')
        self.bottom_layout.addWidget(self.warning_label)
        self.button_box = create_button_box(edit_song_dialog, 'button_box', ['cancel', 'save'])
        self.bottom_layout.addWidget(self.button_box)
        self.dialog_layout.addLayout(self.bottom_layout)
        self.retranslateUi(edit_song_dialog)

    def retranslateUi(self, edit_song_dialog):
        """
        Translate the UI on the fly.
        """
        edit_song_dialog.setWindowTitle(translate('SongsPlugin.EditSongForm', 'Song Editor'))
        self.title_label.setText(translate('SongsPlugin.EditSongForm', '&Title:'))
        self.alternative_title_label.setText(translate('SongsPlugin.EditSongForm', 'Alt&ernate title:'))
        self.lyrics_label.setText(translate('SongsPlugin.EditSongForm', '&Lyrics:'))
        self.verse_order_label.setText(translate('SongsPlugin.EditSongForm', '&Verse order:'))
        self.verse_add_button.setText(UiStrings().Add)
        #self.verse_edit_button.setText(UiStrings().Edit)
        #self.verse_edit_all_button.setText(translate('SongsPlugin.EditSongForm', 'Ed&it All'))
        self.verse_edit_chords_button.setText(UiStrings().Edit)
        self.verse_edit_all_chords_button.setText(translate('SongsPlugin.EditSongForm', 'Ed&it All'))
        self.verse_delete_button.setText(UiStrings().Delete)
        self.song_tab_widget.setTabText(self.song_tab_widget.indexOf(self.lyrics_tab),
                                        translate('SongsPlugin.EditSongForm', 'Title && Lyrics'))
        self.song_key_label.setText(translate('SongsPlugin.EditSongForm', 'Song &key:'))
        self.transpose_label.setText(translate('SongsPlugin.EditSongForm', 'Trans&pose by:'))
        self.authors_group_box.setTitle(SongStrings.Authors)
        self.author_add_button.setText(translate('SongsPlugin.EditSongForm', '&Add to Song'))
        self.author_edit_button.setText(translate('SongsPlugin.EditSongForm', '&Edit Author Type'))
        self.author_remove_button.setText(translate('SongsPlugin.EditSongForm', '&Remove'))
        self.maintenance_button.setText(translate('SongsPlugin.EditSongForm', '&Manage Authors, Topics, Song Books'))
        self.topics_group_box.setTitle(SongStrings.Topic)
        self.topic_add_button.setText(translate('SongsPlugin.EditSongForm', 'A&dd to Song'))
        self.topic_remove_button.setText(translate('SongsPlugin.EditSongForm', 'R&emove'))
        self.song_book_group_box.setTitle(SongStrings.SongBook)
        self.song_book_name_label.setText(translate('SongsPlugin.EditSongForm', 'Book:'))
        self.song_book_number_label.setText(translate('SongsPlugin.EditSongForm', 'Number:'))
        self.song_tab_widget.setTabText(self.song_tab_widget.indexOf(self.authors_tab),
                                        translate('SongsPlugin.EditSongForm', 'Authors, Topics && Song Book'))
        self.theme_group_box.setTitle(UiStrings().Theme)
        self.theme_add_button.setText(translate('SongsPlugin.EditSongForm', 'New &Theme'))
        self.rights_group_box.setTitle(translate('SongsPlugin.EditSongForm', 'Copyright Information'))
        self.copyright_insert_button.setText(SongStrings.CopyrightSymbol)
        self.ccli_label.setText(UiStrings().CCLISongNumberLabel)
        self.comments_group_box.setTitle(translate('SongsPlugin.EditSongForm', 'Comments'))
        self.song_tab_widget.setTabText(self.song_tab_widget.indexOf(self.theme_tab),
                                        translate('SongsPlugin.EditSongForm', 'Theme, Copyright Info && Comments'))
        self.song_tab_widget.setTabText(self.song_tab_widget.indexOf(self.audio_tab),
                                        translate('SongsPlugin.EditSongForm', 'Linked Audio'))
        self.from_file_button.setText(translate('SongsPlugin.EditSongForm', 'Add &File(s)'))
        self.from_media_button.setText(translate('SongsPlugin.EditSongForm', 'Add &Media'))
        self.audio_remove_button.setText(translate('SongsPlugin.EditSongForm', '&Remove'))
        self.audio_remove_all_button.setText(translate('SongsPlugin.EditSongForm', 'Remove &All'))
        self.not_all_verses_used_warning = \
            translate('SongsPlugin.EditSongForm', '<strong>Warning:</strong> Not all of the verses are in use.')
        self.no_verse_order_entered_warning =  \
            translate('SongsPlugin.EditSongForm', '<strong>Warning:</strong> You have not entered a verse order.')
Example #7
0
    def setup_ui(self, songselect_dialog):
        songselect_dialog.setObjectName('songselect_dialog')
        songselect_dialog.resize(616, 378)
        self.songselect_layout = QtWidgets.QVBoxLayout(songselect_dialog)
        self.songselect_layout.setSpacing(0)
        self.songselect_layout.setContentsMargins(0, 0, 0, 0)
        self.songselect_layout.setObjectName('songselect_layout')
        self.stacked_widget = QtWidgets.QStackedWidget(songselect_dialog)
        self.stacked_widget.setObjectName('stacked_widget')
        self.login_page = QtWidgets.QWidget()
        self.login_page.setObjectName('login_page')
        self.login_layout = QtWidgets.QFormLayout(self.login_page)
        self.login_layout.setContentsMargins(120, 100, 120, 100)
        self.login_layout.setSpacing(8)
        self.login_layout.setObjectName('login_layout')
        self.notice_layout = QtWidgets.QHBoxLayout()
        self.notice_layout.setObjectName('notice_layout')
        self.notice_label = QtWidgets.QLabel(self.login_page)
        self.notice_label.setWordWrap(True)
        self.notice_label.setObjectName('notice_label')
        self.notice_layout.addWidget(self.notice_label)
        self.login_layout.setLayout(0, QtWidgets.QFormLayout.SpanningRole, self.notice_layout)
        self.username_label = QtWidgets.QLabel(self.login_page)
        self.username_label.setObjectName('usernameLabel')
        self.login_layout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.username_label)
        self.username_edit = QtWidgets.QLineEdit(self.login_page)
        self.username_edit.setObjectName('usernameEdit')
        self.login_layout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.username_edit)
        self.password_label = QtWidgets.QLabel(self.login_page)
        self.password_label.setObjectName('passwordLabel')
        self.login_layout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.password_label)
        self.password_edit = QtWidgets.QLineEdit(self.login_page)
        self.password_edit.setEchoMode(QtWidgets.QLineEdit.Password)
        self.password_edit.setObjectName('passwordEdit')
        self.login_layout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.password_edit)
        self.save_password_checkbox = QtWidgets.QCheckBox(self.login_page)
        self.save_password_checkbox.setTristate(False)
        self.save_password_checkbox.setObjectName('save_password_checkbox')
        self.login_layout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.save_password_checkbox)
        self.login_button_layout = QtWidgets.QHBoxLayout()
        self.login_button_layout.setSpacing(8)
        self.login_button_layout.setContentsMargins(0, -1, -1, -1)
        self.login_button_layout.setObjectName('login_button_layout')
        self.login_spacer = QtWidgets.QWidget(self.login_page)
        self.login_spacer.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.login_spacer.setObjectName('login_spacer')
        self.login_button_layout.addWidget(self.login_spacer)
        self.login_progress_bar = QtWidgets.QProgressBar(self.login_page)
        self.login_progress_bar.setMinimum(0)
        self.login_progress_bar.setMaximum(3)
        self.login_progress_bar.setValue(0)
        self.login_progress_bar.setMinimumWidth(200)
        self.login_progress_bar.setVisible(False)
        self.login_button_layout.addWidget(self.login_progress_bar)
        self.login_button = QtWidgets.QPushButton(self.login_page)
        self.login_button.setIcon(build_icon(':/songs/song_author_edit.png'))
        self.login_button.setObjectName('login_button')
        self.login_button_layout.addWidget(self.login_button)
        self.login_layout.setLayout(4, QtWidgets.QFormLayout.SpanningRole, self.login_button_layout)
        self.stacked_widget.addWidget(self.login_page)
        self.search_page = QtWidgets.QWidget()
        self.search_page.setObjectName('search_page')
        self.search_layout = QtWidgets.QVBoxLayout(self.search_page)
        self.search_layout.setSpacing(8)
        self.search_layout.setContentsMargins(8, 8, 8, 8)
        self.search_layout.setObjectName('search_layout')
        self.search_input_layout = QtWidgets.QHBoxLayout()
        self.search_input_layout.setSpacing(8)
        self.search_input_layout.setObjectName('search_input_layout')
        self.search_label = QtWidgets.QLabel(self.search_page)
        self.search_label.setObjectName('search_label')
        self.search_input_layout.addWidget(self.search_label)
        self.search_combobox = HistoryComboBox(self.search_page)
        self.search_combobox.setObjectName('search_combobox')
        self.search_input_layout.addWidget(self.search_combobox)
        self.search_button = QtWidgets.QPushButton(self.search_page)
        self.search_button.setIcon(build_icon(':/general/general_find.png'))
        self.search_button.setObjectName('search_button')
        self.search_input_layout.addWidget(self.search_button)
        self.search_layout.addLayout(self.search_input_layout)
        self.search_progress_layout = QtWidgets.QHBoxLayout()
        self.search_progress_layout.setSpacing(8)
        self.search_progress_layout.setObjectName('search_progress_layout')
        self.search_progress_bar = QtWidgets.QProgressBar(self.search_page)
        self.search_progress_bar.setMinimum(0)
        self.search_progress_bar.setMaximum(3)
        self.search_progress_bar.setValue(0)
        self.search_progress_layout.addWidget(self.search_progress_bar)
        self.stop_button = QtWidgets.QPushButton(self.search_page)
        self.stop_button.setIcon(build_icon(':/songs/song_search_stop.png'))
        self.stop_button.setObjectName('stop_button')
        self.search_progress_layout.addWidget(self.stop_button)
        self.search_layout.addLayout(self.search_progress_layout)
        self.search_results_widget = QtWidgets.QListWidget(self.search_page)
        self.search_results_widget.setProperty("showDropIndicator", False)
        self.search_results_widget.setAlternatingRowColors(True)
        self.search_results_widget.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
        self.search_results_widget.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
        self.search_results_widget.setObjectName('search_results_widget')
        self.search_layout.addWidget(self.search_results_widget)
        self.result_count_label = QtWidgets.QLabel(self.search_page)
        self.result_count_label.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignCenter)
        self.result_count_label.setObjectName('result_count_label')
        self.search_layout.addWidget(self.result_count_label)
        self.view_layout = QtWidgets.QHBoxLayout()
        self.view_layout.setSpacing(8)
        self.view_layout.setObjectName('view_layout')
        self.logout_button = QtWidgets.QPushButton(self.search_page)
        self.logout_button.setIcon(build_icon(':/songs/song_author_edit.png'))
        self.view_layout.addWidget(self.logout_button)
        self.view_spacer = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.view_layout.addItem(self.view_spacer)
        self.view_button = QtWidgets.QPushButton(self.search_page)
        self.view_button.setIcon(build_icon(':/songs/song_search_all.png'))
        self.view_button.setObjectName('view_button')
        self.view_layout.addWidget(self.view_button)
        self.search_layout.addLayout(self.view_layout)
        self.stacked_widget.addWidget(self.search_page)
        self.song_page = QtWidgets.QWidget()
        self.song_page.setObjectName('song_page')
        self.song_layout = QtWidgets.QGridLayout(self.song_page)
        self.song_layout.setContentsMargins(8, 8, 8, 8)
        self.song_layout.setSpacing(8)
        self.song_layout.setObjectName('song_layout')
        self.title_label = QtWidgets.QLabel(self.song_page)
        self.title_label.setObjectName('title_label')
        self.song_layout.addWidget(self.title_label, 0, 0, 1, 1)
        self.title_edit = QtWidgets.QLineEdit(self.song_page)
        self.title_edit.setReadOnly(True)
        self.title_edit.setObjectName('title_edit')
        self.song_layout.addWidget(self.title_edit, 0, 1, 1, 1)
        self.authors_label = QtWidgets.QLabel(self.song_page)
        self.authors_label.setObjectName('authors_label')
        self.song_layout.addWidget(self.authors_label, 0, 2, 1, 1)
        self.author_list_widget = QtWidgets.QListWidget(self.song_page)
        self.author_list_widget.setObjectName('author_list_widget')
        self.song_layout.addWidget(self.author_list_widget, 0, 3, 3, 1)
        self.copyright_label = QtWidgets.QLabel(self.song_page)
        self.copyright_label.setObjectName('copyright_label')
        self.song_layout.addWidget(self.copyright_label, 1, 0, 1, 1)
        self.copyright_edit = QtWidgets.QLineEdit(self.song_page)
        self.copyright_edit.setReadOnly(True)
        self.copyright_edit.setObjectName('copyright_edit')
        self.song_layout.addWidget(self.copyright_edit, 1, 1, 1, 1)
        self.ccli_label = QtWidgets.QLabel(self.song_page)
        self.ccli_label.setObjectName('ccli_label')
        self.song_layout.addWidget(self.ccli_label, 2, 0, 1, 1)
        self.ccli_edit = QtWidgets.QLineEdit(self.song_page)
        self.ccli_edit.setReadOnly(True)
        self.ccli_edit.setObjectName('ccli_edit')
        self.song_layout.addWidget(self.ccli_edit, 2, 1, 1, 1)
        self.lyrics_label = QtWidgets.QLabel(self.song_page)
        self.lyrics_label.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop)
        self.lyrics_label.setObjectName('lyrics_label')
        self.song_layout.addWidget(self.lyrics_label, 3, 0, 1, 1)
        self.lyrics_table_widget = SingleColumnTableWidget(self.song_page)
        self.lyrics_table_widget.setObjectName('lyrics_table_widget')
        self.lyrics_table_widget.setRowCount(0)
        self.song_layout.addWidget(self.lyrics_table_widget, 3, 1, 1, 3)
        self.song_progress_bar = QtWidgets.QProgressBar(self.song_page)
        self.song_progress_bar.setMinimum(0)
        self.song_progress_bar.setMaximum(3)
        self.song_progress_bar.setValue(0)
        self.song_progress_bar.setVisible(False)
        self.song_layout.addWidget(self.song_progress_bar, 4, 0, 1, 4)
        self.import_layout = QtWidgets.QHBoxLayout()
        self.import_layout.setObjectName('import_layout')
        self.back_button = QtWidgets.QPushButton(self.song_page)
        self.back_button.setIcon(build_icon(':/general/general_back.png'))
        self.back_button.setObjectName('back_button')
        self.import_layout.addWidget(self.back_button)
        self.import_spacer = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding,
                                                   QtWidgets.QSizePolicy.Minimum)
        self.import_layout.addItem(self.import_spacer)
        self.import_button = QtWidgets.QPushButton(self.song_page)
        self.import_button.setIcon(build_icon(':/general/general_import.png'))
        self.import_button.setObjectName('import_button')
        self.import_layout.addWidget(self.import_button)
        self.song_layout.addLayout(self.import_layout, 5, 0, 1, 5)
        self.stacked_widget.addWidget(self.song_page)
        self.songselect_layout.addWidget(self.stacked_widget)
        self.username_label.setBuddy(self.username_edit)
        self.password_label.setBuddy(self.password_edit)
        self.title_label.setBuddy(self.title_edit)
        self.authors_label.setBuddy(self.author_list_widget)
        self.copyright_label.setBuddy(self.copyright_edit)
        self.ccli_label.setBuddy(self.ccli_edit)
        self.lyrics_label.setBuddy(self.lyrics_table_widget)

        self.retranslate_ui(songselect_dialog)
        self.stacked_widget.setCurrentIndex(0)
Example #8
0
class Ui_SongSelectDialog(object):
    """
    The actual Qt components that make up the dialog.
    """
    def setup_ui(self, songselect_dialog):
        songselect_dialog.setObjectName('songselect_dialog')
        songselect_dialog.resize(616, 378)
        self.songselect_layout = QtWidgets.QVBoxLayout(songselect_dialog)
        self.songselect_layout.setSpacing(0)
        self.songselect_layout.setContentsMargins(0, 0, 0, 0)
        self.songselect_layout.setObjectName('songselect_layout')
        self.stacked_widget = QtWidgets.QStackedWidget(songselect_dialog)
        self.stacked_widget.setObjectName('stacked_widget')
        self.login_page = QtWidgets.QWidget()
        self.login_page.setObjectName('login_page')
        self.login_layout = QtWidgets.QFormLayout(self.login_page)
        self.login_layout.setContentsMargins(120, 100, 120, 100)
        self.login_layout.setSpacing(8)
        self.login_layout.setObjectName('login_layout')
        self.notice_layout = QtWidgets.QHBoxLayout()
        self.notice_layout.setObjectName('notice_layout')
        self.notice_label = QtWidgets.QLabel(self.login_page)
        self.notice_label.setWordWrap(True)
        self.notice_label.setObjectName('notice_label')
        self.notice_layout.addWidget(self.notice_label)
        self.login_layout.setLayout(0, QtWidgets.QFormLayout.SpanningRole, self.notice_layout)
        self.username_label = QtWidgets.QLabel(self.login_page)
        self.username_label.setObjectName('usernameLabel')
        self.login_layout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.username_label)
        self.username_edit = QtWidgets.QLineEdit(self.login_page)
        self.username_edit.setObjectName('usernameEdit')
        self.login_layout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.username_edit)
        self.password_label = QtWidgets.QLabel(self.login_page)
        self.password_label.setObjectName('passwordLabel')
        self.login_layout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.password_label)
        self.password_edit = QtWidgets.QLineEdit(self.login_page)
        self.password_edit.setEchoMode(QtWidgets.QLineEdit.Password)
        self.password_edit.setObjectName('passwordEdit')
        self.login_layout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.password_edit)
        self.save_password_checkbox = QtWidgets.QCheckBox(self.login_page)
        self.save_password_checkbox.setTristate(False)
        self.save_password_checkbox.setObjectName('save_password_checkbox')
        self.login_layout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.save_password_checkbox)
        self.login_button_layout = QtWidgets.QHBoxLayout()
        self.login_button_layout.setSpacing(8)
        self.login_button_layout.setContentsMargins(0, -1, -1, -1)
        self.login_button_layout.setObjectName('login_button_layout')
        self.login_spacer = QtWidgets.QWidget(self.login_page)
        self.login_spacer.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.login_spacer.setObjectName('login_spacer')
        self.login_button_layout.addWidget(self.login_spacer)
        self.login_progress_bar = QtWidgets.QProgressBar(self.login_page)
        self.login_progress_bar.setMinimum(0)
        self.login_progress_bar.setMaximum(3)
        self.login_progress_bar.setValue(0)
        self.login_progress_bar.setMinimumWidth(200)
        self.login_progress_bar.setVisible(False)
        self.login_button_layout.addWidget(self.login_progress_bar)
        self.login_button = QtWidgets.QPushButton(self.login_page)
        self.login_button.setIcon(build_icon(':/songs/song_author_edit.png'))
        self.login_button.setObjectName('login_button')
        self.login_button_layout.addWidget(self.login_button)
        self.login_layout.setLayout(4, QtWidgets.QFormLayout.SpanningRole, self.login_button_layout)
        self.stacked_widget.addWidget(self.login_page)
        self.search_page = QtWidgets.QWidget()
        self.search_page.setObjectName('search_page')
        self.search_layout = QtWidgets.QVBoxLayout(self.search_page)
        self.search_layout.setSpacing(8)
        self.search_layout.setContentsMargins(8, 8, 8, 8)
        self.search_layout.setObjectName('search_layout')
        self.search_input_layout = QtWidgets.QHBoxLayout()
        self.search_input_layout.setSpacing(8)
        self.search_input_layout.setObjectName('search_input_layout')
        self.search_label = QtWidgets.QLabel(self.search_page)
        self.search_label.setObjectName('search_label')
        self.search_input_layout.addWidget(self.search_label)
        self.search_combobox = HistoryComboBox(self.search_page)
        self.search_combobox.setObjectName('search_combobox')
        self.search_input_layout.addWidget(self.search_combobox)
        self.search_button = QtWidgets.QPushButton(self.search_page)
        self.search_button.setIcon(build_icon(':/general/general_find.png'))
        self.search_button.setObjectName('search_button')
        self.search_input_layout.addWidget(self.search_button)
        self.search_layout.addLayout(self.search_input_layout)
        self.search_progress_layout = QtWidgets.QHBoxLayout()
        self.search_progress_layout.setSpacing(8)
        self.search_progress_layout.setObjectName('search_progress_layout')
        self.search_progress_bar = QtWidgets.QProgressBar(self.search_page)
        self.search_progress_bar.setMinimum(0)
        self.search_progress_bar.setMaximum(3)
        self.search_progress_bar.setValue(0)
        self.search_progress_layout.addWidget(self.search_progress_bar)
        self.stop_button = QtWidgets.QPushButton(self.search_page)
        self.stop_button.setIcon(build_icon(':/songs/song_search_stop.png'))
        self.stop_button.setObjectName('stop_button')
        self.search_progress_layout.addWidget(self.stop_button)
        self.search_layout.addLayout(self.search_progress_layout)
        self.search_results_widget = QtWidgets.QListWidget(self.search_page)
        self.search_results_widget.setProperty("showDropIndicator", False)
        self.search_results_widget.setAlternatingRowColors(True)
        self.search_results_widget.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
        self.search_results_widget.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
        self.search_results_widget.setObjectName('search_results_widget')
        self.search_layout.addWidget(self.search_results_widget)
        self.result_count_label = QtWidgets.QLabel(self.search_page)
        self.result_count_label.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignCenter)
        self.result_count_label.setObjectName('result_count_label')
        self.search_layout.addWidget(self.result_count_label)
        self.view_layout = QtWidgets.QHBoxLayout()
        self.view_layout.setSpacing(8)
        self.view_layout.setObjectName('view_layout')
        self.logout_button = QtWidgets.QPushButton(self.search_page)
        self.logout_button.setIcon(build_icon(':/songs/song_author_edit.png'))
        self.view_layout.addWidget(self.logout_button)
        self.view_spacer = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.view_layout.addItem(self.view_spacer)
        self.view_button = QtWidgets.QPushButton(self.search_page)
        self.view_button.setIcon(build_icon(':/songs/song_search_all.png'))
        self.view_button.setObjectName('view_button')
        self.view_layout.addWidget(self.view_button)
        self.search_layout.addLayout(self.view_layout)
        self.stacked_widget.addWidget(self.search_page)
        self.song_page = QtWidgets.QWidget()
        self.song_page.setObjectName('song_page')
        self.song_layout = QtWidgets.QGridLayout(self.song_page)
        self.song_layout.setContentsMargins(8, 8, 8, 8)
        self.song_layout.setSpacing(8)
        self.song_layout.setObjectName('song_layout')
        self.title_label = QtWidgets.QLabel(self.song_page)
        self.title_label.setObjectName('title_label')
        self.song_layout.addWidget(self.title_label, 0, 0, 1, 1)
        self.title_edit = QtWidgets.QLineEdit(self.song_page)
        self.title_edit.setReadOnly(True)
        self.title_edit.setObjectName('title_edit')
        self.song_layout.addWidget(self.title_edit, 0, 1, 1, 1)
        self.authors_label = QtWidgets.QLabel(self.song_page)
        self.authors_label.setObjectName('authors_label')
        self.song_layout.addWidget(self.authors_label, 0, 2, 1, 1)
        self.author_list_widget = QtWidgets.QListWidget(self.song_page)
        self.author_list_widget.setObjectName('author_list_widget')
        self.song_layout.addWidget(self.author_list_widget, 0, 3, 3, 1)
        self.copyright_label = QtWidgets.QLabel(self.song_page)
        self.copyright_label.setObjectName('copyright_label')
        self.song_layout.addWidget(self.copyright_label, 1, 0, 1, 1)
        self.copyright_edit = QtWidgets.QLineEdit(self.song_page)
        self.copyright_edit.setReadOnly(True)
        self.copyright_edit.setObjectName('copyright_edit')
        self.song_layout.addWidget(self.copyright_edit, 1, 1, 1, 1)
        self.ccli_label = QtWidgets.QLabel(self.song_page)
        self.ccli_label.setObjectName('ccli_label')
        self.song_layout.addWidget(self.ccli_label, 2, 0, 1, 1)
        self.ccli_edit = QtWidgets.QLineEdit(self.song_page)
        self.ccli_edit.setReadOnly(True)
        self.ccli_edit.setObjectName('ccli_edit')
        self.song_layout.addWidget(self.ccli_edit, 2, 1, 1, 1)
        self.lyrics_label = QtWidgets.QLabel(self.song_page)
        self.lyrics_label.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop)
        self.lyrics_label.setObjectName('lyrics_label')
        self.song_layout.addWidget(self.lyrics_label, 3, 0, 1, 1)
        self.lyrics_table_widget = SingleColumnTableWidget(self.song_page)
        self.lyrics_table_widget.setObjectName('lyrics_table_widget')
        self.lyrics_table_widget.setRowCount(0)
        self.song_layout.addWidget(self.lyrics_table_widget, 3, 1, 1, 3)
        self.song_progress_bar = QtWidgets.QProgressBar(self.song_page)
        self.song_progress_bar.setMinimum(0)
        self.song_progress_bar.setMaximum(3)
        self.song_progress_bar.setValue(0)
        self.song_progress_bar.setVisible(False)
        self.song_layout.addWidget(self.song_progress_bar, 4, 0, 1, 4)
        self.import_layout = QtWidgets.QHBoxLayout()
        self.import_layout.setObjectName('import_layout')
        self.back_button = QtWidgets.QPushButton(self.song_page)
        self.back_button.setIcon(build_icon(':/general/general_back.png'))
        self.back_button.setObjectName('back_button')
        self.import_layout.addWidget(self.back_button)
        self.import_spacer = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding,
                                                   QtWidgets.QSizePolicy.Minimum)
        self.import_layout.addItem(self.import_spacer)
        self.import_button = QtWidgets.QPushButton(self.song_page)
        self.import_button.setIcon(build_icon(':/general/general_import.png'))
        self.import_button.setObjectName('import_button')
        self.import_layout.addWidget(self.import_button)
        self.song_layout.addLayout(self.import_layout, 5, 0, 1, 5)
        self.stacked_widget.addWidget(self.song_page)
        self.songselect_layout.addWidget(self.stacked_widget)
        self.username_label.setBuddy(self.username_edit)
        self.password_label.setBuddy(self.password_edit)
        self.title_label.setBuddy(self.title_edit)
        self.authors_label.setBuddy(self.author_list_widget)
        self.copyright_label.setBuddy(self.copyright_edit)
        self.ccli_label.setBuddy(self.ccli_edit)
        self.lyrics_label.setBuddy(self.lyrics_table_widget)

        self.retranslate_ui(songselect_dialog)
        self.stacked_widget.setCurrentIndex(0)

    def retranslate_ui(self, songselect_dialog):
        """
        Translate the GUI.
        """
        songselect_dialog.setWindowTitle(translate('SongsPlugin.SongSelectForm', 'CCLI SongSelect Importer'))
        self.notice_label.setText(
            translate('SongsPlugin.SongSelectForm', '<strong>Note:</strong> '
                      'An Internet connection is required in order to import songs from CCLI SongSelect.')
        )
        self.username_label.setText(translate('SongsPlugin.SongSelectForm', 'Username:'******'SongsPlugin.SongSelectForm', 'Password:'******'SongsPlugin.SongSelectForm', 'Save username and password'))
        self.login_button.setText(translate('SongsPlugin.SongSelectForm', 'Login'))
        self.search_label.setText(translate('SongsPlugin.SongSelectForm', 'Search Text:'))
        self.search_button.setText(translate('SongsPlugin.SongSelectForm', 'Search'))
        self.stop_button.setText(translate('SongsPlugin.SongSelectForm', 'Stop'))
        self.result_count_label.setText(translate('SongsPlugin.SongSelectForm',
                                                  'Found {count:d} song(s)').format(count=0))
        self.logout_button.setText(translate('SongsPlugin.SongSelectForm', 'Logout'))
        self.view_button.setText(translate('SongsPlugin.SongSelectForm', 'View'))
        self.title_label.setText(translate('SongsPlugin.SongSelectForm', 'Title:'))
        self.authors_label.setText(translate('SongsPlugin.SongSelectForm', 'Author(s):'))
        self.copyright_label.setText(translate('SongsPlugin.SongSelectForm', 'Copyright:'))
        self.ccli_label.setText(translate('SongsPlugin.SongSelectForm', 'CCLI Number:'))
        self.lyrics_label.setText(translate('SongsPlugin.SongSelectForm', 'Lyrics:'))
        self.back_button.setText(translate('SongsPlugin.SongSelectForm', 'Back'))
        self.import_button.setText(translate('SongsPlugin.SongSelectForm', 'Import'))
Example #9
0
    def setup_ui(self, songselect_dialog):
        songselect_dialog.setObjectName('songselect_dialog')
        songselect_dialog.resize(616, 378)
        self.songselect_layout = QtWidgets.QVBoxLayout(songselect_dialog)
        self.songselect_layout.setSpacing(0)
        self.songselect_layout.setContentsMargins(0, 0, 0, 0)
        self.songselect_layout.setObjectName('songselect_layout')
        self.stacked_widget = QtWidgets.QStackedWidget(songselect_dialog)
        self.stacked_widget.setObjectName('stacked_widget')
        self.login_page = QtWidgets.QWidget()
        self.login_page.setObjectName('login_page')
        self.login_layout = QtWidgets.QFormLayout(self.login_page)
        self.login_layout.setContentsMargins(120, 100, 120, 100)
        self.login_layout.setSpacing(8)
        self.login_layout.setObjectName('login_layout')
        self.notice_layout = QtWidgets.QHBoxLayout()
        self.notice_layout.setObjectName('notice_layout')
        self.notice_label = QtWidgets.QLabel(self.login_page)
        self.notice_label.setWordWrap(True)
        self.notice_label.setObjectName('notice_label')
        self.notice_layout.addWidget(self.notice_label)
        self.login_layout.setLayout(0, QtWidgets.QFormLayout.SpanningRole,
                                    self.notice_layout)
        self.username_label = QtWidgets.QLabel(self.login_page)
        self.username_label.setObjectName('usernameLabel')
        self.login_layout.setWidget(1, QtWidgets.QFormLayout.LabelRole,
                                    self.username_label)
        self.username_edit = QtWidgets.QLineEdit(self.login_page)
        self.username_edit.setObjectName('usernameEdit')
        self.login_layout.setWidget(1, QtWidgets.QFormLayout.FieldRole,
                                    self.username_edit)
        self.password_label = QtWidgets.QLabel(self.login_page)
        self.password_label.setObjectName('passwordLabel')
        self.login_layout.setWidget(2, QtWidgets.QFormLayout.LabelRole,
                                    self.password_label)
        self.password_edit = QtWidgets.QLineEdit(self.login_page)
        self.password_edit.setEchoMode(QtWidgets.QLineEdit.Password)
        self.password_edit.setObjectName('passwordEdit')
        self.login_layout.setWidget(2, QtWidgets.QFormLayout.FieldRole,
                                    self.password_edit)
        self.save_password_checkbox = QtWidgets.QCheckBox(self.login_page)
        self.save_password_checkbox.setTristate(False)
        self.save_password_checkbox.setObjectName('save_password_checkbox')
        self.login_layout.setWidget(3, QtWidgets.QFormLayout.FieldRole,
                                    self.save_password_checkbox)
        self.login_button_layout = QtWidgets.QHBoxLayout()
        self.login_button_layout.setSpacing(8)
        self.login_button_layout.setContentsMargins(0, -1, -1, -1)
        self.login_button_layout.setObjectName('login_button_layout')
        self.login_spacer = QtWidgets.QWidget(self.login_page)
        self.login_spacer.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                        QtWidgets.QSizePolicy.Minimum)
        self.login_spacer.setObjectName('login_spacer')
        self.login_button_layout.addWidget(self.login_spacer)
        self.login_progress_bar = QtWidgets.QProgressBar(self.login_page)
        self.login_progress_bar.setMinimum(0)
        self.login_progress_bar.setMaximum(3)
        self.login_progress_bar.setValue(0)
        self.login_progress_bar.setMinimumWidth(200)
        self.login_progress_bar.setVisible(False)
        self.login_button_layout.addWidget(self.login_progress_bar)
        self.login_button = QtWidgets.QPushButton(self.login_page)
        self.login_button.setIcon(build_icon(':/songs/song_author_edit.png'))
        self.login_button.setObjectName('login_button')
        self.login_button_layout.addWidget(self.login_button)
        self.login_layout.setLayout(4, QtWidgets.QFormLayout.SpanningRole,
                                    self.login_button_layout)
        self.stacked_widget.addWidget(self.login_page)
        self.search_page = QtWidgets.QWidget()
        self.search_page.setObjectName('search_page')
        self.search_layout = QtWidgets.QVBoxLayout(self.search_page)
        self.search_layout.setSpacing(8)
        self.search_layout.setContentsMargins(8, 8, 8, 8)
        self.search_layout.setObjectName('search_layout')
        self.search_input_layout = QtWidgets.QHBoxLayout()
        self.search_input_layout.setSpacing(8)
        self.search_input_layout.setObjectName('search_input_layout')
        self.search_label = QtWidgets.QLabel(self.search_page)
        self.search_label.setObjectName('search_label')
        self.search_input_layout.addWidget(self.search_label)
        self.search_combobox = HistoryComboBox(self.search_page)
        self.search_combobox.setObjectName('search_combobox')
        self.search_input_layout.addWidget(self.search_combobox)
        self.search_button = QtWidgets.QPushButton(self.search_page)
        self.search_button.setIcon(build_icon(':/general/general_find.png'))
        self.search_button.setObjectName('search_button')
        self.search_input_layout.addWidget(self.search_button)
        self.search_layout.addLayout(self.search_input_layout)
        self.search_progress_layout = QtWidgets.QHBoxLayout()
        self.search_progress_layout.setSpacing(8)
        self.search_progress_layout.setObjectName('search_progress_layout')
        self.search_progress_bar = QtWidgets.QProgressBar(self.search_page)
        self.search_progress_bar.setMinimum(0)
        self.search_progress_bar.setMaximum(3)
        self.search_progress_bar.setValue(0)
        self.search_progress_layout.addWidget(self.search_progress_bar)
        self.stop_button = QtWidgets.QPushButton(self.search_page)
        self.stop_button.setIcon(build_icon(':/songs/song_search_stop.png'))
        self.stop_button.setObjectName('stop_button')
        self.search_progress_layout.addWidget(self.stop_button)
        self.search_layout.addLayout(self.search_progress_layout)
        self.search_results_widget = QtWidgets.QListWidget(self.search_page)
        self.search_results_widget.setProperty("showDropIndicator", False)
        self.search_results_widget.setAlternatingRowColors(True)
        self.search_results_widget.setSelectionMode(
            QtWidgets.QAbstractItemView.ExtendedSelection)
        self.search_results_widget.setSelectionBehavior(
            QtWidgets.QAbstractItemView.SelectRows)
        self.search_results_widget.setObjectName('search_results_widget')
        self.search_layout.addWidget(self.search_results_widget)
        self.result_count_label = QtWidgets.QLabel(self.search_page)
        self.result_count_label.setAlignment(QtCore.Qt.AlignRight
                                             | QtCore.Qt.AlignCenter)
        self.result_count_label.setObjectName('result_count_label')
        self.search_layout.addWidget(self.result_count_label)
        self.view_layout = QtWidgets.QHBoxLayout()
        self.view_layout.setSpacing(8)
        self.view_layout.setObjectName('view_layout')
        self.logout_button = QtWidgets.QPushButton(self.search_page)
        self.logout_button.setIcon(build_icon(':/songs/song_author_edit.png'))
        self.view_layout.addWidget(self.logout_button)
        self.view_spacer = QtWidgets.QSpacerItem(
            40, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Minimum)
        self.view_layout.addItem(self.view_spacer)
        self.view_button = QtWidgets.QPushButton(self.search_page)
        self.view_button.setIcon(build_icon(':/songs/song_search_all.png'))
        self.view_button.setObjectName('view_button')
        self.view_layout.addWidget(self.view_button)
        self.search_layout.addLayout(self.view_layout)
        self.stacked_widget.addWidget(self.search_page)
        self.song_page = QtWidgets.QWidget()
        self.song_page.setObjectName('song_page')
        self.song_layout = QtWidgets.QGridLayout(self.song_page)
        self.song_layout.setContentsMargins(8, 8, 8, 8)
        self.song_layout.setSpacing(8)
        self.song_layout.setObjectName('song_layout')
        self.title_label = QtWidgets.QLabel(self.song_page)
        self.title_label.setObjectName('title_label')
        self.song_layout.addWidget(self.title_label, 0, 0, 1, 1)
        self.title_edit = QtWidgets.QLineEdit(self.song_page)
        self.title_edit.setReadOnly(True)
        self.title_edit.setObjectName('title_edit')
        self.song_layout.addWidget(self.title_edit, 0, 1, 1, 1)
        self.authors_label = QtWidgets.QLabel(self.song_page)
        self.authors_label.setObjectName('authors_label')
        self.song_layout.addWidget(self.authors_label, 0, 2, 1, 1)
        self.author_list_widget = QtWidgets.QListWidget(self.song_page)
        self.author_list_widget.setObjectName('author_list_widget')
        self.song_layout.addWidget(self.author_list_widget, 0, 3, 3, 1)
        self.copyright_label = QtWidgets.QLabel(self.song_page)
        self.copyright_label.setObjectName('copyright_label')
        self.song_layout.addWidget(self.copyright_label, 1, 0, 1, 1)
        self.copyright_edit = QtWidgets.QLineEdit(self.song_page)
        self.copyright_edit.setReadOnly(True)
        self.copyright_edit.setObjectName('copyright_edit')
        self.song_layout.addWidget(self.copyright_edit, 1, 1, 1, 1)
        self.ccli_label = QtWidgets.QLabel(self.song_page)
        self.ccli_label.setObjectName('ccli_label')
        self.song_layout.addWidget(self.ccli_label, 2, 0, 1, 1)
        self.ccli_edit = QtWidgets.QLineEdit(self.song_page)
        self.ccli_edit.setReadOnly(True)
        self.ccli_edit.setObjectName('ccli_edit')
        self.song_layout.addWidget(self.ccli_edit, 2, 1, 1, 1)
        self.lyrics_label = QtWidgets.QLabel(self.song_page)
        self.lyrics_label.setAlignment(QtCore.Qt.AlignLeading
                                       | QtCore.Qt.AlignLeft
                                       | QtCore.Qt.AlignTop)
        self.lyrics_label.setObjectName('lyrics_label')
        self.song_layout.addWidget(self.lyrics_label, 3, 0, 1, 1)
        self.lyrics_table_widget = SingleColumnTableWidget(self.song_page)
        self.lyrics_table_widget.setObjectName('lyrics_table_widget')
        self.lyrics_table_widget.setRowCount(0)
        self.song_layout.addWidget(self.lyrics_table_widget, 3, 1, 1, 3)
        self.song_progress_bar = QtWidgets.QProgressBar(self.song_page)
        self.song_progress_bar.setMinimum(0)
        self.song_progress_bar.setMaximum(3)
        self.song_progress_bar.setValue(0)
        self.song_progress_bar.setVisible(False)
        self.song_layout.addWidget(self.song_progress_bar, 4, 0, 1, 4)
        self.import_layout = QtWidgets.QHBoxLayout()
        self.import_layout.setObjectName('import_layout')
        self.back_button = QtWidgets.QPushButton(self.song_page)
        self.back_button.setIcon(build_icon(':/general/general_back.png'))
        self.back_button.setObjectName('back_button')
        self.import_layout.addWidget(self.back_button)
        self.import_spacer = QtWidgets.QSpacerItem(
            40, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Minimum)
        self.import_layout.addItem(self.import_spacer)
        self.import_button = QtWidgets.QPushButton(self.song_page)
        self.import_button.setIcon(build_icon(':/general/general_import.png'))
        self.import_button.setObjectName('import_button')
        self.import_layout.addWidget(self.import_button)
        self.song_layout.addLayout(self.import_layout, 5, 0, 1, 5)
        self.stacked_widget.addWidget(self.song_page)
        self.songselect_layout.addWidget(self.stacked_widget)
        self.username_label.setBuddy(self.username_edit)
        self.password_label.setBuddy(self.password_edit)
        self.title_label.setBuddy(self.title_edit)
        self.authors_label.setBuddy(self.author_list_widget)
        self.copyright_label.setBuddy(self.copyright_edit)
        self.ccli_label.setBuddy(self.ccli_edit)
        self.lyrics_label.setBuddy(self.lyrics_table_widget)

        self.retranslate_ui(songselect_dialog)
        self.stacked_widget.setCurrentIndex(0)
Example #10
0
class Ui_SongSelectDialog(object):
    """
    The actual Qt components that make up the dialog.
    """
    def setup_ui(self, songselect_dialog):
        songselect_dialog.setObjectName('songselect_dialog')
        songselect_dialog.resize(616, 378)
        self.songselect_layout = QtWidgets.QVBoxLayout(songselect_dialog)
        self.songselect_layout.setSpacing(0)
        self.songselect_layout.setContentsMargins(0, 0, 0, 0)
        self.songselect_layout.setObjectName('songselect_layout')
        self.stacked_widget = QtWidgets.QStackedWidget(songselect_dialog)
        self.stacked_widget.setObjectName('stacked_widget')
        self.login_page = QtWidgets.QWidget()
        self.login_page.setObjectName('login_page')
        self.login_layout = QtWidgets.QFormLayout(self.login_page)
        self.login_layout.setContentsMargins(120, 100, 120, 100)
        self.login_layout.setSpacing(8)
        self.login_layout.setObjectName('login_layout')
        self.notice_layout = QtWidgets.QHBoxLayout()
        self.notice_layout.setObjectName('notice_layout')
        self.notice_label = QtWidgets.QLabel(self.login_page)
        self.notice_label.setWordWrap(True)
        self.notice_label.setObjectName('notice_label')
        self.notice_layout.addWidget(self.notice_label)
        self.login_layout.setLayout(0, QtWidgets.QFormLayout.SpanningRole,
                                    self.notice_layout)
        self.username_label = QtWidgets.QLabel(self.login_page)
        self.username_label.setObjectName('usernameLabel')
        self.login_layout.setWidget(1, QtWidgets.QFormLayout.LabelRole,
                                    self.username_label)
        self.username_edit = QtWidgets.QLineEdit(self.login_page)
        self.username_edit.setObjectName('usernameEdit')
        self.login_layout.setWidget(1, QtWidgets.QFormLayout.FieldRole,
                                    self.username_edit)
        self.password_label = QtWidgets.QLabel(self.login_page)
        self.password_label.setObjectName('passwordLabel')
        self.login_layout.setWidget(2, QtWidgets.QFormLayout.LabelRole,
                                    self.password_label)
        self.password_edit = QtWidgets.QLineEdit(self.login_page)
        self.password_edit.setEchoMode(QtWidgets.QLineEdit.Password)
        self.password_edit.setObjectName('passwordEdit')
        self.login_layout.setWidget(2, QtWidgets.QFormLayout.FieldRole,
                                    self.password_edit)
        self.save_password_checkbox = QtWidgets.QCheckBox(self.login_page)
        self.save_password_checkbox.setTristate(False)
        self.save_password_checkbox.setObjectName('save_password_checkbox')
        self.login_layout.setWidget(3, QtWidgets.QFormLayout.FieldRole,
                                    self.save_password_checkbox)
        self.login_button_layout = QtWidgets.QHBoxLayout()
        self.login_button_layout.setSpacing(8)
        self.login_button_layout.setContentsMargins(0, -1, -1, -1)
        self.login_button_layout.setObjectName('login_button_layout')
        self.login_spacer = QtWidgets.QWidget(self.login_page)
        self.login_spacer.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                        QtWidgets.QSizePolicy.Minimum)
        self.login_spacer.setObjectName('login_spacer')
        self.login_button_layout.addWidget(self.login_spacer)
        self.login_progress_bar = QtWidgets.QProgressBar(self.login_page)
        self.login_progress_bar.setMinimum(0)
        self.login_progress_bar.setMaximum(3)
        self.login_progress_bar.setValue(0)
        self.login_progress_bar.setMinimumWidth(200)
        self.login_progress_bar.setVisible(False)
        self.login_button_layout.addWidget(self.login_progress_bar)
        self.login_button = QtWidgets.QPushButton(self.login_page)
        self.login_button.setIcon(build_icon(':/songs/song_author_edit.png'))
        self.login_button.setObjectName('login_button')
        self.login_button_layout.addWidget(self.login_button)
        self.login_layout.setLayout(4, QtWidgets.QFormLayout.SpanningRole,
                                    self.login_button_layout)
        self.stacked_widget.addWidget(self.login_page)
        self.search_page = QtWidgets.QWidget()
        self.search_page.setObjectName('search_page')
        self.search_layout = QtWidgets.QVBoxLayout(self.search_page)
        self.search_layout.setSpacing(8)
        self.search_layout.setContentsMargins(8, 8, 8, 8)
        self.search_layout.setObjectName('search_layout')
        self.search_input_layout = QtWidgets.QHBoxLayout()
        self.search_input_layout.setSpacing(8)
        self.search_input_layout.setObjectName('search_input_layout')
        self.search_label = QtWidgets.QLabel(self.search_page)
        self.search_label.setObjectName('search_label')
        self.search_input_layout.addWidget(self.search_label)
        self.search_combobox = HistoryComboBox(self.search_page)
        self.search_combobox.setObjectName('search_combobox')
        self.search_input_layout.addWidget(self.search_combobox)
        self.search_button = QtWidgets.QPushButton(self.search_page)
        self.search_button.setIcon(build_icon(':/general/general_find.png'))
        self.search_button.setObjectName('search_button')
        self.search_input_layout.addWidget(self.search_button)
        self.search_layout.addLayout(self.search_input_layout)
        self.search_progress_layout = QtWidgets.QHBoxLayout()
        self.search_progress_layout.setSpacing(8)
        self.search_progress_layout.setObjectName('search_progress_layout')
        self.search_progress_bar = QtWidgets.QProgressBar(self.search_page)
        self.search_progress_bar.setMinimum(0)
        self.search_progress_bar.setMaximum(3)
        self.search_progress_bar.setValue(0)
        self.search_progress_layout.addWidget(self.search_progress_bar)
        self.stop_button = QtWidgets.QPushButton(self.search_page)
        self.stop_button.setIcon(build_icon(':/songs/song_search_stop.png'))
        self.stop_button.setObjectName('stop_button')
        self.search_progress_layout.addWidget(self.stop_button)
        self.search_layout.addLayout(self.search_progress_layout)
        self.search_results_widget = QtWidgets.QListWidget(self.search_page)
        self.search_results_widget.setProperty("showDropIndicator", False)
        self.search_results_widget.setAlternatingRowColors(True)
        self.search_results_widget.setSelectionMode(
            QtWidgets.QAbstractItemView.ExtendedSelection)
        self.search_results_widget.setSelectionBehavior(
            QtWidgets.QAbstractItemView.SelectRows)
        self.search_results_widget.setObjectName('search_results_widget')
        self.search_layout.addWidget(self.search_results_widget)
        self.result_count_label = QtWidgets.QLabel(self.search_page)
        self.result_count_label.setAlignment(QtCore.Qt.AlignRight
                                             | QtCore.Qt.AlignCenter)
        self.result_count_label.setObjectName('result_count_label')
        self.search_layout.addWidget(self.result_count_label)
        self.view_layout = QtWidgets.QHBoxLayout()
        self.view_layout.setSpacing(8)
        self.view_layout.setObjectName('view_layout')
        self.logout_button = QtWidgets.QPushButton(self.search_page)
        self.logout_button.setIcon(build_icon(':/songs/song_author_edit.png'))
        self.view_layout.addWidget(self.logout_button)
        self.view_spacer = QtWidgets.QSpacerItem(
            40, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Minimum)
        self.view_layout.addItem(self.view_spacer)
        self.view_button = QtWidgets.QPushButton(self.search_page)
        self.view_button.setIcon(build_icon(':/songs/song_search_all.png'))
        self.view_button.setObjectName('view_button')
        self.view_layout.addWidget(self.view_button)
        self.search_layout.addLayout(self.view_layout)
        self.stacked_widget.addWidget(self.search_page)
        self.song_page = QtWidgets.QWidget()
        self.song_page.setObjectName('song_page')
        self.song_layout = QtWidgets.QGridLayout(self.song_page)
        self.song_layout.setContentsMargins(8, 8, 8, 8)
        self.song_layout.setSpacing(8)
        self.song_layout.setObjectName('song_layout')
        self.title_label = QtWidgets.QLabel(self.song_page)
        self.title_label.setObjectName('title_label')
        self.song_layout.addWidget(self.title_label, 0, 0, 1, 1)
        self.title_edit = QtWidgets.QLineEdit(self.song_page)
        self.title_edit.setReadOnly(True)
        self.title_edit.setObjectName('title_edit')
        self.song_layout.addWidget(self.title_edit, 0, 1, 1, 1)
        self.authors_label = QtWidgets.QLabel(self.song_page)
        self.authors_label.setObjectName('authors_label')
        self.song_layout.addWidget(self.authors_label, 0, 2, 1, 1)
        self.author_list_widget = QtWidgets.QListWidget(self.song_page)
        self.author_list_widget.setObjectName('author_list_widget')
        self.song_layout.addWidget(self.author_list_widget, 0, 3, 3, 1)
        self.copyright_label = QtWidgets.QLabel(self.song_page)
        self.copyright_label.setObjectName('copyright_label')
        self.song_layout.addWidget(self.copyright_label, 1, 0, 1, 1)
        self.copyright_edit = QtWidgets.QLineEdit(self.song_page)
        self.copyright_edit.setReadOnly(True)
        self.copyright_edit.setObjectName('copyright_edit')
        self.song_layout.addWidget(self.copyright_edit, 1, 1, 1, 1)
        self.ccli_label = QtWidgets.QLabel(self.song_page)
        self.ccli_label.setObjectName('ccli_label')
        self.song_layout.addWidget(self.ccli_label, 2, 0, 1, 1)
        self.ccli_edit = QtWidgets.QLineEdit(self.song_page)
        self.ccli_edit.setReadOnly(True)
        self.ccli_edit.setObjectName('ccli_edit')
        self.song_layout.addWidget(self.ccli_edit, 2, 1, 1, 1)
        self.lyrics_label = QtWidgets.QLabel(self.song_page)
        self.lyrics_label.setAlignment(QtCore.Qt.AlignLeading
                                       | QtCore.Qt.AlignLeft
                                       | QtCore.Qt.AlignTop)
        self.lyrics_label.setObjectName('lyrics_label')
        self.song_layout.addWidget(self.lyrics_label, 3, 0, 1, 1)
        self.lyrics_table_widget = SingleColumnTableWidget(self.song_page)
        self.lyrics_table_widget.setObjectName('lyrics_table_widget')
        self.lyrics_table_widget.setRowCount(0)
        self.song_layout.addWidget(self.lyrics_table_widget, 3, 1, 1, 3)
        self.song_progress_bar = QtWidgets.QProgressBar(self.song_page)
        self.song_progress_bar.setMinimum(0)
        self.song_progress_bar.setMaximum(3)
        self.song_progress_bar.setValue(0)
        self.song_progress_bar.setVisible(False)
        self.song_layout.addWidget(self.song_progress_bar, 4, 0, 1, 4)
        self.import_layout = QtWidgets.QHBoxLayout()
        self.import_layout.setObjectName('import_layout')
        self.back_button = QtWidgets.QPushButton(self.song_page)
        self.back_button.setIcon(build_icon(':/general/general_back.png'))
        self.back_button.setObjectName('back_button')
        self.import_layout.addWidget(self.back_button)
        self.import_spacer = QtWidgets.QSpacerItem(
            40, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Minimum)
        self.import_layout.addItem(self.import_spacer)
        self.import_button = QtWidgets.QPushButton(self.song_page)
        self.import_button.setIcon(build_icon(':/general/general_import.png'))
        self.import_button.setObjectName('import_button')
        self.import_layout.addWidget(self.import_button)
        self.song_layout.addLayout(self.import_layout, 5, 0, 1, 5)
        self.stacked_widget.addWidget(self.song_page)
        self.songselect_layout.addWidget(self.stacked_widget)
        self.username_label.setBuddy(self.username_edit)
        self.password_label.setBuddy(self.password_edit)
        self.title_label.setBuddy(self.title_edit)
        self.authors_label.setBuddy(self.author_list_widget)
        self.copyright_label.setBuddy(self.copyright_edit)
        self.ccli_label.setBuddy(self.ccli_edit)
        self.lyrics_label.setBuddy(self.lyrics_table_widget)

        self.retranslate_ui(songselect_dialog)
        self.stacked_widget.setCurrentIndex(0)

    def retranslate_ui(self, songselect_dialog):
        """
        Translate the GUI.
        """
        songselect_dialog.setWindowTitle(
            translate('SongsPlugin.SongSelectForm',
                      'CCLI SongSelect Importer'))
        self.notice_label.setText(
            translate(
                'SongsPlugin.SongSelectForm', '<strong>Note:</strong> '
                'An Internet connection is required in order to import songs from CCLI SongSelect.'
            ))
        self.username_label.setText(
            translate('SongsPlugin.SongSelectForm', 'Username:'******'SongsPlugin.SongSelectForm', 'Password:'******'SongsPlugin.SongSelectForm',
                      'Save username and password'))
        self.login_button.setText(
            translate('SongsPlugin.SongSelectForm', 'Login'))
        self.search_label.setText(
            translate('SongsPlugin.SongSelectForm', 'Search Text:'))
        self.search_button.setText(
            translate('SongsPlugin.SongSelectForm', 'Search'))
        self.stop_button.setText(
            translate('SongsPlugin.SongSelectForm', 'Stop'))
        self.result_count_label.setText(
            translate('SongsPlugin.SongSelectForm',
                      'Found {count:d} song(s)').format(count=0))
        self.logout_button.setText(
            translate('SongsPlugin.SongSelectForm', 'Logout'))
        self.view_button.setText(
            translate('SongsPlugin.SongSelectForm', 'View'))
        self.title_label.setText(
            translate('SongsPlugin.SongSelectForm', 'Title:'))
        self.authors_label.setText(
            translate('SongsPlugin.SongSelectForm', 'Author(s):'))
        self.copyright_label.setText(
            translate('SongsPlugin.SongSelectForm', 'Copyright:'))
        self.ccli_label.setText(
            translate('SongsPlugin.SongSelectForm', 'CCLI Number:'))
        self.lyrics_label.setText(
            translate('SongsPlugin.SongSelectForm', 'Lyrics:'))
        self.back_button.setText(
            translate('SongsPlugin.SongSelectForm', 'Back'))
        self.import_button.setText(
            translate('SongsPlugin.SongSelectForm', 'Import'))