From af82682348c932ac618b6d5a25b59f300853ce0b Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 28 Aug 2009 19:27:32 +0100 Subject: [PATCH] Images can only loop if more than 1 --- openlp/core/lib/serviceitem.py | 3 --- openlp/core/ui/slidecontroller.py | 19 ++++++++++++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 77edf8901..a1985b427 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -98,12 +98,9 @@ class ServiceItem(object): self.frames = self.service_frames self.service_frames = [] elif self.service_item_type == ServiceType.Image: - #print "image" - #print self.service_frames for slide in self.service_frames: slide[u'image'] = self.RenderManager.resize_image(slide[u'image']) self.frames = self.service_frames - #self.service_frames = [] else: log.error(u'Invalid value renderer :%s' % self.service_item_type) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index e689f9871..e41682046 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -137,9 +137,6 @@ class SlideController(QtGui.QWidget): translate(u'SlideController', u'Stop continuous loop'), self.onStopLoop) self.DelaySpinBox = QtGui.QSpinBox() -# self.SpinWidget = QtGui.QWidgetAction(self.Toolbar) -# self.SpinWidget.setDefaultWidget(self.DelaySpinBox) -# self.Toolbar.addAction(self.SpinWidget) self.Toolbar.addToolbarWidget(u'Image SpinBox', self.DelaySpinBox) #self.DelaySpinBox.setValue(self.parent.parent.ImageTab.loop_delay) self.DelaySpinBox.setSuffix(translate(u'SlideController', u's')) @@ -184,8 +181,16 @@ class SlideController(QtGui.QWidget): QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onSlideSelected) QtCore.QObject.connect(self.PreviewListWidget, QtCore.SIGNAL(u'activated(QModelIndex)'), self.onSlideSelected) + if isLive: + self.Toolbar.makeWidgetsInvisible(self.image_list) + else: + pass def enableToolBar(self, item): + """ + Allows the toolbars to be reconfigured based on Controller Type + and ServiceItem Type + """ if self.isLive: self.enableLiveToolBar(item) else: @@ -198,7 +203,11 @@ class SlideController(QtGui.QWidget): if item.service_item_type == ServiceType.Text: self.Toolbar.makeWidgetsInvisible(self.image_list) elif item.service_item_type == ServiceType.Image: - self.Toolbar.makeWidgetsVisible(self.image_list) + #Not sensible to allow loops with 1 frame + if len(item.frames) > 1: + self.Toolbar.makeWidgetsVisible(self.image_list) + else: + self.Toolbar.makeWidgetsInvisible(self.image_list) def enablePreviewToolBar(self, item): """ @@ -212,8 +221,8 @@ class SlideController(QtGui.QWidget): request the correct the toolbar of the plugin Called by plugins """ - self.enableToolBar(item) item.render() + self.enableToolBar(item) self.displayServiceManagerItems(item, 0) def addServiceManagerItem(self, item, slideno):