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
|
||||
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
|
||||
|
@ -67,8 +67,8 @@ class Ui_MainWindow(object):
|
||||
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))
|
||||
|
@ -21,7 +21,8 @@ import logging
|
||||
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 @@ class SlideController(QtGui.QWidget):
|
||||
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 @@ class SlideController(QtGui.QWidget):
|
||||
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 @@ class SlideController(QtGui.QWidget):
|
||||
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 @@ class SlideController(QtGui.QWidget):
|
||||
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 @@ class SlideController(QtGui.QWidget):
|
||||
"""
|
||||
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 @@ class SlideController(QtGui.QWidget):
|
||||
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 @@ class SlideController(QtGui.QWidget):
|
||||
"""
|
||||
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):
|
||||
"""
|
||||
|
@ -70,6 +70,7 @@ class ImpressController(object):
|
||||
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 @@ class ImpressController(object):
|
||||
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()
|
||||
|
||||
|
@ -40,11 +40,11 @@ class MessageListener(object):
|
||||
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 @@ class MessageListener(object):
|
||||
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])
|
||||
|
Loading…
Reference in New Issue
Block a user