forked from openlp/openlp
head
This commit is contained in:
commit
eccbc54e75
@ -199,7 +199,7 @@ class Manager(object):
|
||||
Any parameters to order the returned objects by. Defaults to None.
|
||||
"""
|
||||
query = self.session.query(object_class)
|
||||
if filter_clause:
|
||||
if filter_clause is not None:
|
||||
query = query.filter(filter_clause)
|
||||
if order_by_ref is not None:
|
||||
return query.order_by(order_by_ref).all()
|
||||
@ -237,7 +237,7 @@ class Manager(object):
|
||||
"""
|
||||
try:
|
||||
query = self.session.query(object_class)
|
||||
if filter_clause:
|
||||
if filter_clause is not None:
|
||||
query = query.filter(filter_clause)
|
||||
query.delete(synchronize_session=False)
|
||||
self.session.commit()
|
||||
|
@ -86,7 +86,7 @@ class ServiceItem(object):
|
||||
self.service_item_type = None
|
||||
self._raw_frames = []
|
||||
self._display_frames = []
|
||||
self._uuid = unicode(uuid.uuid1())
|
||||
self._uuid = 0
|
||||
self.notes = u''
|
||||
self.from_plugin = False
|
||||
self.capabilities = []
|
||||
@ -94,6 +94,9 @@ class ServiceItem(object):
|
||||
self.cache = {}
|
||||
self.icon = None
|
||||
|
||||
def _new_item(self):
|
||||
self._uuid = unicode(uuid.uuid1())
|
||||
|
||||
def add_capability(self, capability):
|
||||
"""
|
||||
Add an ItemCapability to a ServiceItem
|
||||
@ -200,6 +203,7 @@ class ServiceItem(object):
|
||||
self.service_item_type = ServiceItemType.Image
|
||||
self._raw_frames.append(
|
||||
{u'title': title, u'image': image, u'path': path})
|
||||
self._new_item()
|
||||
|
||||
def add_from_text(self, title, raw_slide, verse_tag=None):
|
||||
"""
|
||||
@ -215,6 +219,7 @@ class ServiceItem(object):
|
||||
title = title.split(u'\n')[0]
|
||||
self._raw_frames.append(
|
||||
{u'title': title, u'raw_slide': raw_slide, u'verseTag':verse_tag})
|
||||
self._new_item()
|
||||
|
||||
def add_from_command(self, path, file_name, image):
|
||||
"""
|
||||
@ -232,6 +237,7 @@ class ServiceItem(object):
|
||||
self.service_item_type = ServiceItemType.Command
|
||||
self._raw_frames.append(
|
||||
{u'title': file_name, u'image': image, u'path': path})
|
||||
self._new_item()
|
||||
|
||||
def get_service_repr(self):
|
||||
"""
|
||||
|
@ -370,6 +370,6 @@ class SongMediaItem(MediaManagerItem):
|
||||
translate('SongsPlugin.MediaItem', 'CCLI Licence: ') + ccli))
|
||||
service_item.raw_footer = raw_footer
|
||||
service_item.audit = [
|
||||
song.title, author_audit, song.copyright, song.ccli_number
|
||||
song.title, author_audit, song.copyright, unicode(song.ccli_number)
|
||||
]
|
||||
return True
|
||||
|
@ -109,7 +109,7 @@ class SongUsagePlugin(Plugin):
|
||||
log.info(u'SongUsage Initialising')
|
||||
Plugin.initialise(self)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'songs_live_started'),
|
||||
QtCore.SIGNAL(u'slidecontroller_live_started'),
|
||||
self.onReceiveSongUsage)
|
||||
self.SongUsageActive = QtCore.QSettings().value(
|
||||
self.settingsSection + u'/active',
|
||||
@ -133,11 +133,11 @@ class SongUsagePlugin(Plugin):
|
||||
QtCore.QSettings().setValue(self.settingsSection + u'/active',
|
||||
QtCore.QVariant(self.SongUsageActive))
|
||||
|
||||
def onReceiveSongUsage(self, items):
|
||||
def onReceiveSongUsage(self, item):
|
||||
"""
|
||||
SongUsage a live song from SlideController
|
||||
Song Usage for live song from SlideController
|
||||
"""
|
||||
audit = items[0].audit
|
||||
audit = item[0].audit
|
||||
if self.SongUsageActive and audit:
|
||||
song_usage_item = SongUsageItem()
|
||||
song_usage_item.usagedate = datetime.today()
|
||||
|
Loading…
Reference in New Issue
Block a user