openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #05806
[Merge] lp:~trb143/openlp/bugs into lp:openlp
Tim Bentley has proposed merging lp:~trb143/openlp/bugs into lp:openlp.
Requested reviews:
Jon Tibble (meths)
Related bugs:
#693150 Custom Slide Display footer option
https://bugs.launchpad.net/bugs/693150
#693202 delete theme
https://bugs.launchpad.net/bugs/693202
For more details, see:
https://code.launchpad.net/~trb143/openlp/bugs/+merge/47160
Slide Controller names have been cleaned up and some line lengths fixed
Added guards to presentation code to stop loading if preview images are missing stops crash later on.
--
https://code.launchpad.net/~trb143/openlp/bugs/+merge/47160
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py 2011-01-19 20:00:31 +0000
+++ openlp/core/lib/serviceitem.py 2011-01-22 12:51:27 +0000
@@ -392,10 +392,16 @@
"""
Returns the title of the raw frame
"""
- return self._raw_frames[row][u'title']
+ try:
+ return self._raw_frames[row][u'title']
+ except IndexError:
+ return u''
def get_frame_path(self, row=0):
"""
Returns the path of the raw frame
"""
- return self._raw_frames[row][u'path']
+ try:
+ return self._raw_frames[row][u'path']
+ except IndexError:
+ return u''
=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py 2011-01-22 11:07:54 +0000
+++ openlp/core/ui/servicemanager.py 2011-01-22 12:51:27 +0000
@@ -1039,7 +1039,7 @@
ItemCapabilities.AllowsPreview):
self.mainwindow.previewController.addServiceManagerItem(
self.serviceItems[item][u'service_item'], 0)
- self.mainwindow.liveController.PreviewListWidget.setFocus()
+ self.mainwindow.liveController.previewListWidget.setFocus()
else:
criticalErrorMessageBox(
translate('OpenLP.ServiceManager', 'Missing Display Handler'),
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py 2011-01-22 11:07:54 +0000
+++ openlp/core/ui/slidecontroller.py 2011-01-22 12:51:27 +0000
@@ -42,7 +42,7 @@
events.
"""
def __init__(self, parent=None, name=None):
- QtGui.QTableWidget.__init__(self, parent.Controller)
+ QtGui.QTableWidget.__init__(self, parent.controller)
self.parent = parent
@@ -80,154 +80,154 @@
self.Panel = QtGui.QWidget(parent.ControlSplitter)
self.slideList = {}
# Layout for holding panel
- self.PanelLayout = QtGui.QVBoxLayout(self.Panel)
- self.PanelLayout.setSpacing(0)
- self.PanelLayout.setMargin(0)
+ self.panelLayout = QtGui.QVBoxLayout(self.Panel)
+ self.panelLayout.setSpacing(0)
+ self.panelLayout.setMargin(0)
# Type label for the top of the slide controller
- self.TypeLabel = QtGui.QLabel(self.Panel)
+ self.typeLabel = QtGui.QLabel(self.Panel)
if self.isLive:
- self.TypeLabel.setText(translate('OpenLP.SlideController', 'Live'))
+ self.typeLabel.setText(translate('OpenLP.SlideController', 'Live'))
self.split = 1
self.typePrefix = u'live'
else:
- self.TypeLabel.setText(translate('OpenLP.SlideController',
+ self.typeLabel.setText(translate('OpenLP.SlideController',
'Preview'))
self.split = 0
self.typePrefix = u'preview'
- self.TypeLabel.setStyleSheet(u'font-weight: bold; font-size: 12pt;')
- self.TypeLabel.setAlignment(QtCore.Qt.AlignCenter)
- self.PanelLayout.addWidget(self.TypeLabel)
+ self.typeLabel.setStyleSheet(u'font-weight: bold; font-size: 12pt;')
+ self.typeLabel.setAlignment(QtCore.Qt.AlignCenter)
+ self.panelLayout.addWidget(self.typeLabel)
# Splitter
- self.Splitter = QtGui.QSplitter(self.Panel)
- self.Splitter.setOrientation(QtCore.Qt.Vertical)
- self.PanelLayout.addWidget(self.Splitter)
+ self.splitter = QtGui.QSplitter(self.Panel)
+ self.splitter.setOrientation(QtCore.Qt.Vertical)
+ self.panelLayout.addWidget(self.splitter)
# Actual controller section
- self.Controller = QtGui.QWidget(self.Splitter)
- self.Controller.setGeometry(QtCore.QRect(0, 0, 100, 536))
- self.Controller.setSizePolicy(
+ self.controller = QtGui.QWidget(self.splitter)
+ self.controller.setGeometry(QtCore.QRect(0, 0, 100, 536))
+ self.controller.setSizePolicy(
QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,
QtGui.QSizePolicy.Maximum))
- self.ControllerLayout = QtGui.QVBoxLayout(self.Controller)
- self.ControllerLayout.setSpacing(0)
- self.ControllerLayout.setMargin(0)
+ self.controllerLayout = QtGui.QVBoxLayout(self.controller)
+ self.controllerLayout.setSpacing(0)
+ self.controllerLayout.setMargin(0)
# Controller list view
- self.PreviewListWidget = SlideList(self)
- self.PreviewListWidget.setColumnCount(1)
- self.PreviewListWidget.horizontalHeader().setVisible(False)
- self.PreviewListWidget.setColumnWidth(
- 0, self.Controller.width())
- self.PreviewListWidget.isLive = self.isLive
- self.PreviewListWidget.setObjectName(u'PreviewListWidget')
- self.PreviewListWidget.setSelectionBehavior(1)
- self.PreviewListWidget.setEditTriggers(
+ self.previewListWidget = SlideList(self)
+ self.previewListWidget.setColumnCount(1)
+ self.previewListWidget.horizontalHeader().setVisible(False)
+ self.previewListWidget.setColumnWidth(
+ 0, self.controller.width())
+ self.previewListWidget.isLive = self.isLive
+ self.previewListWidget.setObjectName(u'PreviewListWidget')
+ self.previewListWidget.setSelectionBehavior(1)
+ self.previewListWidget.setEditTriggers(
QtGui.QAbstractItemView.NoEditTriggers)
- self.PreviewListWidget.setHorizontalScrollBarPolicy(
+ self.previewListWidget.setHorizontalScrollBarPolicy(
QtCore.Qt.ScrollBarAlwaysOff)
- self.PreviewListWidget.setAlternatingRowColors(True)
- self.ControllerLayout.addWidget(self.PreviewListWidget)
+ self.previewListWidget.setAlternatingRowColors(True)
+ self.controllerLayout.addWidget(self.previewListWidget)
# Build the full toolbar
- self.Toolbar = OpenLPToolbar(self)
+ self.toolbar = OpenLPToolbar(self)
sizeToolbarPolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed,
QtGui.QSizePolicy.Fixed)
sizeToolbarPolicy.setHorizontalStretch(0)
sizeToolbarPolicy.setVerticalStretch(0)
sizeToolbarPolicy.setHeightForWidth(
- self.Toolbar.sizePolicy().hasHeightForWidth())
- self.Toolbar.setSizePolicy(sizeToolbarPolicy)
- self.previousItem = self.Toolbar.addToolbarButton(
+ self.toolbar.sizePolicy().hasHeightForWidth())
+ self.toolbar.setSizePolicy(sizeToolbarPolicy)
+ self.previousItem = self.toolbar.addToolbarButton(
translate('OpenLP.SlideController', 'Previous Slide'),
u':/slides/slide_previous.png',
translate('OpenLP.SlideController', 'Move to previous'),
self.onSlideSelectedPrevious)
- self.nextItem = self.Toolbar.addToolbarButton(
+ self.nextItem = self.toolbar.addToolbarButton(
translate('OpenLP.SlideController', 'Next Slide'),
u':/slides/slide_next.png',
translate('OpenLP.SlideController', 'Move to next'),
self.onSlideSelectedNext)
if self.isLive:
- self.Toolbar.addToolbarSeparator(u'Close Separator')
- self.HideMenu = QtGui.QToolButton(self.Toolbar)
- self.HideMenu.setText(translate('OpenLP.SlideController', 'Hide'))
- self.HideMenu.setPopupMode(QtGui.QToolButton.MenuButtonPopup)
- self.Toolbar.addToolbarWidget(u'Hide Menu', self.HideMenu)
- self.HideMenu.setMenu(QtGui.QMenu(
- translate('OpenLP.SlideController', 'Hide'), self.Toolbar))
- self.BlankScreen = QtGui.QAction(QtGui.QIcon(
+ self.toolbar.addToolbarSeparator(u'Close Separator')
+ self.hideMenu = QtGui.QToolButton(self.toolbar)
+ self.hideMenu.setText(translate('OpenLP.SlideController', 'Hide'))
+ self.hideMenu.setPopupMode(QtGui.QToolButton.MenuButtonPopup)
+ self.toolbar.addToolbarWidget(u'Hide Menu', self.hideMenu)
+ self.hideMenu.setMenu(QtGui.QMenu(
+ translate('OpenLP.SlideController', 'Hide'), self.toolbar))
+ self.blankScreen = QtGui.QAction(QtGui.QIcon(
u':/slides/slide_blank.png'),
translate('OpenLP.SlideController',
- 'Blank Screen'), self.HideMenu)
- self.BlankScreen.setCheckable(True)
- self.ThemeScreen = QtGui.QAction(QtGui.QIcon(
+ 'Blank Screen'), self.hideMenu)
+ self.blankScreen.setCheckable(True)
+ self.themeScreen = QtGui.QAction(QtGui.QIcon(
u':/slides/slide_theme.png'),
translate('OpenLP.SlideController',
- 'Blank to Theme'), self.HideMenu)
- self.ThemeScreen.setCheckable(True)
- self.HideMenu.setDefaultAction(self.BlankScreen)
- self.HideMenu.menu().addAction(self.BlankScreen)
- self.HideMenu.menu().addAction(self.ThemeScreen)
+ 'Blank to Theme'), self.hideMenu)
+ self.themeScreen.setCheckable(True)
+ self.hideMenu.setDefaultAction(self.blankScreen)
+ self.hideMenu.menu().addAction(self.blankScreen)
+ self.hideMenu.menu().addAction(self.themeScreen)
if self.screens.display_count > 1:
- self.DesktopScreen = QtGui.QAction(QtGui.QIcon(
+ self.desktopScreen = QtGui.QAction(QtGui.QIcon(
u':/slides/slide_desktop.png'),
translate('OpenLP.SlideController',
- 'Show Desktop'), self.HideMenu)
- self.HideMenu.menu().addAction(self.DesktopScreen)
- self.DesktopScreen.setCheckable(True)
- QtCore.QObject.connect(self.DesktopScreen,
+ 'Show Desktop'), self.hideMenu)
+ self.hideMenu.menu().addAction(self.desktopScreen)
+ self.desktopScreen.setCheckable(True)
+ QtCore.QObject.connect(self.desktopScreen,
QtCore.SIGNAL(u'triggered(bool)'), self.onHideDisplay)
- self.Toolbar.addToolbarSeparator(u'Loop Separator')
- self.Toolbar.addToolbarButton(
+ self.toolbar.addToolbarSeparator(u'Loop Separator')
+ self.toolbar.addToolbarButton(
u'Start Loop', u':/media/media_time.png',
translate('OpenLP.SlideController', 'Start continuous loop'),
self.onStartLoop)
- self.Toolbar.addToolbarButton(
+ self.toolbar.addToolbarButton(
u'Stop Loop', u':/media/media_stop.png',
translate('OpenLP.SlideController', 'Stop continuous loop'),
self.onStopLoop)
self.DelaySpinBox = QtGui.QSpinBox()
self.DelaySpinBox.setMinimum(1)
self.DelaySpinBox.setMaximum(180)
- self.Toolbar.addToolbarWidget(u'Image SpinBox', self.DelaySpinBox)
+ self.toolbar.addToolbarWidget(u'Image SpinBox', self.DelaySpinBox)
self.DelaySpinBox.setSuffix(translate('OpenLP.SlideController',
's'))
self.DelaySpinBox.setToolTip(translate('OpenLP.SlideController',
'Delay between slides in seconds'))
else:
- self.Toolbar.addToolbarSeparator(u'Close Separator')
- self.Toolbar.addToolbarButton(
+ self.toolbar.addToolbarSeparator(u'Close Separator')
+ self.toolbar.addToolbarButton(
u'Go Live', u':/general/general_live.png',
translate('OpenLP.SlideController', 'Move to live'),
self.onGoLive)
- self.Toolbar.addToolbarSeparator(u'Close Separator')
- self.Toolbar.addToolbarButton(
+ self.toolbar.addToolbarSeparator(u'Close Separator')
+ self.toolbar.addToolbarButton(
u'Edit Song', u':/general/general_edit.png',
translate('OpenLP.SlideController',
'Edit and reload song preview'),
self.onEditSong)
- self.ControllerLayout.addWidget(self.Toolbar)
+ self.controllerLayout.addWidget(self.toolbar)
# Build a Media ToolBar
- self.Mediabar = OpenLPToolbar(self)
- self.Mediabar.addToolbarButton(
+ self.mediabar = OpenLPToolbar(self)
+ self.mediabar.addToolbarButton(
u'Media Start', u':/slides/media_playback_start.png',
translate('OpenLP.SlideController', 'Start playing media'),
self.onMediaPlay)
- self.Mediabar.addToolbarButton(
+ self.mediabar.addToolbarButton(
u'Media Pause', u':/slides/media_playback_pause.png',
translate('OpenLP.SlideController', 'Start playing media'),
self.onMediaPause)
- self.Mediabar.addToolbarButton(
+ self.mediabar.addToolbarButton(
u'Media Stop', u':/slides/media_playback_stop.png',
translate('OpenLP.SlideController', 'Start playing media'),
self.onMediaStop)
if self.isLive:
# Build the Song Toolbar
- self.SongMenu = QtGui.QToolButton(self.Toolbar)
- self.SongMenu.setText(translate('OpenLP.SlideController',
+ self.songMenu = QtGui.QToolButton(self.toolbar)
+ self.songMenu.setText(translate('OpenLP.SlideController',
'Go To'))
- self.SongMenu.setPopupMode(QtGui.QToolButton.InstantPopup)
- self.Toolbar.addToolbarWidget(u'Song Menu', self.SongMenu)
- self.SongMenu.setMenu(QtGui.QMenu(
- translate('OpenLP.SlideController', 'Go To'), self.Toolbar))
- self.Toolbar.makeWidgetsInvisible([u'Song Menu'])
+ self.songMenu.setPopupMode(QtGui.QToolButton.InstantPopup)
+ self.toolbar.addToolbarWidget(u'Song Menu', self.songMenu)
+ self.songMenu.setMenu(QtGui.QMenu(
+ translate('OpenLP.SlideController', 'Go To'), self.toolbar))
+ self.toolbar.makeWidgetsInvisible([u'Song Menu'])
# Build the volumeSlider.
self.volumeSlider = QtGui.QSlider(QtCore.Qt.Horizontal)
self.volumeSlider.setTickInterval(1)
@@ -239,29 +239,29 @@
self.seekSlider = Phonon.SeekSlider()
self.seekSlider.setGeometry(QtCore.QRect(90, 260, 221, 24))
self.seekSlider.setObjectName(u'seekSlider')
- self.Mediabar.addToolbarWidget(u'Seek Slider', self.seekSlider)
+ self.mediabar.addToolbarWidget(u'Seek Slider', self.seekSlider)
self.volumeSlider = Phonon.VolumeSlider()
self.volumeSlider.setGeometry(QtCore.QRect(90, 260, 221, 24))
self.volumeSlider.setObjectName(u'volumeSlider')
- self.Mediabar.addToolbarWidget(u'Audio Volume', self.volumeSlider)
- self.ControllerLayout.addWidget(self.Mediabar)
+ self.mediabar.addToolbarWidget(u'Audio Volume', self.volumeSlider)
+ self.controllerLayout.addWidget(self.mediabar)
# Screen preview area
- self.PreviewFrame = QtGui.QFrame(self.Splitter)
- self.PreviewFrame.setGeometry(QtCore.QRect(0, 0, 300, 300 * self.ratio))
- self.PreviewFrame.setMinimumHeight(100)
- self.PreviewFrame.setSizePolicy(QtGui.QSizePolicy(
+ self.previewFrame = QtGui.QFrame(self.splitter)
+ self.previewFrame.setGeometry(QtCore.QRect(0, 0, 300, 300 * self.ratio))
+ self.previewFrame.setMinimumHeight(100)
+ self.previewFrame.setSizePolicy(QtGui.QSizePolicy(
QtGui.QSizePolicy.Ignored, QtGui.QSizePolicy.Ignored,
QtGui.QSizePolicy.Label))
- self.PreviewFrame.setFrameShape(QtGui.QFrame.StyledPanel)
- self.PreviewFrame.setFrameShadow(QtGui.QFrame.Sunken)
- self.PreviewFrame.setObjectName(u'PreviewFrame')
- self.grid = QtGui.QGridLayout(self.PreviewFrame)
+ self.previewFrame.setFrameShape(QtGui.QFrame.StyledPanel)
+ self.previewFrame.setFrameShadow(QtGui.QFrame.Sunken)
+ self.previewFrame.setObjectName(u'PreviewFrame')
+ self.grid = QtGui.QGridLayout(self.previewFrame)
self.grid.setMargin(8)
self.grid.setObjectName(u'grid')
- self.SlideLayout = QtGui.QVBoxLayout()
- self.SlideLayout.setSpacing(0)
- self.SlideLayout.setMargin(0)
- self.SlideLayout.setObjectName(u'SlideLayout')
+ self.slideLayout = QtGui.QVBoxLayout()
+ self.slideLayout.setSpacing(0)
+ self.slideLayout.setMargin(0)
+ self.slideLayout.setObjectName(u'SlideLayout')
self.mediaObject = Phonon.MediaObject(self)
self.video = Phonon.VideoWidget()
self.video.setVisible(False)
@@ -270,33 +270,33 @@
Phonon.createPath(self.mediaObject, self.audio)
if not self.isLive:
self.video.setGeometry(QtCore.QRect(0, 0, 300, 225))
- self.SlideLayout.insertWidget(0, self.video)
+ self.slideLayout.insertWidget(0, self.video)
# Actual preview screen
- self.SlidePreview = QtGui.QLabel(self)
+ self.slidePreview = QtGui.QLabel(self)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed,
QtGui.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(
- self.SlidePreview.sizePolicy().hasHeightForWidth())
- self.SlidePreview.setSizePolicy(sizePolicy)
- self.SlidePreview.setFixedSize(
+ self.slidePreview.sizePolicy().hasHeightForWidth())
+ self.slidePreview.setSizePolicy(sizePolicy)
+ self.slidePreview.setFixedSize(
QtCore.QSize(self.settingsmanager.slidecontroller_image,
self.settingsmanager.slidecontroller_image / self.ratio))
- self.SlidePreview.setFrameShape(QtGui.QFrame.Box)
- self.SlidePreview.setFrameShadow(QtGui.QFrame.Plain)
- self.SlidePreview.setLineWidth(1)
- self.SlidePreview.setScaledContents(True)
- self.SlidePreview.setObjectName(u'SlidePreview')
- self.SlideLayout.insertWidget(0, self.SlidePreview)
- self.grid.addLayout(self.SlideLayout, 0, 0, 1, 1)
+ self.slidePreview.setFrameShape(QtGui.QFrame.Box)
+ self.slidePreview.setFrameShadow(QtGui.QFrame.Plain)
+ self.slidePreview.setLineWidth(1)
+ self.slidePreview.setScaledContents(True)
+ self.slidePreview.setObjectName(u'SlidePreview')
+ self.slideLayout.insertWidget(0, self.slidePreview)
+ self.grid.addLayout(self.slideLayout, 0, 0, 1, 1)
# Signals
- QtCore.QObject.connect(self.PreviewListWidget,
+ QtCore.QObject.connect(self.previewListWidget,
QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onSlideSelected)
if self.isLive:
- QtCore.QObject.connect(self.BlankScreen,
+ QtCore.QObject.connect(self.blankScreen,
QtCore.SIGNAL(u'triggered(bool)'), self.onBlankDisplay)
- QtCore.QObject.connect(self.ThemeScreen,
+ QtCore.QObject.connect(self.themeScreen,
QtCore.SIGNAL(u'triggered(bool)'), self.onThemeDisplay)
QtCore.QObject.connect(self.volumeSlider,
QtCore.SIGNAL(u'sliderReleased()'), self.mediaVolume)
@@ -305,17 +305,17 @@
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'slidecontroller_live_spin_delay'),
self.receiveSpinDelay)
- self.Toolbar.makeWidgetsInvisible(self.loopList)
- self.Toolbar.actions[u'Stop Loop'].setVisible(False)
+ self.toolbar.makeWidgetsInvisible(self.loopList)
+ self.toolbar.actions[u'Stop Loop'].setVisible(False)
else:
- QtCore.QObject.connect(self.PreviewListWidget,
+ QtCore.QObject.connect(self.previewListWidget,
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'),
self.onGoLiveClick)
- self.Toolbar.makeWidgetsInvisible(self.songEditList)
- self.Mediabar.setVisible(False)
+ self.toolbar.makeWidgetsInvisible(self.songEditList)
+ self.mediabar.setVisible(False)
if self.isLive:
self.setLiveHotkeys(self)
- self.PreviewListWidget.addActions(
+ self.previewListWidget.addActions(
[self.previousItem,
self.nextItem,
self.previousService,
@@ -329,7 +329,7 @@
self.escapeItem])
else:
self.setPreviewHotkeys()
- self.PreviewListWidget.addActions(
+ self.previewListWidget.addActions(
[self.nextItem,
self.previousItem])
QtCore.QObject.connect(Receiver.get_receiver(),
@@ -422,7 +422,6 @@
def serviceNext(self):
Receiver.send_message('servicemanager_next_item')
-
def screenSizeChanged(self):
"""
Settings dialog has changed the screen size of adjust output and
@@ -453,42 +452,42 @@
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()):
+ if self.ratio < float(self.previewFrame.width()) / float(
+ self.previewFrame.height()):
# We have to take the height as limit.
- max_height = self.PreviewFrame.height() - self.grid.margin() * 2
- self.SlidePreview.setFixedSize(QtCore.QSize(max_height * self.ratio,
+ max_height = self.previewFrame.height() - self.grid.margin() * 2
+ self.slidePreview.setFixedSize(QtCore.QSize(max_height * self.ratio,
max_height))
else:
# We have to take the width as limit.
- max_width = self.PreviewFrame.width() - self.grid.margin() * 2
- self.SlidePreview.setFixedSize(QtCore.QSize(max_width,
+ max_width = self.previewFrame.width() - self.grid.margin() * 2
+ self.slidePreview.setFixedSize(QtCore.QSize(max_width,
max_width / self.ratio))
# Make sure that the frames have the correct size.
- self.PreviewListWidget.setColumnWidth(0,
- self.PreviewListWidget.viewport().size().width())
+ 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()
+ 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(
+ self.previewListWidget.setRowHeight(
framenumber, width / self.ratio)
def onSongBarHandler(self):
request = unicode(self.sender().text())
slideno = self.slideList[request]
- if slideno > self.PreviewListWidget.rowCount():
- self.PreviewListWidget.selectRow(
- self.PreviewListWidget.rowCount() - 1)
+ if slideno > self.previewListWidget.rowCount():
+ self.previewListWidget.selectRow(
+ self.previewListWidget.rowCount() - 1)
else:
- if slideno + 1 < self.PreviewListWidget.rowCount():
- self.PreviewListWidget.scrollToItem(
- self.PreviewListWidget.item(slideno + 1, 0))
- self.PreviewListWidget.selectRow(slideno)
+ if slideno + 1 < self.previewListWidget.rowCount():
+ self.previewListWidget.scrollToItem(
+ self.previewListWidget.item(slideno + 1, 0))
+ self.previewListWidget.selectRow(slideno)
self.onSlideSelected()
def receiveSpinDelay(self, value):
@@ -508,35 +507,35 @@
"""
Allows the live toolbar to be customised
"""
- self.Toolbar.setVisible(True)
- self.Mediabar.setVisible(False)
- self.Toolbar.makeWidgetsInvisible([u'Song Menu'])
- self.Toolbar.makeWidgetsInvisible(self.loopList)
- self.Toolbar.actions[u'Stop Loop'].setVisible(False)
+ self.toolbar.setVisible(True)
+ self.mediabar.setVisible(False)
+ self.toolbar.makeWidgetsInvisible([u'Song Menu'])
+ self.toolbar.makeWidgetsInvisible(self.loopList)
+ self.toolbar.actions[u'Stop Loop'].setVisible(False)
if item.is_text():
if QtCore.QSettings().value(
self.parent.songsSettingsSection + u'/display songbar',
QtCore.QVariant(True)).toBool() and len(self.slideList) > 0:
- self.Toolbar.makeWidgetsVisible([u'Song Menu'])
+ self.toolbar.makeWidgetsVisible([u'Song Menu'])
if item.is_capable(ItemCapabilities.AllowsLoop) and \
len(item.get_frames()) > 1:
- self.Toolbar.makeWidgetsVisible(self.loopList)
+ self.toolbar.makeWidgetsVisible(self.loopList)
if item.is_media():
- self.Toolbar.setVisible(False)
- self.Mediabar.setVisible(True)
+ self.toolbar.setVisible(False)
+ self.mediabar.setVisible(True)
def enablePreviewToolBar(self, item):
"""
Allows the Preview toolbar to be customised
"""
- self.Toolbar.setVisible(True)
- self.Mediabar.setVisible(False)
- self.Toolbar.makeWidgetsInvisible(self.songEditList)
+ self.toolbar.setVisible(True)
+ self.mediabar.setVisible(False)
+ self.toolbar.makeWidgetsInvisible(self.songEditList)
if item.is_capable(ItemCapabilities.AllowsEdit) and item.from_plugin:
- self.Toolbar.makeWidgetsVisible(self.songEditList)
+ self.toolbar.makeWidgetsVisible(self.songEditList)
elif item.is_media():
- self.Toolbar.setVisible(False)
- self.Mediabar.setVisible(True)
+ self.toolbar.setVisible(False)
+ self.mediabar.setVisible(True)
self.volumeSlider.setAudioOutput(self.audio)
def refreshServiceItem(self):
@@ -567,7 +566,7 @@
Replacement item following a remote edit
"""
if item.__eq__(self.serviceItem):
- self._processItem(item, self.PreviewListWidget.currentRow())
+ self._processItem(item, self.previewListWidget.currentRow())
def addServiceManagerItem(self, item, slideno):
"""
@@ -581,10 +580,10 @@
slideno = 0
# If service item is the same as the current on only change slide
if item.__eq__(self.serviceItem):
- if slideno + 1 < self.PreviewListWidget.rowCount():
- self.PreviewListWidget.scrollToItem(
- self.PreviewListWidget.item(slideno + 1, 0))
- self.PreviewListWidget.selectRow(slideno)
+ if slideno + 1 < self.previewListWidget.rowCount():
+ self.previewListWidget.scrollToItem(
+ self.previewListWidget.item(slideno + 1, 0))
+ self.previewListWidget.selectRow(slideno)
self.onSlideSelected()
return
self._processItem(item, slideno)
@@ -606,7 +605,7 @@
if self.isLive:
if serviceItem.is_capable(ItemCapabilities.ProvidesOwnDisplay):
self._forceUnblank()
- blanked = self.BlankScreen.isChecked()
+ blanked = self.blankScreen.isChecked()
else:
blanked = False
Receiver.send_message(u'%s_start' % serviceItem.name.lower(),
@@ -614,16 +613,16 @@
self.slideList = {}
width = self.parent.ControlSplitter.sizes()[self.split]
self.serviceItem = serviceItem
- self.PreviewListWidget.clear()
- self.PreviewListWidget.setRowCount(0)
- self.PreviewListWidget.setColumnWidth(0, width)
+ self.previewListWidget.clear()
+ self.previewListWidget.setRowCount(0)
+ self.previewListWidget.setColumnWidth(0, width)
if self.isLive:
- self.SongMenu.menu().clear()
+ self.songMenu.menu().clear()
row = 0
text = []
for framenumber, frame in enumerate(self.serviceItem.get_frames()):
- self.PreviewListWidget.setRowCount(
- self.PreviewListWidget.rowCount() + 1)
+ self.previewListWidget.setRowCount(
+ self.previewListWidget.rowCount() + 1)
item = QtGui.QTableWidgetItem()
slideHeight = 0
if self.serviceItem.is_text():
@@ -635,7 +634,7 @@
if self.isLive:
if tag1 not in self.slideList:
self.slideList[tag1] = framenumber
- self.SongMenu.menu().addAction(tag1,
+ self.songMenu.menu().addAction(tag1,
self.onSongBarHandler)
else:
row += 1
@@ -652,33 +651,33 @@
image = self.parent.renderManager.image_manager. \
get_image(frame[u'title'])
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
row += 1
text.append(unicode(row))
- self.PreviewListWidget.setItem(framenumber, 0, item)
+ self.previewListWidget.setItem(framenumber, 0, item)
if slideHeight != 0:
- self.PreviewListWidget.setRowHeight(framenumber, slideHeight)
- self.PreviewListWidget.setVerticalHeaderLabels(text)
+ self.previewListWidget.setRowHeight(framenumber, slideHeight)
+ self.previewListWidget.setVerticalHeaderLabels(text)
if self.serviceItem.is_text():
- self.PreviewListWidget.resizeRowsToContents()
- self.PreviewListWidget.setColumnWidth(0,
- self.PreviewListWidget.viewport().size().width())
- if slideno > self.PreviewListWidget.rowCount():
- self.PreviewListWidget.selectRow(
- self.PreviewListWidget.rowCount() - 1)
+ self.previewListWidget.resizeRowsToContents()
+ self.previewListWidget.setColumnWidth(0,
+ self.previewListWidget.viewport().size().width())
+ if slideno > self.previewListWidget.rowCount():
+ self.previewListWidget.selectRow(
+ self.previewListWidget.rowCount() - 1)
else:
- if slideno + 1 < self.PreviewListWidget.rowCount():
- self.PreviewListWidget.scrollToItem(
- self.PreviewListWidget.item(slideno + 1, 0))
- self.PreviewListWidget.selectRow(slideno)
+ if slideno + 1 < self.previewListWidget.rowCount():
+ self.previewListWidget.scrollToItem(
+ self.previewListWidget.item(slideno + 1, 0))
+ self.previewListWidget.selectRow(slideno)
self.enableToolBar(serviceItem)
# Pass to display for viewing
self.display.buildHtml(self.serviceItem)
if serviceItem.is_media():
self.onMediaStart(serviceItem)
self.onSlideSelected()
- self.PreviewListWidget.setFocus()
+ self.previewListWidget.setFocus()
Receiver.send_message(u'slidecontroller_%s_started' % self.typePrefix,
[serviceItem])
@@ -697,7 +696,7 @@
dataItem[u'tag'] = unicode(framenumber)
dataItem[u'text'] = u''
dataItem[u'selected'] = \
- (self.PreviewListWidget.currentRow() == framenumber)
+ (self.previewListWidget.currentRow() == framenumber)
data.append(dataItem)
Receiver.send_message(u'slidecontroller_%s_text_response'
% self.typePrefix, data)
@@ -714,7 +713,7 @@
[self.serviceItem, self.isLive])
self.updatePreview()
else:
- self.PreviewListWidget.selectRow(0)
+ self.previewListWidget.selectRow(0)
self.onSlideSelected()
def onSlideSelectedIndex(self, message):
@@ -729,10 +728,10 @@
[self.serviceItem, self.isLive, index])
self.updatePreview()
else:
- if index + 1 < self.PreviewListWidget.rowCount():
- self.PreviewListWidget.scrollToItem(
- self.PreviewListWidget.item(index + 1, 0))
- self.PreviewListWidget.selectRow(index)
+ if index + 1 < self.previewListWidget.rowCount():
+ self.previewListWidget.scrollToItem(
+ self.previewListWidget.item(index + 1, 0))
+ self.previewListWidget.selectRow(index)
self.onSlideSelected()
def mainDisplaySetBackground(self):
@@ -769,11 +768,11 @@
Handle the blank screen button actions
"""
log.debug(u'onBlankDisplay %s' % checked)
- self.HideMenu.setDefaultAction(self.BlankScreen)
- self.BlankScreen.setChecked(checked)
- self.ThemeScreen.setChecked(False)
+ self.hideMenu.setDefaultAction(self.blankScreen)
+ self.blankScreen.setChecked(checked)
+ self.themeScreen.setChecked(False)
if self.screens.display_count > 1:
- self.DesktopScreen.setChecked(False)
+ self.desktopScreen.setChecked(False)
if checked:
Receiver.send_message(u'maindisplay_hide', HideMode.Blank)
QtCore.QSettings().setValue(
@@ -790,11 +789,11 @@
Handle the Theme screen button
"""
log.debug(u'onThemeDisplay %s' % checked)
- self.HideMenu.setDefaultAction(self.ThemeScreen)
- self.BlankScreen.setChecked(False)
- self.ThemeScreen.setChecked(checked)
+ self.hideMenu.setDefaultAction(self.themeScreen)
+ self.blankScreen.setChecked(False)
+ self.themeScreen.setChecked(checked)
if self.screens.display_count > 1:
- self.DesktopScreen.setChecked(False)
+ self.desktopScreen.setChecked(False)
if checked:
Receiver.send_message(u'maindisplay_hide', HideMode.Theme)
QtCore.QSettings().setValue(
@@ -811,13 +810,13 @@
Handle the Hide screen button
"""
log.debug(u'onHideDisplay %s' % checked)
- self.HideMenu.setDefaultAction(self.DesktopScreen)
- self.BlankScreen.setChecked(False)
- self.ThemeScreen.setChecked(False)
+ self.hideMenu.setDefaultAction(self.desktopScreen)
+ self.blankScreen.setChecked(False)
+ self.themeScreen.setChecked(False)
# On valid if more than 1 display
if self.screens.display_count <= 1:
return
- self.DesktopScreen.setChecked(checked)
+ self.desktopScreen.setChecked(checked)
if checked:
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
QtCore.QSettings().setValue(
@@ -864,9 +863,9 @@
Generate the preview when you click on a slide.
if this is the Live Controller also display on the screen
"""
- row = self.PreviewListWidget.currentRow()
+ row = self.previewListWidget.currentRow()
self.selectedRow = 0
- if row > -1 and row < self.PreviewListWidget.rowCount():
+ if row > -1 and row < self.previewListWidget.rowCount():
if self.serviceItem.is_command():
if self.isLive:
Receiver.send_message(
@@ -879,7 +878,7 @@
frame = self.display.text(toDisplay)
else:
frame = self.display.image(toDisplay)
- self.SlidePreview.setPixmap(QtGui.QPixmap.fromImage(frame))
+ self.slidePreview.setPixmap(QtGui.QPixmap.fromImage(frame))
self.selectedRow = row
Receiver.send_message(u'slidecontroller_%s_changed' % self.typePrefix,
row)
@@ -888,10 +887,10 @@
"""
The slide has been changed. Update the slidecontroller accordingly
"""
- if row + 1 < self.PreviewListWidget.rowCount():
- self.PreviewListWidget.scrollToItem(
- self.PreviewListWidget.item(row + 1, 0))
- self.PreviewListWidget.selectRow(row)
+ if row + 1 < self.previewListWidget.rowCount():
+ self.previewListWidget.scrollToItem(
+ self.previewListWidget.item(row + 1, 0))
+ self.previewListWidget.selectRow(row)
self.updatePreview()
Receiver.send_message(u'slidecontroller_%s_changed' % self.typePrefix,
row)
@@ -904,7 +903,7 @@
QtCore.QTimer.singleShot(0.5, self.grabMainDisplay)
QtCore.QTimer.singleShot(2.5, self.grabMainDisplay)
else:
- self.SlidePreview.setPixmap(
+ self.slidePreview.setPixmap(
QtGui.QPixmap.fromImage(self.display.preview()))
def grabMainDisplay(self):
@@ -912,7 +911,7 @@
rect = self.screens.current[u'size']
winimg = QtGui.QPixmap.grabWindow(winid, rect.x(),
rect.y(), rect.width(), rect.height())
- self.SlidePreview.setPixmap(winimg)
+ self.slidePreview.setPixmap(winimg)
def onSlideSelectedNextNoloop(self):
self.onSlideSelectedNext(False)
@@ -928,17 +927,17 @@
if self.serviceItem.is_command() and self.isLive:
self.updatePreview()
else:
- row = self.PreviewListWidget.currentRow() + 1
- if row == self.PreviewListWidget.rowCount():
+ row = self.previewListWidget.currentRow() + 1
+ if row == self.previewListWidget.rowCount():
if loop:
row = 0
else:
Receiver.send_message('servicemanager_next_item')
return
- if row + 1 < self.PreviewListWidget.rowCount():
- self.PreviewListWidget.scrollToItem(
- self.PreviewListWidget.item(row + 1, 0))
- self.PreviewListWidget.selectRow(row)
+ if row + 1 < self.previewListWidget.rowCount():
+ self.previewListWidget.scrollToItem(
+ self.previewListWidget.item(row + 1, 0))
+ self.previewListWidget.selectRow(row)
self.onSlideSelected()
def onSlideSelectedPreviousNoloop(self):
@@ -955,16 +954,16 @@
if self.serviceItem.is_command() and self.isLive:
self.updatePreview()
else:
- row = self.PreviewListWidget.currentRow() - 1
+ row = self.previewListWidget.currentRow() - 1
if row == -1:
if loop:
- row = self.PreviewListWidget.rowCount() - 1
+ row = self.previewListWidget.rowCount() - 1
else:
row = 0
- if row + 1 < self.PreviewListWidget.rowCount():
- self.PreviewListWidget.scrollToItem(
- self.PreviewListWidget.item(row + 1, 0))
- self.PreviewListWidget.selectRow(row)
+ if row + 1 < self.previewListWidget.rowCount():
+ self.previewListWidget.scrollToItem(
+ self.previewListWidget.item(row + 1, 0))
+ self.previewListWidget.selectRow(row)
self.onSlideSelected()
def onSlideSelectedLast(self):
@@ -978,19 +977,19 @@
if self.serviceItem.is_command():
self.updatePreview()
else:
- self.PreviewListWidget.selectRow(
- self.PreviewListWidget.rowCount() - 1)
+ self.previewListWidget.selectRow(
+ self.previewListWidget.rowCount() - 1)
self.onSlideSelected()
def onStartLoop(self):
"""
Start the timer loop running and store the timer id
"""
- if self.PreviewListWidget.rowCount() > 1:
+ if self.previewListWidget.rowCount() > 1:
self.timer_id = self.startTimer(
int(self.DelaySpinBox.value()) * 1000)
- self.Toolbar.actions[u'Stop Loop'].setVisible(True)
- self.Toolbar.actions[u'Start Loop'].setVisible(False)
+ self.toolbar.actions[u'Stop Loop'].setVisible(True)
+ self.toolbar.actions[u'Start Loop'].setVisible(False)
def onStopLoop(self):
"""
@@ -999,8 +998,8 @@
if self.timer_id != 0:
self.killTimer(self.timer_id)
self.timer_id = 0
- self.Toolbar.actions[u'Start Loop'].setVisible(True)
- self.Toolbar.actions[u'Stop Loop'].setVisible(False)
+ self.toolbar.actions[u'Start Loop'].setVisible(True)
+ self.toolbar.actions[u'Stop Loop'].setVisible(False)
def timerEvent(self, event):
"""
@@ -1029,8 +1028,8 @@
"""
If preview copy slide item to live
"""
- row = self.PreviewListWidget.currentRow()
- if row > -1 and row < self.PreviewListWidget.rowCount():
+ row = self.previewListWidget.currentRow()
+ if row > -1 and row < self.previewListWidget.rowCount():
self.parent.liveController.addServiceManagerItem(
self.serviceItem, row)
@@ -1077,7 +1076,7 @@
if self.isLive:
self.display.videoPlay()
else:
- self.SlidePreview.hide()
+ self.slidePreview.hide()
self.video.show()
self.mediaObject.play()
@@ -1091,8 +1090,8 @@
else:
self.mediaObject.stop()
self.video.hide()
- self.SlidePreview.clear()
- self.SlidePreview.show()
+ self.slidePreview.clear()
+ self.slidePreview.show()
def onMediaClose(self):
"""
@@ -1105,23 +1104,23 @@
self.mediaObject.stop()
self.mediaObject.clearQueue()
self.video.hide()
- self.SlidePreview.clear()
- self.SlidePreview.show()
+ self.slidePreview.clear()
+ self.slidePreview.show()
def _forceUnblank(self):
"""
Used by command items which provide their own displays to reset the
screen hide attributes
"""
- if self.BlankScreen.isChecked:
- self.BlankScreen.setChecked(False)
- self.HideMenu.setDefaultAction(self.BlankScreen)
+ if self.blankScreen.isChecked:
+ self.blankScreen.setChecked(False)
+ self.hideMenu.setDefaultAction(self.blankScreen)
QtCore.QSettings().remove(
self.parent.generalSettingsSection + u'/screen blank')
- if self.ThemeScreen.isChecked:
- self.ThemeScreen.setChecked(False)
- self.HideMenu.setDefaultAction(self.ThemeScreen)
+ if self.themeScreen.isChecked:
+ self.themeScreen.setChecked(False)
+ self.hideMenu.setDefaultAction(self.themeScreen)
if self.screens.display_count > 1:
- if self.DesktopScreen.isChecked:
- self.DesktopScreen.setChecked(False)
- self.HideMenu.setDefaultAction(self.DesktopScreen)
+ if self.desktopScreen.isChecked:
+ self.desktopScreen.setChecked(False)
+ self.hideMenu.setDefaultAction(self.desktopScreen)
=== modified file 'openlp/plugins/presentations/lib/mediaitem.py'
--- openlp/plugins/presentations/lib/mediaitem.py 2011-01-15 19:24:50 +0000
+++ openlp/plugins/presentations/lib/mediaitem.py 2011-01-22 12:51:27 +0000
@@ -268,12 +268,22 @@
doc.load_presentation()
i = 1
img = doc.get_thumbnail_path(i, True)
- while img:
- service_item.add_from_command(path, name, img)
- i = i + 1
- img = doc.get_thumbnail_path(i, True)
- doc.close_presentation()
- return True
+ if img:
+ while img:
+ service_item.add_from_command(path, name, img)
+ i = i + 1
+ img = doc.get_thumbnail_path(i, True)
+ doc.close_presentation()
+ return True
+ else:
+ # File is no longer present
+ criticalErrorMessageBox(
+ translate('PresentationPlugin.MediaItem',
+ 'Missing Presentation'),
+ unicode(translate('PresentationPlugin.MediaItem',
+ 'The Presentation %s is incomplete,'
+ ' please reload.')) % filename)
+ return False
else:
# File is no longer present
criticalErrorMessageBox(
Follow ups