diff --git a/openlp/core/lib/imagemanager.py b/openlp/core/lib/imagemanager.py index ecbfd58f9..0d8d488fd 100644 --- a/openlp/core/lib/imagemanager.py +++ b/openlp/core/lib/imagemanager.py @@ -280,7 +280,7 @@ class ImageManager(QtCore.QObject): """ Add image to cache if it is not already there. """ - log.debug('add_image path: %s, source: %s, width: %d, height: %d ' % (path, source, width, height)) + log.debug('add_image %s' % path) if not (path, source, width, height) in self._cache: image = Image(path, source, background, width, height) self._cache[(path, source, width, height)] = image diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 7332cea1f..bad53f63e 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -292,7 +292,7 @@ class ServiceItem(RegistryProperties): :param path: The directory in which the image file is located. :param title: A title for the slide in the service item. :param background: - :param thumbnail: Optional thumbnail, used for remote thumbnails. + :param thumbnail: Optional alternative thumbnail, used for remote thumbnails. """ if background: self.image_border = background @@ -302,8 +302,6 @@ class ServiceItem(RegistryProperties): thumbnail = os.path.join(AppLocation.get_section_data_path('images'), 'thumbnails', os.path.split(path)[1]) create_thumb(path, thumbnail, False) self._raw_frames.append({'title': title, 'path': path, 'image': thumbnail}) - self.image_manager.add_image(thumbnail, ImageSource.ImagePlugin, self.image_border, 88, 88) - self.image_manager.add_image(thumbnail, ImageSource.ImagePlugin, self.image_border, 320, 240) self.image_manager.add_image(path, ImageSource.ImagePlugin, self.image_border) self._new_item() diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 5b4122072..d5892c250 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -34,7 +34,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.common import Registry, AppLocation, Settings, UiStrings, check_directory_exists, translate from openlp.core.lib import ItemCapabilities, MediaManagerItem, ServiceItemContext, StringContent, TreeWidgetWithDnD,\ - build_icon, check_item_selected, create_thumb, validate_thumb, ImageSource + build_icon, check_item_selected, create_thumb, validate_thumb from openlp.core.lib.ui import create_widget_action, critical_error_message_box from openlp.core.utils import delete_file, get_locale_key, get_images_filter from openlp.plugins.images.forms import AddGroupForm, ChooseGroupForm @@ -590,8 +590,7 @@ class ImageMediaItem(MediaManagerItem): # Continue with the existing images. for filename in images_file_names: name = os.path.split(filename)[1] - service_item.add_from_image(filename, ImageSource.ImagePlugin, background, - os.path.join(self.service_path, name)) + service_item.add_from_image(filename, name, background, os.path.join(self.service_path, name)) return True def check_group_exists(self, new_group): diff --git a/openlp/plugins/remotes/html/openlp.js b/openlp/plugins/remotes/html/openlp.js index ba2ffdf05..9f18c1552 100644 --- a/openlp/plugins/remotes/html/openlp.js +++ b/openlp/plugins/remotes/html/openlp.js @@ -90,18 +90,22 @@ window.OpenLP = { var indexInt = parseInt(idx,10); var slide = data.results.slides[idx]; var text = slide["tag"]; - if (text != "") text = text + ": "; - if (slide["title"]) + if (text != "") { + text = text + ": "; + } + if (slide["title"]) { text += slide["title"] - else + } else { text += slide["text"]; - if (slide["notes"]) + } + if (slide["notes"]) { text += ("
" + slide["notes"] + "
"); + } text = text.replace(/\n/g, '
'); - if (slide["img"]) + if (slide["img"]) { text += ""; - var li = $("
  • ").append( - $("").html(text)); + } + var li = $("
  • ").append($("").html(text)); if (slide["selected"]) { li.attr("data-theme", "e"); } diff --git a/openlp/plugins/remotes/lib/httprouter.py b/openlp/plugins/remotes/lib/httprouter.py index c43590f35..8df6a1c8d 100644 --- a/openlp/plugins/remotes/lib/httprouter.py +++ b/openlp/plugins/remotes/lib/httprouter.py @@ -125,7 +125,7 @@ from mako.template import Template from PyQt4 import QtCore from openlp.core.common import Registry, RegistryProperties, AppLocation, Settings, translate -from openlp.core.lib import PluginStatus, StringContent, image_to_byte, ItemCapabilities, ImageSource +from openlp.core.lib import PluginStatus, StringContent, image_to_byte, ItemCapabilities log = logging.getLogger(__name__) FILE_TYPES = { @@ -406,8 +406,10 @@ class HttpRouter(RegistryProperties): full_path = os.path.normpath(os.path.join(AppLocation.get_section_data_path(controller_name), 'thumbnails/' + full_path)) if os.path.exists(full_path): + path, just_file_name = os.path.split(full_path) + self.image_manager.add_image(full_path, just_file_name, None, width, height) ext, content_type = self.get_content_type(full_path) - image = self.image_manager.get_image(full_path, ImageSource.ImagePlugin, width, height) + image = self.image_manager.get_image(full_path, just_file_name, width, height) content = image_to_byte(image, False) if len(content) == 0: return self.do_not_found() @@ -502,7 +504,7 @@ class HttpRouter(RegistryProperties): item['tag'] = str(index + 1) item['text'] = str(frame['text']) item['html'] = str(frame['html']) - # Handle images, unless a thumbnail is given or if thumbnails is disabled + # Handle images, unless a custom thumbnail is given or if thumbnails is disabled elif current_item.is_image() and not frame.get('image', '') and Settings().value('remotes/thumbnails'): item['tag'] = str(index + 1) thumbnail_path = os.path.sep + os.path.join('images', 'thumbnails', frame['title']) @@ -528,6 +530,7 @@ class HttpRouter(RegistryProperties): item['selected'] = (self.live_controller.selected_row == index) if current_item.notes: item['notes'] = item.get('notes', '') + '\n' + current_item.notes + print(item) data.append(item) json_data = {'results': {'slides': data}} if current_item: