From 0c8156b4c44ef9b51f7daae02cf2c9982cd4b4be Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Tue, 11 Sep 2018 22:43:27 -0700 Subject: [PATCH] Loading and saving of screens is working; Refractored retranslateUi => retranslate_ui --- openlp/core/api/tab.py | 6 +- openlp/core/display/canvas.py | 4 +- openlp/core/display/screens.py | 33 +++- openlp/core/lib/mediamanageritem.py | 8 +- openlp/core/lib/settingstab.py | 8 +- openlp/core/projectors/editform.py | 8 +- openlp/core/projectors/tab.py | 6 +- openlp/core/ui/advancedtab.py | 6 +- openlp/core/ui/exceptiondialog.py | 6 +- openlp/core/ui/exceptionform.py | 2 +- openlp/core/ui/filerenamedialog.py | 6 +- openlp/core/ui/filerenameform.py | 2 +- openlp/core/ui/firsttimelanguagedialog.py | 6 +- openlp/core/ui/firsttimelanguageform.py | 2 +- openlp/core/ui/formattingtagdialog.py | 6 +- openlp/core/ui/formattingtagform.py | 2 +- openlp/core/ui/generaltab.py | 163 +----------------- openlp/core/ui/mainwindow.py | 10 +- openlp/core/ui/media/playertab.py | 6 +- openlp/core/ui/plugindialog.py | 6 +- openlp/core/ui/pluginform.py | 2 +- openlp/core/ui/printservicedialog.py | 6 +- openlp/core/ui/printserviceform.py | 2 +- openlp/core/ui/serviceitemeditdialog.py | 6 +- openlp/core/ui/serviceitemeditform.py | 2 +- openlp/core/ui/servicenoteform.py | 8 +- openlp/core/ui/settingsdialog.py | 6 +- openlp/core/ui/settingsform.py | 29 ++-- openlp/core/ui/shortcutlistdialog.py | 6 +- openlp/core/ui/shortcutlistform.py | 2 +- openlp/core/ui/splashscreen.py | 4 +- openlp/core/ui/starttimedialog.py | 6 +- openlp/core/ui/starttimeform.py | 2 +- openlp/core/ui/themeform.py | 2 +- openlp/core/ui/themelayoutdialog.py | 6 +- openlp/core/ui/themelayoutform.py | 2 +- openlp/core/ui/themestab.py | 6 +- openlp/core/ui/themewizard.py | 6 +- openlp/core/widgets/wizard.py | 6 +- openlp/plugins/alerts/forms/__init__.py | 2 +- openlp/plugins/alerts/forms/alertdialog.py | 6 +- openlp/plugins/alerts/forms/alertform.py | 2 +- openlp/plugins/alerts/lib/alertstab.py | 6 +- .../plugins/bibles/forms/bibleimportform.py | 6 +- openlp/plugins/bibles/forms/booknamedialog.py | 6 +- openlp/plugins/bibles/forms/booknameform.py | 2 +- .../plugins/bibles/forms/editbibledialog.py | 6 +- openlp/plugins/bibles/forms/editbibleform.py | 2 +- openlp/plugins/bibles/forms/languagedialog.py | 6 +- openlp/plugins/bibles/forms/languageform.py | 2 +- openlp/plugins/bibles/lib/biblestab.py | 6 +- openlp/plugins/bibles/lib/mediaitem.py | 8 +- .../plugins/custom/forms/editcustomdialog.py | 6 +- openlp/plugins/custom/forms/editcustomform.py | 2 +- .../custom/forms/editcustomslidedialog.py | 6 +- .../custom/forms/editcustomslideform.py | 2 +- openlp/plugins/custom/lib/customtab.py | 6 +- openlp/plugins/custom/lib/mediaitem.py | 2 +- openlp/plugins/images/forms/__init__.py | 2 +- openlp/plugins/images/forms/addgroupdialog.py | 6 +- openlp/plugins/images/forms/addgroupform.py | 2 +- .../plugins/images/forms/choosegroupdialog.py | 6 +- .../plugins/images/forms/choosegroupform.py | 2 +- openlp/plugins/images/lib/imagetab.py | 6 +- openlp/plugins/images/lib/mediaitem.py | 2 +- .../media/forms/mediaclipselectordialog.py | 6 +- .../media/forms/mediaclipselectorform.py | 2 +- openlp/plugins/media/lib/mediaitem.py | 2 +- openlp/plugins/media/lib/mediatab.py | 6 +- openlp/plugins/presentations/lib/mediaitem.py | 2 +- .../presentations/lib/presentationtab.py | 6 +- openlp/plugins/songs/forms/__init__.py | 2 +- openlp/plugins/songs/forms/authorsdialog.py | 6 +- openlp/plugins/songs/forms/authorsform.py | 2 +- .../songs/forms/duplicatesongremovalform.py | 2 +- openlp/plugins/songs/forms/editsongdialog.py | 6 +- openlp/plugins/songs/forms/editsongform.py | 2 +- openlp/plugins/songs/forms/editversedialog.py | 6 +- openlp/plugins/songs/forms/editverseform.py | 2 +- .../plugins/songs/forms/mediafilesdialog.py | 6 +- openlp/plugins/songs/forms/mediafilesform.py | 2 +- openlp/plugins/songs/forms/songbookdialog.py | 6 +- openlp/plugins/songs/forms/songbookform.py | 2 +- openlp/plugins/songs/forms/songexportform.py | 6 +- openlp/plugins/songs/forms/songimportform.py | 6 +- .../songs/forms/songmaintenancedialog.py | 6 +- .../songs/forms/songmaintenanceform.py | 2 +- .../plugins/songs/forms/songreviewwidget.py | 8 +- openlp/plugins/songs/forms/topicsdialog.py | 6 +- openlp/plugins/songs/forms/topicsform.py | 2 +- openlp/plugins/songs/lib/mediaitem.py | 2 +- openlp/plugins/songs/lib/songstab.py | 6 +- .../songusage/forms/songusagedeletedialog.py | 6 +- .../songusage/forms/songusagedeleteform.py | 2 +- .../songusage/forms/songusagedetaildialog.py | 6 +- .../songusage/forms/songusagedetailform.py | 2 +- 96 files changed, 259 insertions(+), 384 deletions(-) diff --git a/openlp/core/api/tab.py b/openlp/core/api/tab.py index 61e922c32..83a8d76aa 100644 --- a/openlp/core/api/tab.py +++ b/openlp/core/api/tab.py @@ -43,9 +43,9 @@ class ApiTab(SettingsTab): advanced_translated = translate('OpenLP.AdvancedTab', 'Advanced') super(ApiTab, self).__init__(parent, 'api', advanced_translated) - def setupUi(self): + def setup_ui(self): self.setObjectName('ApiTab') - super(ApiTab, self).setupUi() + super(ApiTab, self).setup_ui() self.server_settings_group_box = QtWidgets.QGroupBox(self.left_column) self.server_settings_group_box.setObjectName('server_settings_group_box') self.server_settings_layout = QtWidgets.QFormLayout(self.server_settings_group_box) @@ -154,7 +154,7 @@ class ApiTab(SettingsTab): self.thumbnails_check_box.stateChanged.connect(self.on_thumbnails_check_box_changed) self.address_edit.textChanged.connect(self.set_urls) - def retranslateUi(self): + def retranslate_ui(self): self.tab_title_visible = translate('RemotePlugin.RemoteTab', 'Remote Interface') self.server_settings_group_box.setTitle(translate('RemotePlugin.RemoteTab', 'Server Settings')) self.address_label.setText(translate('RemotePlugin.RemoteTab', 'Serve on IP address:')) diff --git a/openlp/core/display/canvas.py b/openlp/core/display/canvas.py index 3ad63daec..09070d816 100644 --- a/openlp/core/display/canvas.py +++ b/openlp/core/display/canvas.py @@ -226,7 +226,7 @@ class MainCanvas(OpenLPMixin, Canvas, RegistryProperties): self.rebuild_css = False self.hide_mode = None self.override = {} - self.retranslateUi() + self.retranslate_ui() self.media_object = None if self.is_live: self.audio_player = AudioPlayer(self) @@ -325,7 +325,7 @@ class MainCanvas(OpenLPMixin, Canvas, RegistryProperties): for plugin in self.plugin_manager.plugins: plugin.refresh_css(self.frame) - def retranslateUi(self): + def retranslate_ui(self): """ Setup the interface translation strings. """ diff --git a/openlp/core/display/screens.py b/openlp/core/display/screens.py index 3e9c8a828..eb60931d9 100644 --- a/openlp/core/display/screens.py +++ b/openlp/core/display/screens.py @@ -24,8 +24,9 @@ The :mod:`screen` module provides management functionality for a machines' displays. """ import logging +from functools import cmp_to_key -from PyQt5 import QtCore +from PyQt5 import QtCore, QtWidgets from openlp.core.common.i18n import translate from openlp.core.common.registry import Registry @@ -49,7 +50,7 @@ class Screen(object): """ self.number = number self.geometry = geometry - self.display_geometry = geometry + self.custom_geometry = None self.is_primary = is_primary self.is_display = is_display @@ -64,6 +65,13 @@ class Screen(object): name = '{name} ({primary})'.format(name=name, primary=translate('OpenLP.ScreenList', 'primary')) return name + @property + def display_geometry(self): + """ + Returns the geometry to use when displaying. This property decides between the native and custom geometries + """ + return self.custom_geometry or self.geometry + @classmethod def from_dict(cls, screen_dict): """ @@ -280,10 +288,27 @@ class ScreenList(object): """ Update the list of screens """ + def _screen_compare(this, other): + """ + Compare screens. Can't use a key here because of the nested property and method to be called + """ + if this.geometry().x() < other.geometry().x(): + return -1 + elif this.geometry().x() > other.geometry().x(): + return 1 + else: + if this.geometry().y() < other.geometry().y(): + return -1 + elif this.geometry().y() > other.geometry().y(): + return 1 + else: + return 0 self.screens = [] - for number in range(self.desktop.screenCount()): + os_screens = QtWidgets.QApplication.screens() + os_screens.sort(key=cmp_to_key(_screen_compare)) + for number, screen in enumerate(os_screens): self.screens.append( - Screen(number, self.desktop.screenGeometry(number), self.desktop.primaryScreen() == number)) + Screen(number, screen.geometry(), self.desktop.primaryScreen() == number)) def on_screen_resolution_changed(self, number): """ diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 009734c0a..2136510db 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -108,8 +108,8 @@ class MediaManagerItem(QtWidgets.QWidget, RegistryProperties): self.page_layout.setSpacing(0) self.page_layout.setContentsMargins(0, 0, 0, 0) self.required_icons() - self.setupUi() - self.retranslateUi() + self.setup_ui() + self.retranslate_ui() self.auto_select_id = -1 def setup_item(self): @@ -130,7 +130,7 @@ class MediaManagerItem(QtWidgets.QWidget, RegistryProperties): self.has_delete_icon = True self.add_to_service_item = False - def retranslateUi(self): + def retranslate_ui(self): """ This method is called automatically to provide OpenLP with the opportunity to translate the ``MediaManagerItem`` to another language. @@ -145,7 +145,7 @@ class MediaManagerItem(QtWidgets.QWidget, RegistryProperties): self.toolbar = OpenLPToolbar(self) self.page_layout.addWidget(self.toolbar) - def setupUi(self): + def setup_ui(self): """ This method sets up the interface on the button. Plugin developers use this to add and create toolbars, and the rest of the interface of the media manager item. diff --git a/openlp/core/lib/settingstab.py b/openlp/core/lib/settingstab.py index 324628cd9..8a2b93ba0 100644 --- a/openlp/core/lib/settingstab.py +++ b/openlp/core/lib/settingstab.py @@ -54,12 +54,12 @@ class SettingsTab(QtWidgets.QWidget, RegistryProperties): """ Run some initial setup. This method is separate from __init__ in order to mock it out in tests. """ - self.setupUi() - self.retranslateUi() + self.setup_ui() + self.retranslate_ui() self.initialise() self.load() - def setupUi(self): + def setup_ui(self): """ Setup the tab's interface. """ @@ -90,7 +90,7 @@ class SettingsTab(QtWidgets.QWidget, RegistryProperties): left_width = max(left_width, self.left_column.minimumSizeHint().width()) self.left_column.setFixedWidth(left_width) - def retranslateUi(self): + def retranslate_ui(self): """ Setup the interface translation strings. """ diff --git a/openlp/core/projectors/editform.py b/openlp/core/projectors/editform.py index ef88605ef..2c0a9efc7 100644 --- a/openlp/core/projectors/editform.py +++ b/openlp/core/projectors/editform.py @@ -42,7 +42,7 @@ class Ui_ProjectorEditForm(object): The :class:`~openlp.core.lib.ui.projector.editform.Ui_ProjectorEditForm` class defines the user interface for the ProjectorEditForm dialog. """ - def setupUi(self, edit_projector_dialog): + def setup_ui(self, edit_projector_dialog): """ Create the interface layout. """ @@ -108,7 +108,7 @@ class Ui_ProjectorEditForm(object): QtWidgets.QDialogButtonBox.Cancel) self.dialog_layout.addWidget(self.button_box, 8, 0, 1, 2) - def retranslateUi(self, edit_projector_dialog): + def retranslate_ui(self, edit_projector_dialog): if self.new_projector: title = translate('OpenLP.ProjectorEditForm', 'Add New Projector') self.projector.port = PJLINK_PORT @@ -150,7 +150,7 @@ class ProjectorEditForm(QtWidgets.QDialog, Ui_ProjectorEditForm): super(ProjectorEditForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) self.projectordb = projectordb - self.setupUi(self) + self.setup_ui(self) self.button_box.accepted.connect(self.accept_me) self.button_box.helpRequested.connect(self.help_me) self.button_box.rejected.connect(self.cancel_me) @@ -169,7 +169,7 @@ class ProjectorEditForm(QtWidgets.QDialog, Ui_ProjectorEditForm): self.ip_text_label.setVisible(True) # Since it's already defined, IP address is unchangeable, so focus on port number self.port_text.setFocus() - self.retranslateUi(self) + self.retranslate_ui(self) reply = QtWidgets.QDialog.exec(self) return reply diff --git a/openlp/core/projectors/tab.py b/openlp/core/projectors/tab.py index 2407bad66..b9fb38d83 100644 --- a/openlp/core/projectors/tab.py +++ b/openlp/core/projectors/tab.py @@ -50,12 +50,12 @@ class ProjectorTab(SettingsTab): projector_translated = translate('OpenLP.ProjectorTab', 'Projector') super(ProjectorTab, self).__init__(parent, 'Projector', projector_translated) - def setupUi(self): + def setup_ui(self): """ Setup the UI """ self.setObjectName('ProjectorTab') - super(ProjectorTab, self).setupUi() + super(ProjectorTab, self).setup_ui() self.connect_box = QtWidgets.QGroupBox(self.left_column) self.connect_box.setObjectName('connect_box') self.connect_box_layout = QtWidgets.QFormLayout(self.connect_box) @@ -95,7 +95,7 @@ class ProjectorTab(SettingsTab): self.connect_on_linkup.setObjectName('connect_on_linkup') self.connect_box_layout.addRow(self.connect_on_linkup) - def retranslateUi(self): + def retranslate_ui(self): """ Translate the UI on the fly """ diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index 25e51f485..90c56d9da 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -59,12 +59,12 @@ class AdvancedTab(SettingsTab): advanced_translated = translate('OpenLP.AdvancedTab', 'Advanced') super(AdvancedTab, self).__init__(parent, 'Advanced', advanced_translated) - def setupUi(self): + def setup_ui(self): """ Configure the UI elements for the tab. """ self.setObjectName('AdvancedTab') - super(AdvancedTab, self).setupUi() + super(AdvancedTab, self).setup_ui() self.ui_group_box = QtWidgets.QGroupBox(self.left_column) self.ui_group_box.setObjectName('ui_group_box') self.ui_layout = QtWidgets.QFormLayout(self.ui_group_box) @@ -241,7 +241,7 @@ class AdvancedTab(SettingsTab): self.next_item_radio_button.clicked.connect(self.on_next_item_button_clicked) self.search_as_type_check_box.stateChanged.connect(self.on_search_as_type_check_box_changed) - def retranslateUi(self): + def retranslate_ui(self): """ Setup the interface translation strings. """ diff --git a/openlp/core/ui/exceptiondialog.py b/openlp/core/ui/exceptiondialog.py index e24dc5b90..5772aace6 100644 --- a/openlp/core/ui/exceptiondialog.py +++ b/openlp/core/ui/exceptiondialog.py @@ -34,7 +34,7 @@ class Ui_ExceptionDialog(object): """ The GUI widgets of the exception dialog. """ - def setupUi(self, exception_dialog): + def setup_ui(self, exception_dialog): """ Set up the UI. """ @@ -84,10 +84,10 @@ class Ui_ExceptionDialog(object): [self.send_report_button, self.save_report_button, self.attach_tile_button]) self.exception_layout.addWidget(self.button_box) - self.retranslateUi(exception_dialog) + self.retranslate_ui(exception_dialog) self.description_text_edit.textChanged.connect(self.on_description_updated) - def retranslateUi(self, exception_dialog): + def retranslate_ui(self, exception_dialog): """ Translate the widgets on the fly. """ diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 76a472b05..2a8a1beb8 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -50,7 +50,7 @@ class ExceptionForm(QtWidgets.QDialog, Ui_ExceptionDialog, RegistryProperties): Constructor. """ super(ExceptionForm, self).__init__(None, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) - self.setupUi(self) + self.setup_ui(self) self.settings_section = 'crashreport' self.report_text = '**OpenLP Bug Report**\n' \ 'Version: {version}\n\n' \ diff --git a/openlp/core/ui/filerenamedialog.py b/openlp/core/ui/filerenamedialog.py index 648933538..7d70bed87 100644 --- a/openlp/core/ui/filerenamedialog.py +++ b/openlp/core/ui/filerenamedialog.py @@ -33,7 +33,7 @@ class Ui_FileRenameDialog(object): """ The UI widgets for the rename dialog """ - def setupUi(self, file_rename_dialog): + def setup_ui(self, file_rename_dialog): """ Set up the UI """ @@ -51,10 +51,10 @@ class Ui_FileRenameDialog(object): self.dialog_layout.addWidget(self.file_name_edit, 0, 1) self.button_box = create_button_box(file_rename_dialog, 'button_box', ['cancel', 'ok']) self.dialog_layout.addWidget(self.button_box, 1, 0, 1, 2) - self.retranslateUi(file_rename_dialog) + self.retranslate_ui(file_rename_dialog) self.setMaximumHeight(self.sizeHint().height()) - def retranslateUi(self, file_rename_dialog): + def retranslate_ui(self, file_rename_dialog): """ Translate the UI on the fly. """ diff --git a/openlp/core/ui/filerenameform.py b/openlp/core/ui/filerenameform.py index 471242207..76140f6a7 100644 --- a/openlp/core/ui/filerenameform.py +++ b/openlp/core/ui/filerenameform.py @@ -46,7 +46,7 @@ class FileRenameForm(QtWidgets.QDialog, Ui_FileRenameDialog, RegistryProperties) """ Set up the class. This method is mocked out by the tests. """ - self.setupUi(self) + self.setup_ui(self) def exec(self, copy=False): """ diff --git a/openlp/core/ui/firsttimelanguagedialog.py b/openlp/core/ui/firsttimelanguagedialog.py index ab56e479a..44366f8b5 100644 --- a/openlp/core/ui/firsttimelanguagedialog.py +++ b/openlp/core/ui/firsttimelanguagedialog.py @@ -33,7 +33,7 @@ class Ui_FirstTimeLanguageDialog(object): """ The UI widgets of the language selection dialog. """ - def setupUi(self, language_dialog): + def setup_ui(self, language_dialog): """ Set up the UI. """ @@ -59,10 +59,10 @@ class Ui_FirstTimeLanguageDialog(object): self.dialog_layout.addLayout(self.language_layout) self.button_box = create_button_box(language_dialog, 'button_box', ['cancel', 'ok']) self.dialog_layout.addWidget(self.button_box) - self.retranslateUi(language_dialog) + self.retranslate_ui(language_dialog) self.setMaximumHeight(self.sizeHint().height()) - def retranslateUi(self, language_dialog): + def retranslate_ui(self, language_dialog): """ Translate the UI on the fly. """ diff --git a/openlp/core/ui/firsttimelanguageform.py b/openlp/core/ui/firsttimelanguageform.py index aae5ee739..9caea14c9 100644 --- a/openlp/core/ui/firsttimelanguageform.py +++ b/openlp/core/ui/firsttimelanguageform.py @@ -39,7 +39,7 @@ class FirstTimeLanguageForm(QtWidgets.QDialog, Ui_FirstTimeLanguageDialog): """ super(FirstTimeLanguageForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) - self.setupUi(self) + self.setup_ui(self) self.qm_list = LanguageManager.get_qm_list() self.language_combo_box.addItem('Autodetect') self.language_combo_box.addItems(sorted(self.qm_list.keys())) diff --git a/openlp/core/ui/formattingtagdialog.py b/openlp/core/ui/formattingtagdialog.py index b88ece576..4e884e141 100644 --- a/openlp/core/ui/formattingtagdialog.py +++ b/openlp/core/ui/formattingtagdialog.py @@ -33,7 +33,7 @@ class Ui_FormattingTagDialog(object): """ The UI widgets for the formatting tags window. """ - def setupUi(self, formatting_tag_dialog): + def setup_ui(self, formatting_tag_dialog): """ Set up the UI """ @@ -103,9 +103,9 @@ class Ui_FormattingTagDialog(object): self.restore_button.setIcon(UiIcons().undo) self.restore_button.setObjectName('restore_button') self.list_data_grid_layout.addWidget(self.button_box) - self.retranslateUi(formatting_tag_dialog) + self.retranslate_ui(formatting_tag_dialog) - def retranslateUi(self, formatting_tag_dialog): + def retranslate_ui(self, formatting_tag_dialog): """ Translate the UI on the fly """ diff --git a/openlp/core/ui/formattingtagform.py b/openlp/core/ui/formattingtagform.py index 6482e73d3..d20bdc94a 100644 --- a/openlp/core/ui/formattingtagform.py +++ b/openlp/core/ui/formattingtagform.py @@ -52,7 +52,7 @@ class FormattingTagForm(QtWidgets.QDialog, Ui_FormattingTagDialog, FormattingTag """ super(FormattingTagForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) - self.setupUi(self) + self.setup_ui(self) self._setup() def _setup(self): diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index b46e75239..4eb7ddadd 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -29,7 +29,6 @@ from PyQt5 import QtGui, QtWidgets from openlp.core.common import get_images_filter from openlp.core.common.i18n import UiStrings, translate from openlp.core.common.path import Path -from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings from openlp.core.display.screens import ScreenList from openlp.core.lib.settingstab import SettingsTab @@ -54,73 +53,13 @@ class GeneralTab(SettingsTab): general_translated = translate('OpenLP.GeneralTab', 'General') super(GeneralTab, self).__init__(parent, 'Core', general_translated) - def setupUi(self): + def setup_ui(self): """ Create the user interface for the general settings tab """ self.setObjectName('GeneralTab') - super(GeneralTab, self).setupUi() + super(GeneralTab, self).setup_ui() self.tab_layout.setStretch(1, 1) - # Monitors - self.screen_group_box = QtWidgets.QGroupBox(self.left_column) - self.screen_group_box.setObjectName('screen_group_box') - self.screen_layout = QtWidgets.QVBoxLayout(self.screen_group_box) - self.screen_layout.setObjectName('screen_layout') - self.screen_combo_box = QtWidgets.QComboBox(self.screen_group_box) - self.screen_combo_box.setObjectName('screen_combo_box') - self.screen_layout.addWidget(self.screen_combo_box) - # Actual screen details - self.screen_detail_layout = QtWidgets.QGridLayout() - self.screen_detail_layout.setContentsMargins(0, 0, 0, 0) - # self.screen_detail_layout.setSpacing(8) - self.screen_detail_layout.setObjectName('screen_detail_layout') - self.screen_use_this_checkbox = QtWidgets.QCheckBox(self.screen_group_box) - self.screen_use_this_checkbox.setObjectName('screen_use_this_checkbox') - self.screen_detail_layout.addWidget(self.screen_use_this_checkbox) - # Display Position - # self.override_radio_button = QtWidgets.QRadioButton(self.screen_group_box) - # self.override_radio_button.setObjectName('override_radio_button') - # self.screen_detail_layout.addWidget(self.override_radio_button) - # self.custom_x_label = QtWidgets.QLabel(self.screen_group_box) - # self.custom_x_label.setObjectName('custom_x_label') - # self.screen_layout.addWidget(self.custom_x_label) - # self.custom_X_value_edit = QtWidgets.QSpinBox(self.screen_group_box) - # self.custom_X_value_edit.setObjectName('custom_X_value_edit') - # self.custom_X_value_edit.setRange(-9999, 9999) - # self.screen_layout.addWidget(self.custom_X_value_edit) - # self.custom_y_label = QtWidgets.QLabel(self.screen_group_box) - # self.custom_y_label.setObjectName('custom_y_label') - # self.screen_layout.addWidget(self.custom_y_label) - # self.custom_Y_value_edit = QtWidgets.QSpinBox(self.screen_group_box) - # self.custom_Y_value_edit.setObjectName('custom_Y_value_edit') - # self.custom_Y_value_edit.setRange(-9999, 9999) - # self.screen_layout.addWidget(self.custom_Y_value_edit) - # self.custom_width_label = QtWidgets.QLabel(self.screen_group_box) - # self.custom_width_label.setObjectName('custom_width_label') - # self.screen_layout.addWidget(self.custom_width_label) - # self.custom_width_value_edit = QtWidgets.QSpinBox(self.screen_group_box) - # self.custom_width_value_edit.setObjectName('custom_width_value_edit') - # self.custom_width_value_edit.setRange(1, 9999) - # self.screen_layout.addWidget(self.custom_width_value_edit) - # self.custom_height_label = QtWidgets.QLabel(self.screen_group_box) - # self.custom_height_label.setObjectName('custom_height_label') - # self.screen_layout.addWidget(self.custom_height_label) - # self.custom_height_value_edit = QtWidgets.QSpinBox(self.screen_group_box) - # self.custom_height_value_edit.setObjectName('custom_height_value_edit') - # self.custom_height_value_edit.setRange(1, 9999) - # self.screen_layout.addWidget(self.custom_height_value_edit) - # self.display_on_screen_check = QtWidgets.QCheckBox(self.screen_group_box) - # self.display_on_screen_check.setObjectName('screen_combo_box') - # self.screen_layout.addWidget(self.display_on_screen_check) - # Set up the stretchiness of each column, so that the first column - # less stretchy (and therefore smaller) than the others - # self.screen_layout.setColumnStretch(0, 1) - # self.screen_layout.setColumnStretch(1, 3) - # self.screen_layout.setColumnStretch(2, 3) - # self.screen_layout.setColumnStretch(3, 3) - # self.screen_layout.setColumnStretch(4, 3) - self.screen_layout.addLayout(self.screen_detail_layout) - self.left_layout.addWidget(self.screen_group_box) # CCLI Details self.ccli_group_box = QtWidgets.QGroupBox(self.left_column) self.ccli_group_box.setObjectName('ccli_group_box') @@ -221,30 +160,17 @@ class GeneralTab(SettingsTab): self.settings_layout.addRow(self.timeout_label, self.timeout_spin_box) self.right_layout.addWidget(self.settings_group_box) self.right_layout.addStretch() - # Signals and slots - # self.override_radio_button.toggled.connect(self.on_override_radio_button_pressed) - # self.custom_height_value_edit.valueChanged.connect(self.on_display_changed) - # self.custom_width_value_edit.valueChanged.connect(self.on_display_changed) - # self.custom_Y_value_edit.valueChanged.connect(self.on_display_changed) - # self.custom_X_value_edit.valueChanged.connect(self.on_display_changed) - self.screen_combo_box.currentIndexChanged.connect(self.on_display_changed) - # Reload the tab, as the screen resolution/count may have changed. - Registry().register_function('config_screen_changed', self.load) # Remove for now self.username_label.setVisible(False) self.username_edit.setVisible(False) self.password_label.setVisible(False) self.password_edit.setVisible(False) - def retranslateUi(self): + def retranslate_ui(self): """ Translate the general settings tab to the currently selected language """ self.tab_title_visible = translate('OpenLP.GeneralTab', 'General') - self.screen_group_box.setTitle(translate('OpenLP.GeneralTab', 'Monitors')) - # self.screen_radio_button.setText(translate('OpenLP.GeneralTab', 'Select screen for output display:')) - self.screen_use_this_checkbox.setText(translate('OpenLP.GeneralTab', 'Use this screen as a display')) - # self.display_on_screen_check.setText(translate('OpenLP.GeneralTab', 'Display if a single screen')) self.startup_group_box.setTitle(translate('OpenLP.GeneralTab', 'Application Startup')) self.warning_check_box.setText(translate('OpenLP.GeneralTab', 'Show blank screen warning')) self.auto_open_check_box.setText(translate('OpenLP.GeneralTab', 'Automatically open the previous service file')) @@ -269,12 +195,6 @@ class GeneralTab(SettingsTab): self.number_label.setText(UiStrings().CCLINumberLabel) self.username_label.setText(translate('OpenLP.GeneralTab', 'SongSelect username:')) self.password_label.setText(translate('OpenLP.GeneralTab', 'SongSelect password:')) - # Moved from display tab - # self.override_radio_button.setText(translate('OpenLP.GeneralTab', 'Override display position:')) - # self.custom_x_label.setText(translate('OpenLP.GeneralTab', 'X')) - # self.custom_y_label.setText(translate('OpenLP.GeneralTab', 'Y')) - # self.custom_height_label.setText(translate('OpenLP.GeneralTab', 'Height')) - # self.custom_width_label.setText(translate('OpenLP.GeneralTab', 'Width')) self.audio_group_box.setTitle(translate('OpenLP.GeneralTab', 'Background Audio')) self.start_paused_check_box.setText(translate('OpenLP.GeneralTab', 'Start background audio paused')) self.repeat_list_check_box.setText(translate('OpenLP.GeneralTab', 'Repeat track list')) @@ -288,25 +208,12 @@ class GeneralTab(SettingsTab): """ settings = Settings() settings.beginGroup(self.settings_section) - self.screen_combo_box.clear() - for screen in self.screens: - self.screen_combo_box.addItem(str(screen), screen.number) - screens = settings.value('screens') - for number, screen in screens.items(): - if screen['is_display']: - for item_index in range(self.screen_combo_box.count()): - if self.screen_combo_box.itemData(item_index) == number: - self.screen_combo_box.setCurrentIndex(item_index) - else: - self.screen_combo_box.setCurrentIndex(0) self.number_edit.setText(settings.value('ccli number')) self.username_edit.setText(settings.value('songselect username')) self.password_edit.setText(settings.value('songselect password')) self.save_check_service_check_box.setChecked(settings.value('save prompt')) self.auto_unblank_check_box.setChecked(settings.value('auto unblank')) self.click_live_slide_to_unblank_check_box.setChecked(settings.value('click live slide to unblank')) - # TODO: This is going to be a more complicated setup - # self.display_on_screen_check.setChecked(self.screens.display) self.warning_check_box.setChecked(settings.value('blank warning')) self.auto_open_check_box.setChecked(settings.value('auto open')) self.show_splash_check_box.setChecked(settings.value('show splash')) @@ -317,21 +224,9 @@ class GeneralTab(SettingsTab): self.check_for_updates_check_box.setChecked(settings.value('update check')) self.auto_preview_check_box.setChecked(settings.value('auto preview')) self.timeout_spin_box.setValue(settings.value('loop delay')) - # self.screen_radio_button.setChecked(not settings.value('override position',)) - # self.override_radio_button.setChecked(settings.value('override position')) - # self.custom_X_value_edit.setValue(settings.value('x position')) - # self.custom_Y_value_edit.setValue(settings.value('y position')) - # self.custom_height_value_edit.setValue(settings.value('height')) - # self.custom_width_value_edit.setValue(settings.value('width')) self.start_paused_check_box.setChecked(settings.value('audio start paused')) self.repeat_list_check_box.setChecked(settings.value('audio repeat list')) settings.endGroup() - # self.screen_combo_box.setDisabled(self.override_radio_button.isChecked()) - # self.custom_X_value_edit.setEnabled(self.override_radio_button.isChecked()) - # self.custom_Y_value_edit.setEnabled(self.override_radio_button.isChecked()) - # self.custom_height_value_edit.setEnabled(self.override_radio_button.isChecked()) - # self.custom_width_value_edit.setEnabled(self.override_radio_button.isChecked()) - self.display_changed = False def save(self): """ @@ -339,8 +234,6 @@ class GeneralTab(SettingsTab): """ settings = Settings() settings.beginGroup(self.settings_section) - # settings.setValue('screen', self.screen_combo_box.currentIndex()) - # settings.setValue('display on screen', self.display_on_screen_check.isChecked()) settings.setValue('blank warning', self.warning_check_box.isChecked()) settings.setValue('auto open', self.auto_open_check_box.isChecked()) settings.setValue('show splash', self.show_splash_check_box.isChecked()) @@ -356,60 +249,16 @@ class GeneralTab(SettingsTab): settings.setValue('ccli number', self.number_edit.displayText()) settings.setValue('songselect username', self.username_edit.displayText()) settings.setValue('songselect password', self.password_edit.displayText()) - # settings.setValue('x position', self.custom_X_value_edit.value()) - # settings.setValue('y position', self.custom_Y_value_edit.value()) - # settings.setValue('height', self.custom_height_value_edit.value()) - # settings.setValue('width', self.custom_width_value_edit.value()) - # settings.setValue('override position', self.override_radio_button.isChecked()) settings.setValue('audio start paused', self.start_paused_check_box.isChecked()) settings.setValue('audio repeat list', self.repeat_list_check_box.isChecked()) settings.endGroup() - # On save update the screens as well - self.post_set_up(True) + self.post_set_up() - def post_set_up(self, is_post_update=False): + def post_set_up(self): """ - Apply settings after settings tab has loaded and most of the system so must be delayed + Apply settings after the tab has loaded """ self.settings_form.register_post_process('slidecontroller_live_spin_delay') - # Do not continue on start up. - if not is_post_update: - return - self.screens.set_display_screen(self.screen_combo_box.currentData()) - # self.screens.display = self.display_on_screen_check.isChecked() - # self.screens.override['size'] = QtCore.QRect( - # self.custom_X_value_edit.value(), - # self.custom_Y_value_edit.value(), - # self.custom_width_value_edit.value(), - # self.custom_height_value_edit.value()) - # self.screens.override['number'] = self.screens.which_screen(self.screens.override['size']) - # self.screens.override['primary'] = (self.screens.desktop.primaryScreen() == self.screens.override['number']) - # if self.override_radio_button.isChecked(): - # self.screens.set_override_display() - # else: - # self.screens.reset_current_display() - if self.display_changed: - self.settings_form.register_post_process('config_screen_changed') - self.display_changed = False - - def on_override_radio_button_pressed(self, checked): - """ - Toggle screen state depending on check box state. - - :param checked: The state of the check box (boolean). - """ - self.screen_combo_box.setDisabled(checked) - self.custom_X_value_edit.setEnabled(checked) - self.custom_Y_value_edit.setEnabled(checked) - self.custom_height_value_edit.setEnabled(checked) - self.custom_width_value_edit.setEnabled(checked) - self.display_changed = True - - def on_display_changed(self): - """ - Called when the width, height, x position or y position has changed. - """ - self.display_changed = True def on_logo_background_color_changed(self, color): """ diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 6ebd920b9..6f77ffa9f 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -68,7 +68,7 @@ class Ui_MainWindow(object): """ This is the UI part of the main window. """ - def setupUi(self, main_window): + def setup_ui(self, main_window): """ Set up the user interface """ @@ -346,7 +346,7 @@ class Ui_MainWindow(object): self.tools_menu.menuAction(), self.settings_menu.menuAction(), self.help_menu.menuAction())) add_actions(self, [self.search_shortcut_action]) # Initialise the translation - self.retranslateUi(main_window) + self.retranslate_ui(main_window) self.media_tool_box.setCurrentIndex(0) # Connect up some signals and slots self.file_menu.aboutToShow.connect(self.update_recent_files_menu) @@ -357,7 +357,7 @@ class Ui_MainWindow(object): self.set_lock_panel(panel_locked) self.settings_imported = False - def retranslateUi(self, main_window): + def retranslate_ui(self, main_window): """ Set up the translation system """ @@ -510,10 +510,10 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, LogMixin, RegistryPropert PluginManager(self) ImageManager() # Set up the interface - self.setupUi(self) + self.setup_ui(self) # Define the media Dock Manager self.media_dock_manager = MediaDockManager(self.media_tool_box) - # Load settings after setupUi so default UI sizes are overwritten + # Load settings after setup_ui so default UI sizes are overwritten # Once settings are loaded update the menu with the recent files. self.update_recent_files_menu() self.plugin_form = PluginForm(self) diff --git a/openlp/core/ui/media/playertab.py b/openlp/core/ui/media/playertab.py index 6425e4310..c0532da0c 100644 --- a/openlp/core/ui/media/playertab.py +++ b/openlp/core/ui/media/playertab.py @@ -61,12 +61,12 @@ class PlayerTab(SettingsTab): player_translated = translate('OpenLP.PlayerTab', 'Players') super(PlayerTab, self).__init__(parent, 'Players', player_translated) - def setupUi(self): + def setup_ui(self): """ Set up the UI """ self.setObjectName('MediaTab') - super(PlayerTab, self).setupUi() + super(PlayerTab, self).setup_ui() self.background_color_group_box = QtWidgets.QGroupBox(self.left_column) self.background_color_group_box.setObjectName('background_color_group_box') self.form_layout = QtWidgets.QFormLayout(self.background_color_group_box) @@ -123,7 +123,7 @@ class PlayerTab(SettingsTab): # Signals and slots self.background_color_button.colorChanged.connect(self.on_background_color_changed) - def retranslateUi(self): + def retranslate_ui(self): """ Translate the UI on the fly """ diff --git a/openlp/core/ui/plugindialog.py b/openlp/core/ui/plugindialog.py index 76c587d6a..77c3b4f3e 100644 --- a/openlp/core/ui/plugindialog.py +++ b/openlp/core/ui/plugindialog.py @@ -33,7 +33,7 @@ class Ui_PluginViewDialog(object): """ The UI of the plugin view dialog """ - def setupUi(self, plugin_view_dialog): + def setup_ui(self, plugin_view_dialog): """ Set up the UI """ @@ -66,9 +66,9 @@ class Ui_PluginViewDialog(object): self.plugin_layout.addLayout(self.list_layout) self.button_box = create_button_box(plugin_view_dialog, 'button_box', ['ok']) self.plugin_layout.addWidget(self.button_box) - self.retranslateUi(plugin_view_dialog) + self.retranslate_ui(plugin_view_dialog) - def retranslateUi(self, plugin_view_dialog): + def retranslate_ui(self, plugin_view_dialog): """ Translate the UI on the fly """ diff --git a/openlp/core/ui/pluginform.py b/openlp/core/ui/pluginform.py index 386d3e5b0..717a96d0b 100644 --- a/openlp/core/ui/pluginform.py +++ b/openlp/core/ui/pluginform.py @@ -46,7 +46,7 @@ class PluginForm(QtWidgets.QDialog, Ui_PluginViewDialog, RegistryProperties): QtCore.Qt.WindowCloseButtonHint) self.active_plugin = None self.programatic_change = False - self.setupUi(self) + self.setup_ui(self) self.load() self._clear_details() # Right, now let's put some signals and slots together! diff --git a/openlp/core/ui/printservicedialog.py b/openlp/core/ui/printservicedialog.py index f529f5206..5d58308e4 100644 --- a/openlp/core/ui/printservicedialog.py +++ b/openlp/core/ui/printservicedialog.py @@ -45,7 +45,7 @@ class Ui_PrintServiceDialog(object): """ The UI of the print service dialog """ - def setupUi(self, print_service_dialog): + def setup_ui(self, print_service_dialog): """ Set up the UI """ @@ -127,10 +127,10 @@ class Ui_PrintServiceDialog(object): self.options_group_box.setLayout(self.group_layout) self.options_layout.addWidget(self.options_group_box) - self.retranslateUi(print_service_dialog) + self.retranslate_ui(print_service_dialog) self.options_button.toggled.connect(self.toggle_options) - def retranslateUi(self, print_service_dialog): + def retranslate_ui(self, print_service_dialog): """ Translate the UI on the fly """ diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index 683b8b620..7cca69ebc 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -133,7 +133,7 @@ class PrintServiceForm(QtWidgets.QDialog, Ui_PrintServiceDialog, RegistryPropert self.print_dialog = QtPrintSupport.QPrintDialog(self.printer, self) self.document = QtGui.QTextDocument() self.zoom = 0 - self.setupUi(self) + self.setup_ui(self) # Load the settings for the dialog. settings = Settings() settings.beginGroup('advanced') diff --git a/openlp/core/ui/serviceitemeditdialog.py b/openlp/core/ui/serviceitemeditdialog.py index 0c9949da8..db87db3d3 100644 --- a/openlp/core/ui/serviceitemeditdialog.py +++ b/openlp/core/ui/serviceitemeditdialog.py @@ -33,7 +33,7 @@ class Ui_ServiceItemEditDialog(object): """ The UI widgets for the service item edit dialog """ - def setupUi(self, serviceItemEditDialog): + def setup_ui(self, serviceItemEditDialog): """ Set up the UI """ @@ -62,9 +62,9 @@ class Ui_ServiceItemEditDialog(object): self.dialog_layout.addLayout(self.button_layout, 0, 1) self.button_box = create_button_box(serviceItemEditDialog, 'button_box', ['cancel', 'save']) self.dialog_layout.addWidget(self.button_box, 1, 0, 1, 2) - self.retranslateUi(serviceItemEditDialog) + self.retranslate_ui(serviceItemEditDialog) - def retranslateUi(self, serviceItemEditDialog): + def retranslate_ui(self, serviceItemEditDialog): """ Translate the UI on the fly """ diff --git a/openlp/core/ui/serviceitemeditform.py b/openlp/core/ui/serviceitemeditform.py index dce243f7d..06af8ddef 100644 --- a/openlp/core/ui/serviceitemeditform.py +++ b/openlp/core/ui/serviceitemeditform.py @@ -39,7 +39,7 @@ class ServiceItemEditForm(QtWidgets.QDialog, Ui_ServiceItemEditDialog, RegistryP """ super(ServiceItemEditForm, self).__init__(Registry().get('main_window'), QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) - self.setupUi(self) + self.setup_ui(self) self.item_list = [] self.list_widget.currentRowChanged.connect(self.on_current_row_changed) diff --git a/openlp/core/ui/servicenoteform.py b/openlp/core/ui/servicenoteform.py index b4e61ce69..22b933db7 100644 --- a/openlp/core/ui/servicenoteform.py +++ b/openlp/core/ui/servicenoteform.py @@ -41,8 +41,8 @@ class ServiceNoteForm(QtWidgets.QDialog, RegistryProperties): """ super(ServiceNoteForm, self).__init__(Registry().get('main_window'), QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) - self.setupUi() - self.retranslateUi() + self.setup_ui() + self.retranslate_ui() def exec(self): """ @@ -51,7 +51,7 @@ class ServiceNoteForm(QtWidgets.QDialog, RegistryProperties): self.text_edit.setFocus() return QtWidgets.QDialog.exec(self) - def setupUi(self): + def setup_ui(self): """ Set up the UI of the dialog """ @@ -66,7 +66,7 @@ class ServiceNoteForm(QtWidgets.QDialog, RegistryProperties): self.button_box = create_button_box(self, 'button_box', ['cancel', 'save']) self.dialog_layout.addWidget(self.button_box) - def retranslateUi(self): + def retranslate_ui(self): """ Translate the UI on the fly """ diff --git a/openlp/core/ui/settingsdialog.py b/openlp/core/ui/settingsdialog.py index 913f0255d..619d20030 100644 --- a/openlp/core/ui/settingsdialog.py +++ b/openlp/core/ui/settingsdialog.py @@ -33,7 +33,7 @@ class Ui_SettingsDialog(object): """ The UI widgets of the settings dialog. """ - def setupUi(self, settings_dialog): + def setup_ui(self, settings_dialog): """ Set up the UI """ @@ -54,9 +54,9 @@ class Ui_SettingsDialog(object): self.dialog_layout.addLayout(self.stacked_layout, 0, 1, 1, 1) self.button_box = create_button_box(settings_dialog, 'button_box', ['cancel', 'ok']) self.dialog_layout.addWidget(self.button_box, 1, 1, 1, 1) - self.retranslateUi(settings_dialog) + self.retranslate_ui(settings_dialog) - def retranslateUi(self, settings_dialog): + def retranslate_ui(self, settings_dialog): """ Translate the UI on the fly """ diff --git a/openlp/core/ui/settingsform.py b/openlp/core/ui/settingsform.py index fc8b4e74e..19f0fa929 100644 --- a/openlp/core/ui/settingsform.py +++ b/openlp/core/ui/settingsform.py @@ -33,6 +33,7 @@ from openlp.core.lib import build_icon from openlp.core.projectors.tab import ProjectorTab from openlp.core.ui.advancedtab import AdvancedTab from openlp.core.ui.generaltab import GeneralTab +from openlp.core.ui.screenstab import ScreensTab from openlp.core.ui.themestab import ThemesTab from openlp.core.ui.media import PlayerTab from openlp.core.ui.settingsdialog import Ui_SettingsDialog @@ -53,7 +54,7 @@ class SettingsForm(QtWidgets.QDialog, Ui_SettingsDialog, RegistryProperties): super(SettingsForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) self.processes = [] - self.setupUi(self) + self.setup_ui(self) self.setting_list_widget.currentRowChanged.connect(self.list_item_changed) self.general_tab = None self.themes_tab = None @@ -73,8 +74,9 @@ class SettingsForm(QtWidgets.QDialog, Ui_SettingsDialog, RegistryProperties): # take at 0 and the rest shuffle up. self.stacked_layout.takeAt(0) self.insert_tab(self.general_tab) - self.insert_tab(self.themes_tab) self.insert_tab(self.advanced_tab) + self.insert_tab(self.screens_tab) + self.insert_tab(self.themes_tab) self.insert_tab(self.player_tab) self.insert_tab(self.projector_tab) self.insert_tab(self.api_tab) @@ -151,18 +153,17 @@ class SettingsForm(QtWidgets.QDialog, Ui_SettingsDialog, RegistryProperties): """ Run any post-setup code for the tabs on the form """ - # General tab - self.general_tab = GeneralTab(self) - # Themes tab - self.themes_tab = ThemesTab(self) - # Projector Tab - self.projector_tab = ProjectorTab(self) - # Advanced tab - self.advanced_tab = AdvancedTab(self) - # Advanced tab - self.player_tab = PlayerTab(self) - # Api tab - self.api_tab = ApiTab(self) + try: + self.general_tab = GeneralTab(self) + self.themes_tab = ThemesTab(self) + self.projector_tab = ProjectorTab(self) + self.advanced_tab = AdvancedTab(self) + self.player_tab = PlayerTab(self) + self.api_tab = ApiTab(self) + self.screens_tab = ScreensTab(self) + except Exception as e: + print(e) + # Post setup self.general_tab.post_set_up() self.themes_tab.post_set_up() self.advanced_tab.post_set_up() diff --git a/openlp/core/ui/shortcutlistdialog.py b/openlp/core/ui/shortcutlistdialog.py index e7c498f92..af544bf39 100644 --- a/openlp/core/ui/shortcutlistdialog.py +++ b/openlp/core/ui/shortcutlistdialog.py @@ -67,7 +67,7 @@ class Ui_ShortcutListDialog(object): """ The UI widgets for the shortcut dialog. """ - def setupUi(self, shortcutListDialog): + def setup_ui(self, shortcutListDialog): """ Set up the UI """ @@ -130,9 +130,9 @@ class Ui_ShortcutListDialog(object): self.button_box = create_button_box(shortcutListDialog, 'button_box', ['cancel', 'ok', 'defaults']) self.button_box.setOrientation(QtCore.Qt.Horizontal) self.shortcut_list_layout.addWidget(self.button_box) - self.retranslateUi(shortcutListDialog) + self.retranslate_ui(shortcutListDialog) - def retranslateUi(self, shortcutListDialog): + def retranslate_ui(self, shortcutListDialog): """ Translate the UI on the fly """ diff --git a/openlp/core/ui/shortcutlistform.py b/openlp/core/ui/shortcutlistform.py index 779b86eea..d09103a8f 100644 --- a/openlp/core/ui/shortcutlistform.py +++ b/openlp/core/ui/shortcutlistform.py @@ -49,7 +49,7 @@ class ShortcutListForm(QtWidgets.QDialog, Ui_ShortcutListDialog, RegistryPropert """ super(ShortcutListForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) - self.setupUi(self) + self.setup_ui(self) self.changed_actions = {} self.action_list = ActionList.get_instance() self.dialog_was_shown = False diff --git a/openlp/core/ui/splashscreen.py b/openlp/core/ui/splashscreen.py index 6e6ca4b97..805b40b38 100644 --- a/openlp/core/ui/splashscreen.py +++ b/openlp/core/ui/splashscreen.py @@ -35,9 +35,9 @@ class SplashScreen(QtWidgets.QSplashScreen): Constructor """ super(SplashScreen, self).__init__() - self.setupUi() + self.setup_ui() - def setupUi(self): + def setup_ui(self): """ Set up the UI """ diff --git a/openlp/core/ui/starttimedialog.py b/openlp/core/ui/starttimedialog.py index c159f7660..c22bf1d7f 100644 --- a/openlp/core/ui/starttimedialog.py +++ b/openlp/core/ui/starttimedialog.py @@ -33,7 +33,7 @@ class Ui_StartTimeDialog(object): """ The UI widgets for the time dialog """ - def setupUi(self, StartTimeDialog): + def setup_ui(self, StartTimeDialog): """ Set up the UI """ @@ -107,10 +107,10 @@ class Ui_StartTimeDialog(object): self.dialog_layout.addWidget(self.second_spin_box, 3, 1, 1, 1) self.button_box = create_button_box(StartTimeDialog, 'button_box', ['cancel', 'ok']) self.dialog_layout.addWidget(self.button_box, 5, 2, 1, 2) - self.retranslateUi(StartTimeDialog) + self.retranslate_ui(StartTimeDialog) self.setMaximumHeight(self.sizeHint().height()) - def retranslateUi(self, StartTimeDialog): + def retranslate_ui(self, StartTimeDialog): """ Update the translations on the fly """ diff --git a/openlp/core/ui/starttimeform.py b/openlp/core/ui/starttimeform.py index 9d8bee4cf..9d7823785 100644 --- a/openlp/core/ui/starttimeform.py +++ b/openlp/core/ui/starttimeform.py @@ -41,7 +41,7 @@ class StartTimeForm(QtWidgets.QDialog, Ui_StartTimeDialog, RegistryProperties): """ super(StartTimeForm, self).__init__(Registry().get('main_window'), QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) - self.setupUi(self) + self.setup_ui(self) def exec(self): """ diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index e8a368006..a0d0ab9ad 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -60,7 +60,7 @@ class ThemeForm(QtWidgets.QWizard, Ui_ThemeWizard, RegistryProperties): """ Set up the class. This method is mocked out by the tests. """ - self.setupUi(self) + self.setup_ui(self) self.registerFields() self.update_theme_allowed = True self.temp_background_filename = None diff --git a/openlp/core/ui/themelayoutdialog.py b/openlp/core/ui/themelayoutdialog.py index f09770b60..751efa91b 100644 --- a/openlp/core/ui/themelayoutdialog.py +++ b/openlp/core/ui/themelayoutdialog.py @@ -33,7 +33,7 @@ class Ui_ThemeLayoutDialog(object): """ The layout of the theme """ - def setupUi(self, themeLayoutDialog): + def setup_ui(self, themeLayoutDialog): """ Set up the UI """ @@ -62,9 +62,9 @@ class Ui_ThemeLayoutDialog(object): self.preview_layout.addWidget(self.footer_colour_label) self.button_box = create_button_box(themeLayoutDialog, 'button_box', ['ok']) self.preview_layout.addWidget(self.button_box) - self.retranslateUi(themeLayoutDialog) + self.retranslate_ui(themeLayoutDialog) - def retranslateUi(self, themeLayoutDialog): + def retranslate_ui(self, themeLayoutDialog): """ Translate the UI on the fly """ diff --git a/openlp/core/ui/themelayoutform.py b/openlp/core/ui/themelayoutform.py index 5c676d2d5..dafbada96 100644 --- a/openlp/core/ui/themelayoutform.py +++ b/openlp/core/ui/themelayoutform.py @@ -36,7 +36,7 @@ class ThemeLayoutForm(QtWidgets.QDialog, Ui_ThemeLayoutDialog): Constructor """ super(ThemeLayoutForm, self).__init__(parent) - self.setupUi(self) + self.setup_ui(self) def exec(self, image): """ diff --git a/openlp/core/ui/themestab.py b/openlp/core/ui/themestab.py index 6a5d9bccf..53e3a84f5 100644 --- a/openlp/core/ui/themestab.py +++ b/openlp/core/ui/themestab.py @@ -45,12 +45,12 @@ class ThemesTab(SettingsTab): theme_translated = translate('OpenLP.ThemesTab', 'Themes') super(ThemesTab, self).__init__(parent, 'Themes', theme_translated) - def setupUi(self): + def setup_ui(self): """ Set up the UI """ self.setObjectName('ThemesTab') - super(ThemesTab, self).setupUi() + super(ThemesTab, self).setup_ui() self.global_group_box = QtWidgets.QGroupBox(self.left_column) self.global_group_box.setObjectName('global_group_box') self.global_group_box_layout = QtWidgets.QVBoxLayout(self.global_group_box) @@ -109,7 +109,7 @@ class ThemesTab(SettingsTab): self.default_combo_box.activated.connect(self.on_default_combo_box_changed) Registry().register_function('theme_update_list', self.update_theme_list) - def retranslateUi(self): + def retranslate_ui(self): """ Translate the UI on the fly """ diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index 0219ef758..171f5419c 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -37,7 +37,7 @@ class Ui_ThemeWizard(object): """ The Create/Edit theme wizard """ - def setupUi(self, theme_wizard): + def setup_ui(self, theme_wizard): """ Set up the UI """ @@ -375,7 +375,7 @@ class Ui_ThemeWizard(object): self.preview_area_layout.addWidget(self.preview_box_label) self.preview_layout.addWidget(self.preview_area) theme_wizard.addPage(self.preview_page) - self.retranslateUi(theme_wizard) + self.retranslate_ui(theme_wizard) self.background_combo_box.currentIndexChanged.connect(self.background_stack.setCurrentIndex) self.outline_check_box.toggled.connect(self.outline_color_button.setEnabled) self.outline_check_box.toggled.connect(self.outline_size_spin_box.setEnabled) @@ -390,7 +390,7 @@ class Ui_ThemeWizard(object): self.footer_position_check_box.toggled.connect(self.footer_width_spin_box.setDisabled) self.footer_position_check_box.toggled.connect(self.footer_height_spin_box.setDisabled) - def retranslateUi(self, theme_wizard): + def retranslate_ui(self, theme_wizard): """ Translate the UI on the fly """ diff --git a/openlp/core/widgets/wizard.py b/openlp/core/widgets/wizard.py index 5bd9f337f..738818469 100644 --- a/openlp/core/widgets/wizard.py +++ b/openlp/core/widgets/wizard.py @@ -110,7 +110,7 @@ class OpenLPWizard(QtWidgets.QWizard, RegistryProperties): self.delete_icon = UiIcons().delete self.finish_button = self.button(QtWidgets.QWizard.FinishButton) self.cancel_button = self.button(QtWidgets.QWizard.CancelButton) - self.setupUi(image) + self.setup_ui(image) self.register_fields() self.custom_init() self.custom_signals() @@ -119,7 +119,7 @@ class OpenLPWizard(QtWidgets.QWizard, RegistryProperties): self.error_copy_to_button.clicked.connect(self.on_error_copy_to_button_clicked) self.error_save_to_button.clicked.connect(self.on_error_save_to_button_clicked) - def setupUi(self, image): + def setup_ui(self, image): """ Set up the wizard UI. :param image: path to start up image @@ -136,7 +136,7 @@ class OpenLPWizard(QtWidgets.QWizard, RegistryProperties): self.add_custom_pages() if self.with_progress_page: self.add_progress_page() - self.retranslateUi() + self.retranslate_ui() def register_fields(self): """ diff --git a/openlp/plugins/alerts/forms/__init__.py b/openlp/plugins/alerts/forms/__init__.py index ff297ae8f..2e4e41ec7 100644 --- a/openlp/plugins/alerts/forms/__init__.py +++ b/openlp/plugins/alerts/forms/__init__.py @@ -35,7 +35,7 @@ mentioned above, like so:: def __init__(self, parent=None): super(AuthorsForm, self).__init__(parent) - self.setupUi(self) + self.setup_ui(self) This allows OpenLP to use ``self.object`` for all the GUI elements while keeping them separate from the functionality, so that it is easier to recreate the GUI from the .ui files later if necessary. diff --git a/openlp/plugins/alerts/forms/alertdialog.py b/openlp/plugins/alerts/forms/alertdialog.py index 983c79085..1feac882c 100644 --- a/openlp/plugins/alerts/forms/alertdialog.py +++ b/openlp/plugins/alerts/forms/alertdialog.py @@ -31,7 +31,7 @@ class Ui_AlertDialog(object): """ Alert UI Class """ - def setupUi(self, alert_dialog): + def setup_ui(self, alert_dialog): """ Setup the Alert UI dialog @@ -83,9 +83,9 @@ class Ui_AlertDialog(object): self.button_box = create_button_box(alert_dialog, 'button_box', ['close'], [self.display_button, self.display_close_button]) self.alert_dialog_layout.addWidget(self.button_box, 2, 0, 1, 2) - self.retranslateUi(alert_dialog) + self.retranslate_ui(alert_dialog) - def retranslateUi(self, alert_dialog): + def retranslate_ui(self, alert_dialog): """ Retranslate the UI strings diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py index 481853fa9..32da0353a 100644 --- a/openlp/plugins/alerts/forms/alertform.py +++ b/openlp/plugins/alerts/forms/alertform.py @@ -41,7 +41,7 @@ class AlertForm(QtWidgets.QDialog, Ui_AlertDialog): self.manager = plugin.manager self.plugin = plugin self.item_id = None - self.setupUi(self) + self.setup_ui(self) self.display_button.clicked.connect(self.on_display_clicked) self.display_close_button.clicked.connect(self.on_display_close_clicked) self.alert_text_edit.textChanged.connect(self.on_text_changed) diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index f01b5440f..c1672b1df 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -33,9 +33,9 @@ class AlertsTab(SettingsTab): """ AlertsTab is the alerts settings tab in the settings dialog. """ - def setupUi(self): + def setup_ui(self): self.setObjectName('AlertsTab') - super(AlertsTab, self).setupUi() + super(AlertsTab, self).setup_ui() self.font_group_box = QtWidgets.QGroupBox(self.left_column) self.font_group_box.setObjectName('font_group_box') self.font_layout = QtWidgets.QFormLayout(self.font_group_box) @@ -93,7 +93,7 @@ class AlertsTab(SettingsTab): self.timeout_spin_box.valueChanged.connect(self.on_timeout_spin_box_changed) self.font_size_spin_box.valueChanged.connect(self.on_font_size_spin_box_changed) - def retranslateUi(self): + def retranslate_ui(self): self.font_group_box.setTitle(translate('AlertsPlugin.AlertsTab', 'Font')) self.font_label.setText(translate('AlertsPlugin.AlertsTab', 'Font name:')) self.font_color_label.setText(translate('AlertsPlugin.AlertsTab', 'Font color:')) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index d32711b62..6b9744386 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -82,11 +82,11 @@ class BibleImportForm(OpenLPWizard): super(BibleImportForm, self).__init__(parent, bible_plugin, 'bibleImportWizard', ':/wizards/wizard_importbible.bmp') - def setupUi(self, image): + def setup_ui(self, image): """ Set up the UI for the bible wizard. """ - super(BibleImportForm, self).setupUi(image) + super(BibleImportForm, self).setup_ui(image) self.format_combo_box.currentIndexChanged.connect(self.on_current_index_changed) def on_current_index_changed(self, index): @@ -388,7 +388,7 @@ class BibleImportForm(OpenLPWizard): self.license_details_layout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.full_license_edit) self.addPage(self.license_details_page) - def retranslateUi(self): + def retranslate_ui(self): """ Allow for localisation of the bible import wizard. """ diff --git a/openlp/plugins/bibles/forms/booknamedialog.py b/openlp/plugins/bibles/forms/booknamedialog.py index a76078f9f..2ef5d7b7e 100644 --- a/openlp/plugins/bibles/forms/booknamedialog.py +++ b/openlp/plugins/bibles/forms/booknamedialog.py @@ -28,7 +28,7 @@ from openlp.core.ui.icons import UiIcons class Ui_BookNameDialog(object): - def setupUi(self, book_name_dialog): + def setup_ui(self, book_name_dialog): book_name_dialog.setObjectName('book_name_dialog') book_name_dialog.setWindowIcon(UiIcons().main_icon) book_name_dialog.resize(400, 271) @@ -79,9 +79,9 @@ class Ui_BookNameDialog(object): self.button_box = create_button_box(book_name_dialog, 'button_box', ['cancel', 'ok']) self.book_name_layout.addWidget(self.button_box) - self.retranslateUi(book_name_dialog) + self.retranslate_ui(book_name_dialog) - def retranslateUi(self, book_name_dialog): + def retranslate_ui(self, book_name_dialog): book_name_dialog.setWindowTitle(translate('BiblesPlugin.BookNameDialog', 'Select Book Name')) self.info_label.setText( translate('BiblesPlugin.BookNameDialog', 'The following book name cannot be matched up internally. ' diff --git a/openlp/plugins/bibles/forms/booknameform.py b/openlp/plugins/bibles/forms/booknameform.py index b8a3aac20..b8499c1d5 100644 --- a/openlp/plugins/bibles/forms/booknameform.py +++ b/openlp/plugins/bibles/forms/booknameform.py @@ -51,7 +51,7 @@ class BookNameForm(QDialog, Ui_BookNameDialog): """ super(BookNameForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) - self.setupUi(self) + self.setup_ui(self) self.custom_signals() self.book_names = BibleStrings().BookNames self.book_id = False diff --git a/openlp/plugins/bibles/forms/editbibledialog.py b/openlp/plugins/bibles/forms/editbibledialog.py index b5bf1aba3..caa28a85c 100644 --- a/openlp/plugins/bibles/forms/editbibledialog.py +++ b/openlp/plugins/bibles/forms/editbibledialog.py @@ -30,7 +30,7 @@ from openlp.core.ui.icons import UiIcons class Ui_EditBibleDialog(object): - def setupUi(self, edit_bible_dialog): + def setup_ui(self, edit_bible_dialog): edit_bible_dialog.setObjectName('edit_bible_dialog') edit_bible_dialog.setWindowIcon(UiIcons().main_icon) edit_bible_dialog.resize(520, 400) @@ -125,10 +125,10 @@ class Ui_EditBibleDialog(object): self.dialog_layout.addWidget(self.bible_tab_widget) self.button_box = create_button_box(edit_bible_dialog, 'button_box', ['cancel', 'save']) self.dialog_layout.addWidget(self.button_box) - self.retranslateUi(edit_bible_dialog) + self.retranslate_ui(edit_bible_dialog) QtCore.QMetaObject.connectSlotsByName(edit_bible_dialog) - def retranslateUi(self, edit_bible_dialog): + def retranslate_ui(self, edit_bible_dialog): self.book_names = BibleStrings().BookNames edit_bible_dialog.setWindowTitle(translate('BiblesPlugin.EditBibleForm', 'Bible Editor')) # Meta tab diff --git a/openlp/plugins/bibles/forms/editbibleform.py b/openlp/plugins/bibles/forms/editbibleform.py index 086a65ceb..f59e55153 100644 --- a/openlp/plugins/bibles/forms/editbibleform.py +++ b/openlp/plugins/bibles/forms/editbibleform.py @@ -49,7 +49,7 @@ class EditBibleForm(QtWidgets.QDialog, Ui_EditBibleDialog, RegistryProperties): QtCore.Qt.WindowCloseButtonHint) self.media_item = media_item self.book_names = BibleStrings().BookNames - self.setupUi(self) + self.setup_ui(self) self.manager = manager def load_bible(self, bible): diff --git a/openlp/plugins/bibles/forms/languagedialog.py b/openlp/plugins/bibles/forms/languagedialog.py index b93b62626..917a70db7 100644 --- a/openlp/plugins/bibles/forms/languagedialog.py +++ b/openlp/plugins/bibles/forms/languagedialog.py @@ -28,7 +28,7 @@ from openlp.core.ui.icons import UiIcons class Ui_LanguageDialog(object): - def setupUi(self, language_dialog): + def setup_ui(self, language_dialog): language_dialog.setObjectName('language_dialog') language_dialog.setWindowIcon(UiIcons().main_icon) language_dialog.resize(400, 165) @@ -61,9 +61,9 @@ class Ui_LanguageDialog(object): self.button_box = create_button_box(language_dialog, 'button_box', ['cancel', 'ok']) self.language_layout.addWidget(self.button_box) - self.retranslateUi(language_dialog) + self.retranslate_ui(language_dialog) - def retranslateUi(self, language_dialog): + def retranslate_ui(self, language_dialog): language_dialog.setWindowTitle(translate('BiblesPlugin.LanguageDialog', 'Select Language')) self.bible_label.setText(translate('BiblesPlugin.LanguageDialog', '')) self.info_label.setText( diff --git a/openlp/plugins/bibles/forms/languageform.py b/openlp/plugins/bibles/forms/languageform.py index 3f9f28780..b80bbf854 100644 --- a/openlp/plugins/bibles/forms/languageform.py +++ b/openlp/plugins/bibles/forms/languageform.py @@ -47,7 +47,7 @@ class LanguageForm(QDialog, Ui_LanguageDialog): """ super(LanguageForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) - self.setupUi(self) + self.setup_ui(self) def exec(self, bible_name): if bible_name: diff --git a/openlp/plugins/bibles/lib/biblestab.py b/openlp/plugins/bibles/lib/biblestab.py index fa90811a4..f20340c72 100644 --- a/openlp/plugins/bibles/lib/biblestab.py +++ b/openlp/plugins/bibles/lib/biblestab.py @@ -47,9 +47,9 @@ class BiblesTab(SettingsTab): self.display_style = 0 super().__init__(*args, **kwargs) - def setupUi(self): + def setup_ui(self): self.setObjectName('BiblesTab') - super(BiblesTab, self).setupUi() + super(BiblesTab, self).setup_ui() self.verse_display_group_box = QtWidgets.QGroupBox(self.left_column) self.verse_display_group_box.setObjectName('verse_display_group_box') self.verse_display_layout = QtWidgets.QFormLayout(self.verse_display_group_box) @@ -174,7 +174,7 @@ class BiblesTab(SettingsTab): self.bible_search_while_typing_check_box.stateChanged.connect( self.on_bible_search_while_typing_check_box_changed) - def retranslateUi(self): + def retranslate_ui(self): self.verse_display_group_box.setTitle(translate('BiblesPlugin.BiblesTab', 'Verse Display')) self.is_verse_number_visible_check_box.setText(translate('BiblesPlugin.BiblesTab', 'Show verse numbers')) self.new_chapters_check_box.setText(translate('BiblesPlugin.BiblesTab', 'Only show new chapter numbers')) diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index 32ca16bd6..3a9eb1635 100755 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -233,8 +233,8 @@ class BibleMediaItem(MediaManagerItem): self.results_view_tab.setCurrentIndex(ResultsTab.Search) self.page_layout.addWidget(self.results_view_tab) - def setupUi(self): - super().setupUi() + def setup_ui(self): + super().setup_ui() sort_model = QtCore.QSortFilterProxyModel(self.select_book_combo_box) model = self.select_book_combo_box.model() # Reparent the combo box model to the sort proxy, otherwise it will be deleted when we change the comobox's @@ -268,8 +268,8 @@ class BibleMediaItem(MediaManagerItem): self.on_results_view_tab_total_update(ResultsTab.Saved) self.on_results_view_tab_total_update(ResultsTab.Search) - def retranslateUi(self): - log.debug('retranslateUi') + def retranslate_ui(self): + log.debug('retranslate_ui') self.chapter_label.setText(translate('BiblesPlugin.MediaItem', 'Chapter:')) self.verse_label.setText(translate('BiblesPlugin.MediaItem', 'Verse:')) self.style_combo_box.setItemText(LayoutStyle.VersePerSlide, UiStrings().VersePerSlide) diff --git a/openlp/plugins/custom/forms/editcustomdialog.py b/openlp/plugins/custom/forms/editcustomdialog.py index 4fd300d38..fbcfdb746 100644 --- a/openlp/plugins/custom/forms/editcustomdialog.py +++ b/openlp/plugins/custom/forms/editcustomdialog.py @@ -27,7 +27,7 @@ from openlp.core.ui.icons import UiIcons class Ui_CustomEditDialog(object): - def setupUi(self, custom_edit_dialog): + def setup_ui(self, custom_edit_dialog): """ Build the Edit Dialog UI :param custom_edit_dialog: The Dialog @@ -98,9 +98,9 @@ class Ui_CustomEditDialog(object): self.button_box = create_button_box(custom_edit_dialog, 'button_box', ['cancel', 'save'], [self.preview_button]) self.dialog_layout.addWidget(self.button_box) - self.retranslateUi(custom_edit_dialog) + self.retranslate_ui(custom_edit_dialog) - def retranslateUi(self, custom_edit_dialog): + def retranslate_ui(self, custom_edit_dialog): custom_edit_dialog.setWindowTitle(translate('CustomPlugin.EditCustomForm', 'Edit Custom Slides')) self.title_label.setText(translate('CustomPlugin.EditCustomForm', '&Title:')) self.add_button.setText(UiStrings().Add) diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index 0ab518960..d3be07f91 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -49,7 +49,7 @@ class EditCustomForm(QtWidgets.QDialog, Ui_CustomEditDialog): QtCore.Qt.WindowCloseButtonHint) self.manager = manager self.media_item = media_item - self.setupUi(self) + self.setup_ui(self) # Create other objects and forms. self.edit_slide_form = EditCustomSlideForm(self) # Connecting signals and slots diff --git a/openlp/plugins/custom/forms/editcustomslidedialog.py b/openlp/plugins/custom/forms/editcustomslidedialog.py index 46f74b42a..c5107025e 100644 --- a/openlp/plugins/custom/forms/editcustomslidedialog.py +++ b/openlp/plugins/custom/forms/editcustomslidedialog.py @@ -29,7 +29,7 @@ from openlp.core.widgets.edits import SpellTextEdit class Ui_CustomSlideEditDialog(object): - def setupUi(self, custom_slide_edit_dialog): + def setup_ui(self, custom_slide_edit_dialog): custom_slide_edit_dialog.setObjectName('custom_slide_edit_dialog') custom_slide_edit_dialog.setWindowIcon(UiIcons().main_icon) custom_slide_edit_dialog.resize(350, 300) @@ -42,9 +42,9 @@ class Ui_CustomSlideEditDialog(object): self.button_box = create_button_box(custom_slide_edit_dialog, 'button_box', ['cancel', 'save'], [self.split_button, self.insert_button]) self.dialog_layout.addWidget(self.button_box) - self.retranslateUi(custom_slide_edit_dialog) + self.retranslate_ui(custom_slide_edit_dialog) - def retranslateUi(self, custom_slide_edit_dialog): + def retranslate_ui(self, custom_slide_edit_dialog): custom_slide_edit_dialog.setWindowTitle(translate('CustomPlugin.EditVerseForm', 'Edit Slide')) self.split_button.setText(UiStrings().Split) self.split_button.setToolTip(UiStrings().SplitToolTip) diff --git a/openlp/plugins/custom/forms/editcustomslideform.py b/openlp/plugins/custom/forms/editcustomslideform.py index 4619abb82..eb0b14364 100644 --- a/openlp/plugins/custom/forms/editcustomslideform.py +++ b/openlp/plugins/custom/forms/editcustomslideform.py @@ -41,7 +41,7 @@ class EditCustomSlideForm(QtWidgets.QDialog, Ui_CustomSlideEditDialog): """ super(EditCustomSlideForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) - self.setupUi(self) + self.setup_ui(self) # Connecting signals and slots self.insert_button.clicked.connect(self.on_insert_button_clicked) self.split_button.clicked.connect(self.on_split_button_clicked) diff --git a/openlp/plugins/custom/lib/customtab.py b/openlp/plugins/custom/lib/customtab.py index 1150b9c0f..9623f2f4f 100644 --- a/openlp/plugins/custom/lib/customtab.py +++ b/openlp/plugins/custom/lib/customtab.py @@ -34,9 +34,9 @@ class CustomTab(SettingsTab): """ CustomTab is the Custom settings tab in the settings dialog. """ - def setupUi(self): + def setup_ui(self): self.setObjectName('CustomTab') - super(CustomTab, self).setupUi() + super(CustomTab, self).setup_ui() self.custom_mode_group_box = QtWidgets.QGroupBox(self.left_column) self.custom_mode_group_box.setObjectName('custom_mode_group_box') self.custom_mode_layout = QtWidgets.QFormLayout(self.custom_mode_group_box) @@ -53,7 +53,7 @@ class CustomTab(SettingsTab): self.display_footer_check_box.stateChanged.connect(self.on_display_footer_check_box_changed) self.add_from_service_checkbox.stateChanged.connect(self.on_add_from_service_check_box_changed) - def retranslateUi(self): + def retranslate_ui(self): self.custom_mode_group_box.setTitle(translate('CustomPlugin.CustomTab', 'Custom Display')) self.display_footer_check_box.setText(translate('CustomPlugin.CustomTab', 'Display footer')) self.add_from_service_checkbox.setText(translate('CustomPlugin.CustomTab', diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index 77441d2a4..9f46e62cd 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -102,7 +102,7 @@ class CustomMediaItem(MediaManagerItem): self.add_custom_from_service = Settings().value(self.settings_section + '/add custom from service') self.is_search_as_you_type_enabled = Settings().value('advanced/search as type') - def retranslateUi(self): + def retranslate_ui(self): """ """ diff --git a/openlp/plugins/images/forms/__init__.py b/openlp/plugins/images/forms/__init__.py index f7a6b947b..afff288ea 100644 --- a/openlp/plugins/images/forms/__init__.py +++ b/openlp/plugins/images/forms/__init__.py @@ -35,7 +35,7 @@ mentioned above, like so:: def __init__(self, parent=None): super(AuthorsForm, self).__init__(parent) - self.setupUi(self) + self.setup_ui(self) This allows OpenLP to use ``self.object`` for all the GUI elements while keeping them separate from the functionality, so that it is easier to recreate the GUI from the .ui files later if necessary. diff --git a/openlp/plugins/images/forms/addgroupdialog.py b/openlp/plugins/images/forms/addgroupdialog.py index bd11df702..f3e6d5fe9 100644 --- a/openlp/plugins/images/forms/addgroupdialog.py +++ b/openlp/plugins/images/forms/addgroupdialog.py @@ -27,7 +27,7 @@ from openlp.core.lib.ui import create_button_box class Ui_AddGroupDialog(object): - def setupUi(self, add_group_dialog): + def setup_ui(self, add_group_dialog): add_group_dialog.setObjectName('add_group_dialog') add_group_dialog.resize(300, 10) self.dialog_layout = QtWidgets.QVBoxLayout(add_group_dialog) @@ -48,10 +48,10 @@ class Ui_AddGroupDialog(object): self.dialog_layout.addLayout(self.name_layout) self.button_box = create_button_box(add_group_dialog, 'button_box', ['cancel', 'save']) self.dialog_layout.addWidget(self.button_box) - self.retranslateUi(add_group_dialog) + self.retranslate_ui(add_group_dialog) add_group_dialog.setMaximumHeight(add_group_dialog.sizeHint().height()) - def retranslateUi(self, add_group_dialog): + def retranslate_ui(self, add_group_dialog): add_group_dialog.setWindowTitle(translate('ImagePlugin.AddGroupForm', 'Add group')) self.parent_group_label.setText(translate('ImagePlugin.AddGroupForm', 'Parent group:')) self.name_label.setText(translate('ImagePlugin.AddGroupForm', 'Group name:')) diff --git a/openlp/plugins/images/forms/addgroupform.py b/openlp/plugins/images/forms/addgroupform.py index bcfa1ad21..b1ae51bc4 100644 --- a/openlp/plugins/images/forms/addgroupform.py +++ b/openlp/plugins/images/forms/addgroupform.py @@ -37,7 +37,7 @@ class AddGroupForm(QtWidgets.QDialog, Ui_AddGroupDialog): """ super(AddGroupForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) - self.setupUi(self) + self.setup_ui(self) def exec(self, clear=True, show_top_level_group=False, selected_group=None): """ diff --git a/openlp/plugins/images/forms/choosegroupdialog.py b/openlp/plugins/images/forms/choosegroupdialog.py index 49e3f5f5b..0187c9c07 100644 --- a/openlp/plugins/images/forms/choosegroupdialog.py +++ b/openlp/plugins/images/forms/choosegroupdialog.py @@ -30,7 +30,7 @@ class Ui_ChooseGroupDialog(object): """ The UI for the "Choose Image Group" form. """ - def setupUi(self, choose_group_dialog): + def setup_ui(self, choose_group_dialog): """ Set up the UI. @@ -69,10 +69,10 @@ class Ui_ChooseGroupDialog(object): self.group_button_box = create_button_box(choose_group_dialog, 'buttonBox', ['ok']) self.choose_group_layout.setWidget(5, QtWidgets.QFormLayout.FieldRole, self.group_button_box) - self.retranslateUi(choose_group_dialog) + self.retranslate_ui(choose_group_dialog) QtCore.QMetaObject.connectSlotsByName(choose_group_dialog) - def retranslateUi(self, choose_group_dialog): + def retranslate_ui(self, choose_group_dialog): """ Translate the UI on the fly. diff --git a/openlp/plugins/images/forms/choosegroupform.py b/openlp/plugins/images/forms/choosegroupform.py index 2f61bf6db..eb81ebd42 100644 --- a/openlp/plugins/images/forms/choosegroupform.py +++ b/openlp/plugins/images/forms/choosegroupform.py @@ -35,7 +35,7 @@ class ChooseGroupForm(QtWidgets.QDialog, Ui_ChooseGroupDialog): """ super(ChooseGroupForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) - self.setupUi(self) + self.setup_ui(self) def exec(self, selected_group=None): """ diff --git a/openlp/plugins/images/lib/imagetab.py b/openlp/plugins/images/lib/imagetab.py index a3845dba3..bb8f07bf8 100644 --- a/openlp/plugins/images/lib/imagetab.py +++ b/openlp/plugins/images/lib/imagetab.py @@ -32,9 +32,9 @@ class ImageTab(SettingsTab): """ ImageTab is the images settings tab in the settings dialog. """ - def setupUi(self): + def setup_ui(self): self.setObjectName('ImagesTab') - super(ImageTab, self).setupUi() + super(ImageTab, self).setup_ui() self.background_color_group_box = QtWidgets.QGroupBox(self.left_column) self.background_color_group_box.setObjectName('background_color_group_box') self.form_layout = QtWidgets.QFormLayout(self.background_color_group_box) @@ -58,7 +58,7 @@ class ImageTab(SettingsTab): # Signals and slots self.background_color_button.colorChanged.connect(self.on_background_color_changed) - def retranslateUi(self): + def retranslate_ui(self): self.background_color_group_box.setTitle(UiStrings().BackgroundColor) self.background_color_label.setText(UiStrings().BackgroundColorColon) self.information_label.setText( diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 8d7701696..3c064a8ca 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -76,7 +76,7 @@ class ImageMediaItem(MediaManagerItem): # Allow DnD from the desktop. self.list_view.activateDnD() - def retranslateUi(self): + def retranslate_ui(self): self.on_new_prompt = translate('ImagePlugin.MediaItem', 'Select Image(s)') file_formats = get_images_filter() self.on_new_file_masks = '{formats};;{files} (*)'.format(formats=file_formats, files=UiStrings().AllFiles) diff --git a/openlp/plugins/media/forms/mediaclipselectordialog.py b/openlp/plugins/media/forms/mediaclipselectordialog.py index 3c32df553..b6732daeb 100644 --- a/openlp/plugins/media/forms/mediaclipselectordialog.py +++ b/openlp/plugins/media/forms/mediaclipselectordialog.py @@ -28,7 +28,7 @@ from openlp.core.ui.icons import UiIcons class Ui_MediaClipSelector(object): - def setupUi(self, media_clip_selector): + def setup_ui(self, media_clip_selector): media_clip_selector.setObjectName('media_clip_selector') media_clip_selector.resize(554, 654) self.combobox_size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, @@ -161,7 +161,7 @@ class Ui_MediaClipSelector(object): self.save_button = self.button_box.button(QtWidgets.QDialogButtonBox.Save) self.main_layout.addWidget(self.button_box) - self.retranslateUi(media_clip_selector) + self.retranslate_ui(media_clip_selector) self.button_box.accepted.connect(media_clip_selector.accept) self.button_box.rejected.connect(media_clip_selector.reject) QtCore.QMetaObject.connectSlotsByName(media_clip_selector) @@ -181,7 +181,7 @@ class Ui_MediaClipSelector(object): media_clip_selector.setTabOrder(self.jump_end_button, self.save_button) media_clip_selector.setTabOrder(self.save_button, self.close_button) - def retranslateUi(self, media_clip_selector): + def retranslate_ui(self, media_clip_selector): media_clip_selector.setWindowTitle(translate('MediaPlugin.MediaClipSelector', 'Select Media Clip')) self.source_groupbox.setTitle(translate('MediaPlugin.MediaClipSelector', 'Source')) self.media_path_label.setText(translate('MediaPlugin.MediaClipSelector', 'Media path:')) diff --git a/openlp/plugins/media/forms/mediaclipselectorform.py b/openlp/plugins/media/forms/mediaclipselectorform.py index cee38e3ee..b2a2a5afd 100644 --- a/openlp/plugins/media/forms/mediaclipselectorform.py +++ b/openlp/plugins/media/forms/mediaclipselectorform.py @@ -65,7 +65,7 @@ class MediaClipSelectorForm(QtWidgets.QDialog, Ui_MediaClipSelector, RegistryPro self.audio_cd = False self.playback_length = 0 self.media_item = media_item - self.setupUi(self) + self.setup_ui(self) # setup play/pause icon self.play_icon = UiIcons().play self.pause_icon = UiIcons().pause diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index c77b42288..e1eb0b026 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -86,7 +86,7 @@ class MediaMediaItem(MediaManagerItem, RegistryProperties): # Allow DnD from the desktop self.list_view.activateDnD() - def retranslateUi(self): + def retranslate_ui(self): """ This method is called automatically to provide OpenLP with the opportunity to translate the ``MediaManagerItem`` to another language. diff --git a/openlp/plugins/media/lib/mediatab.py b/openlp/plugins/media/lib/mediatab.py index 297a9e723..4e1048478 100644 --- a/openlp/plugins/media/lib/mediatab.py +++ b/openlp/plugins/media/lib/mediatab.py @@ -35,9 +35,9 @@ class MediaTab(SettingsTab): self.parent = parent super(MediaTab, self).__init__(parent, title, visible_title, icon_path) - def setupUi(self): + def setup_ui(self): self.setObjectName('MediaTab') - super(MediaTab, self).setupUi() + super(MediaTab, self).setup_ui() self.advanced_group_box = QtWidgets.QGroupBox(self.left_column) self.advanced_group_box.setObjectName('advanced_group_box') self.advanced_layout = QtWidgets.QVBoxLayout(self.advanced_group_box) @@ -52,7 +52,7 @@ class MediaTab(SettingsTab): self.left_layout.addStretch() self.right_layout.addStretch() - def retranslateUi(self): + def retranslate_ui(self): self.advanced_group_box.setTitle(UiStrings().Advanced) self.override_player_check_box.setText(translate('MediaPlugin.MediaTab', 'Allow media player to be overridden')) self.auto_start_check_box.setText(translate('MediaPlugin.MediaTab', 'Start new Live media automatically')) diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 468bd75f9..d0c4d46b3 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -56,7 +56,7 @@ class PresentationMediaItem(MediaManagerItem): self.controllers = controllers super(PresentationMediaItem, self).__init__(parent, plugin) - def retranslateUi(self): + def retranslate_ui(self): """ The name of the plugin media displayed in UI """ diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index e1437b875..7bc30f13b 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -42,12 +42,12 @@ class PresentationTab(SettingsTab): super(PresentationTab, self).__init__(parent, title, visible_title, icon_path) self.activated = False - def setupUi(self): + def setup_ui(self): """ Create the controls for the settings tab """ self.setObjectName('PresentationTab') - super(PresentationTab, self).setupUi() + super(PresentationTab, self).setup_ui() self.controllers_group_box = QtWidgets.QGroupBox(self.left_column) self.controllers_group_box.setObjectName('controllers_group_box') self.controllers_layout = QtWidgets.QVBoxLayout(self.controllers_group_box) @@ -99,7 +99,7 @@ class PresentationTab(SettingsTab): self.program_path_edit.pathChanged.connect(self.on_program_path_edit_path_changed) self.pdf_program_check_box.clicked.connect(self.program_path_edit.setEnabled) - def retranslateUi(self): + def retranslate_ui(self): """ Make any translation changes """ diff --git a/openlp/plugins/songs/forms/__init__.py b/openlp/plugins/songs/forms/__init__.py index b95871295..c5b10afa3 100644 --- a/openlp/plugins/songs/forms/__init__.py +++ b/openlp/plugins/songs/forms/__init__.py @@ -39,7 +39,7 @@ mentioned above, like so:: def __init__(self, parent=None): super(AuthorsForm, self).__init__(parent) - self.setupUi(self) + self.setup_ui(self) This allows OpenLP to use ``self.object`` for all the GUI elements while keeping them separate from the functionality, so that it is easier to recreate the GUI diff --git a/openlp/plugins/songs/forms/authorsdialog.py b/openlp/plugins/songs/forms/authorsdialog.py index 7a83b463f..9c7845391 100644 --- a/openlp/plugins/songs/forms/authorsdialog.py +++ b/openlp/plugins/songs/forms/authorsdialog.py @@ -32,7 +32,7 @@ class Ui_AuthorsDialog(object): The :class:`~openlp.plugins.songs.forms.authorsdialog.Ui_AuthorsDialog` class defines the user interface for the AuthorsForm dialog. """ - def setupUi(self, authors_dialog): + def setup_ui(self, authors_dialog): """ Set up the UI for the dialog. """ @@ -65,10 +65,10 @@ class Ui_AuthorsDialog(object): self.dialog_layout.addLayout(self.author_layout) self.button_box = create_button_box(authors_dialog, 'button_box', ['cancel', 'save']) self.dialog_layout.addWidget(self.button_box) - self.retranslateUi(authors_dialog) + self.retranslate_ui(authors_dialog) authors_dialog.setMaximumHeight(authors_dialog.sizeHint().height()) - def retranslateUi(self, authors_dialog): + def retranslate_ui(self, authors_dialog): """ Translate the UI on the fly. """ diff --git a/openlp/plugins/songs/forms/authorsform.py b/openlp/plugins/songs/forms/authorsform.py index 9ef42131d..609467aa2 100644 --- a/openlp/plugins/songs/forms/authorsform.py +++ b/openlp/plugins/songs/forms/authorsform.py @@ -37,7 +37,7 @@ class AuthorsForm(QtWidgets.QDialog, Ui_AuthorsDialog): """ super(AuthorsForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) - self.setupUi(self) + self.setup_ui(self) self.auto_display_name = False self.first_name_edit.textEdited.connect(self.on_first_name_edited) self.last_name_edit.textEdited.connect(self.on_last_name_edited) diff --git a/openlp/plugins/songs/forms/duplicatesongremovalform.py b/openlp/plugins/songs/forms/duplicatesongremovalform.py index 548d16c78..7ed37ad2d 100644 --- a/openlp/plugins/songs/forms/duplicatesongremovalform.py +++ b/openlp/plugins/songs/forms/duplicatesongremovalform.py @@ -129,7 +129,7 @@ class DuplicateSongRemovalForm(OpenLPWizard, RegistryProperties): self.dummy_page = QtWidgets.QWizardPage() self.dummy_page_id = self.addPage(self.dummy_page) - def retranslateUi(self): + def retranslate_ui(self): """ Song wizard localisation. """ diff --git a/openlp/plugins/songs/forms/editsongdialog.py b/openlp/plugins/songs/forms/editsongdialog.py index 026b79ea5..5eb83bce4 100644 --- a/openlp/plugins/songs/forms/editsongdialog.py +++ b/openlp/plugins/songs/forms/editsongdialog.py @@ -34,7 +34,7 @@ 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): + def setup_ui(self, edit_song_dialog): edit_song_dialog.setObjectName('edit_song_dialog') edit_song_dialog.setWindowIcon(UiIcons().main_icon) edit_song_dialog.resize(900, 600) @@ -293,9 +293,9 @@ class Ui_EditSongDialog(object): 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) + self.retranslate_ui(edit_song_dialog) - def retranslateUi(self, edit_song_dialog): + def retranslate_ui(self, edit_song_dialog): """ Translate the UI on the fly. """ diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 06ca0d893..6e25fd032 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -64,7 +64,7 @@ class EditSongForm(QtWidgets.QDialog, Ui_EditSongDialog, RegistryProperties): self.song = None # can this be automated? self.width = 400 - self.setupUi(self) + self.setup_ui(self) # Connecting signals and slots self.author_add_button.clicked.connect(self.on_author_add_button_clicked) self.author_edit_button.clicked.connect(self.on_author_edit_button_clicked) diff --git a/openlp/plugins/songs/forms/editversedialog.py b/openlp/plugins/songs/forms/editversedialog.py index 310bcad7d..cc279ea6d 100644 --- a/openlp/plugins/songs/forms/editversedialog.py +++ b/openlp/plugins/songs/forms/editversedialog.py @@ -31,7 +31,7 @@ from openlp.plugins.songs.lib import VerseType class Ui_EditVerseDialog(object): - def setupUi(self, edit_verse_dialog): + def setup_ui(self, edit_verse_dialog): edit_verse_dialog.setObjectName('edit_verse_dialog') edit_verse_dialog.setWindowIcon(UiIcons().main_icon) edit_verse_dialog.resize(400, 400) @@ -86,9 +86,9 @@ class Ui_EditVerseDialog(object): self.dialog_layout.addLayout(self.transpose_layout) self.button_box = create_button_box(edit_verse_dialog, 'button_box', ['cancel', 'ok']) self.dialog_layout.addWidget(self.button_box) - self.retranslateUi(edit_verse_dialog) + self.retranslate_ui(edit_verse_dialog) - def retranslateUi(self, edit_verse_dialog): + def retranslate_ui(self, edit_verse_dialog): edit_verse_dialog.setWindowTitle(translate('SongsPlugin.EditVerseForm', 'Edit Verse')) self.verse_type_label.setText(translate('SongsPlugin.EditVerseForm', '&Verse type:')) self.verse_type_combo_box.setItemText(VerseType.Verse, VerseType.translated_names[VerseType.Verse]) diff --git a/openlp/plugins/songs/forms/editverseform.py b/openlp/plugins/songs/forms/editverseform.py index 436c5039f..dcf9d7d63 100644 --- a/openlp/plugins/songs/forms/editverseform.py +++ b/openlp/plugins/songs/forms/editverseform.py @@ -46,7 +46,7 @@ class EditVerseForm(QtWidgets.QDialog, Ui_EditVerseDialog): """ super(EditVerseForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) - self.setupUi(self) + self.setup_ui(self) self.has_single_verse = False self.insert_button.clicked.connect(self.on_insert_button_clicked) self.overflow_split_button.clicked.connect(self.on_overflow_split_button_clicked) diff --git a/openlp/plugins/songs/forms/mediafilesdialog.py b/openlp/plugins/songs/forms/mediafilesdialog.py index 4a7bffa8c..4f6c5fdfc 100644 --- a/openlp/plugins/songs/forms/mediafilesdialog.py +++ b/openlp/plugins/songs/forms/mediafilesdialog.py @@ -31,7 +31,7 @@ class Ui_MediaFilesDialog(object): """ The user interface for the media files dialog. """ - def setupUi(self, media_files_dialog): + def setup_ui(self, media_files_dialog): """ Set up the user interface. """ @@ -55,9 +55,9 @@ class Ui_MediaFilesDialog(object): self.files_vertical_layout.addWidget(self.file_list_widget) self.button_box = create_button_box(media_files_dialog, 'button_box', ['cancel', 'ok']) self.files_vertical_layout.addWidget(self.button_box) - self.retranslateUi(media_files_dialog) + self.retranslate_ui(media_files_dialog) - def retranslateUi(self, media_files_dialog): + def retranslate_ui(self, media_files_dialog): """ Translate the UI on the fly. diff --git a/openlp/plugins/songs/forms/mediafilesform.py b/openlp/plugins/songs/forms/mediafilesform.py index 29a0603cf..e6644f4db 100644 --- a/openlp/plugins/songs/forms/mediafilesform.py +++ b/openlp/plugins/songs/forms/mediafilesform.py @@ -38,7 +38,7 @@ class MediaFilesForm(QtWidgets.QDialog, Ui_MediaFilesDialog): def __init__(self, parent): super(MediaFilesForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) - self.setupUi(self) + self.setup_ui(self) def populate_files(self, file_paths): """ diff --git a/openlp/plugins/songs/forms/songbookdialog.py b/openlp/plugins/songs/forms/songbookdialog.py index 00404aa71..d0958b372 100644 --- a/openlp/plugins/songs/forms/songbookdialog.py +++ b/openlp/plugins/songs/forms/songbookdialog.py @@ -31,7 +31,7 @@ class Ui_SongBookDialog(object): """ The user interface for the Songbook dialog. """ - def setupUi(self, song_book_dialog): + def setup_ui(self, song_book_dialog): """ Set up the user interface. """ @@ -57,10 +57,10 @@ class Ui_SongBookDialog(object): self.dialog_layout.addLayout(self.book_layout) self.button_box = create_button_box(song_book_dialog, 'button_box', ['cancel', 'save']) self.dialog_layout.addWidget(self.button_box) - self.retranslateUi(song_book_dialog) + self.retranslate_ui(song_book_dialog) song_book_dialog.setMaximumHeight(song_book_dialog.sizeHint().height()) - def retranslateUi(self, song_book_dialog): + def retranslate_ui(self, song_book_dialog): """ Translate the UI on the fly. """ diff --git a/openlp/plugins/songs/forms/songbookform.py b/openlp/plugins/songs/forms/songbookform.py index 1976d866d..64138cac3 100644 --- a/openlp/plugins/songs/forms/songbookform.py +++ b/openlp/plugins/songs/forms/songbookform.py @@ -40,7 +40,7 @@ class SongBookForm(QtWidgets.QDialog, Ui_SongBookDialog): """ super(SongBookForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) - self.setupUi(self) + self.setup_ui(self) def exec(self, clear=True): """ diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index f67eae94b..ee948b7ee 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -66,11 +66,11 @@ class SongExportForm(OpenLPWizard): log.debug('Stopping songs export') self.stop_export_flag = True - def setupUi(self, image): + def setup_ui(self, image): """ Set up the song wizard UI. """ - super(SongExportForm, self).setupUi(image) + super(SongExportForm, self).setup_ui(image) def custom_signals(self): """ @@ -135,7 +135,7 @@ class SongExportForm(OpenLPWizard): self.export_song_layout.addLayout(self.grid_layout) self.addPage(self.export_song_page) - def retranslateUi(self): + def retranslate_ui(self): """ Song wizard localisation. """ diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 6941cbea2..a235996ab 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -57,12 +57,12 @@ class SongImportForm(OpenLPWizard, RegistryProperties): super(SongImportForm, self).__init__(parent, plugin, 'songImportWizard', ':/wizards/wizard_song.bmp') self.clipboard = self.main_window.clipboard - def setupUi(self, image): + def setup_ui(self, image): """ Set up the song wizard UI. """ self.format_widgets = dict([(song_format, {}) for song_format in SongFormat.get_format_list()]) - super(SongImportForm, self).setupUi(image) + super(SongImportForm, self).setup_ui(image) self.current_format = SongFormat.OpenLyrics self.format_stack.setCurrentIndex(self.current_format) self.format_combo_box.currentIndexChanged.connect(self.on_current_index_changed) @@ -127,7 +127,7 @@ class SongImportForm(OpenLPWizard, RegistryProperties): self.source_layout.addLayout(self.format_stack) self.addPage(self.source_page) - def retranslateUi(self): + def retranslate_ui(self): """ Song wizard localisation. """ diff --git a/openlp/plugins/songs/forms/songmaintenancedialog.py b/openlp/plugins/songs/forms/songmaintenancedialog.py index a27cbdc2f..c6909580a 100644 --- a/openlp/plugins/songs/forms/songmaintenancedialog.py +++ b/openlp/plugins/songs/forms/songmaintenancedialog.py @@ -32,7 +32,7 @@ class Ui_SongMaintenanceDialog(object): """ The user interface for the song maintenance dialog """ - def setupUi(self, song_maintenance_dialog): + def setup_ui(self, song_maintenance_dialog): """ Set up the user interface for the song maintenance dialog """ @@ -134,11 +134,11 @@ class Ui_SongMaintenanceDialog(object): self.dialog_layout.addLayout(self.stacked_layout, 0, 1) self.button_box = create_button_box(song_maintenance_dialog, 'button_box', ['close']) self.dialog_layout.addWidget(self.button_box, 1, 0, 1, 2) - self.retranslateUi(song_maintenance_dialog) + self.retranslate_ui(song_maintenance_dialog) self.stacked_layout.setCurrentIndex(0) self.type_list_widget.currentRowChanged.connect(self.stacked_layout.setCurrentIndex) - def retranslateUi(self, song_maintenance_dialog): + def retranslate_ui(self, song_maintenance_dialog): """ Translate the UI on the fly. """ diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index 4bdb12a57..69e22353d 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -47,7 +47,7 @@ class SongMaintenanceForm(QtWidgets.QDialog, Ui_SongMaintenanceDialog, RegistryP """ super(SongMaintenanceForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) - self.setupUi(self) + self.setup_ui(self) self.manager = manager self.author_form = AuthorsForm(self) self.topic_form = TopicsForm(self) diff --git a/openlp/plugins/songs/forms/songreviewwidget.py b/openlp/plugins/songs/forms/songreviewwidget.py index 904ac0307..f64ced274 100644 --- a/openlp/plugins/songs/forms/songreviewwidget.py +++ b/openlp/plugins/songs/forms/songreviewwidget.py @@ -56,11 +56,11 @@ class SongReviewWidget(QtWidgets.QWidget): """ super(SongReviewWidget, self).__init__(parent) self.song = song - self.setupUi() - self.retranslateUi() + self.setup_ui() + self.retranslate_ui() self.song_remove_button.clicked.connect(self.on_remove_button_clicked) - def setupUi(self): + def setup_ui(self): self.song_vertical_layout = QtWidgets.QVBoxLayout(self) self.song_vertical_layout.setObjectName('song_vertical_layout') self.song_group_box = QtWidgets.QGroupBox(self) @@ -186,7 +186,7 @@ class SongReviewWidget(QtWidgets.QWidget): self.song_remove_button.setSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) self.song_vertical_layout.addWidget(self.song_remove_button, alignment=QtCore.Qt.AlignHCenter) - def retranslateUi(self): + def retranslate_ui(self): self.song_remove_button.setText('Remove') self.song_title_label.setText('Title:') self.song_alternate_title_label.setText('Alternate Title:') diff --git a/openlp/plugins/songs/forms/topicsdialog.py b/openlp/plugins/songs/forms/topicsdialog.py index 889f80b36..4a029fafb 100644 --- a/openlp/plugins/songs/forms/topicsdialog.py +++ b/openlp/plugins/songs/forms/topicsdialog.py @@ -31,7 +31,7 @@ class Ui_TopicsDialog(object): """ The user interface for the topics dialog. """ - def setupUi(self, topics_dialog): + def setup_ui(self, topics_dialog): """ Set up the user interface for the topics dialog. """ @@ -51,10 +51,10 @@ class Ui_TopicsDialog(object): self.dialog_layout.addLayout(self.name_layout) self.button_box = create_button_box(topics_dialog, 'button_box', ['cancel', 'save']) self.dialog_layout.addWidget(self.button_box) - self.retranslateUi(topics_dialog) + self.retranslate_ui(topics_dialog) topics_dialog.setMaximumHeight(topics_dialog.sizeHint().height()) - def retranslateUi(self, topics_dialog): + def retranslate_ui(self, topics_dialog): """ Translate the UI on the fly. """ diff --git a/openlp/plugins/songs/forms/topicsform.py b/openlp/plugins/songs/forms/topicsform.py index 101a8e705..06149d44d 100644 --- a/openlp/plugins/songs/forms/topicsform.py +++ b/openlp/plugins/songs/forms/topicsform.py @@ -40,7 +40,7 @@ class TopicsForm(QtWidgets.QDialog, Ui_TopicsDialog): """ super(TopicsForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) - self.setupUi(self) + self.setup_ui(self) def exec(self, clear=True): """ diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 51f4d0407..3e5737944 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -133,7 +133,7 @@ class SongMediaItem(MediaManagerItem): self.display_written_by_text = Settings().value(self.settings_section + '/display written by') self.display_copyright_symbol = Settings().value(self.settings_section + '/display copyright symbol') - def retranslateUi(self): + def retranslate_ui(self): self.search_text_label.setText('{text}:'.format(text=UiStrings().Search)) self.search_text_button.setText(UiStrings().Search) self.maintenance_action.setText(SongStrings.SongMaintenance) diff --git a/openlp/plugins/songs/lib/songstab.py b/openlp/plugins/songs/lib/songstab.py index f28728cf2..186d63f2f 100644 --- a/openlp/plugins/songs/lib/songstab.py +++ b/openlp/plugins/songs/lib/songstab.py @@ -32,12 +32,12 @@ class SongsTab(SettingsTab): """ SongsTab is the Songs settings tab in the settings dialog. """ - def setupUi(self): + def setup_ui(self): """ Set up the configuration tab UI. """ self.setObjectName('SongsTab') - super(SongsTab, self).setupUi() + super(SongsTab, self).setup_ui() self.mode_group_box = QtWidgets.QGroupBox(self.left_column) self.mode_group_box.setObjectName('mode_group_box') self.mode_layout = QtWidgets.QVBoxLayout(self.mode_group_box) @@ -108,7 +108,7 @@ class SongsTab(SettingsTab): self.german_notation_radio_button.clicked.connect(self.on_german_notation_button_clicked) self.neolatin_notation_radio_button.clicked.connect(self.on_neolatin_notation_button_clicked) - def retranslateUi(self): + def retranslate_ui(self): self.mode_group_box.setTitle(translate('SongsPlugin.SongsTab', 'Song related settings')) self.tool_bar_active_check_box.setText(translate('SongsPlugin.SongsTab', 'Enable "Go to verse" button in Live panel')) diff --git a/openlp/plugins/songusage/forms/songusagedeletedialog.py b/openlp/plugins/songusage/forms/songusagedeletedialog.py index 82196bf48..581c85b73 100644 --- a/openlp/plugins/songusage/forms/songusagedeletedialog.py +++ b/openlp/plugins/songusage/forms/songusagedeletedialog.py @@ -31,7 +31,7 @@ class Ui_SongUsageDeleteDialog(object): """ The Song Usage delete dialog """ - def setupUi(self, song_usage_delete_dialog): + def setup_ui(self, song_usage_delete_dialog): """ Setup the UI @@ -55,9 +55,9 @@ class Ui_SongUsageDeleteDialog(object): self.vertical_layout.addWidget(self.delete_calendar) self.button_box = create_button_box(song_usage_delete_dialog, 'button_box', ['cancel', 'ok']) self.vertical_layout.addWidget(self.button_box) - self.retranslateUi(song_usage_delete_dialog) + self.retranslate_ui(song_usage_delete_dialog) - def retranslateUi(self, song_usage_delete_dialog): + def retranslate_ui(self, song_usage_delete_dialog): """ Retranslate the strings :param song_usage_delete_dialog: diff --git a/openlp/plugins/songusage/forms/songusagedeleteform.py b/openlp/plugins/songusage/forms/songusagedeleteform.py index 23a994ff5..f3e25c0f7 100644 --- a/openlp/plugins/songusage/forms/songusagedeleteform.py +++ b/openlp/plugins/songusage/forms/songusagedeleteform.py @@ -39,7 +39,7 @@ class SongUsageDeleteForm(QtWidgets.QDialog, Ui_SongUsageDeleteDialog, RegistryP self.manager = manager super(SongUsageDeleteForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) - self.setupUi(self) + self.setup_ui(self) self.button_box.clicked.connect(self.on_button_box_clicked) def on_button_box_clicked(self, button): diff --git a/openlp/plugins/songusage/forms/songusagedetaildialog.py b/openlp/plugins/songusage/forms/songusagedetaildialog.py index 5e9e57872..d7da6e450 100644 --- a/openlp/plugins/songusage/forms/songusagedetaildialog.py +++ b/openlp/plugins/songusage/forms/songusagedetaildialog.py @@ -32,7 +32,7 @@ class Ui_SongUsageDetailDialog(object): """ The Song Usage report details """ - def setupUi(self, song_usage_detail_dialog): + def setup_ui(self, song_usage_detail_dialog): """ Set up the UI @@ -74,10 +74,10 @@ class Ui_SongUsageDetailDialog(object): self.vertical_layout.addWidget(self.file_group_box) self.button_box = create_button_box(song_usage_detail_dialog, 'button_box', ['cancel', 'ok']) self.vertical_layout.addWidget(self.button_box) - self.retranslateUi(song_usage_detail_dialog) + self.retranslate_ui(song_usage_detail_dialog) self.report_path_edit.pathChanged.connect(song_usage_detail_dialog.on_report_path_edit_path_changed) - def retranslateUi(self, song_usage_detail_dialog): + def retranslate_ui(self, song_usage_detail_dialog): """ Retranslate the UI diff --git a/openlp/plugins/songusage/forms/songusagedetailform.py b/openlp/plugins/songusage/forms/songusagedetailform.py index f25f56bee..78e2fdf37 100644 --- a/openlp/plugins/songusage/forms/songusagedetailform.py +++ b/openlp/plugins/songusage/forms/songusagedetailform.py @@ -48,7 +48,7 @@ class SongUsageDetailForm(QtWidgets.QDialog, Ui_SongUsageDetailDialog, RegistryP super(SongUsageDetailForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint | QtCore.Qt.WindowCloseButtonHint) self.plugin = plugin - self.setupUi(self) + self.setup_ui(self) def initialise(self): """