Fix the icons for the media plugin so they are shown.

bzr-revno: 2078
This commit is contained in:
Tim Bentley 2012-10-10 17:48:33 +02:00 committed by Andreas Preikschat
commit f52859c2f8
6 changed files with 14 additions and 7 deletions

View File

@ -855,7 +855,11 @@ class SlideController(Controller):
else:
label = QtGui.QLabel()
label.setMargin(4)
label.setScaledContents(True)
if serviceItem.is_media():
label.setAlignment(QtCore.Qt.AlignHCenter |
QtCore.Qt.AlignVCenter)
else:
label.setScaledContents(True)
if self.serviceItem.is_command():
label.setPixmap(QtGui.QPixmap(frame[u'image']))
else:

View File

@ -42,8 +42,9 @@ from openlp.core.ui.media import get_media_players, set_media_players
log = logging.getLogger(__name__)
CLAPPERBOARD = QtGui.QImage(u':/media/media_video.png')
#TODO: Add an appropriate Icon for DVDs, CDs, ...
CLAPPERBOARD = u':/media/slidecontroller_multimedia.png'
VIDEO = QtGui.QImage(u':/media/media_video.png')
AUDIO = QtGui.QImage(u':/media/media_audio.png')
DVD_ICON = QtGui.QImage(u':/media/media_video.png')
class MediaMediaItem(MediaManagerItem):
@ -218,7 +219,7 @@ class MediaMediaItem(MediaManagerItem):
service_item.add_capability(ItemCapabilities.RequiresMedia)
# force a non-existent theme
service_item.theme = -1
frame = u':/media/image_clapperboard.png'
frame = CLAPPERBOARD
(path, name) = os.path.split(filename)
service_item.add_from_command(path, name, frame)
return True
@ -290,10 +291,10 @@ class MediaMediaItem(MediaManagerItem):
key=lambda filename: os.path.split(unicode(filename))[1].lower())
for track in media:
track_info = QtCore.QFileInfo(track)
if not track_info.isFile():
if track_info.isFile():
filename = os.path.split(unicode(track))[1]
item_name = QtGui.QListWidgetItem(filename)
item_name.setIcon(build_icon(CLAPPERBOARD))
item_name.setIcon(build_icon(VIDEO))
item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(track))
else:
filename = os.path.split(unicode(track))[1]

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -130,7 +130,9 @@
<qresource prefix="media">
<file>media_time.png</file>
<file>media_stop.png</file>
<file>image_clapperboard.png</file>
<file>media_audio.png</file>
<file>media_video.png</file>
<file>slidecontroller_multimedia.png</file>
</qresource>
<qresource prefix="messagebox">
<file>messagebox_critical.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB