mirror of https://gitlab.com/openlp/openlp.git
Changed some icons to use svg
This commit is contained in:
parent
a4d623a3c0
commit
997cb859d3
|
@ -119,7 +119,7 @@ def str_to_bool(string_value):
|
|||
return str(string_value).strip().lower() in ('true', 'yes', 'y')
|
||||
|
||||
|
||||
def build_icon(icon):
|
||||
def build_icon(icon, size=None):
|
||||
"""
|
||||
Build a QIcon instance from an existing QIcon, a resource location, or a physical file location. If the icon is a
|
||||
QIcon instance, that icon is simply returned. If not, it builds a QIcon instance from the resource or file name.
|
||||
|
@ -127,18 +127,23 @@ def build_icon(icon):
|
|||
:param icon:
|
||||
The icon to build. This can be a QIcon, a resource string in the form ``:/resource/file.png``, or a file
|
||||
location like ``/path/to/file.png``. However, the **recommended** way is to specify a resource string.
|
||||
:param size:
|
||||
The size of the icon to generate
|
||||
:return: The build icon.
|
||||
"""
|
||||
button_icon = QtGui.QIcon()
|
||||
if isinstance(icon, QtGui.QIcon):
|
||||
button_icon = icon
|
||||
elif isinstance(icon, str):
|
||||
return icon
|
||||
button_icon = QtGui.QIcon()
|
||||
if isinstance(icon, str):
|
||||
if icon.startswith(':/'):
|
||||
button_icon.addPixmap(QtGui.QPixmap(icon), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
pix_map = QtGui.QPixmap(icon)
|
||||
else:
|
||||
button_icon.addPixmap(QtGui.QPixmap.fromImage(QtGui.QImage(icon)), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
pix_map = QtGui.QPixmap.fromImage(QtGui.QImage(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 size:
|
||||
pix_map = pix_map.scaled(size, size, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
|
||||
button_icon.addPixmap(pix_map, QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
return button_icon
|
||||
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 |
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -89,7 +89,7 @@ class SettingsForm(QtWidgets.QDialog, Ui_SettingsDialog, RegistryProperties):
|
|||
# add the tab to get it to display in the correct part of the screen
|
||||
self.stacked_layout.addWidget(tab_widget)
|
||||
if is_visible:
|
||||
list_item = QtWidgets.QListWidgetItem(build_icon(tab_widget.icon_path), tab_widget.tab_title_visible)
|
||||
list_item = QtWidgets.QListWidgetItem(build_icon(tab_widget.icon_path, 16), tab_widget.tab_title_visible)
|
||||
list_item.setData(QtCore.Qt.UserRole, tab_widget.tab_title)
|
||||
self.setting_list_widget.addItem(list_item)
|
||||
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue