diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index d00d85b54..284724552 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -129,16 +129,16 @@ def build_icon(icon): location like ``/path/to/file.png``. However, the **recommended** way is to specify a resource string. :return: The build icon. """ - button_icon = QtGui.QIcon() if isinstance(icon, QtGui.QIcon): - button_icon = icon - elif isinstance(icon, str): - if icon.startswith(':/'): - button_icon.addPixmap(QtGui.QPixmap(icon), QtGui.QIcon.Normal, QtGui.QIcon.Off) - else: - button_icon.addPixmap(QtGui.QPixmap.fromImage(QtGui.QImage(icon)), QtGui.QIcon.Normal, QtGui.QIcon.Off) + return icon + pix_map = None + button_icon = QtGui.QIcon() + if isinstance(icon, str): + pix_map = QtGui.QPixmap(icon) elif isinstance(icon, QtGui.QImage): - button_icon.addPixmap(QtGui.QPixmap.fromImage(icon), QtGui.QIcon.Normal, QtGui.QIcon.Off) + pix_map = QtGui.QPixmap.fromImage(icon) + if pix_map: + button_icon.addPixmap(pix_map, QtGui.QIcon.Normal, QtGui.QIcon.Off) return button_icon diff --git a/openlp/core/ui/exceptiondialog.py b/openlp/core/ui/exceptiondialog.py index f01cf5b26..36e039cee 100644 --- a/openlp/core/ui/exceptiondialog.py +++ b/openlp/core/ui/exceptiondialog.py @@ -38,7 +38,7 @@ class Ui_ExceptionDialog(object): Set up the UI. """ exception_dialog.setObjectName('exception_dialog') - exception_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + exception_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) self.exception_layout = QtWidgets.QVBoxLayout(exception_dialog) self.exception_layout.setObjectName('exception_layout') self.message_layout = QtWidgets.QHBoxLayout() diff --git a/openlp/core/ui/filerenamedialog.py b/openlp/core/ui/filerenamedialog.py index ede60bcfb..cc4574279 100644 --- a/openlp/core/ui/filerenamedialog.py +++ b/openlp/core/ui/filerenamedialog.py @@ -37,7 +37,7 @@ class Ui_FileRenameDialog(object): Set up the UI """ file_rename_dialog.setObjectName('file_rename_dialog') - file_rename_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + file_rename_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) file_rename_dialog.resize(300, 10) self.dialog_layout = QtWidgets.QGridLayout(file_rename_dialog) self.dialog_layout.setObjectName('dialog_layout') diff --git a/openlp/core/ui/firsttimelanguagedialog.py b/openlp/core/ui/firsttimelanguagedialog.py index dd1389ba2..f32ec9076 100644 --- a/openlp/core/ui/firsttimelanguagedialog.py +++ b/openlp/core/ui/firsttimelanguagedialog.py @@ -38,7 +38,7 @@ class Ui_FirstTimeLanguageDialog(object): Set up the UI. """ language_dialog.setObjectName('language_dialog') - language_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + language_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) language_dialog.resize(300, 50) self.dialog_layout = QtWidgets.QVBoxLayout(language_dialog) self.dialog_layout.setContentsMargins(8, 8, 8, 8) diff --git a/openlp/core/ui/firsttimewizard.py b/openlp/core/ui/firsttimewizard.py index 7b93c1680..63937ebb2 100644 --- a/openlp/core/ui/firsttimewizard.py +++ b/openlp/core/ui/firsttimewizard.py @@ -55,7 +55,7 @@ class UiFirstTimeWizard(object): :param first_time_wizard: The wizard form """ first_time_wizard.setObjectName('first_time_wizard') - first_time_wizard.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + first_time_wizard.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) first_time_wizard.resize(550, 386) first_time_wizard.setModal(True) first_time_wizard.setOptions(QtWidgets.QWizard.IndependentPages | QtWidgets.QWizard.NoBackButtonOnStartPage | diff --git a/openlp/core/ui/formattingtagdialog.py b/openlp/core/ui/formattingtagdialog.py index 19412921d..83ec18115 100644 --- a/openlp/core/ui/formattingtagdialog.py +++ b/openlp/core/ui/formattingtagdialog.py @@ -38,7 +38,7 @@ class Ui_FormattingTagDialog(object): Set up the UI """ formatting_tag_dialog.setObjectName('formatting_tag_dialog') - formatting_tag_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + formatting_tag_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) formatting_tag_dialog.resize(725, 548) self.list_data_grid_layout = QtWidgets.QVBoxLayout(formatting_tag_dialog) self.list_data_grid_layout.setContentsMargins(8, 8, 8, 8) diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index 463aad73f..629e55e0f 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -44,7 +44,7 @@ class GeneralTab(SettingsTab): self.logo_file = ':/graphics/openlp-splash-screen.png' self.logo_background_color = '#ffffff' self.screens = ScreenList() - self.icon_path = ':/icon/openlp-logo-16x16.png' + self.icon_path = ':/icon/openlp-logo.svg' general_translated = translate('OpenLP.GeneralTab', 'General') super(GeneralTab, self).__init__(parent, 'Core', general_translated) diff --git a/openlp/core/ui/plugindialog.py b/openlp/core/ui/plugindialog.py index ad461cd44..cd41d77a8 100644 --- a/openlp/core/ui/plugindialog.py +++ b/openlp/core/ui/plugindialog.py @@ -38,7 +38,7 @@ class Ui_PluginViewDialog(object): Set up the UI """ plugin_view_dialog.setObjectName('plugin_view_dialog') - plugin_view_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + plugin_view_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) plugin_view_dialog.setWindowModality(QtCore.Qt.ApplicationModal) self.plugin_layout = QtWidgets.QVBoxLayout(plugin_view_dialog) self.plugin_layout.setObjectName('plugin_layout') diff --git a/openlp/core/ui/printservicedialog.py b/openlp/core/ui/printservicedialog.py index c658d1496..f82bfecd4 100644 --- a/openlp/core/ui/printservicedialog.py +++ b/openlp/core/ui/printservicedialog.py @@ -50,7 +50,7 @@ class Ui_PrintServiceDialog(object): Set up the UI """ print_service_dialog.setObjectName('print_service_dialog') - print_service_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + print_service_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) print_service_dialog.resize(664, 594) self.main_layout = QtWidgets.QVBoxLayout(print_service_dialog) self.main_layout.setSpacing(0) diff --git a/openlp/core/ui/projector/editform.py b/openlp/core/ui/projector/editform.py index f4cf8a774..f15d5b550 100644 --- a/openlp/core/ui/projector/editform.py +++ b/openlp/core/ui/projector/editform.py @@ -47,7 +47,7 @@ class Ui_ProjectorEditForm(object): Create the interface layout. """ edit_projector_dialog.setObjectName('edit_projector_dialog') - edit_projector_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo-32x32.png')) + edit_projector_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) edit_projector_dialog.setMinimumWidth(400) edit_projector_dialog.setModal(True) # Define the basic layout diff --git a/openlp/core/ui/serviceitemeditdialog.py b/openlp/core/ui/serviceitemeditdialog.py index bbff73f3d..6dc45a847 100644 --- a/openlp/core/ui/serviceitemeditdialog.py +++ b/openlp/core/ui/serviceitemeditdialog.py @@ -38,7 +38,7 @@ class Ui_ServiceItemEditDialog(object): Set up the UI """ serviceItemEditDialog.setObjectName('serviceItemEditDialog') - serviceItemEditDialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + serviceItemEditDialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) self.dialog_layout = QtWidgets.QGridLayout(serviceItemEditDialog) self.dialog_layout.setContentsMargins(8, 8, 8, 8) self.dialog_layout.setSpacing(8) diff --git a/openlp/core/ui/settingsdialog.py b/openlp/core/ui/settingsdialog.py index 3b6c4bc00..97c4c7233 100644 --- a/openlp/core/ui/settingsdialog.py +++ b/openlp/core/ui/settingsdialog.py @@ -38,7 +38,7 @@ class Ui_SettingsDialog(object): Set up the UI """ settings_dialog.setObjectName('settings_dialog') - settings_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + settings_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) settings_dialog.resize(800, 700) self.dialog_layout = QtWidgets.QGridLayout(settings_dialog) self.dialog_layout.setObjectName('dialog_layout') diff --git a/openlp/core/ui/shortcutlistdialog.py b/openlp/core/ui/shortcutlistdialog.py index ed1156025..4de2d4861 100644 --- a/openlp/core/ui/shortcutlistdialog.py +++ b/openlp/core/ui/shortcutlistdialog.py @@ -72,7 +72,7 @@ class Ui_ShortcutListDialog(object): Set up the UI """ shortcutListDialog.setObjectName('shortcutListDialog') - shortcutListDialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + shortcutListDialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) shortcutListDialog.resize(500, 438) self.shortcut_list_layout = QtWidgets.QVBoxLayout(shortcutListDialog) self.shortcut_list_layout.setObjectName('shortcut_list_layout') diff --git a/openlp/core/ui/starttimedialog.py b/openlp/core/ui/starttimedialog.py index 42287596c..e20d625d0 100644 --- a/openlp/core/ui/starttimedialog.py +++ b/openlp/core/ui/starttimedialog.py @@ -38,7 +38,7 @@ class Ui_StartTimeDialog(object): Set up the UI """ StartTimeDialog.setObjectName('StartTimeDialog') - StartTimeDialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + StartTimeDialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) StartTimeDialog.resize(350, 10) self.dialog_layout = QtWidgets.QGridLayout(StartTimeDialog) self.dialog_layout.setObjectName('dialog_layout') diff --git a/openlp/core/ui/themelayoutdialog.py b/openlp/core/ui/themelayoutdialog.py index 5289e1cc2..119611f33 100644 --- a/openlp/core/ui/themelayoutdialog.py +++ b/openlp/core/ui/themelayoutdialog.py @@ -38,7 +38,7 @@ class Ui_ThemeLayoutDialog(object): Set up the UI """ themeLayoutDialog.setObjectName('themeLayoutDialogDialog') - themeLayoutDialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + themeLayoutDialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) self.preview_layout = QtWidgets.QVBoxLayout(themeLayoutDialog) self.preview_layout.setObjectName('preview_layout') self.preview_area = QtWidgets.QWidget(themeLayoutDialog) diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index 427e9836b..95262cf8f 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -40,7 +40,7 @@ class Ui_ThemeWizard(object): Set up the UI """ theme_wizard.setObjectName('OpenLP.ThemeWizard') - theme_wizard.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + theme_wizard.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) theme_wizard.setModal(True) theme_wizard.setOptions(QtWidgets.QWizard.IndependentPages | QtWidgets.QWizard.NoBackButtonOnStartPage | QtWidgets.QWizard.HaveCustomButton1) diff --git a/openlp/plugins/alerts/forms/alertdialog.py b/openlp/plugins/alerts/forms/alertdialog.py index 81af23ae1..83df7a09c 100644 --- a/openlp/plugins/alerts/forms/alertdialog.py +++ b/openlp/plugins/alerts/forms/alertdialog.py @@ -39,7 +39,7 @@ class Ui_AlertDialog(object): """ alert_dialog.setObjectName('alert_dialog') alert_dialog.resize(400, 300) - alert_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + alert_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) self.alert_dialog_layout = QtWidgets.QGridLayout(alert_dialog) self.alert_dialog_layout.setObjectName('alert_dialog_layout') self.alert_text_layout = QtWidgets.QFormLayout() diff --git a/openlp/plugins/bibles/forms/booknamedialog.py b/openlp/plugins/bibles/forms/booknamedialog.py index 6679dc1f3..18adde74b 100644 --- a/openlp/plugins/bibles/forms/booknamedialog.py +++ b/openlp/plugins/bibles/forms/booknamedialog.py @@ -30,7 +30,7 @@ from openlp.core.lib.ui import create_button_box class Ui_BookNameDialog(object): def setupUi(self, book_name_dialog): book_name_dialog.setObjectName('book_name_dialog') - book_name_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + book_name_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) book_name_dialog.resize(400, 271) self.book_name_layout = QtWidgets.QVBoxLayout(book_name_dialog) self.book_name_layout.setSpacing(8) diff --git a/openlp/plugins/bibles/forms/editbibledialog.py b/openlp/plugins/bibles/forms/editbibledialog.py index f1e833637..73ff81239 100644 --- a/openlp/plugins/bibles/forms/editbibledialog.py +++ b/openlp/plugins/bibles/forms/editbibledialog.py @@ -32,7 +32,7 @@ from openlp.plugins.bibles.lib.db import BiblesResourcesDB class Ui_EditBibleDialog(object): def setupUi(self, edit_bible_dialog): edit_bible_dialog.setObjectName('edit_bible_dialog') - edit_bible_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + edit_bible_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) edit_bible_dialog.resize(520, 400) edit_bible_dialog.setModal(True) self.dialog_layout = QtWidgets.QVBoxLayout(edit_bible_dialog) diff --git a/openlp/plugins/bibles/forms/languagedialog.py b/openlp/plugins/bibles/forms/languagedialog.py index ea5c291a0..554c7e35d 100644 --- a/openlp/plugins/bibles/forms/languagedialog.py +++ b/openlp/plugins/bibles/forms/languagedialog.py @@ -30,7 +30,7 @@ from openlp.core.lib.ui import create_button_box class Ui_LanguageDialog(object): def setupUi(self, language_dialog): language_dialog.setObjectName('language_dialog') - language_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + language_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) language_dialog.resize(400, 165) self.language_layout = QtWidgets.QVBoxLayout(language_dialog) self.language_layout.setSpacing(8) diff --git a/openlp/plugins/custom/forms/editcustomdialog.py b/openlp/plugins/custom/forms/editcustomdialog.py index b686e5522..d25ff337b 100644 --- a/openlp/plugins/custom/forms/editcustomdialog.py +++ b/openlp/plugins/custom/forms/editcustomdialog.py @@ -34,7 +34,7 @@ class Ui_CustomEditDialog(object): :param custom_edit_dialog: The Dialog """ custom_edit_dialog.setObjectName('custom_edit_dialog') - custom_edit_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + custom_edit_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) custom_edit_dialog.resize(450, 350) self.dialog_layout = QtWidgets.QVBoxLayout(custom_edit_dialog) self.dialog_layout.setObjectName('dialog_layout') diff --git a/openlp/plugins/custom/forms/editcustomslidedialog.py b/openlp/plugins/custom/forms/editcustomslidedialog.py index 5f46c6f28..d08679eee 100644 --- a/openlp/plugins/custom/forms/editcustomslidedialog.py +++ b/openlp/plugins/custom/forms/editcustomslidedialog.py @@ -31,7 +31,7 @@ from openlp.core.ui.lib import SpellTextEdit class Ui_CustomSlideEditDialog(object): def setupUi(self, custom_slide_edit_dialog): custom_slide_edit_dialog.setObjectName('custom_slide_edit_dialog') - custom_slide_edit_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + custom_slide_edit_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) custom_slide_edit_dialog.resize(350, 300) self.dialog_layout = QtWidgets.QVBoxLayout(custom_slide_edit_dialog) self.slide_text_edit = SpellTextEdit(self) diff --git a/openlp/plugins/songs/forms/authorsdialog.py b/openlp/plugins/songs/forms/authorsdialog.py index 666baffec..7b2995480 100644 --- a/openlp/plugins/songs/forms/authorsdialog.py +++ b/openlp/plugins/songs/forms/authorsdialog.py @@ -36,7 +36,7 @@ class Ui_AuthorsDialog(object): Set up the UI for the dialog. """ authors_dialog.setObjectName('authors_dialog') - authors_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + authors_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) authors_dialog.resize(300, 10) authors_dialog.setModal(True) self.dialog_layout = QtWidgets.QVBoxLayout(authors_dialog) diff --git a/openlp/plugins/songs/forms/editsongdialog.py b/openlp/plugins/songs/forms/editsongdialog.py index 46e37c1cd..b23fe1189 100644 --- a/openlp/plugins/songs/forms/editsongdialog.py +++ b/openlp/plugins/songs/forms/editsongdialog.py @@ -36,7 +36,7 @@ class Ui_EditSongDialog(object): """ def setupUi(self, edit_song_dialog): edit_song_dialog.setObjectName('edit_song_dialog') - edit_song_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + edit_song_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) edit_song_dialog.resize(900, 600) edit_song_dialog.setModal(True) self.dialog_layout = QtWidgets.QVBoxLayout(edit_song_dialog) diff --git a/openlp/plugins/songs/forms/editversedialog.py b/openlp/plugins/songs/forms/editversedialog.py index 6819f3ca6..13dce97fb 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): edit_verse_dialog.setObjectName('edit_verse_dialog') - edit_verse_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + edit_verse_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) edit_verse_dialog.resize(400, 400) edit_verse_dialog.setModal(True) self.dialog_layout = QtWidgets.QVBoxLayout(edit_verse_dialog) diff --git a/openlp/plugins/songs/forms/mediafilesdialog.py b/openlp/plugins/songs/forms/mediafilesdialog.py index 4309eb91f..2b9bcceab 100644 --- a/openlp/plugins/songs/forms/mediafilesdialog.py +++ b/openlp/plugins/songs/forms/mediafilesdialog.py @@ -35,7 +35,7 @@ class Ui_MediaFilesDialog(object): Set up the user interface. """ media_files_dialog.setObjectName('media_files_dialog') - media_files_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + media_files_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) media_files_dialog.setWindowModality(QtCore.Qt.ApplicationModal) media_files_dialog.resize(400, 300) media_files_dialog.setModal(True) diff --git a/openlp/plugins/songs/forms/songbookdialog.py b/openlp/plugins/songs/forms/songbookdialog.py index 7e1c04d20..10ed154b4 100644 --- a/openlp/plugins/songs/forms/songbookdialog.py +++ b/openlp/plugins/songs/forms/songbookdialog.py @@ -35,7 +35,7 @@ class Ui_SongBookDialog(object): Set up the user interface. """ song_book_dialog.setObjectName('song_book_dialog') - song_book_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + song_book_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) song_book_dialog.resize(300, 10) self.dialog_layout = QtWidgets.QVBoxLayout(song_book_dialog) self.dialog_layout.setObjectName('dialog_layout') diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index 27f317963..b0d044b2d 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -51,7 +51,7 @@ class SongExportForm(OpenLPWizard): :param parent: The QWidget-derived parent of the wizard. :param plugin: The songs plugin. """ - super(SongExportForm, self).__init__(parent, plugin, 'song_export_wizard', ':/wizards/wizard_exportsong.bmp') + super(SongExportForm, self).__init__(parent, plugin, 'song_export_wizard', ':/wizards/wizard_song.bmp') self.stop_export_flag = False Registry().register_function('openlp_stop_wizard', self.stop_export) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 2539973da..b25021ca9 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -52,7 +52,7 @@ class SongImportForm(OpenLPWizard, RegistryProperties): :param parent: The QWidget-derived parent of the wizard. :param plugin: The songs plugin. """ - super(SongImportForm, self).__init__(parent, plugin, 'songImportWizard', ':/wizards/wizard_importsong.bmp') + super(SongImportForm, self).__init__(parent, plugin, 'songImportWizard', ':/wizards/wizard_song.bmp') self.clipboard = self.main_window.clipboard def setupUi(self, image): diff --git a/openlp/plugins/songs/forms/songmaintenancedialog.py b/openlp/plugins/songs/forms/songmaintenancedialog.py index cd224267b..c0c532688 100644 --- a/openlp/plugins/songs/forms/songmaintenancedialog.py +++ b/openlp/plugins/songs/forms/songmaintenancedialog.py @@ -37,7 +37,7 @@ class Ui_SongMaintenanceDialog(object): Set up the user interface for the song maintenance dialog """ song_maintenance_dialog.setObjectName('song_maintenance_dialog') - song_maintenance_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + song_maintenance_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) song_maintenance_dialog.setWindowModality(QtCore.Qt.ApplicationModal) song_maintenance_dialog.resize(10, 350) self.dialog_layout = QtWidgets.QGridLayout(song_maintenance_dialog) diff --git a/openlp/plugins/songs/forms/songreviewwidget.py b/openlp/plugins/songs/forms/songreviewwidget.py index c8873f028..2e5814626 100644 --- a/openlp/plugins/songs/forms/songreviewwidget.py +++ b/openlp/plugins/songs/forms/songreviewwidget.py @@ -182,7 +182,7 @@ class SongReviewWidget(QtWidgets.QWidget): self.song_vertical_layout.addWidget(self.song_group_box) self.song_remove_button = QtWidgets.QPushButton(self) self.song_remove_button.setObjectName('song_remove_button') - self.song_remove_button.setIcon(build_icon(':/songs/song_delete.png')) + self.song_remove_button.setIcon(build_icon(':/general/general_delete.png')) self.song_remove_button.setSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) self.song_vertical_layout.addWidget(self.song_remove_button, alignment=QtCore.Qt.AlignHCenter) diff --git a/openlp/plugins/songs/forms/topicsdialog.py b/openlp/plugins/songs/forms/topicsdialog.py index 1ed3ac61b..90c19238d 100644 --- a/openlp/plugins/songs/forms/topicsdialog.py +++ b/openlp/plugins/songs/forms/topicsdialog.py @@ -35,7 +35,7 @@ class Ui_TopicsDialog(object): Set up the user interface for the topics dialog. """ topics_dialog.setObjectName('topics_dialog') - topics_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + topics_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) topics_dialog.resize(300, 10) self.dialog_layout = QtWidgets.QVBoxLayout(topics_dialog) self.dialog_layout.setObjectName('dialog_layout') diff --git a/openlp/plugins/songusage/forms/songusagedeletedialog.py b/openlp/plugins/songusage/forms/songusagedeletedialog.py index 40fabe3f7..6f3f72651 100644 --- a/openlp/plugins/songusage/forms/songusagedeletedialog.py +++ b/openlp/plugins/songusage/forms/songusagedeletedialog.py @@ -38,7 +38,7 @@ class Ui_SongUsageDeleteDialog(object): :param song_usage_delete_dialog: """ song_usage_delete_dialog.setObjectName('song_usage_delete_dialog') - song_usage_delete_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + song_usage_delete_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) song_usage_delete_dialog.resize(291, 243) self.vertical_layout = QtWidgets.QVBoxLayout(song_usage_delete_dialog) self.vertical_layout.setSpacing(8) diff --git a/openlp/plugins/songusage/forms/songusagedetaildialog.py b/openlp/plugins/songusage/forms/songusagedetaildialog.py index b665e74c2..e9e4a6bbe 100644 --- a/openlp/plugins/songusage/forms/songusagedetaildialog.py +++ b/openlp/plugins/songusage/forms/songusagedetaildialog.py @@ -38,7 +38,7 @@ class Ui_SongUsageDetailDialog(object): :param song_usage_detail_dialog: """ song_usage_detail_dialog.setObjectName('song_usage_detail_dialog') - song_usage_detail_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) + song_usage_detail_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) song_usage_detail_dialog.resize(609, 413) self.vertical_layout = QtWidgets.QVBoxLayout(song_usage_detail_dialog) self.vertical_layout.setSpacing(8) diff --git a/resources/images/about-new.bmp b/resources/images/about-new.bmp deleted file mode 100644 index b523f6b60..000000000 Binary files a/resources/images/about-new.bmp and /dev/null differ diff --git a/resources/images/bibles_search_clear.png b/resources/images/bibles_search_clear.png index 551ce7c96..19a1665ba 100644 Binary files a/resources/images/bibles_search_clear.png and b/resources/images/bibles_search_clear.png differ diff --git a/resources/images/bibles_search_combined.png b/resources/images/bibles_search_combined.png index 161b3fcd6..8fc16c886 100644 Binary files a/resources/images/bibles_search_combined.png and b/resources/images/bibles_search_combined.png differ diff --git a/resources/images/bibles_upgrade_alert.png b/resources/images/bibles_upgrade_alert.png deleted file mode 100644 index 331aa2687..000000000 Binary files a/resources/images/bibles_upgrade_alert.png and /dev/null differ diff --git a/resources/images/custom_delete.png b/resources/images/custom_delete.png deleted file mode 100644 index ef8e685e2..000000000 Binary files a/resources/images/custom_delete.png and /dev/null differ diff --git a/resources/images/custom_edit.png b/resources/images/custom_edit.png deleted file mode 100644 index d79aa5151..000000000 Binary files a/resources/images/custom_edit.png and /dev/null differ diff --git a/resources/images/custom_new.png b/resources/images/custom_new.png deleted file mode 100644 index 8431237bd..000000000 Binary files a/resources/images/custom_new.png and /dev/null differ diff --git a/resources/images/general_search_clear.png b/resources/images/general_search_clear.png deleted file mode 100644 index 6c4b83b7a..000000000 Binary files a/resources/images/general_search_clear.png and /dev/null differ diff --git a/resources/images/image_clapperboard.png b/resources/images/image_clapperboard.png deleted file mode 100644 index e46056914..000000000 Binary files a/resources/images/image_clapperboard.png and /dev/null differ diff --git a/resources/images/image_delete.png b/resources/images/image_delete.png deleted file mode 100644 index ef8e685e2..000000000 Binary files a/resources/images/image_delete.png and /dev/null differ diff --git a/resources/images/image_load.png b/resources/images/image_load.png deleted file mode 100644 index eb211e233..000000000 Binary files a/resources/images/image_load.png and /dev/null differ diff --git a/resources/images/import_load.png b/resources/images/import_load.png deleted file mode 100644 index eb211e233..000000000 Binary files a/resources/images/import_load.png and /dev/null differ diff --git a/resources/images/import_move_to_list.png b/resources/images/import_move_to_list.png deleted file mode 100644 index 5c0005856..000000000 Binary files a/resources/images/import_move_to_list.png and /dev/null differ diff --git a/resources/images/import_remove.png b/resources/images/import_remove.png deleted file mode 100644 index ef8e685e2..000000000 Binary files a/resources/images/import_remove.png and /dev/null differ diff --git a/resources/images/import_selectall.png b/resources/images/import_selectall.png deleted file mode 100644 index 0f0d9f152..000000000 Binary files a/resources/images/import_selectall.png and /dev/null differ diff --git a/resources/images/messagebox_critical.png b/resources/images/messagebox_critical.png deleted file mode 100644 index 3fb497a19..000000000 Binary files a/resources/images/messagebox_critical.png and /dev/null differ diff --git a/resources/images/messagebox_info.png b/resources/images/messagebox_info.png deleted file mode 100644 index 4e3a257f3..000000000 Binary files a/resources/images/messagebox_info.png and /dev/null differ diff --git a/resources/images/messagebox_warning.png b/resources/images/messagebox_warning.png deleted file mode 100644 index 331aa2687..000000000 Binary files a/resources/images/messagebox_warning.png and /dev/null differ diff --git a/resources/images/openlp-2.qrc b/resources/images/openlp-2.qrc index 867e4dd7a..ebff58a0a 100644 --- a/resources/images/openlp-2.qrc +++ b/resources/images/openlp-2.qrc @@ -23,8 +23,7 @@ topic_maintenance.png song_author_edit.png song_book_edit.png - song_delete.png - + image_group.png image_new_group.png @@ -33,7 +32,6 @@ bibles_search_combined.png bibles_search_text.png bibles_search_reference.png - bibles_upgrade_alert.png bibles_search_clear.png bibles_search_unlock.png bibles_search_lock.png @@ -71,7 +69,6 @@ general_back.png - slide_close.png slide_next.png slide_blank.png slide_desktop.png @@ -83,12 +80,6 @@ media_playback_next.png - openlp-logo-16x16.png - openlp-logo-32x32.png - openlp-logo-48x48.png - openlp-logo-64x64.png - openlp-logo-128x128.png - openlp-logo-256x256.png openlp-logo.svg @@ -97,24 +88,18 @@ openlp-about-logo.png - import_selectall.png - import_move_to_list.png - import_remove.png - import_load.png - + export_load.png openlp-osx-wizard.png - wizard_exportsong.bmp - wizard_importsong.bmp + wizard_song.bmp wizard_importbible.bmp wizard_firsttime.bmp wizard_createtheme.bmp wizard_duplicateremoval.bmp - wizard_createprojector.png - + service_collapse_all.png service_expand_all.png @@ -155,10 +140,7 @@ multimedia-player.png - messagebox_critical.png - messagebox_info.png - messagebox_warning.png - + network_server.png network_ssl.png @@ -170,10 +152,8 @@ tools_add.png - tools_alert.png - + - theme_delete.png theme_new.png theme_edit.png @@ -201,12 +181,10 @@ projector_power_on_tiled.png projector_show.png projector_show_tiled.png - projector_spacer.png projector_warmup.png - projector_view.png - + android_app_qr.png ios_app_qr.png - + \ No newline at end of file diff --git a/resources/images/openlp-about-logo.svg b/resources/images/openlp-about-logo.svg deleted file mode 100644 index d4f9c2dbe..000000000 --- a/resources/images/openlp-about-logo.svg +++ /dev/null @@ -1,323 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/images/openlp-default-dualdisplay.svg b/resources/images/openlp-default-dualdisplay.svg deleted file mode 100644 index 40ebedeac..000000000 --- a/resources/images/openlp-default-dualdisplay.svg +++ /dev/null @@ -1,489 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/images/openlp-logo-256x256.png b/resources/images/openlp-logo-256x256.png deleted file mode 100644 index 0fcf37a7c..000000000 Binary files a/resources/images/openlp-logo-256x256.png and /dev/null differ diff --git a/resources/images/openlp-logo-420x420.png b/resources/images/openlp-logo-420x420.png deleted file mode 100644 index 81b893b9a..000000000 Binary files a/resources/images/openlp-logo-420x420.png and /dev/null differ diff --git a/resources/images/openlp-logo.svg b/resources/images/openlp-logo.svg index c5e7985e1..d1ff61bec 100644 --- a/resources/images/openlp-logo.svg +++ b/resources/images/openlp-logo.svg @@ -1,6 +1,4 @@ - - + id="svg5740" + height="467.39178" + width="467.39178"> + style="stop-color:#ffffff;stop-opacity:0.25098041;" /> + style="stop-color:#ffffff;stop-opacity:0;" /> + style="stop-color:#cdcdff;stop-opacity:1;" /> + style="stop-color:#ebebff;stop-opacity:1;" /> + style="stop-color:#000d26;stop-opacity:1;" /> + style="stop-color:#507fda;stop-opacity:1;" /> - + color-interpolation-filters="sRGB" + id="filter6926"> + id="feGaussianBlur6928" + stdDeviation="3.5771872" /> - - - - - - - - - - - - - - - + xlink:href="#linearGradient3195" /> - + + y1="276.68851" + x1="470.25891" + gradientTransform="matrix(0.7247086,0,0,0.7843464,-109.42065,-2.1325924)" + gradientUnits="userSpaceOnUse" + id="linearGradient4057" + xlink:href="#linearGradient3208" /> - @@ -273,92 +88,56 @@ image/svg+xml + + id="layer1" /> + id="layer5" /> + id="layer3" /> + id="layer2" /> + id="layer6"> + transform="translate(9.8817328,9.8817328)" + id="g4018"> - + + id="path6317" + d="M 833.03006,395.26932 A 357.71872,357.71872 0 0 1 475.31134,752.98804 357.71872,357.71872 0 0 1 117.59262,395.26932 357.71872,357.71872 0 0 1 475.31134,37.550598 357.71872,357.71872 0 0 1 833.03006,395.26932 Z" + transform="matrix(0.6317287,0,0,0.6317287,-64.581662,-12.716988)" /> + id="path6327" /> + id="path3203" /> diff --git a/resources/images/openlp-splash-screen.svg b/resources/images/openlp-splash-screen.svg deleted file mode 100644 index b45f2015c..000000000 --- a/resources/images/openlp-splash-screen.svg +++ /dev/null @@ -1,296 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/images/openlp.org.ico b/resources/images/openlp.org.ico deleted file mode 100644 index f11e76809..000000000 Binary files a/resources/images/openlp.org.ico and /dev/null differ diff --git a/resources/images/presentation_delete.png b/resources/images/presentation_delete.png deleted file mode 100644 index ef8e685e2..000000000 Binary files a/resources/images/presentation_delete.png and /dev/null differ diff --git a/resources/images/presentation_load.png b/resources/images/presentation_load.png deleted file mode 100644 index eb211e233..000000000 Binary files a/resources/images/presentation_load.png and /dev/null differ diff --git a/resources/images/projector_connectors.png b/resources/images/projector_connectors.png deleted file mode 100644 index 77a6a4dd7..000000000 Binary files a/resources/images/projector_connectors.png and /dev/null differ diff --git a/resources/images/projector_spacer.png b/resources/images/projector_spacer.png deleted file mode 100644 index ca5a54a04..000000000 Binary files a/resources/images/projector_spacer.png and /dev/null differ diff --git a/resources/images/projector_view.png b/resources/images/projector_view.png deleted file mode 100644 index e4d7e971b..000000000 Binary files a/resources/images/projector_view.png and /dev/null differ diff --git a/resources/images/service_delete.png b/resources/images/service_delete.png deleted file mode 100644 index ef8e685e2..000000000 Binary files a/resources/images/service_delete.png and /dev/null differ diff --git a/resources/images/service_edit.png b/resources/images/service_edit.png deleted file mode 100644 index 84e345d22..000000000 Binary files a/resources/images/service_edit.png and /dev/null differ diff --git a/resources/images/service_new.png b/resources/images/service_new.png deleted file mode 100644 index 8431237bd..000000000 Binary files a/resources/images/service_new.png and /dev/null differ diff --git a/resources/images/service_open.png b/resources/images/service_open.png deleted file mode 100644 index eb211e233..000000000 Binary files a/resources/images/service_open.png and /dev/null differ diff --git a/resources/images/service_save.png b/resources/images/service_save.png deleted file mode 100644 index 8072aea32..000000000 Binary files a/resources/images/service_save.png and /dev/null differ diff --git a/resources/images/slide_close.png b/resources/images/slide_close.png deleted file mode 100644 index 2c2f99eb4..000000000 Binary files a/resources/images/slide_close.png and /dev/null differ diff --git a/resources/images/song_delete.png b/resources/images/song_delete.png deleted file mode 100644 index ef8e685e2..000000000 Binary files a/resources/images/song_delete.png and /dev/null differ diff --git a/resources/images/song_edit.png b/resources/images/song_edit.png deleted file mode 100644 index 84e345d22..000000000 Binary files a/resources/images/song_edit.png and /dev/null differ diff --git a/resources/images/song_export.png b/resources/images/song_export.png deleted file mode 100644 index d26519b7f..000000000 Binary files a/resources/images/song_export.png and /dev/null differ diff --git a/resources/images/song_new.png b/resources/images/song_new.png deleted file mode 100644 index 8431237bd..000000000 Binary files a/resources/images/song_new.png and /dev/null differ diff --git a/resources/images/system_add.png b/resources/images/system_add.png deleted file mode 100644 index 7bb9b1be8..000000000 Binary files a/resources/images/system_add.png and /dev/null differ diff --git a/resources/images/system_live.png b/resources/images/system_live.png deleted file mode 100644 index cb2be2258..000000000 Binary files a/resources/images/system_live.png and /dev/null differ diff --git a/resources/images/system_preview.png b/resources/images/system_preview.png deleted file mode 100644 index d196792bb..000000000 Binary files a/resources/images/system_preview.png and /dev/null differ diff --git a/resources/images/theme_delete.png b/resources/images/theme_delete.png deleted file mode 100644 index ef8e685e2..000000000 Binary files a/resources/images/theme_delete.png and /dev/null differ diff --git a/resources/images/theme_export.png b/resources/images/theme_export.png deleted file mode 100644 index d26519b7f..000000000 Binary files a/resources/images/theme_export.png and /dev/null differ diff --git a/resources/images/theme_import.png b/resources/images/theme_import.png deleted file mode 100644 index 0ee789269..000000000 Binary files a/resources/images/theme_import.png and /dev/null differ diff --git a/resources/images/tools_alert.png b/resources/images/tools_alert.png deleted file mode 100644 index 331aa2687..000000000 Binary files a/resources/images/tools_alert.png and /dev/null differ diff --git a/resources/images/video_delete.png b/resources/images/video_delete.png deleted file mode 100644 index ef8e685e2..000000000 Binary files a/resources/images/video_delete.png and /dev/null differ diff --git a/resources/images/video_load.png b/resources/images/video_load.png deleted file mode 100644 index eb211e233..000000000 Binary files a/resources/images/video_load.png and /dev/null differ diff --git a/resources/images/wizard_createprojector.png b/resources/images/wizard_createprojector.png deleted file mode 100644 index d17a01e41..000000000 Binary files a/resources/images/wizard_createprojector.png and /dev/null differ diff --git a/resources/images/wizard_importsong.bmp b/resources/images/wizard_importsong.bmp deleted file mode 100644 index 948422dcc..000000000 Binary files a/resources/images/wizard_importsong.bmp and /dev/null differ diff --git a/resources/images/wizard_exportsong.bmp b/resources/images/wizard_song.bmp similarity index 100% rename from resources/images/wizard_exportsong.bmp rename to resources/images/wizard_song.bmp diff --git a/scripts/clean_up_resources.py b/scripts/clean_up_resources.py new file mode 100755 index 000000000..ce4cc8f6d --- /dev/null +++ b/scripts/clean_up_resources.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 + +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2016 OpenLP Developers # +# --------------------------------------------------------------------------- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +############################################################################### + +import fnmatch +import os + +from lxml import etree + +resource_path = os.path.join('..', 'resources', 'images') +resource_file_path = os.path.join(resource_path, 'openlp-2.qrc') +src_directory = os.path.join('..', 'openlp') + +RESOURCES_TO_IGNORE = [ + 'openlp.svg', + 'OpenLP.ico', + 'openlp-2.qrc', + 'openlp-logo-16x16.png', + 'openlp-logo-32x32.png', + 'openlp-logo-48x48.png', + 'openlp-logo-64x64.png', + 'openlp-logo-128x128.png', + 'README.txt' +] + +tree = etree.parse(resource_file_path) +root = tree.getroot() + +print('Looking for unused resources listed in openlp-2.qrc') +print('----------------------------------------------------------------') +resources = root.findall('.//file') +for current_dir, dirs, files in os.walk(src_directory): + for file_name in files: + if not fnmatch.fnmatch(file_name, '*.py'): + continue + file_path = os.path.join(current_dir, file_name) + with open(file_path) as source_file: + file_contents = source_file.read() + # Create a copy of the resources list so that we don't change the list while we're iterating through it! + for resource in list(resources): + if resource.text in file_contents: + resources.remove(resource) +if resources: + print('Unused resources listed in openlp-2.qrc:') + print(*(x.text for x in resources), sep='\n') + print('----------------------------------------------------------------') + remove = None + while remove != 'yes' and remove != 'no': + remove = input('Would you like to remove these files from openlp-2.qrc? (yes/no)') + if remove == 'yes': + for resource in resources: + parent = resource.find('..') + parent.remove(resource) + tree.write(resource_file_path, encoding='utf8') +else: + print('No unused resources listed in openlp-2.qrc') +print('----------------------------------------------------------------') + +print('\nLooking for resource files which are not lited in openlp-2.qrc') +print('----------------------------------------------------------------') +resources = [x.text for x in root.findall('.//file')] +removable_resources = [] +for resource_name in os.listdir(resource_path): + if resource_name not in RESOURCES_TO_IGNORE and resource_name not in resources: + removable_resources.append(resource_name) +if removable_resources: + print('Resource files not listed in openlp-2.qrc:') + print(*removable_resources, sep='\n') + print('----------------------------------------------------------------') + remove = None + while remove != 'yes' and remove != 'no': + remove = input('Would you like to delete these files from the resource folder? (yes/no)') + print('----------------------------------------------------------------') + if remove == 'yes': + for resource in removable_resources: + resource_file = os.path.join(resource_path, resource) + print('Removing {file}'.format(file=resource_file)) + os.remove(resource_file) +else: + print('All resource files are listed!') diff --git a/tests/functional/openlp_core_lib/test_lib.py b/tests/functional/openlp_core_lib/test_lib.py index 145be21f4..db95044fd 100644 --- a/tests/functional/openlp_core_lib/test_lib.py +++ b/tests/functional/openlp_core_lib/test_lib.py @@ -189,16 +189,14 @@ class TestLib(TestCase): """ Test the build_icon() function with a QIcon instance """ - with patch('openlp.core.lib.QtGui') as MockedQtGui: - # GIVEN: A mocked QIcon - MockedQtGui.QIcon = MagicMock - mocked_icon = MockedQtGui.QIcon() + # GIVEN: An icon QIcon + icon = QtGui.QIcon() - # WHEN: We pass a QIcon instance in - result = build_icon(mocked_icon) + # WHEN: We pass a QIcon instance in + result = build_icon(icon) - # THEN: The result should be our mocked QIcon - self.assertIs(mocked_icon, result, 'The result should be the mocked QIcon') + # THEN: The result should be the same icon as we passed in + self.assertIs(icon, result, 'The result should be the same icon as we passed in') def test_build_icon_with_resource(self): """ @@ -223,6 +221,30 @@ class TestLib(TestCase): self.assertIsInstance(result, MagicMock, 'The result should be a MagicMock, because we mocked it out') def test_image_to_byte(self): + """ + Test the image_to_byte() function + """ + with patch('openlp.core.lib.QtCore') as MockedQtCore: + # GIVEN: A set of mocked-out Qt classes + mocked_byte_array = MagicMock() + MockedQtCore.QByteArray.return_value = mocked_byte_array + mocked_buffer = MagicMock() + MockedQtCore.QBuffer.return_value = mocked_buffer + MockedQtCore.QIODevice.WriteOnly = 'writeonly' + mocked_image = MagicMock() + + # WHEN: We convert an image to a byte array + result = image_to_byte(mocked_image, base_64=False) + + # THEN: We should receive the mocked_buffer + MockedQtCore.QByteArray.assert_called_with() + MockedQtCore.QBuffer.assert_called_with(mocked_byte_array) + mocked_buffer.open.assert_called_with('writeonly') + mocked_image.save.assert_called_with(mocked_buffer, "PNG") + self.assertFalse(mocked_byte_array.toBase64.called) + self.assertEqual(mocked_byte_array, result, 'The mocked out byte array should be returned') + + def test_image_to_byte_base_64(self): """ Test the image_to_byte() function """ diff --git a/tests/functional/openlp_core_ui/test_settingsform.py b/tests/functional/openlp_core_ui/test_settingsform.py index 051bc7af1..3f6f0aaad 100644 --- a/tests/functional/openlp_core_ui/test_settingsform.py +++ b/tests/functional/openlp_core_ui/test_settingsform.py @@ -48,7 +48,7 @@ class TestSettingsForm(TestCase): general_tab = MagicMock() general_tab.tab_title = 'mock' general_tab.tab_title_visible = 'Mock' - general_tab.icon_path = ':/icon/openlp-logo-16x16.png' + general_tab.icon_path = ':/icon/openlp-logo.svg' # WHEN: We insert the general tab with patch.object(settings_form.stacked_layout, 'addWidget') as mocked_add_widget, \ @@ -86,14 +86,14 @@ class TestSettingsForm(TestCase): general_tab = QtWidgets.QWidget(None) general_tab.tab_title = 'mock-general' general_tab.tab_title_visible = 'Mock General' - general_tab.icon_path = ':/icon/openlp-logo-16x16.png' + general_tab.icon_path = ':/icon/openlp-logo.svg' mocked_general_save = MagicMock() general_tab.save = mocked_general_save settings_form.insert_tab(general_tab, is_visible=True) themes_tab = QtWidgets.QWidget(None) themes_tab.tab_title = 'mock-themes' themes_tab.tab_title_visible = 'Mock Themes' - themes_tab.icon_path = ':/icon/openlp-logo-16x16.png' + themes_tab.icon_path = ':/icon/openlp-logo.svg' mocked_theme_save = MagicMock() themes_tab.save = mocked_theme_save settings_form.insert_tab(themes_tab, is_visible=False) @@ -114,7 +114,7 @@ class TestSettingsForm(TestCase): general_tab = QtWidgets.QWidget(None) general_tab.tab_title = 'mock' general_tab.tab_title_visible = 'Mock' - general_tab.icon_path = ':/icon/openlp-logo-16x16.png' + general_tab.icon_path = ':/icon/openlp-logo.svg' settings_form.insert_tab(general_tab, is_visible=True) with patch.object(settings_form.stacked_layout, 'count') as mocked_count: @@ -133,14 +133,14 @@ class TestSettingsForm(TestCase): general_tab = QtWidgets.QWidget(None) general_tab.tab_title = 'mock-general' general_tab.tab_title_visible = 'Mock General' - general_tab.icon_path = ':/icon/openlp-logo-16x16.png' + general_tab.icon_path = ':/icon/openlp-logo.svg' mocked_general_cancel = MagicMock() general_tab.cancel = mocked_general_cancel settings_form.insert_tab(general_tab, is_visible=True) themes_tab = QtWidgets.QWidget(None) themes_tab.tab_title = 'mock-themes' themes_tab.tab_title_visible = 'Mock Themes' - themes_tab.icon_path = ':/icon/openlp-logo-16x16.png' + themes_tab.icon_path = ':/icon/openlp-logo.svg' mocked_theme_cancel = MagicMock() themes_tab.cancel = mocked_theme_cancel settings_form.insert_tab(themes_tab, is_visible=False)