forked from openlp/openlp
Move fixups for Presentations
This commit is contained in:
parent
5e088abfc2
commit
4a5767a5cf
@ -31,5 +31,6 @@ class SettingsManager(object):
|
|||||||
self.mainwindow_docbars = self.width / 5
|
self.mainwindow_docbars = self.width / 5
|
||||||
if self.mainwindow_docbars > 300:
|
if self.mainwindow_docbars > 300:
|
||||||
self.mainwindow_docbars = 300
|
self.mainwindow_docbars = 300
|
||||||
self.mainwindow_slidecontroller = (self.width - (self.mainwindow_docbars * 3 ) / 2) / 2
|
self.slidecontroller = ((self.width - (self.mainwindow_docbars * 3 ) / 2) / 2) -100
|
||||||
print self.width, self.mainwindow_docbars, self.mainwindow_slidecontroller
|
self.slidecontroller_image = self.slidecontroller - 50
|
||||||
|
print self.width, self.mainwindow_docbars, self.slidecontroller, self.slidecontroller_image
|
||||||
|
@ -67,8 +67,8 @@ class Ui_MainWindow(object):
|
|||||||
self.ControlSplitter.setObjectName(u'ControlSplitter')
|
self.ControlSplitter.setObjectName(u'ControlSplitter')
|
||||||
self.MainContentLayout.addWidget(self.ControlSplitter)
|
self.MainContentLayout.addWidget(self.ControlSplitter)
|
||||||
# Create slide controllers
|
# Create slide controllers
|
||||||
self.PreviewController = SlideController(self)
|
self.PreviewController = SlideController(self, self.settingsmanager)
|
||||||
self.LiveController = SlideController(self, True)
|
self.LiveController = SlideController(self, self.settingsmanager, True)
|
||||||
# Create menu
|
# Create menu
|
||||||
self.MenuBar = QtGui.QMenuBar(MainWindow)
|
self.MenuBar = QtGui.QMenuBar(MainWindow)
|
||||||
self.MenuBar.setGeometry(QtCore.QRect(0, 0, 1087, 27))
|
self.MenuBar.setGeometry(QtCore.QRect(0, 0, 1087, 27))
|
||||||
|
@ -21,7 +21,8 @@ import logging
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui
|
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):
|
class SlideList(QtGui.QTableWidget):
|
||||||
"""
|
"""
|
||||||
@ -59,11 +60,12 @@ class SlideController(QtGui.QWidget):
|
|||||||
global log
|
global log
|
||||||
log = logging.getLogger(u'SlideController')
|
log = logging.getLogger(u'SlideController')
|
||||||
|
|
||||||
def __init__(self, parent, isLive=False):
|
def __init__(self, parent, settingsmanager, isLive=False):
|
||||||
"""
|
"""
|
||||||
Set up the Slide Controller.
|
Set up the Slide Controller.
|
||||||
"""
|
"""
|
||||||
QtGui.QWidget.__init__(self, parent)
|
QtGui.QWidget.__init__(self, parent)
|
||||||
|
self.settingsmanager = settingsmanager
|
||||||
self.isLive = isLive
|
self.isLive = isLive
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.image_list = [u'Start Loop', u'Stop Loop', u'Loop Spearator', u'Image SpinBox']
|
self.image_list = [u'Start Loop', u'Stop Loop', u'Loop Spearator', u'Image SpinBox']
|
||||||
@ -152,7 +154,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.Toolbar.setSizePolicy(sizeToolbarPolicy)
|
self.Toolbar.setSizePolicy(sizeToolbarPolicy)
|
||||||
# Screen preview area
|
# Screen preview area
|
||||||
self.PreviewFrame = QtGui.QFrame(self.Splitter)
|
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(
|
self.PreviewFrame.setSizePolicy(QtGui.QSizePolicy(
|
||||||
QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Minimum))
|
QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Minimum))
|
||||||
self.PreviewFrame.setFrameShape(QtGui.QFrame.StyledPanel)
|
self.PreviewFrame.setFrameShape(QtGui.QFrame.StyledPanel)
|
||||||
@ -170,7 +172,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
sizePolicy.setHeightForWidth(
|
sizePolicy.setHeightForWidth(
|
||||||
self.SlidePreview.sizePolicy().hasHeightForWidth())
|
self.SlidePreview.sizePolicy().hasHeightForWidth())
|
||||||
self.SlidePreview.setSizePolicy(sizePolicy)
|
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.setFrameShape(QtGui.QFrame.Box)
|
||||||
self.SlidePreview.setFrameShadow(QtGui.QFrame.Plain)
|
self.SlidePreview.setFrameShadow(QtGui.QFrame.Plain)
|
||||||
self.SlidePreview.setLineWidth(1)
|
self.SlidePreview.setLineWidth(1)
|
||||||
@ -232,7 +234,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
log.debug(u'addServiceItem')
|
log.debug(u'addServiceItem')
|
||||||
#If old item was a command tell it to stop
|
#If old item was a command tell it to stop
|
||||||
if self.item is not None and self.item.service_item_type == ServiceType.Command:
|
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
|
self.item = item
|
||||||
item.render()
|
item.render()
|
||||||
self.enableToolBar(item)
|
self.enableToolBar(item)
|
||||||
@ -250,8 +252,8 @@ class SlideController(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
log.debug(u'addServiceItem')
|
log.debug(u'addServiceItem')
|
||||||
#If old item was a command tell it to stop
|
#If old item was a command tell it to stop
|
||||||
if self.item.service_item_type == ServiceType.Command:
|
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
|
self.item = item
|
||||||
self.enableToolBar(item)
|
self.enableToolBar(item)
|
||||||
if item.service_item_type == ServiceType.Command:
|
if item.service_item_type == ServiceType.Command:
|
||||||
@ -269,7 +271,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.serviceitem = serviceitem
|
self.serviceitem = serviceitem
|
||||||
slide_image = self.serviceitem.frames[0][u'image']
|
slide_image = self.serviceitem.frames[0][u'image']
|
||||||
size = slide_image.size()
|
size = slide_image.size()
|
||||||
slide_width = 300
|
slide_width = self.settingsmanager.slidecontroller_image
|
||||||
slide_height = slide_width * size.height() / size.width()
|
slide_height = slide_width * size.height() / size.width()
|
||||||
self.PreviewListWidget.clear()
|
self.PreviewListWidget.clear()
|
||||||
self.PreviewListWidget.setRowCount(0)
|
self.PreviewListWidget.setRowCount(0)
|
||||||
@ -340,6 +342,9 @@ class SlideController(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
Go to the previous slide.
|
Go to the previous slide.
|
||||||
"""
|
"""
|
||||||
|
if self.item.service_item_type == ServiceType.Command:
|
||||||
|
Receiver().send_message(u'%s_previous'% self.item.name.lower())
|
||||||
|
else:
|
||||||
row = self.PreviewListWidget.currentRow() - 1
|
row = self.PreviewListWidget.currentRow() - 1
|
||||||
if row == -1:
|
if row == -1:
|
||||||
row = self.PreviewListWidget.rowCount() - 1
|
row = self.PreviewListWidget.rowCount() - 1
|
||||||
|
@ -70,6 +70,7 @@ class ImpressController(object):
|
|||||||
self.document = desktop.loadComponentFromURL(url, "_blank", 0, properties)
|
self.document = desktop.loadComponentFromURL(url, "_blank", 0, properties)
|
||||||
self.presentation = self.document.getPresentation()
|
self.presentation = self.document.getPresentation()
|
||||||
self.presentation.start()
|
self.presentation.start()
|
||||||
|
self.xSlideSshowController = desktop.getCurrentComponent().Presentation.getController()
|
||||||
except:
|
except:
|
||||||
log.error(u'Failed reason %s' % sys.exc_info())
|
log.error(u'Failed reason %s' % sys.exc_info())
|
||||||
|
|
||||||
@ -115,8 +116,8 @@ class ImpressController(object):
|
|||||||
slideNumber = property(getSlideNumber, setSlideNumber)
|
slideNumber = property(getSlideNumber, setSlideNumber)
|
||||||
|
|
||||||
def nextStep(self):
|
def nextStep(self):
|
||||||
self.presentation.gotoNextSlide()
|
self.xSlideSshowController.gotoNextEffect()
|
||||||
|
|
||||||
def prevStep(self):
|
def previousStep(self):
|
||||||
self.presentation.gotoPreviousSlide()
|
self.xSlideSshowController.gotoPreviousSlide()
|
||||||
|
|
||||||
|
@ -40,11 +40,11 @@ class MessageListener(object):
|
|||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'presentations_start'), self.startup)
|
QtCore.SIGNAL(u'presentations_start'), self.startup)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
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.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'presentations_first'), self.next)
|
QtCore.SIGNAL(u'presentations_first'), self.next)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
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.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'presentations_next'), self.next)
|
QtCore.SIGNAL(u'presentations_next'), self.next)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
@ -61,6 +61,12 @@ class MessageListener(object):
|
|||||||
def next(self, message):
|
def next(self, message):
|
||||||
self.controllers[self.handler].nextStep()
|
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):
|
def decodeMessage(self, message):
|
||||||
bits = message.split(u':')
|
bits = message.split(u':')
|
||||||
file = os.path.join(bits[1], bits[2])
|
file = os.path.join(bits[1], bits[2])
|
||||||
|
Loading…
Reference in New Issue
Block a user