Accidentially removed image load logic. Readded.

This commit is contained in:
Patrick Zimmermann 2013-04-15 19:26:18 +02:00
parent 3609d2e0e1
commit 0dbda9ee21
2 changed files with 14 additions and 4 deletions

View File

@ -32,7 +32,7 @@ The :mod:`slidecontroller` module contains the most important part of OpenLP - t
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import Registry, ServiceItem from openlp.core.lib import ImageSource, Registry, ServiceItem
class ListPreviewWidget(object): class ListPreviewWidget(object):
@ -87,7 +87,7 @@ class ListPreviewWidget(object):
for framenumber in range(len(self.service_item.get_frames())): for framenumber in range(len(self.service_item.get_frames())):
self.preview_table_widget.setRowHeight(framenumber, width / ratio) self.preview_table_widget.setRowHeight(framenumber, width / ratio)
def replace_service_manager_item(self, service_item, width, ratio): def replace_service_manager_item(self, service_item, width, ratio, slideno):
""" """
Loads a ServiceItem into the system from ServiceManager Loads a ServiceItem into the system from ServiceManager
Display the slide number passed Display the slide number passed
@ -119,6 +119,15 @@ class ListPreviewWidget(object):
label.setAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter) label.setAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignVCenter)
else: else:
label.setScaledContents(True) label.setScaledContents(True)
if self.service_item.is_command():
label.setPixmap(QtGui.QPixmap(frame[u'image']))
else:
# If current slide set background to image
if framenumber == slideno:
self.service_item.bg_image_bytes = self.image_manager.get_image_bytes(frame[u'path'],
ImageSource.ImagePlugin)
image = self.image_manager.get_image(frame[u'path'], ImageSource.ImagePlugin)
label.setPixmap(QtGui.QPixmap.fromImage(image))
self.preview_table_widget.setCellWidget(framenumber, 0, label) self.preview_table_widget.setCellWidget(framenumber, 0, label)
slideHeight = width / ratio slideHeight = width / ratio
row += 1 row += 1
@ -176,3 +185,4 @@ class ListPreviewWidget(object):
return self._main_window return self._main_window
main_window = property(_get_main_window) main_window = property(_get_main_window)

View File

@ -36,7 +36,7 @@ from collections import deque
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import OpenLPToolbar, ItemCapabilities, ServiceItem, ImageSource, SlideLimits, \ from openlp.core.lib import OpenLPToolbar, ItemCapabilities, ServiceItem, SlideLimits, \
ServiceItemAction, Settings, Registry, UiStrings, ScreenList, build_icon, build_html, translate ServiceItemAction, Settings, Registry, UiStrings, ScreenList, build_icon, build_html, translate
from openlp.core.ui import HideMode, MainDisplay, Display, DisplayControllerType, ListPreviewWidget from openlp.core.ui import HideMode, MainDisplay, Display, DisplayControllerType, ListPreviewWidget
from openlp.core.lib.ui import create_action from openlp.core.lib.ui import create_action