This commit is contained in:
Andreas Preikschat 2011-01-12 20:31:46 +01:00
parent 98b0d9b4a8
commit 727f7fe7bf
3 changed files with 18 additions and 13 deletions

View File

@ -266,7 +266,7 @@ class MediaManagerItem(QtGui.QWidget):
""" """
Creates the main widget for listing items the media item is tracking Creates the main widget for listing items the media item is tracking
""" """
#Add the List widget # Add the List widget
self.listView = self.ListViewWithDnD_class(self) self.listView = self.ListViewWithDnD_class(self)
self.listView.uniformItemSizes = True self.listView.uniformItemSizes = True
self.listView.setSpacing(1) self.listView.setSpacing(1)
@ -275,9 +275,9 @@ class MediaManagerItem(QtGui.QWidget):
self.listView.setAlternatingRowColors(True) self.listView.setAlternatingRowColors(True)
self.listView.setDragEnabled(True) self.listView.setDragEnabled(True)
self.listView.setObjectName(u'%sListView' % self.plugin.name) self.listView.setObjectName(u'%sListView' % self.plugin.name)
#Add to pageLayout # Add to pageLayout
self.pageLayout.addWidget(self.listView) self.pageLayout.addWidget(self.listView)
#define and add the context menu # define and add the context menu
self.listView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) self.listView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
name_string = self.plugin.getString(StringContent.Name) name_string = self.plugin.getString(StringContent.Name)
if self.hasEditIcon: if self.hasEditIcon:
@ -314,7 +314,7 @@ class MediaManagerItem(QtGui.QWidget):
context_menu_action( context_menu_action(
self.listView, u':/general/general_add.png', self.listView, u':/general/general_add.png',
translate('OpenLP.MediaManagerItem', translate('OpenLP.MediaManagerItem',
'&Add to selected Service Item'), '&Add to selected Service Item'),
self.onAddEditClick)) self.onAddEditClick))
QtCore.QObject.connect(self.listView, QtCore.QObject.connect(self.listView,
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
@ -441,7 +441,7 @@ class MediaManagerItem(QtGui.QWidget):
QtGui.QMessageBox.information(self, QtGui.QMessageBox.information(self,
translate('OpenLP.MediaManagerItem', 'No Items Selected'), translate('OpenLP.MediaManagerItem', 'No Items Selected'),
translate('OpenLP.MediaManagerItem', translate('OpenLP.MediaManagerItem',
'You must select one or more items to preview.')) 'You must select one or more items to preview.'))
else: else:
log.debug(u'%s Preview requested', self.plugin.name) log.debug(u'%s Preview requested', self.plugin.name)
serviceItem = self.buildServiceItem() serviceItem = self.buildServiceItem()

View File

@ -60,6 +60,7 @@ class ItemCapabilities(object):
AddIfNewItem = 9 AddIfNewItem = 9
ProvidesOwnDisplay = 10 ProvidesOwnDisplay = 10
class ServiceItem(object): class ServiceItem(object):
""" """
The service item is a base class for the plugins to use to interact with The service item is a base class for the plugins to use to interact with

View File

@ -412,13 +412,17 @@ class SlideController(QtGui.QWidget):
max_width = self.PreviewFrame.width() - self.grid.margin() * 2 max_width = self.PreviewFrame.width() - self.grid.margin() * 2
self.SlidePreview.setFixedSize(QtCore.QSize(max_width, self.SlidePreview.setFixedSize(QtCore.QSize(max_width,
max_width / self.ratio)) max_width / self.ratio))
width = self.parent.ControlSplitter.sizes()[self.split] # Make sure that the frames have the correct size.
self.PreviewListWidget.setColumnWidth(0, width) if self.serviceItem:
# Sort out image heights (Songs, bibles excluded) self.PreviewListWidget.resizeRowsToContents()
if self.serviceItem and not self.serviceItem.is_text(): # Sort out image heights (Songs, bibles excluded)
for framenumber in range(len(self.serviceItem.get_frames())): if not self.serviceItem.is_text():
self.PreviewListWidget.setRowHeight( width = self.parent.ControlSplitter.sizes()[self.split]
framenumber, width / self.ratio) for framenumber in range(len(self.serviceItem.get_frames())):
self.PreviewListWidget.setRowHeight(
framenumber, width / self.ratio)
self.PreviewListWidget.setColumnWidth(0,
self.PreviewListWidget.viewport().size().width())
def onSongBarHandler(self): def onSongBarHandler(self):
request = unicode(self.sender().text()) request = unicode(self.sender().text())
@ -590,7 +594,7 @@ class SlideController(QtGui.QWidget):
self.parent.renderManager.height) self.parent.renderManager.height)
else: else:
image = self.parent.renderManager.image_manager. \ image = self.parent.renderManager.image_manager. \
get_image(frame[u'title']) get_image(frame[u'title'])
label.setPixmap(QtGui.QPixmap.fromImage(image)) label.setPixmap(QtGui.QPixmap.fromImage(image))
self.PreviewListWidget.setCellWidget(framenumber, 0, label) self.PreviewListWidget.setCellWidget(framenumber, 0, label)
slideHeight = width * self.parent.renderManager.screen_ratio slideHeight = width * self.parent.renderManager.screen_ratio