forked from openlp/openlp
fix up song edit from preview
bzr-revno: 625
This commit is contained in:
commit
b7a7dd4a2c
8
openlp-1to2-converter.py
Normal file → Executable file
8
openlp-1to2-converter.py
Normal file → Executable file
@ -25,7 +25,13 @@
|
||||
|
||||
import sys
|
||||
import os
|
||||
import sqlite
|
||||
try:
|
||||
import sqlite
|
||||
except:
|
||||
try:
|
||||
import pysqlite2
|
||||
except:
|
||||
print 'No Sqlite2 package available'
|
||||
import sqlite3
|
||||
import re
|
||||
from optparse import OptionParser
|
||||
|
@ -86,6 +86,13 @@ class EventReceiver(QtCore.QObject):
|
||||
|
||||
``config_updated``
|
||||
Informs components the config has changed
|
||||
|
||||
``edit_song``
|
||||
Requests the current song on the preview display be loaded for edit
|
||||
|
||||
``preview_song``
|
||||
Tells the song plugin the edit has finished and the song can be previewed
|
||||
Only available if the edit was triggered by the Preview button.
|
||||
"""
|
||||
global log
|
||||
log = logging.getLogger(u'EventReceiver')
|
||||
|
@ -97,6 +97,8 @@ class SlideController(QtGui.QWidget):
|
||||
]
|
||||
self.timer_id = 0
|
||||
self.commandItem = None
|
||||
self.songEdit = False
|
||||
self.row = 0
|
||||
self.Panel = QtGui.QWidget(parent.ControlSplitter)
|
||||
# Layout for holding panel
|
||||
self.PanelLayout = QtGui.QVBoxLayout(self.Panel)
|
||||
@ -180,6 +182,7 @@ class SlideController(QtGui.QWidget):
|
||||
self.Toolbar.addToolbarWidget(
|
||||
u'Image SpinBox', self.DelaySpinBox)
|
||||
self.DelaySpinBox.setSuffix(self.trUtf8(u's'))
|
||||
self.DelaySpinBox.setToolTip(self.trUtf8(u'Delay between slides in seconds'))
|
||||
|
||||
self.ControllerLayout.addWidget(self.Toolbar)
|
||||
# Screen preview area
|
||||
@ -289,7 +292,12 @@ class SlideController(QtGui.QWidget):
|
||||
Receiver().send_message(u'%s_start' % item.name.lower(), \
|
||||
[item.shortname, item.service_item_path,
|
||||
item.service_frames[0][u'title']])
|
||||
self.displayServiceManagerItems(item, 0)
|
||||
slideno = 0
|
||||
if self.songEdit:
|
||||
slideno = self.row
|
||||
self.songEdit = False
|
||||
self.displayServiceManagerItems(item, slideno)
|
||||
|
||||
|
||||
def addServiceManagerItem(self, item, slideno):
|
||||
"""
|
||||
@ -297,7 +305,7 @@ class SlideController(QtGui.QWidget):
|
||||
request the correct the toolbar of the plugin
|
||||
Called by ServiceManager
|
||||
"""
|
||||
log.debug(u'addServiceItem')
|
||||
log.debug(u'addServiceManagerItem')
|
||||
#If old item was a command tell it to stop
|
||||
if self.commandItem is not None and \
|
||||
self.commandItem.service_item_type == ServiceType.Command:
|
||||
@ -387,12 +395,13 @@ class SlideController(QtGui.QWidget):
|
||||
if this is the Live Controller also display on the screen
|
||||
"""
|
||||
row = self.PreviewListWidget.currentRow()
|
||||
self.row = 0
|
||||
if row > -1 and row < self.PreviewListWidget.rowCount():
|
||||
if self.commandItem.service_item_type == ServiceType.Command:
|
||||
Receiver().send_message(u'%s_slide'% self.commandItem.name.lower(), [row])
|
||||
QtCore.QTimer.singleShot(0.5, self.grabMainDisplay)
|
||||
if isLive:
|
||||
QtCore.QTimer.singleShot(0.5, self.grabMainDisplay)
|
||||
else:
|
||||
#label = self.PreviewListWidget.cellWidget(row, 0)
|
||||
frame = self.serviceitem.frames[row][u'image']
|
||||
before = time.time()
|
||||
if frame is None:
|
||||
@ -401,6 +410,7 @@ class SlideController(QtGui.QWidget):
|
||||
log.info(u'Slide Rendering took %4s' % (time.time() - before))
|
||||
if self.isLive:
|
||||
self.parent.mainDisplay.frameView(frame)
|
||||
self.row = row
|
||||
|
||||
def grabMainDisplay(self):
|
||||
winid = QtGui.QApplication.desktop().winId()
|
||||
@ -474,6 +484,7 @@ class SlideController(QtGui.QWidget):
|
||||
self.onSlideSelectedNext()
|
||||
|
||||
def onEditSong(self):
|
||||
self.songEdit = True
|
||||
Receiver().send_message(u'edit_song')
|
||||
|
||||
def onGoLive(self):
|
||||
|
@ -125,7 +125,7 @@ class SongMediaItem(MediaManagerItem):
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'edit_song'), self.onEventEditSong)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'proview_song'), self.onPreviewClick)
|
||||
QtCore.SIGNAL(u'preview_song'), self.onPreviewClick)
|
||||
|
||||
def configUpdated(self):
|
||||
self.searchAsYouType = str_to_bool(
|
||||
@ -181,7 +181,6 @@ class SongMediaItem(MediaManagerItem):
|
||||
if song.id == self.fromPreview:
|
||||
self.fromPreview = 0
|
||||
self.ListView.setCurrentItem(song_name)
|
||||
self.onPreviewClick()
|
||||
|
||||
def displayResultsAuthor(self, searchresults):
|
||||
log.debug(u'display results Author')
|
||||
|
Loading…
Reference in New Issue
Block a user