openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #00809
[Merge] lp:~j-corwin/openlp/present into lp:openlp
Jonathan Corwin has proposed merging lp:~j-corwin/openlp/present into lp:openlp.
Requested reviews:
Tim Bentley (trb143):
--
https://code.launchpad.net/~j-corwin/openlp/present/+merge/14561
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py 2009-11-05 17:33:38 +0000
+++ openlp/core/ui/maindisplay.py 2009-11-06 19:30:25 +0000
@@ -47,16 +47,16 @@
if type(event) == QtGui.QKeyEvent:
#here accept the event and do something
if event.key() == QtCore.Qt.Key_Up:
- Receiver().send_message(u'slidecontroller_previous')
+ Receiver().send_message(u'live_slidecontroller_previous')
event.accept()
elif event.key() == QtCore.Qt.Key_Down:
- Receiver().send_message(u'slidecontroller_next')
+ Receiver().send_message(u'live_slidecontroller_next')
event.accept()
elif event.key() == QtCore.Qt.Key_PageUp:
- Receiver().send_message(u'slidecontroller_first')
+ Receiver().send_message(u'live_slidecontroller_first')
event.accept()
elif event.key() == QtCore.Qt.Key_PageDown:
- Receiver().send_message(u'slidecontroller_last')
+ Receiver().send_message(u'live_slidecontroller_last')
event.accept()
elif event.key() == QtCore.Qt.Key_Escape:
self.resetDisplay()
@@ -116,9 +116,9 @@
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'alert_text'), self.displayAlert)
QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'presentations_start'), self.hideDisplay)
+ QtCore.SIGNAL(u'live_slide_hide'), self.hideDisplay)
QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'presentations_stop'), self.showDisplay)
+ QtCore.SIGNAL(u'live_slide_show'), self.showDisplay)
QtCore.QObject.connect(self.mediaObject,
QtCore.SIGNAL(u'finished()'), self.onMediaFinish)
QtCore.QObject.connect(Receiver.get_receiver(),
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py 2009-11-04 01:16:15 +0000
+++ openlp/core/ui/slidecontroller.py 2009-11-06 19:30:25 +0000
@@ -253,16 +253,20 @@
self.Toolbar.makeWidgetsInvisible(self.media_list)
else:
self.Toolbar.makeWidgetsInvisible(self.song_list)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'slidecontroller_first'), self.onSlideSelectedFirst)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'slidecontroller_next'), self.onSlideSelectedNext)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'slidecontroller_previous'), self.onSlideSelectedPrevious)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'slidecontroller_last'), self.onSlideSelectedLast)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'slidecontroller_change'), self.onSlideChange)
+ if isLive:
+ prefix = u'live_slidecontroller'
+ else:
+ prefix = u'preview_slidecontroller'
+ QtCore.QObject.connect(Receiver.get_receiver(),
+ QtCore.SIGNAL(u'%s_first' % prefix), self.onSlideSelectedFirst)
+ QtCore.QObject.connect(Receiver.get_receiver(),
+ QtCore.SIGNAL(u'%s_next' % prefix), self.onSlideSelectedNext)
+ QtCore.QObject.connect(Receiver.get_receiver(),
+ QtCore.SIGNAL(u'%s_previous' % prefix), self.onSlideSelectedPrevious)
+ QtCore.QObject.connect(Receiver.get_receiver(),
+ QtCore.SIGNAL(u'%s_last' % prefix), self.onSlideSelectedLast)
+ QtCore.QObject.connect(Receiver.get_receiver(),
+ QtCore.SIGNAL(u'%s_change' % prefix), self.onSlideChange)
def onSongBarHandler(self):
request = self.sender().text()
@@ -350,7 +354,7 @@
if item.service_item_type == ServiceItemType.Command:
Receiver().send_message(u'%s_start' % item.name.lower(), \
[item.shortname, item.service_item_path,
- item.service_frames[0][u'title']])
+ item.service_frames[0][u'title'], self.isLive])
slideno = 0
if self.songEdit:
slideno = self.row
@@ -381,7 +385,7 @@
if item.service_item_type == ServiceItemType.Command:
Receiver().send_message(u'%s_start' % item.name.lower(), \
[item.shortname, item.service_item_path,
- item.service_frames[0][u'title'], slideno])
+ item.service_frames[0][u'title'], slideno, self.isLive])
self.displayServiceManagerItems(item, slideno)
def displayServiceManagerItems(self, serviceitem, slideno):
=== modified file 'openlp/plugins/presentations/lib/messagelistener.py'
--- openlp/plugins/presentations/lib/messagelistener.py 2009-11-03 19:01:53 +0000
+++ openlp/plugins/presentations/lib/messagelistener.py 2009-11-06 19:30:25 +0000
@@ -41,6 +41,7 @@
def __init__(self, controllers):
self.controllers = controllers
self.handler = None
+ self.is_live = None
# messages are sent from core.ui.slidecontroller
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'presentations_start'), self.startup)
@@ -60,20 +61,25 @@
QtCore.SIGNAL(u'presentations_blank'), self.blank)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'presentations_unblank'), self.unblank)
+ self.timer = QtCore.QTimer()
+ self.timer.setInterval(500)
+ QtCore.QObject.connect(self.timer, QtCore.SIGNAL("timeout()"), self.timeout)
def startup(self, message):
"""
Start of new presentation
Save the handler as any new presentations start here
"""
- self.handler, file = self.decodeMessage(message)
+ self.handler, file, self.is_live = self.decodeMessage(message)
self.controller = self.controllers[self.handler]
if self.controller.is_loaded():
self.shutdown(None)
self.controller.load_presentation(file)
- self.controller.start_presentation()
+ if self.is_live:
+ self.controller.start_presentation()
+ Receiver().send_message(u'live_slide_hide')
self.controller.slidenumber = 0
- self.controller.timer.start()
+ self.timer.start()
def activate(self):
if self.controller.is_active():
@@ -85,52 +91,66 @@
self.controller.goto_slide(self.controller.slidenumber)
def slide(self, message):
+ if not self.is_live:
+ return
self.activate()
if message:
self.controller.goto_slide(message[0]+1)
- self.controller.poll_slidenumber()
+ self.controller.poll_slidenumber(self.is_live)
def first(self, message):
"""
Based on the handler passed at startup triggers the first slide
"""
+ if not self.is_live:
+ return
self.activate()
self.controller.start_presentation()
- self.controller.poll_slidenumber()
+ self.controller.poll_slidenumber(self.is_live)
def last(self, message):
"""
Based on the handler passed at startup triggers the first slide
"""
+ if not self.is_live:
+ return
self.activate()
self.controller.goto_slide(self.controller.get_slide_count())
- self.controller.poll_slidenumber()
+ self.controller.poll_slidenumber(self.is_live)
def next(self, message):
"""
Based on the handler passed at startup triggers the next slide event
"""
+ if not self.is_live:
+ return
self.activate()
self.controller.next_step()
- self.controller.poll_slidenumber()
+ self.controller.poll_slidenumber(self.is_live)
def previous(self, message):
"""
Based on the handler passed at startup triggers the previous slide event
"""
+ if not self.is_live:
+ return
self.activate()
self.controller.previous_step()
- self.controller.poll_slidenumber()
+ self.controller.poll_slidenumber(self.is_live)
def shutdown(self, message):
"""
Based on the handler passed at startup triggers slide show to shut down
"""
+ if self.is_live:
+ Receiver().send_message(u'live_slide_show')
self.controller.close_presentation()
self.controller.slidenumber = 0
- self.controller.timer.shutdown()
+ self.timer.stop()
def blank(self):
+ if not self.is_live:
+ return
if not self.controller.is_loaded():
return
if not self.controller.is_active():
@@ -138,6 +158,8 @@
self.controller.blank_screen()
def unblank(self):
+ if not self.is_live:
+ return
self.activate()
self.controller.unblank_screen()
@@ -149,4 +171,7 @@
Message containing Presentaion handler name and file to be presented.
"""
file = os.path.join(message[1], message[2])
- return message[0], file
+ return message[0], file, message[3]
+
+ def timeout(self):
+ self.controller.poll_slidenumber(self.is_live)
=== modified file 'openlp/plugins/presentations/lib/presentationcontroller.py'
--- openlp/plugins/presentations/lib/presentationcontroller.py 2009-10-30 01:26:45 +0000
+++ openlp/plugins/presentations/lib/presentationcontroller.py 2009-11-06 19:30:25 +0000
@@ -149,9 +149,6 @@
self.thumbnailprefix = u'slide'
if not os.path.isdir(self.thumbnailroot):
os.makedirs(self.thumbnailroot)
- self.timer = QtCore.QTimer()
- self.timer.setInterval(500)
- QtCore.QObject.connect(self.timer, QtCore.SIGNAL("timeout()"), self.poll_slidenumber)
def check_available(self):
"""
@@ -188,6 +185,7 @@
``presentation``
The file name of the presentations to the run.
+
"""
pass
@@ -207,9 +205,7 @@
recent than the powerpoint
"""
lastimage = self.get_slide_preview_file(self.get_slide_count())
- if lastimage is None:
- return False
- if not os.path.isfile(lastimage):
+ if not (lastimage and os.path.isfile(lastimage)):
return False
imgdate = os.stat(lastimage).st_mtime
pptdate = os.stat(self.filepath).st_mtime
@@ -301,7 +297,7 @@
"""
return None
- def poll_slidenumber(self):
+ def poll_slidenumber(self, is_live):
"""
Check the current slide number
"""
@@ -311,5 +307,9 @@
if current == self.slidenumber:
return
self.slidenumber = current
- Receiver().send_message(u'slidecontroller_change', self.slidenumber - 1)
-
\ No newline at end of file
+ if is_live:
+ prefix = u'live'
+ else:
+ prefix = u'preview'
+ Receiver().send_message(u'%s_slidecontroller_change' % prefix,
+ self.slidenumber - 1)
Follow ups