From 154ca1412039d2a795989e1b5f075c6bebf00cc8 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 7 Apr 2018 17:16:42 +0100 Subject: [PATCH] more bits --- openlp/core/app.py | 1 + openlp/core/common/i18n.py | 15 +++++++++++---- openlp/core/ui/formattingtagdialog.py | 4 ++-- openlp/core/ui/mainwindow.py | 2 +- openlp/core/ui/servicemanager.py | 2 +- openlp/core/ui/thememanager.py | 6 +++--- openlp/plugins/alerts/forms/alertdialog.py | 2 +- openlp/plugins/songs/songsplugin.py | 4 ++-- 8 files changed, 22 insertions(+), 14 deletions(-) diff --git a/openlp/core/app.py b/openlp/core/app.py index 252c14d55..4e0d4842a 100644 --- a/openlp/core/app.py +++ b/openlp/core/app.py @@ -404,6 +404,7 @@ def main(args=None): if not Settings().value('core/has run wizard'): if not FirstTimeLanguageForm().exec(): # if cancel then stop processing + server.close_server() sys.exit() # i18n Set Language language = LanguageManager.get_language() diff --git a/openlp/core/common/i18n.py b/openlp/core/common/i18n.py index 29b91e2f4..2d969dbf3 100644 --- a/openlp/core/common/i18n.py +++ b/openlp/core/common/i18n.py @@ -560,7 +560,7 @@ import qtawesome as qta class UiIcons(object): """ - Provide standard strings for objects to use. + Provide standard icons for objects to use. """ __instance__ = None @@ -574,9 +574,16 @@ class UiIcons(object): def __init__(self): """ - These strings should need a good reason to be retranslated elsewhere. - Should some/more/less of these have an & attached? + These are the font icons used in the code. """ + self.clone = qta.icon('fa.clone') self.database = qta.icon('fa.database') + self.delete = qta.icon('fa.trash') + self.edit = qta.icon('fa.edit') + self.download = qta.icon('fa.download') + self.music = qta.icon('fa.music') + self.new = qta.icon('fa.file') + self.print = qta.icon('fa.print') self.save = qta.icon('fa.save') - #self.images = qta.icon('fa.images') + self.upload = qta.icon('fa.upload') + #self.video = qta.icon('fa.video') diff --git a/openlp/core/ui/formattingtagdialog.py b/openlp/core/ui/formattingtagdialog.py index f9a12489c..9f876b494 100644 --- a/openlp/core/ui/formattingtagdialog.py +++ b/openlp/core/ui/formattingtagdialog.py @@ -24,7 +24,7 @@ The UI widgets for the formatting tags window. """ from PyQt5 import QtCore, QtWidgets -from openlp.core.common.i18n import UiStrings, translate +from openlp.core.common.i18n import UiStrings, UiIcons, translate from openlp.core.lib import build_icon from openlp.core.lib.ui import create_button_box @@ -87,7 +87,7 @@ class Ui_FormattingTagDialog(object): self.list_data_grid_layout.addWidget(self.tag_table_widget) self.edit_button_layout = QtWidgets.QHBoxLayout() self.new_button = QtWidgets.QPushButton(formatting_tag_dialog) - self.new_button.setIcon(build_icon(':/general/general_new.png')) + self.new_button.setIcon(build_icon(UiIcons().new)) self.new_button.setObjectName('new_button') self.edit_button_layout.addWidget(self.new_button) self.delete_button = QtWidgets.QPushButton(formatting_tag_dialog) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 6c7ccbf1c..93371a488 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -165,7 +165,7 @@ class Ui_MainWindow(object): # Create the menu items action_list = ActionList.get_instance() action_list.add_category(UiStrings().File, CategoryOrder.standard_menu) - self.file_new_item = create_action(main_window, 'fileNewItem', icon=':/general/general_new.png', + self.file_new_item = create_action(main_window, 'fileNewItem', icon=UiIcons().new, can_shortcuts=True, category=UiStrings().File, triggers=self.service_manager_contents.on_new_service_clicked) self.file_open_item = create_action(main_window, 'fileOpenItem', icon=':/general/general_open.png', diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index efb95338a..bb6b26e51 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -137,7 +137,7 @@ class Ui_ServiceManager(object): self.layout.setContentsMargins(0, 0, 0, 0) # Create the top toolbar self.toolbar = OpenLPToolbar(self) - self.toolbar.add_toolbar_action('newService', text=UiStrings().NewService, icon=':/general/general_new.png', + self.toolbar.add_toolbar_action('newService', text=UiStrings().NewService, icon=UiIcons().new, tooltip=UiStrings().CreateService, triggers=self.on_new_service_clicked) self.toolbar.add_toolbar_action('openService', text=UiStrings().OpenService, icon=':/general/general_open.png', diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index a1b1d7a55..ca9f5976b 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -30,7 +30,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets from openlp.core.common import delete_file from openlp.core.common.applocation import AppLocation -from openlp.core.common.i18n import UiStrings, translate, get_locale_key +from openlp.core.common.i18n import UiStrings, UiIcons, translate, get_locale_key from openlp.core.common.mixins import LogMixin, RegistryProperties from openlp.core.common.path import Path, copyfile, create_paths, path_to_str from openlp.core.common.registry import Registry, RegistryBase @@ -79,12 +79,12 @@ class Ui_ThemeManager(object): self.toolbar.addSeparator() self.toolbar.add_toolbar_action('importTheme', text=translate('OpenLP.ThemeManager', 'Import Theme'), - icon=':/general/general_import.png', + icon=build_icon(UiIcons().upload), tooltip=translate('OpenLP.ThemeManager', 'Import a theme.'), triggers=self.on_import_theme) self.toolbar.add_toolbar_action('exportTheme', text=translate('OpenLP.ThemeManager', 'Export Theme'), - icon=':/general/general_export.png', + icon=build_icon(UiIcons().download), tooltip=translate('OpenLP.ThemeManager', 'Export a theme.'), triggers=self.on_export_theme) self.layout.addWidget(self.toolbar) diff --git a/openlp/plugins/alerts/forms/alertdialog.py b/openlp/plugins/alerts/forms/alertdialog.py index 258002164..e356b7c36 100644 --- a/openlp/plugins/alerts/forms/alertdialog.py +++ b/openlp/plugins/alerts/forms/alertdialog.py @@ -64,7 +64,7 @@ class Ui_AlertDialog(object): self.manage_button_layout = QtWidgets.QVBoxLayout() self.manage_button_layout.setObjectName('manage_button_layout') self.new_button = QtWidgets.QPushButton(alert_dialog) - self.new_button.setIcon(build_icon(':/general/general_new.png')) + self.new_button.setIcon(build_icon(UiIcons().new)) self.new_button.setObjectName('new_button') self.manage_button_layout.addWidget(self.new_button) self.save_button = QtWidgets.QPushButton(alert_dialog) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 31f239063..586503575 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -33,7 +33,7 @@ from PyQt5 import QtCore, QtWidgets from openlp.core.api.http import register_endpoint from openlp.core.common.actions import ActionList -from openlp.core.common.i18n import UiStrings, translate +from openlp.core.common.i18n import UiStrings, UiIcons, translate from openlp.core.common.registry import Registry from openlp.core.lib import Plugin, StringContent, build_icon from openlp.core.lib.db import Manager @@ -92,7 +92,7 @@ class SongsPlugin(Plugin): super(SongsPlugin, self).__init__('songs', __default_settings__, SongMediaItem, SongsTab) self.manager = Manager('songs', init_schema, upgrade_mod=upgrade) self.weight = -10 - self.icon_path = ':/plugins/plugin_songs.png' + self.icon_path = UiIcons().music self.icon = build_icon(self.icon_path) self.songselect_form = None register_endpoint(songs_endpoint)