openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #05550
[Merge] lp:~googol-hush/openlp/slidecontroller into lp:openlp
Andreas Preikschat has proposed merging lp:~googol-hush/openlp/slidecontroller into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~googol-hush/openlp/slidecontroller/+merge/46031
Hello!
- indent fixes
- the text in the slidecontrollers will resize correctly when resizing the controller itself
--
https://code.launchpad.net/~googol-hush/openlp/slidecontroller/+merge/46031
Your team OpenLP Core is requested to review the proposed merge of lp:~googol-hush/openlp/slidecontroller into lp:openlp.
=== modified file 'openlp/core/lib/mediamanageritem.py'
--- openlp/core/lib/mediamanageritem.py 2011-01-10 17:40:47 +0000
+++ openlp/core/lib/mediamanageritem.py 2011-01-12 20:06:28 +0000
@@ -314,7 +314,7 @@
context_menu_action(
self.listView, u':/general/general_add.png',
translate('OpenLP.MediaManagerItem',
- '&Add to selected Service Item'),
+ '&Add to selected Service Item'),
self.onAddEditClick))
QtCore.QObject.connect(self.listView,
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
@@ -441,7 +441,7 @@
QtGui.QMessageBox.information(self,
translate('OpenLP.MediaManagerItem', 'No Items Selected'),
translate('OpenLP.MediaManagerItem',
- 'You must select one or more items to preview.'))
+ 'You must select one or more items to preview.'))
else:
log.debug(u'%s Preview requested', self.plugin.name)
serviceItem = self.buildServiceItem()
=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py 2010-12-30 09:13:39 +0000
+++ openlp/core/lib/serviceitem.py 2011-01-12 20:06:28 +0000
@@ -60,6 +60,7 @@
AddIfNewItem = 9
ProvidesOwnDisplay = 10
+
class ServiceItem(object):
"""
The service item is a base class for the plugins to use to interact with
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py 2011-01-05 16:57:49 +0000
+++ openlp/core/ui/slidecontroller.py 2011-01-12 20:06:28 +0000
@@ -399,7 +399,8 @@
def previewSizeChanged(self):
"""
Takes care of the SlidePreview's size. Is called when one of the the
- splitters is moved or when the screen size is changed.
+ splitters is moved or when the screen size is changed. Note, that this
+ method is (also) called frequently from the mainwindow *paintEvent*.
"""
if self.ratio < float(self.PreviewFrame.width()) / float(
self.PreviewFrame.height()):
@@ -412,13 +413,19 @@
max_width = self.PreviewFrame.width() - self.grid.margin() * 2
self.SlidePreview.setFixedSize(QtCore.QSize(max_width,
max_width / self.ratio))
- width = self.parent.ControlSplitter.sizes()[self.split]
- self.PreviewListWidget.setColumnWidth(0, width)
- # Sort out image heights (Songs, bibles excluded)
- if self.serviceItem and not self.serviceItem.is_text():
- for framenumber in range(len(self.serviceItem.get_frames())):
- self.PreviewListWidget.setRowHeight(
- framenumber, width / self.ratio)
+ # Make sure that the frames have the correct size.
+ self.PreviewListWidget.setColumnWidth(0,
+ self.PreviewListWidget.viewport().size().width())
+ if self.serviceItem:
+ # Sort out songs, bibles, etc.
+ if self.serviceItem.is_text():
+ self.PreviewListWidget.resizeRowsToContents()
+ else:
+ # Sort out image heights.
+ width = self.parent.ControlSplitter.sizes()[self.split]
+ for framenumber in range(len(self.serviceItem.get_frames())):
+ self.PreviewListWidget.setRowHeight(
+ framenumber, width / self.ratio)
def onSongBarHandler(self):
request = unicode(self.sender().text())
@@ -590,7 +597,7 @@
self.parent.renderManager.height)
else:
image = self.parent.renderManager.image_manager. \
- get_image(frame[u'title'])
+ get_image(frame[u'title'])
label.setPixmap(QtGui.QPixmap.fromImage(image))
self.PreviewListWidget.setCellWidget(framenumber, 0, label)
slideHeight = width * self.parent.renderManager.screen_ratio
Follow ups