← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~trb143/openlp/bugfixes into lp:openlp

 

Tim Bentley has proposed merging lp:~trb143/openlp/bugfixes into lp:openlp.

Requested reviews:
    openlp.org Core (openlp-core)

Changes to Layout values
Presentations now work better!
-- 
https://code.launchpad.net/~trb143/openlp/bugfixes/+merge/11276
Your team openlp.org Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/settingsmanager.py'
--- openlp/core/lib/settingsmanager.py	2009-09-06 12:13:09 +0000
+++ openlp/core/lib/settingsmanager.py	2009-09-06 19:23:57 +0000
@@ -31,5 +31,6 @@
         self.mainwindow_docbars = self.width / 5
         if self.mainwindow_docbars > 300:
             self.mainwindow_docbars = 300
-        self.mainwindow_slidecontroller = (self.width - (self.mainwindow_docbars * 3  ) / 2) / 2
-        print self.width,  self.mainwindow_docbars, self.mainwindow_slidecontroller
+        self.slidecontroller = ((self.width - (self.mainwindow_docbars * 3  ) / 2) / 2) -100
+        self.slidecontroller_image = self.slidecontroller - 50
+        print self.width,  self.mainwindow_docbars,  self.slidecontroller, self.slidecontroller_image

=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py	2009-09-05 06:29:23 +0000
+++ openlp/core/ui/mainwindow.py	2009-09-06 19:23:57 +0000
@@ -67,8 +67,8 @@
         self.ControlSplitter.setObjectName(u'ControlSplitter')
         self.MainContentLayout.addWidget(self.ControlSplitter)
         # Create slide controllers
-        self.PreviewController = SlideController(self)
-        self.LiveController = SlideController(self, True)
+        self.PreviewController = SlideController(self, self.settingsmanager)
+        self.LiveController = SlideController(self, self.settingsmanager, True)
         # Create menu
         self.MenuBar = QtGui.QMenuBar(MainWindow)
         self.MenuBar.setGeometry(QtCore.QRect(0, 0, 1087, 27))

=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py	2009-09-05 19:58:02 +0000
+++ openlp/core/ui/slidecontroller.py	2009-09-06 19:23:57 +0000
@@ -21,7 +21,8 @@
 import os
 
 from PyQt4 import QtCore, QtGui
-from openlp.core.lib import OpenLPToolbar, translate, buildIcon, Receiver, ServiceType, RenderManager
+from openlp.core.lib import OpenLPToolbar, translate, buildIcon, Receiver, \
+    ServiceType, RenderManager, SettingsManager
 
 class SlideList(QtGui.QTableWidget):
     """
@@ -59,11 +60,12 @@
     global log
     log = logging.getLogger(u'SlideController')
 
-    def __init__(self, parent, isLive=False):
+    def __init__(self, parent, settingsmanager, isLive=False):
         """
         Set up the Slide Controller.
         """
         QtGui.QWidget.__init__(self, parent)
+        self.settingsmanager = settingsmanager
         self.isLive = isLive
         self.parent = parent
         self.image_list = [u'Start Loop', u'Stop Loop', u'Loop Spearator', u'Image SpinBox']
@@ -152,7 +154,7 @@
         self.Toolbar.setSizePolicy(sizeToolbarPolicy)
         # Screen preview area
         self.PreviewFrame = QtGui.QFrame(self.Splitter)
-        self.PreviewFrame.setGeometry(QtCore.QRect(0, 0, 300, 225))
+        self.PreviewFrame.setGeometry(QtCore.QRect(0, 0, self.settingsmanager.slidecontroller_image, 225))
         self.PreviewFrame.setSizePolicy(QtGui.QSizePolicy(
             QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Minimum))
         self.PreviewFrame.setFrameShape(QtGui.QFrame.StyledPanel)
@@ -170,7 +172,7 @@
         sizePolicy.setHeightForWidth(
             self.SlidePreview.sizePolicy().hasHeightForWidth())
         self.SlidePreview.setSizePolicy(sizePolicy)
-        self.SlidePreview.setFixedSize(QtCore.QSize(300, 225))
+        self.SlidePreview.setFixedSize(QtCore.QSize(self.settingsmanager.slidecontroller_image, 225))
         self.SlidePreview.setFrameShape(QtGui.QFrame.Box)
         self.SlidePreview.setFrameShadow(QtGui.QFrame.Plain)
         self.SlidePreview.setLineWidth(1)
@@ -232,7 +234,7 @@
         log.debug(u'addServiceItem')
         #If old item was a command tell it to stop
         if self.item is not None and self.item.service_item_type == ServiceType.Command:
-            Receiver().send_message(u'%s_stop'%item.name.lower())
+            Receiver().send_message(u'%s_stop'% self.item.name.lower())
         self.item = item
         item.render()
         self.enableToolBar(item)
@@ -250,8 +252,8 @@
         """
         log.debug(u'addServiceItem')
         #If old item was a command tell it to stop
-        if self.item.service_item_type == ServiceType.Command:
-            Receiver().send_message(u'%s_stop'%item.name.lower())
+        if self.item is not None and self.item.service_item_type == ServiceType.Command:
+            Receiver().send_message(u'%s_stop'% self.item.name.lower())
         self.item = item
         self.enableToolBar(item)
         if item.service_item_type == ServiceType.Command:
@@ -269,7 +271,7 @@
         self.serviceitem = serviceitem
         slide_image = self.serviceitem.frames[0][u'image']
         size = slide_image.size()
-        slide_width = 300
+        slide_width = self.settingsmanager.slidecontroller_image
         slide_height = slide_width * size.height() / size.width()
         self.PreviewListWidget.clear()
         self.PreviewListWidget.setRowCount(0)
@@ -340,11 +342,14 @@
         """
         Go to the previous slide.
         """
-        row = self.PreviewListWidget.currentRow() - 1
-        if row == -1:
-            row = self.PreviewListWidget.rowCount() - 1
-        self.PreviewListWidget.selectRow(row)
-        self.onSlideSelected()
+        if self.item.service_item_type == ServiceType.Command:
+            Receiver().send_message(u'%s_previous'% self.item.name.lower())
+        else:
+            row = self.PreviewListWidget.currentRow() - 1
+            if row == -1:
+                row = self.PreviewListWidget.rowCount() - 1
+            self.PreviewListWidget.selectRow(row)
+            self.onSlideSelected()
 
     def onSlideSelectedLast(self):
         """

=== modified file 'openlp/plugins/presentations/lib/impresscontroller.py'
--- openlp/plugins/presentations/lib/impresscontroller.py	2009-09-06 08:11:32 +0000
+++ openlp/plugins/presentations/lib/impresscontroller.py	2009-09-06 19:23:57 +0000
@@ -70,6 +70,7 @@
             self.document = desktop.loadComponentFromURL(url, "_blank", 0, properties)
             self.presentation = self.document.getPresentation()
             self.presentation.start()
+            self.xSlideSshowController =  desktop.getCurrentComponent().Presentation.getController()
         except:
             log.error(u'Failed reason %s' % sys.exc_info())
 
@@ -115,8 +116,8 @@
     slideNumber = property(getSlideNumber, setSlideNumber)
 
     def nextStep(self):
-        self.presentation.gotoNextSlide()
+       self.xSlideSshowController.gotoNextEffect()
 
-    def prevStep(self):
-        self.presentation.gotoPreviousSlide()
+    def previousStep(self):
+        self.xSlideSshowController.gotoPreviousSlide()
 

=== modified file 'openlp/plugins/presentations/lib/messagelistener.py'
--- openlp/plugins/presentations/lib/messagelistener.py	2009-09-05 19:58:02 +0000
+++ openlp/plugins/presentations/lib/messagelistener.py	2009-09-06 19:23:57 +0000
@@ -40,11 +40,11 @@
         QtCore.QObject.connect(Receiver.get_receiver(),
             QtCore.SIGNAL(u'presentations_start'), self.startup)
         QtCore.QObject.connect(Receiver.get_receiver(),
-            QtCore.SIGNAL(u'presentations_stop'), self.next)
+            QtCore.SIGNAL(u'presentations_stop'), self.shutDown)
         QtCore.QObject.connect(Receiver.get_receiver(),
             QtCore.SIGNAL(u'presentations_first'), self.next)
         QtCore.QObject.connect(Receiver.get_receiver(),
-            QtCore.SIGNAL(u'presentations_previous'), self.next)
+            QtCore.SIGNAL(u'presentations_previous'), self.previous)
         QtCore.QObject.connect(Receiver.get_receiver(),
             QtCore.SIGNAL(u'presentations_next'), self.next)
         QtCore.QObject.connect(Receiver.get_receiver(),
@@ -61,6 +61,12 @@
     def next(self, message):
         self.controllers[self.handler].nextStep()
 
+    def previous(self, message):
+        self.controllers[self.handler].previousStep()
+
+    def shutDown(self, message):
+        self.controllers[self.handler].closePresentation()
+
     def decodeMessage(self, message):
         bits = message.split(u':')
         file = os.path.join(bits[1], bits[2])


Follow ups