diff --git a/openlp/core/common/i18n.py b/openlp/core/common/i18n.py index fb22cc21c..d7e4a3673 100644 --- a/openlp/core/common/i18n.py +++ b/openlp/core/common/i18n.py @@ -577,8 +577,10 @@ class UiIcons(object): These are the font icons used in the code. """ self.add = qta.icon('fa.plus-circle') + self.bible = qta.icon('fa.book') self.clone = qta.icon('fa.clone') self.copy = qta.icon('fa.copy') + self.copyright = qta.icon('fa.copyright') self.database = qta.icon('fa.database') self.default = qta.icon('fa.info-circle') self.delete = qta.icon('fa.trash') diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index 4d67702a1..bcc87c19e 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -136,7 +136,6 @@ def build_icon(icon): pix_map = None button_icon = QtGui.QIcon() if isinstance(icon, str): - print(icon) pix_map = QtGui.QPixmap(icon) elif isinstance(icon, Path): pix_map = QtGui.QPixmap(str(icon)) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 570c6d843..2be9a4ad5 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -34,7 +34,7 @@ from PyQt5 import QtGui from openlp.core.common import md5_hash from openlp.core.common.applocation import AppLocation -from openlp.core.common.i18n import translate +from openlp.core.common.i18n import UiIcons, translate from openlp.core.common.mixins import RegistryProperties from openlp.core.common.path import Path from openlp.core.common.settings import Settings @@ -236,7 +236,18 @@ class ServiceItem(RegistryProperties): :param icon: A string to an icon in the resources or on disk. """ self.icon = icon - self.iconic_representation = build_icon(icon) + if self.name == 'songs': + self.iconic_representation = UiIcons().music + elif self.name == 'bibles': + self.iconic_representation = UiIcons().music + elif self.name == 'presentations': + self.iconic_representation = UiIcons().presentation + elif self.name == 'images': + self.iconic_representation = UiIcons().picture + elif self.name == 'medias': + self.iconic_representation = UiIcons().video + else: + self.iconic_representation = UiIcons().clone def render(self, provides_own_theme_data=False): """ diff --git a/openlp/core/server.py b/openlp/core/server.py index 7e506dffc..fc4ec64b6 100644 --- a/openlp/core/server.py +++ b/openlp/core/server.py @@ -53,12 +53,13 @@ class Server(QtCore.QObject, LogMixin): if 'OpenLP' in args: args.remove('OpenLP') # Yes, there is. - self.out_stream = QtCore.QTextStream(self.out_socket) - self.out_stream.setCodec('UTF-8') - self.out_socket.write(str.encode("".join(args))) - if not self.out_socket.waitForBytesWritten(10): - raise Exception(str(self.out_socket.errorString())) - self.out_socket.disconnectFromServer() + if len(args): + self.out_stream = QtCore.QTextStream(self.out_socket) + self.out_stream.setCodec('UTF-8') + self.out_socket.write(str.encode("".join(args))) + if not self.out_socket.waitForBytesWritten(10): + raise Exception(str(self.out_socket.errorString())) + self.out_socket.disconnectFromServer() def start_server(self): """ diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index aecdadfdb..7e9a57238 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -24,7 +24,7 @@ import logging 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.lib import Plugin, StringContent, build_icon from openlp.core.lib.ui import create_action from openlp.plugins.bibles.endpoint import api_bibles_endpoint, bibles_endpoint @@ -74,8 +74,8 @@ class BiblePlugin(Plugin): def __init__(self): super(BiblePlugin, self).__init__('bibles', __default_settings__, BibleMediaItem, BiblesTab) self.weight = -9 - self.icon_path = ':/plugins/plugin_bibles.png' - self.icon = build_icon(self.icon_path) + self.icon_path = UiIcons().bible + self.icon = UiIcons().bible self.manager = BibleManager(self) register_endpoint(bibles_endpoint) register_endpoint(api_bibles_endpoint) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index db7980d75..754a399db 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -145,7 +145,7 @@ class SongMediaItem(MediaManagerItem): self.edit_song_form = EditSongForm(self, self.main_window, self.plugin.manager) self.open_lyrics = OpenLyrics(self.plugin.manager) self.search_text_edit.set_search_types([ - (SongSearch.Entire, ':/songs/song_search_all.png', + (SongSearch.Entire, UiIcons().music, translate('SongsPlugin.MediaItem', 'Entire Song'), translate('SongsPlugin.MediaItem', 'Search Entire Song...')), (SongSearch.Titles, ':/songs/song_search_title.png', @@ -161,7 +161,7 @@ class SongMediaItem(MediaManagerItem): (SongSearch.Books, ':/songs/song_book_edit.png', SongStrings.SongBooks, translate('SongsPlugin.MediaItem', 'Search Songbooks...')), (SongSearch.Themes, ':/slides/slide_theme.png', UiStrings().Themes, UiStrings().SearchThemes), - (SongSearch.Copyright, ':/songs/song_search_copy.png', + (SongSearch.Copyright, UiIcons().copyright, translate('SongsPlugin.MediaItem', 'Copyright'), translate('SongsPlugin.MediaItem', 'Search Copyright...')), (SongSearch.CCLInumber, ':/songs/song_search_ccli.png',