more bits

This commit is contained in:
Tim Bentley 2018-04-08 18:24:31 +01:00
parent fdae4dc939
commit e5305643c9
6 changed files with 27 additions and 14 deletions

View File

@ -577,8 +577,10 @@ class UiIcons(object):
These are the font icons used in the code. These are the font icons used in the code.
""" """
self.add = qta.icon('fa.plus-circle') self.add = qta.icon('fa.plus-circle')
self.bible = qta.icon('fa.book')
self.clone = qta.icon('fa.clone') self.clone = qta.icon('fa.clone')
self.copy = qta.icon('fa.copy') self.copy = qta.icon('fa.copy')
self.copyright = qta.icon('fa.copyright')
self.database = qta.icon('fa.database') self.database = qta.icon('fa.database')
self.default = qta.icon('fa.info-circle') self.default = qta.icon('fa.info-circle')
self.delete = qta.icon('fa.trash') self.delete = qta.icon('fa.trash')

View File

@ -136,7 +136,6 @@ def build_icon(icon):
pix_map = None pix_map = None
button_icon = QtGui.QIcon() button_icon = QtGui.QIcon()
if isinstance(icon, str): if isinstance(icon, str):
print(icon)
pix_map = QtGui.QPixmap(icon) pix_map = QtGui.QPixmap(icon)
elif isinstance(icon, Path): elif isinstance(icon, Path):
pix_map = QtGui.QPixmap(str(icon)) pix_map = QtGui.QPixmap(str(icon))

View File

@ -34,7 +34,7 @@ from PyQt5 import QtGui
from openlp.core.common import md5_hash from openlp.core.common import md5_hash
from openlp.core.common.applocation import AppLocation 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.mixins import RegistryProperties
from openlp.core.common.path import Path from openlp.core.common.path import Path
from openlp.core.common.settings import Settings 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. :param icon: A string to an icon in the resources or on disk.
""" """
self.icon = icon 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): def render(self, provides_own_theme_data=False):
""" """

View File

@ -53,12 +53,13 @@ class Server(QtCore.QObject, LogMixin):
if 'OpenLP' in args: if 'OpenLP' in args:
args.remove('OpenLP') args.remove('OpenLP')
# Yes, there is. # Yes, there is.
self.out_stream = QtCore.QTextStream(self.out_socket) if len(args):
self.out_stream.setCodec('UTF-8') self.out_stream = QtCore.QTextStream(self.out_socket)
self.out_socket.write(str.encode("".join(args))) self.out_stream.setCodec('UTF-8')
if not self.out_socket.waitForBytesWritten(10): self.out_socket.write(str.encode("".join(args)))
raise Exception(str(self.out_socket.errorString())) if not self.out_socket.waitForBytesWritten(10):
self.out_socket.disconnectFromServer() raise Exception(str(self.out_socket.errorString()))
self.out_socket.disconnectFromServer()
def start_server(self): def start_server(self):
""" """

View File

@ -24,7 +24,7 @@ import logging
from openlp.core.api.http import register_endpoint from openlp.core.api.http import register_endpoint
from openlp.core.common.actions import ActionList 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 import Plugin, StringContent, build_icon
from openlp.core.lib.ui import create_action from openlp.core.lib.ui import create_action
from openlp.plugins.bibles.endpoint import api_bibles_endpoint, bibles_endpoint from openlp.plugins.bibles.endpoint import api_bibles_endpoint, bibles_endpoint
@ -74,8 +74,8 @@ class BiblePlugin(Plugin):
def __init__(self): def __init__(self):
super(BiblePlugin, self).__init__('bibles', __default_settings__, BibleMediaItem, BiblesTab) super(BiblePlugin, self).__init__('bibles', __default_settings__, BibleMediaItem, BiblesTab)
self.weight = -9 self.weight = -9
self.icon_path = ':/plugins/plugin_bibles.png' self.icon_path = UiIcons().bible
self.icon = build_icon(self.icon_path) self.icon = UiIcons().bible
self.manager = BibleManager(self) self.manager = BibleManager(self)
register_endpoint(bibles_endpoint) register_endpoint(bibles_endpoint)
register_endpoint(api_bibles_endpoint) register_endpoint(api_bibles_endpoint)

View File

@ -145,7 +145,7 @@ class SongMediaItem(MediaManagerItem):
self.edit_song_form = EditSongForm(self, self.main_window, self.plugin.manager) self.edit_song_form = EditSongForm(self, self.main_window, self.plugin.manager)
self.open_lyrics = OpenLyrics(self.plugin.manager) self.open_lyrics = OpenLyrics(self.plugin.manager)
self.search_text_edit.set_search_types([ 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', 'Entire Song'),
translate('SongsPlugin.MediaItem', 'Search Entire Song...')), translate('SongsPlugin.MediaItem', 'Search Entire Song...')),
(SongSearch.Titles, ':/songs/song_search_title.png', (SongSearch.Titles, ':/songs/song_search_title.png',
@ -161,7 +161,7 @@ class SongMediaItem(MediaManagerItem):
(SongSearch.Books, ':/songs/song_book_edit.png', SongStrings.SongBooks, (SongSearch.Books, ':/songs/song_book_edit.png', SongStrings.SongBooks,
translate('SongsPlugin.MediaItem', 'Search Songbooks...')), translate('SongsPlugin.MediaItem', 'Search Songbooks...')),
(SongSearch.Themes, ':/slides/slide_theme.png', UiStrings().Themes, UiStrings().SearchThemes), (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', 'Copyright'),
translate('SongsPlugin.MediaItem', 'Search Copyright...')), translate('SongsPlugin.MediaItem', 'Search Copyright...')),
(SongSearch.CCLInumber, ':/songs/song_search_ccli.png', (SongSearch.CCLInumber, ':/songs/song_search_ccli.png',