From 111c0075262fa8c809d4d37115b62b96d1b79f5b Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 15 Sep 2009 06:13:33 +0100 Subject: [PATCH 1/7] Add audit event to slide times and trigger when added to live --- openlp/core/lib/serviceitem.py | 5 ++++- openlp/core/ui/slidecontroller.py | 13 ++++++++++--- openlp/plugins/songs/lib/mediaitem.py | 19 +------------------ 3 files changed, 15 insertions(+), 22 deletions(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index d0b81e3e7..60f6a0fb4 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -58,6 +58,7 @@ class ServiceItem(object): self.shortname = hostplugin.name self.name = self.plugin.name self.title = u'' + self.audit = u'' self.items = [] self.iconic_representation = None self.raw_slides = None @@ -170,7 +171,8 @@ class ServiceItem(object): u'title':self.title, u'icon':self.icon, u'footer':self.raw_footer, - u'type':self.service_item_type + u'type':self.service_item_type, + u'audit':self.audit } oos_data = [] if self.service_item_type == ServiceType.Text: @@ -203,6 +205,7 @@ class ServiceItem(object): self.theme = header[u'theme'] self.addIcon(header[u'icon']) self.raw_footer = header[u'footer'] + self.audit = header[u'audit'] if self.service_item_type == ServiceType.Text: for slide in serviceitem[u'serviceitem'][u'data']: self.service_frames.append(slide) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 04922266d..95189da6f 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -311,6 +311,7 @@ class SlideController(QtGui.QWidget): self.onSlideSelected() self.PreviewListWidget.setFocus() log.info(u'Display Rendering took %4s' % (time.time() - before)) + Receiver().send_message(u'audit_live', self.serviceitem.audit) log.debug(u'displayServiceManagerItems End') #Screen event methods @@ -376,22 +377,28 @@ class SlideController(QtGui.QWidget): def onStartLoop(self): """ - Go to the last slide. + Start the timer loop running and store the timer id """ if self.PreviewListWidget.rowCount() > 1: self.timer_id = self.startTimer(int(self.DelaySpinBox.value()) * 1000) def onStopLoop(self): """ - Go to the last slide. + Stop the timer loop running """ self.killTimer(self.timer_id) def timerEvent(self, event): + """ + If the timer event is for this window select next slide + """ if event.timerId() == self.timer_id: self.onSlideSelectedNext() - + def onGoLive(self): + """ + If preview copy slide item to live + """ row = self.PreviewListWidget.currentRow() if row > -1 and row < self.PreviewListWidget.rowCount(): self.parent.LiveController.addServiceManagerItem(self.commandItem, row) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 9660d689a..e3523b31e 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -251,12 +251,6 @@ class SongMediaItem(MediaManagerItem): self.parent.songmanager.delete_song(item_id) row = self.ListView.row(item) self.ListView.takeItem(row) -# -# def onSongPreviewClick(self): -# service_item = ServiceItem(self.parent) -# service_item.addIcon(u':/media/media_song.png') -# self.generateSlideData(service_item) -# self.parent.preview_controller.addServiceItem(service_item) def generateSlideData(self, service_item): raw_slides =[] @@ -293,16 +287,5 @@ class SongMediaItem(MediaManagerItem): raw_footer.append(song.copyright ) raw_footer.append(unicode(translate(u'SongMediaItem', u'CCL Licence: ') + ccl )) service_item.raw_footer = raw_footer + service_item.audit = u'%s,%s,%s' % (service_item.title, author_list, ccl) return True - -# def onSongLiveClick(self): -# service_item = ServiceItem(self.parent) -# service_item.addIcon(u':/media/media_song.png') -# self.generateSlideData(service_item) -# self.parent.live_controller.addServiceItem(service_item) -# -# def onSongAddClick(self): -# service_item = ServiceItem(self.parent) -# service_item.addIcon( u':/media/media_song.png') -# self.generateSlideData(service_item) -# self.parent.service_manager.addServiceItem(service_item) From 1cc973b334adbf18d1ec5d479898b40ddf8413b4 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 16 Sep 2009 06:01:11 +0100 Subject: [PATCH 2/7] Audit UI 2 --- openlp/plugins/audit/__init__.py | 23 +++++++ openlp/plugins/audit/auditplugin.py | 56 +++++++++++++++++ openlp/plugins/audit/lib/__init__.py | 26 ++++++++ openlp/plugins/audit/lib/audittab.py | 77 ++++++++++++++++++++++++ openlp/plugins/audit/lib/mediaitem.py | 83 ++++++++++++++++++++++++++ resources/images/audit_start.png | Bin 0 -> 3046 bytes resources/images/audit_stop.png | Bin 0 -> 3253 bytes 7 files changed, 265 insertions(+) create mode 100644 openlp/plugins/audit/__init__.py create mode 100644 openlp/plugins/audit/auditplugin.py create mode 100644 openlp/plugins/audit/lib/__init__.py create mode 100644 openlp/plugins/audit/lib/audittab.py create mode 100644 openlp/plugins/audit/lib/mediaitem.py create mode 100644 resources/images/audit_start.png create mode 100644 resources/images/audit_stop.png diff --git a/openlp/plugins/audit/__init__.py b/openlp/plugins/audit/__init__.py new file mode 100644 index 000000000..df3741192 --- /dev/null +++ b/openlp/plugins/audit/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 + +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2009 Raoul Snyman # +# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten # +# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri # +# --------------------------------------------------------------------------- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +############################################################################### diff --git a/openlp/plugins/audit/auditplugin.py b/openlp/plugins/audit/auditplugin.py new file mode 100644 index 000000000..130954003 --- /dev/null +++ b/openlp/plugins/audit/auditplugin.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 + +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2009 Raoul Snyman # +# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten # +# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri # +# --------------------------------------------------------------------------- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +############################################################################### + +import logging + +from PyQt4 import QtCore, QtGui + +from openlp.core.lib import Plugin +from openlp.plugins.audit.lib import AuditMediaItem, AuditTab + +class AuditPlugin(Plugin): + global log + log = logging.getLogger(u'AuditPlugin') + log.info(u'Audit Plugin loaded') + + def __init__(self, plugin_helpers): + # Call the parent constructor + Plugin.__init__(self, u'Audit', u'1.9.0', plugin_helpers) + self.weight = -4 + # Create the plugin icon + self.icon = QtGui.QIcon() + self.icon.addPixmap(QtGui.QPixmap(u':/media/media_image.png'), + QtGui.QIcon.Normal, QtGui.QIcon.Off) + + def get_settings_tab(self): + self.AuditTab = AuditTab() + return self.AuditTab + + def get_media_manager_item(self): + # Create the MediaManagerItem object + self.media_item = AuditMediaItem(self, self.icon, u'Audit') + return self.media_item + + def initialise(self): + log.info(u'Plugin Initialising') diff --git a/openlp/plugins/audit/lib/__init__.py b/openlp/plugins/audit/lib/__init__.py new file mode 100644 index 000000000..544b1dec2 --- /dev/null +++ b/openlp/plugins/audit/lib/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 + +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2009 Raoul Snyman # +# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten # +# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri # +# --------------------------------------------------------------------------- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +############################################################################### + +from mediaitem import AuditMediaItem +from audittab import AuditTab diff --git a/openlp/plugins/audit/lib/audittab.py b/openlp/plugins/audit/lib/audittab.py new file mode 100644 index 000000000..91e6a88b3 --- /dev/null +++ b/openlp/plugins/audit/lib/audittab.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 + +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2009 Raoul Snyman # +# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten # +# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri # +# --------------------------------------------------------------------------- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +############################################################################### + +from PyQt4 import QtCore, QtGui + +from openlp.core.lib import SettingsTab, str_to_bool, translate, Receiver + +class AuditTab(SettingsTab): + """ + AuditTab is the Audit settings tab in the settings dialog. + """ + def __init__(self): + SettingsTab.__init__(self, translate(u'AuditTab', u'Audit'), u'Audit') + + def setupUi(self): + self.setObjectName(u'AuditTab') + self.AuditLayout = QtGui.QFormLayout(self) + self.AuditLayout.setObjectName(u'AuditLayout') + self.AuditModeGroupBox = QtGui.QGroupBox(self) + self.AuditModeGroupBox.setObjectName(u'AuditModeGroupBox') + self.TimeoutLayout = QtGui.QHBoxLayout(self.AuditModeGroupBox) + self.TimeoutLayout.setSpacing(8) + self.TimeoutLayout.setMargin(0) + self.TimeoutLayout.setObjectName(u'TimeoutLayout') + self.TimeoutLabel = QtGui.QLabel(self.AuditModeGroupBox) + self.TimeoutLabel.setObjectName(u'TimeoutLabel') + self.TimeoutLayout.addWidget(self.TimeoutLabel) + self.TimeoutSpinBox = QtGui.QSpinBox(self.AuditModeGroupBox) + self.TimeoutSpinBox.setMaximum(180) + self.TimeoutSpinBox.setObjectName(u'TimeoutSpinBox') + self.TimeoutLayout.addWidget(self.TimeoutSpinBox) + self.TimeoutSpacer = QtGui.QSpacerItem(147, 20, + QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) + self.TimeoutLayout.addItem(self.TimeoutSpacer) + self.AuditLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.AuditModeGroupBox) + # Signals and slots + QtCore.QObject.connect(self.TimeoutSpinBox, + QtCore.SIGNAL(u'valueChanged(int)'), self.onTimeoutSpinBoxChanged) + + def retranslateUi(self): + self.TimeoutLabel.setText(translate(u'AuditTab', u'Slide Loop Delay:')) + self.TimeoutSpinBox.setSuffix(translate(u'AuditTab', u's')) + + def onTimeoutSpinBoxChanged(self): + self.loop_delay = self.TimeoutSpinBox.value() + + def load(self): + self.loop_delay = int(self.config.get_config(u'loop delay', 5)) + self.TimeoutSpinBox.setValue(self.loop_delay) + + def save(self): + self.config.set_config(u'loop delay', self.loop_delay) + Receiver().send_message(u'update_spin_delay', self.loop_delay ) + + def postSetUp(self): + Receiver().send_message(u'update_spin_delay', self.loop_delay ) diff --git a/openlp/plugins/audit/lib/mediaitem.py b/openlp/plugins/audit/lib/mediaitem.py new file mode 100644 index 000000000..9b7a5aa7f --- /dev/null +++ b/openlp/plugins/audit/lib/mediaitem.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 + +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2009 Raoul Snyman # +# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten # +# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri # +# --------------------------------------------------------------------------- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +############################################################################### + +import logging +import os + +from PyQt4 import QtCore, QtGui +from openlp.core.lib import MediaManagerItem, translate, buildIcon + +class AuditMediaItem(MediaManagerItem): + """ + This is the custom media manager item for Audits. + """ + global log + log = logging.getLogger(u'AuditMediaItem') + log.info(u'Audit Media Item loaded') + + def __init__(self, parent, icon, title): + self.TranslationContext = u'AuditPlugin' + self.PluginTextShort = u'Audit' + self.ConfigSection = u'Audits' + self.IconPath = u'Audit/Audit' + self.hasFileIcon = False + self.hasNewIcon = False + self.hasEditIcon = False + MediaManagerItem.__init__(self, parent, icon, title) + + def initialise(self): + pass + + def addStartHeaderBar(self): + self.startMessage = translate(self.TranslationContext, u'Start Collecting') + self.addToolbarButton(self.startMessage, + translate(self.TranslationContext, u'Start collecting alert messages '), + u':audit/audit_start.png', self.onStartClick, u'AuditStartItem') + self.stopMessage = translate(self.TranslationContext, u'Stop Collecting') + self.addToolbarButton(self.stopMessage, + translate(self.TranslationContext, u'Stop collecting alert messages '), + u':audit/audit_stop.png', self.onStopClick, u'AuditStopItem') + + def addMiddleHeaderBar(self): + pass + + def addListViewToToolBar(self): + self.ListView = QtGui.QListWidget() + self.ListView.uniformItemSizes = True + self.ListView.setGeometry(QtCore.QRect(10, 100, 256, 591)) + self.ListView.setSpacing(1) + self.ListView.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) + self.ListView.setAlternatingRowColors(True) + self.ListView.setDragEnabled(True) + self.ListView.setObjectName(u'AlertListView') + #Add tp PageLayout + self.PageLayout.addWidget(self.ListView) + + def onStartClick(self): + self.Toolbar.actions[self.startMessage].setVisible(False) + self.Toolbar.actions[self.stopMessage].setVisible(True) + + def onStopClick(self): + self.Toolbar.actions[self.startMessage].setVisible(True) + self.Toolbar.actions[self.stopMessage].setVisible(False) diff --git a/resources/images/audit_start.png b/resources/images/audit_start.png new file mode 100644 index 0000000000000000000000000000000000000000..1a741be174be6c42ccb2d1efd81c9ad13fb56a06 GIT binary patch literal 3046 zcmV zUQ9Hj*WFUf%mgitWTcsuMCxG?MFD}CXZB~dXZgMN&U-w~Ih-%g<=*e-b7tlb1a>=n z7Nh~NyzBr-0t4GPQ-zfP!lsvj;0H`Pb$r%AO|7S0wl6GB)Six!HhJ7D_Ac(%x~N9ilZ2@%cbZS(8X*!}wz_9yDIVSjU!y}jXYh-!|ucTnCh zw?)t#_ZHF~-VLO?#JB-D)bnXf?o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QKTIr60_% zKu zJ@BljJM6hkJ@PEqD(aOknuig`y1acialHkum&pUYHjo#3hLNWr=t8bS5<3Y1TcEFW zQZ=h0zdQZ5)MQ`82DONyt2Gv`<3B&ios}?Lk-d%fE(nNIJ6)+HqGfs3p@7Wm-IqX5 zUmZ^{3GvaMAb&Qv&(mDX^t?}ds?jx(?z~NQMm_eV&Xd$DI$Ak#q(*x-anZv_9_Y25 zywLL|c?xg^;#n7-B}^9zAVv`QVQn%qcTs#!v9sjt7|rULW+?-W_w|K3azTYWIoi1v(>@yXZxp1O1+CCtL#qgt7`SGlQlHtAyvEA8X|Y zy-VTUhT+N#?uGnG=l&xSi|N*5Exhjo5dn{tS%z>TXveA)inrH*ksosO|J!j@MGIYBu z-xB@(;nV+p*!p;p&slF zqF&@oCk}G25*IzP$pgJ|$O}Ci$@72Pbl{Ls_b1l?001I-R9JLVZ)S9NVRB^v0C?If oFE7{2%*!rLPAo{(%P&d?05;eLSP)anTmS$707*qoM6N<$f_Agk>;M1& literal 0 HcmV?d00001 diff --git a/resources/images/audit_stop.png b/resources/images/audit_stop.png new file mode 100644 index 0000000000000000000000000000000000000000..0dfaa6af3480a572db50909deb7afefadc875a8c GIT binary patch literal 3253 zcmV;m3`+BfP)@mzELLftg^JKsJi!_J?Cn#{sa2= zty*8Ls=Mm$I%}V^tF+=+WJ-WEv`SpCBVFR7Ipmb=GwyI97h;0h9WqQ|W5WA|_lqwu z2Kz7iFXn8dC}_~ed6Xg;FkYCgcp(!p0)LO_3K`E)vCz7%zJxoh>kdX}XTp=ilfPQj zdB}gsf9Y<4+6Eb7?RS(<`Pk3J?3cWb5Y9?ms6~v#r^zR~CE@gzGDH~yA7;phkD9`2 zq8>&)G|5u8TMt zSNPGERxn_NOCKB2s7vRnkUD z3#W1$w_z>l5uhz}hwflGzsbEMUx$u)e)0UmdCkv!zwrBo-M+azxa3yJtrb&#tGFC{ zIrjBd8WA2F9-En`+xTsM`)ZsP&U0ASMSrk5K=?J%DNV9R%;FF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mjfPoyhM literal 0 HcmV?d00001 From 02f839f5ccce1a259185f9f9ffefa4fa0cddad13 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 16 Sep 2009 19:37:25 +0100 Subject: [PATCH 3/7] Audit UI 3 --- openlp/core/lib/eventreceiver.py | 2 ++ openlp/plugins/audit/auditplugin.py | 19 +++++++++++ openlp/plugins/audit/lib/audittab.py | 49 ++++++++++++--------------- openlp/plugins/audit/lib/mediaitem.py | 15 ++++++-- 4 files changed, 55 insertions(+), 30 deletions(-) diff --git a/openlp/core/lib/eventreceiver.py b/openlp/core/lib/eventreceiver.py index 7f6caacc1..ff8e8f925 100644 --- a/openlp/core/lib/eventreceiver.py +++ b/openlp/core/lib/eventreceiver.py @@ -78,6 +78,8 @@ class EventReceiver(QtCore.QObject): ``{plugin}_stop`` Requests a plugin to handle a stop event + ``audit_live`` + Sends live song audit requests to the audit component """ global log log = logging.getLogger(u'EventReceiver') diff --git a/openlp/plugins/audit/auditplugin.py b/openlp/plugins/audit/auditplugin.py index 130954003..ac7972483 100644 --- a/openlp/plugins/audit/auditplugin.py +++ b/openlp/plugins/audit/auditplugin.py @@ -42,6 +42,18 @@ class AuditPlugin(Plugin): self.icon = QtGui.QIcon() self.icon.addPixmap(QtGui.QPixmap(u':/media/media_image.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.auditfile = None + + def check_pre_conditions(self): + """ + Check to see if auditing is required + """ + log.debug('check_pre_conditions') + #Lets see if audit is required + if int(self.config.get_config(u'startup', 0)) == QtCore.Qt.Checked: + return True + else: + return False def get_settings_tab(self): self.AuditTab = AuditTab() @@ -54,3 +66,10 @@ class AuditPlugin(Plugin): def initialise(self): log.info(u'Plugin Initialising') + self.auditfile = open(u'openlp.aud', 'a') + self.media_item.auditFile = self.auditfile + + def finalise(self): + log.debug(u'Finalise') + if self.auditfile is not None: + self.auditfile.close() diff --git a/openlp/plugins/audit/lib/audittab.py b/openlp/plugins/audit/lib/audittab.py index 91e6a88b3..ac3d545ef 100644 --- a/openlp/plugins/audit/lib/audittab.py +++ b/openlp/plugins/audit/lib/audittab.py @@ -39,39 +39,32 @@ class AuditTab(SettingsTab): self.AuditLayout.setObjectName(u'AuditLayout') self.AuditModeGroupBox = QtGui.QGroupBox(self) self.AuditModeGroupBox.setObjectName(u'AuditModeGroupBox') - self.TimeoutLayout = QtGui.QHBoxLayout(self.AuditModeGroupBox) - self.TimeoutLayout.setSpacing(8) - self.TimeoutLayout.setMargin(0) - self.TimeoutLayout.setObjectName(u'TimeoutLayout') - self.TimeoutLabel = QtGui.QLabel(self.AuditModeGroupBox) - self.TimeoutLabel.setObjectName(u'TimeoutLabel') - self.TimeoutLayout.addWidget(self.TimeoutLabel) - self.TimeoutSpinBox = QtGui.QSpinBox(self.AuditModeGroupBox) - self.TimeoutSpinBox.setMaximum(180) - self.TimeoutSpinBox.setObjectName(u'TimeoutSpinBox') - self.TimeoutLayout.addWidget(self.TimeoutSpinBox) - self.TimeoutSpacer = QtGui.QSpacerItem(147, 20, - QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.TimeoutLayout.addItem(self.TimeoutSpacer) + self.AuditModeLayout = QtGui.QVBoxLayout(self.AuditModeGroupBox) + self.AuditModeLayout.setSpacing(8) + self.AuditModeLayout.setMargin(8) + self.AuditModeLayout.setObjectName(u'AuditModeLayout') + self.AuditPortSpinBox = QtGui.QSpinBox(self.AuditModeGroupBox) + self.AuditPortSpinBox.setObjectName(u'AuditPortSpinBox') + self.AuditPortSpinBox.setMaximum(32767) + self.AuditModeLayout.addWidget(self.AuditPortSpinBox) + self.AuditActive = QtGui.QCheckBox(self.AuditModeGroupBox) + self.AuditActive.setObjectName(u'AuditPortSpinBox') + self.AuditModeLayout.addWidget(self.AuditActive) + self.WarningLabel = QtGui.QLabel(self.AuditModeGroupBox) + self.WarningLabel.setObjectName(u'WarningLabel') + self.AuditModeLayout.addWidget(self.WarningLabel) self.AuditLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.AuditModeGroupBox) - # Signals and slots - QtCore.QObject.connect(self.TimeoutSpinBox, - QtCore.SIGNAL(u'valueChanged(int)'), self.onTimeoutSpinBoxChanged) def retranslateUi(self): - self.TimeoutLabel.setText(translate(u'AuditTab', u'Slide Loop Delay:')) - self.TimeoutSpinBox.setSuffix(translate(u'AuditTab', u's')) - - def onTimeoutSpinBoxChanged(self): - self.loop_delay = self.TimeoutSpinBox.value() + self.AuditModeGroupBox.setTitle(translate(u'AuditTab', u'Audit File')) + self.AuditActive.setText(translate(u'AuditTab', 'Audit available:')) + self.WarningLabel.setText(translate(u'AuditTab', u'A restart is needed for this change to become effective')) def load(self): - self.loop_delay = int(self.config.get_config(u'loop delay', 5)) - self.TimeoutSpinBox.setValue(self.loop_delay) + self.AuditPortSpinBox.setValue(int(self.config.get_config(u'Audit port', 4316))) + self.AuditActive.setChecked(int(self.config.get_config(u'startup', 0))) def save(self): - self.config.set_config(u'loop delay', self.loop_delay) - Receiver().send_message(u'update_spin_delay', self.loop_delay ) + self.config.set_config(u'Audit port', unicode(self.AuditPortSpinBox.value())) + self.config.set_config(u'startup', unicode(self.AuditActive.checkState())) - def postSetUp(self): - Receiver().send_message(u'update_spin_delay', self.loop_delay ) diff --git a/openlp/plugins/audit/lib/mediaitem.py b/openlp/plugins/audit/lib/mediaitem.py index 9b7a5aa7f..a85a44599 100644 --- a/openlp/plugins/audit/lib/mediaitem.py +++ b/openlp/plugins/audit/lib/mediaitem.py @@ -24,9 +24,10 @@ import logging import os +from datetime import date from PyQt4 import QtCore, QtGui -from openlp.core.lib import MediaManagerItem, translate, buildIcon +from openlp.core.lib import MediaManagerItem, translate, buildIcon, Receiver class AuditMediaItem(MediaManagerItem): """ @@ -45,9 +46,13 @@ class AuditMediaItem(MediaManagerItem): self.hasNewIcon = False self.hasEditIcon = False MediaManagerItem.__init__(self, parent, icon, title) + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'audit_live'), self.onReceiveAudit) def initialise(self): - pass + self.Toolbar.actions[self.startMessage].setVisible(True) + self.Toolbar.actions[self.stopMessage].setVisible(False) + self.auditActive = False def addStartHeaderBar(self): self.startMessage = translate(self.TranslationContext, u'Start Collecting') @@ -77,7 +82,13 @@ class AuditMediaItem(MediaManagerItem): def onStartClick(self): self.Toolbar.actions[self.startMessage].setVisible(False) self.Toolbar.actions[self.stopMessage].setVisible(True) + self.auditActive = True def onStopClick(self): self.Toolbar.actions[self.startMessage].setVisible(True) self.Toolbar.actions[self.stopMessage].setVisible(False) + self.auditActive = False + + def onReceiveAudit(self, auditData): + if self.auditActive: + self.auditFile.write(u'%s,%s\n' % (date.today(), auditData)) From 8b65992307a9a785ce297fbf31aad512bcb5c443 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Thu, 17 Sep 2009 19:24:13 +0100 Subject: [PATCH 4/7] requested cleanups 1 --- openlp/core/lib/plugin.py | 9 +++ openlp/core/lib/pluginmanager.py | 12 ++++ openlp/core/ui/mainwindow.py | 2 + openlp/plugins/audit/auditplugin.py | 52 +++++++++++--- openlp/plugins/audit/lib/__init__.py | 1 - openlp/plugins/audit/lib/mediaitem.py | 94 -------------------------- resources/images/audit_start.png | Bin 3046 -> 0 bytes resources/images/audit_stop.png | Bin 3253 -> 0 bytes 8 files changed, 67 insertions(+), 103 deletions(-) delete mode 100644 openlp/plugins/audit/lib/mediaitem.py delete mode 100644 resources/images/audit_start.png delete mode 100644 resources/images/audit_stop.png diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index 87c999b97..a64b4938d 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -166,6 +166,15 @@ class Plugin(object): """ pass + def add_tools_menu_item(self, tools_menu): + """ + Create a menu item and add it to the "Tools" menu. + + ``tools_menu`` + The Tools menu + """ + pass + def get_settings_tab(self): """ Create a tab for the settings window. diff --git a/openlp/core/lib/pluginmanager.py b/openlp/core/lib/pluginmanager.py index ecce6747b..4f0ae3742 100644 --- a/openlp/core/lib/pluginmanager.py +++ b/openlp/core/lib/pluginmanager.py @@ -178,6 +178,18 @@ class PluginManager(object): if plugin[u'status'] == u'Active': plugin[u'plugin'].add_export_menu_item(export_menu) + def hook_tools_menu(self, tools_menu): + """ + Loop through all the plugins and give them an opportunity to add an + item to the tools menu. + + ``tools_menu`` + The Tools menu. + """ + for plugin in self.plugins: + if plugin[u'status'] == u'Active': + plugin[u'plugin'].add_tools_menu_item(tools_menu) + def initialise_plugins(self): """ Loop through all the plugins and give them an opportunity to diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 67644643b..f2a90f8fd 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -545,6 +545,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.plugin_manager.hook_import_menu(self.FileImportMenu) # Call the hook method to pull in export menus. self.plugin_manager.hook_export_menu(self.FileExportMenu) + # Call the hook method to pull in tools menus. + self.plugin_manager.hook_tools_menu(self.ToolsMenu) # Call the initialise method to setup plugins. log.info(u'initialise plugins') self.plugin_manager.initialise_plugins() diff --git a/openlp/plugins/audit/auditplugin.py b/openlp/plugins/audit/auditplugin.py index ac7972483..6ad0ef7d7 100644 --- a/openlp/plugins/audit/auditplugin.py +++ b/openlp/plugins/audit/auditplugin.py @@ -26,8 +26,8 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Plugin -from openlp.plugins.audit.lib import AuditMediaItem, AuditTab +from openlp.core.lib import Plugin, Receiver, translate +from openlp.plugins.audit.lib import AuditTab class AuditPlugin(Plugin): global log @@ -55,19 +55,55 @@ class AuditPlugin(Plugin): else: return False + def add_tools_menu_item(self, tools_menu): + """ + Give the Audit plugin the opportunity to add items to the + **Tools** menu. + + ``tools_menu`` + The actual **Tools** menu item, so that your actions can + use it as their parent. + """ + self.ToolsAuditItem = QtGui.QAction(tools_menu) + AuditIcon = QtGui.QIcon() + AuditIcon.addPixmap(QtGui.QPixmap(u':/tools/tools_alert.png'), + QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.ToolsAuditItem.setIcon(AuditIcon) + self.ToolsAuditItem.setObjectName(u'ToolsAuditItem') + self.ToolsAuditItem.setCheckable(True) + self.ToolsAuditItem.setChecked(True) + tools_menu.addSeparator() + tools_menu.addAction(self.ToolsAuditItem) + + self.ToolsAuditItem.setText(translate(u'AuditPlugin', u'A&udit')) + self.ToolsAuditItem.setStatusTip( + translate(u'AuditPlugin', u'Start/Stop live song auditing')) + self.ToolsAuditItem.setShortcut(translate(u'AuditPlugin', u'F4')) +# + # Translations... +# # Signals and slots +# QtCore.QObject.connect(self.MediaManagerDock, +# QtCore.SIGNAL(u'visibilityChanged(bool)'), +# self.ViewMediaManagerItem.setChecked) +# QtCore.QObject.connect(self.ViewMediaManagerItem, +# QtCore.SIGNAL(u'triggered(bool)'), +# self.toggleMediaManager) + def get_settings_tab(self): self.AuditTab = AuditTab() return self.AuditTab - def get_media_manager_item(self): - # Create the MediaManagerItem object - self.media_item = AuditMediaItem(self, self.icon, u'Audit') - return self.media_item - def initialise(self): log.info(u'Plugin Initialising') + QtCore.QObject.connect(Receiver.get_receiver(), + QtCore.SIGNAL(u'audit_live'), self.onReceiveAudit) self.auditfile = open(u'openlp.aud', 'a') - self.media_item.auditFile = self.auditfile + self.auditActive = False + + def onReceiveAudit(self, auditData): + if self.auditActive: + self.auditFile.write(u'%s,%s\n' % (date.today(), auditData)) + self.auditfile.flush() def finalise(self): log.debug(u'Finalise') diff --git a/openlp/plugins/audit/lib/__init__.py b/openlp/plugins/audit/lib/__init__.py index 544b1dec2..9db18d784 100644 --- a/openlp/plugins/audit/lib/__init__.py +++ b/openlp/plugins/audit/lib/__init__.py @@ -22,5 +22,4 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -from mediaitem import AuditMediaItem from audittab import AuditTab diff --git a/openlp/plugins/audit/lib/mediaitem.py b/openlp/plugins/audit/lib/mediaitem.py deleted file mode 100644 index a85a44599..000000000 --- a/openlp/plugins/audit/lib/mediaitem.py +++ /dev/null @@ -1,94 +0,0 @@ -# -*- coding: utf-8 -*- -# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 - -############################################################################### -# OpenLP - Open Source Lyrics Projection # -# --------------------------------------------------------------------------- # -# Copyright (c) 2008-2009 Raoul Snyman # -# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten # -# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri # -# --------------------------------------------------------------------------- # -# This program is free software; you can redistribute it and/or modify it # -# under the terms of the GNU General Public License as published by the Free # -# Software Foundation; version 2 of the License. # -# # -# This program is distributed in the hope that it will be useful, but WITHOUT # -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # -# more details. # -# # -# You should have received a copy of the GNU General Public License along # -# with this program; if not, write to the Free Software Foundation, Inc., 59 # -# Temple Place, Suite 330, Boston, MA 02111-1307 USA # -############################################################################### - -import logging -import os -from datetime import date - -from PyQt4 import QtCore, QtGui -from openlp.core.lib import MediaManagerItem, translate, buildIcon, Receiver - -class AuditMediaItem(MediaManagerItem): - """ - This is the custom media manager item for Audits. - """ - global log - log = logging.getLogger(u'AuditMediaItem') - log.info(u'Audit Media Item loaded') - - def __init__(self, parent, icon, title): - self.TranslationContext = u'AuditPlugin' - self.PluginTextShort = u'Audit' - self.ConfigSection = u'Audits' - self.IconPath = u'Audit/Audit' - self.hasFileIcon = False - self.hasNewIcon = False - self.hasEditIcon = False - MediaManagerItem.__init__(self, parent, icon, title) - QtCore.QObject.connect(Receiver.get_receiver(), - QtCore.SIGNAL(u'audit_live'), self.onReceiveAudit) - - def initialise(self): - self.Toolbar.actions[self.startMessage].setVisible(True) - self.Toolbar.actions[self.stopMessage].setVisible(False) - self.auditActive = False - - def addStartHeaderBar(self): - self.startMessage = translate(self.TranslationContext, u'Start Collecting') - self.addToolbarButton(self.startMessage, - translate(self.TranslationContext, u'Start collecting alert messages '), - u':audit/audit_start.png', self.onStartClick, u'AuditStartItem') - self.stopMessage = translate(self.TranslationContext, u'Stop Collecting') - self.addToolbarButton(self.stopMessage, - translate(self.TranslationContext, u'Stop collecting alert messages '), - u':audit/audit_stop.png', self.onStopClick, u'AuditStopItem') - - def addMiddleHeaderBar(self): - pass - - def addListViewToToolBar(self): - self.ListView = QtGui.QListWidget() - self.ListView.uniformItemSizes = True - self.ListView.setGeometry(QtCore.QRect(10, 100, 256, 591)) - self.ListView.setSpacing(1) - self.ListView.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) - self.ListView.setAlternatingRowColors(True) - self.ListView.setDragEnabled(True) - self.ListView.setObjectName(u'AlertListView') - #Add tp PageLayout - self.PageLayout.addWidget(self.ListView) - - def onStartClick(self): - self.Toolbar.actions[self.startMessage].setVisible(False) - self.Toolbar.actions[self.stopMessage].setVisible(True) - self.auditActive = True - - def onStopClick(self): - self.Toolbar.actions[self.startMessage].setVisible(True) - self.Toolbar.actions[self.stopMessage].setVisible(False) - self.auditActive = False - - def onReceiveAudit(self, auditData): - if self.auditActive: - self.auditFile.write(u'%s,%s\n' % (date.today(), auditData)) diff --git a/resources/images/audit_start.png b/resources/images/audit_start.png deleted file mode 100644 index 1a741be174be6c42ccb2d1efd81c9ad13fb56a06..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3046 zcmV zUQ9Hj*WFUf%mgitWTcsuMCxG?MFD}CXZB~dXZgMN&U-w~Ih-%g<=*e-b7tlb1a>=n z7Nh~NyzBr-0t4GPQ-zfP!lsvj;0H`Pb$r%AO|7S0wl6GB)Six!HhJ7D_Ac(%x~N9ilZ2@%cbZS(8X*!}wz_9yDIVSjU!y}jXYh-!|ucTnCh zw?)t#_ZHF~-VLO?#JB-D)bnXf?o{eU&U3`^%;sB(iylYG1HGOhFZA3?o`_Ku;r#+0k*8pFO3}v60F6Hxr__t9S9ME|Y6=M+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TcEFW zQZ=h0zdQZ5)MQ`82DONyt2Gv`<3B&ios}?Lk-d%fE(nNIJ6)+HqGfs3p@7Wm-IqX5 zUmZ^{3GvaMAb&Qv&(mDX^t?}ds?jx(?z~NQMm_eV&Xd$DI$Ak#q(*x-anZv_9_Y25 zywLL|c?xg^;#n7-B}^9zAVv`QVQn%qcTs#!v9sjt7|rULW+?-W_w|K3azTYWIoi1v(>@yXZxp1O1+CCtL#qgt7`SGlQlHtAyvEA8X|Y zy-VTUhT+N#?uGnG=l&xSi|N*5Exhjo5dn{tS%z>TXveA)inrH*ksosO|J!j@MGIYBu z-xB@(;nV+p*!p;p&slF zqF&@oCk}G25*IzP$pgJ|$O}Ci$@72Pbl{Ls_b1l?001I-R9JLVZ)S9NVRB^v0C?If oFE7{2%*!rLPAo{(%P&d?05;eLSP)anTmS$707*qoM6N<$f_Agk>;M1& diff --git a/resources/images/audit_stop.png b/resources/images/audit_stop.png deleted file mode 100644 index 0dfaa6af3480a572db50909deb7afefadc875a8c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3253 zcmV;m3`+BfP)@mzELLftg^JKsJi!_J?Cn#{sa2= zty*8Ls=Mm$I%}V^tF+=+WJ-WEv`SpCBVFR7Ipmb=GwyI97h;0h9WqQ|W5WA|_lqwu z2Kz7iFXn8dC}_~ed6Xg;FkYCgcp(!p0)LO_3K`E)vCz7%zJxoh>kdX}XTp=ilfPQj zdB}gsf9Y<4+6Eb7?RS(<`Pk3J?3cWb5Y9?ms6~v#r^zR~CE@gzGDH~yA7;phkD9`2 zq8>&)G|5u8TMt zSNPGERxn_NOCKB2s7vRnkUD z3#W1$w_z>l5uhz}hwflGzsbEMUx$u)e)0UmdCkv!zwrBo-M+azxa3yJtrb&#tGFC{ zIrjBd8WA2F9-En`+xTsM`)ZsP&U0ASMSrk5K=?J%DNV9R%;FFELy_e;YQJE=@LU}3 z`hWBP_FY`k@i+3`$cxYISF>Q?f`Nvv^;B=DH?;X8!^0k?wq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entley Date: Fri, 18 Sep 2009 11:47:57 +0100 Subject: [PATCH 5/7] Audit cleanup from last merge --- openlp/plugins/audit/auditplugin.py | 39 +++++++++++++++-------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/openlp/plugins/audit/auditplugin.py b/openlp/plugins/audit/auditplugin.py index 6ad0ef7d7..b0ad33a70 100644 --- a/openlp/plugins/audit/auditplugin.py +++ b/openlp/plugins/audit/auditplugin.py @@ -25,6 +25,7 @@ import logging from PyQt4 import QtCore, QtGui +from datetime import date from openlp.core.lib import Plugin, Receiver, translate from openlp.plugins.audit.lib import AuditTab @@ -64,30 +65,27 @@ class AuditPlugin(Plugin): The actual **Tools** menu item, so that your actions can use it as their parent. """ - self.ToolsAuditItem = QtGui.QAction(tools_menu) AuditIcon = QtGui.QIcon() AuditIcon.addPixmap(QtGui.QPixmap(u':/tools/tools_alert.png'), QtGui.QIcon.Normal, QtGui.QIcon.Off) + self.ToolsAuditItem = QtGui.QAction(tools_menu) self.ToolsAuditItem.setIcon(AuditIcon) - self.ToolsAuditItem.setObjectName(u'ToolsAuditItem') self.ToolsAuditItem.setCheckable(True) - self.ToolsAuditItem.setChecked(True) - tools_menu.addSeparator() - tools_menu.addAction(self.ToolsAuditItem) - + self.ToolsAuditItem.setChecked(False) self.ToolsAuditItem.setText(translate(u'AuditPlugin', u'A&udit')) self.ToolsAuditItem.setStatusTip( translate(u'AuditPlugin', u'Start/Stop live song auditing')) self.ToolsAuditItem.setShortcut(translate(u'AuditPlugin', u'F4')) -# - # Translations... -# # Signals and slots -# QtCore.QObject.connect(self.MediaManagerDock, -# QtCore.SIGNAL(u'visibilityChanged(bool)'), -# self.ViewMediaManagerItem.setChecked) -# QtCore.QObject.connect(self.ViewMediaManagerItem, -# QtCore.SIGNAL(u'triggered(bool)'), -# self.toggleMediaManager) + self.ToolsAuditItem.setObjectName(u'ToolsAuditItem') + tools_menu.addSeparator() + tools_menu.addAction(self.ToolsAuditItem) + # Signals and slots + QtCore.QObject.connect(self.ToolsAuditItem, + QtCore.SIGNAL(u'visibilityChanged(bool)'), + self.ToolsAuditItem.setChecked) + QtCore.QObject.connect(self.ToolsAuditItem, + QtCore.SIGNAL(u'triggered(bool)'), + self.toggleAuditState) def get_settings_tab(self): self.AuditTab = AuditTab() @@ -97,15 +95,18 @@ class AuditPlugin(Plugin): log.info(u'Plugin Initialising') QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'audit_live'), self.onReceiveAudit) - self.auditfile = open(u'openlp.aud', 'a') + self.auditFile = open(u'openlp.aud', 'a') self.auditActive = False + def toggleAuditState(self): + self.auditActive = not self.auditActive + def onReceiveAudit(self, auditData): if self.auditActive: self.auditFile.write(u'%s,%s\n' % (date.today(), auditData)) - self.auditfile.flush() + self.auditFile.flush() def finalise(self): log.debug(u'Finalise') - if self.auditfile is not None: - self.auditfile.close() + if self.auditFile is not None: + self.auditFile.close() From 3a4bb91633a19c9a2f6857216b330a68af36f2e3 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 18 Sep 2009 16:54:15 +0100 Subject: [PATCH 6/7] Fix data format --- openlp/plugins/songs/lib/mediaitem.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 46f90d593..6f2392ee0 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -273,7 +273,7 @@ class SongMediaItem(MediaManagerItem): def generateSlideData(self, service_item): raw_slides =[] raw_footer = [] - author_list = u'' + author_list = [] ccl = u'' item = self.ListView.currentItem() if item is None: @@ -293,9 +293,7 @@ class SongMediaItem(MediaManagerItem): service_item.add_from_text(slide[:30], unicode(slide)) service_item.title = song.title for author in song.authors: - if len(author_list) > 1: - author_list = author_list + u', ' - author_list = author_list + unicode(author.display_name) + author_list.append(unicode(author.display_name)) if song.ccli_number == None or len(song.ccli_number) == 0: ccl = self.parent.settings.GeneralTab.CCLNumber else: @@ -306,5 +304,5 @@ class SongMediaItem(MediaManagerItem): raw_footer.append(unicode( translate(u'SongMediaItem', u'CCL Licence: ') + ccl )) service_item.raw_footer = raw_footer - service_item.audit = u'%s,%s,%s' % (service_item.title, author_list, ccl) + service_item.audit = [service_item.title, author_list, ccl] return True From 9096d1960cbe1cc141b11947af8398023115851a Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Fri, 18 Sep 2009 17:06:39 +0100 Subject: [PATCH 7/7] Fix data format --- openlp/plugins/songs/lib/mediaitem.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 6f2392ee0..cce5cf8a8 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -273,7 +273,8 @@ class SongMediaItem(MediaManagerItem): def generateSlideData(self, service_item): raw_slides =[] raw_footer = [] - author_list = [] + author_list = u'' + author_audit = [] ccl = u'' item = self.ListView.currentItem() if item is None: @@ -293,7 +294,10 @@ class SongMediaItem(MediaManagerItem): service_item.add_from_text(slide[:30], unicode(slide)) service_item.title = song.title for author in song.authors: - author_list.append(unicode(author.display_name)) + if len(author_list) > 1: + author_list = author_list + u', ' + author_list = author_list + unicode(author.display_name) + author_audit.append(unicode(author.display_name)) if song.ccli_number == None or len(song.ccli_number) == 0: ccl = self.parent.settings.GeneralTab.CCLNumber else: @@ -304,5 +308,5 @@ class SongMediaItem(MediaManagerItem): raw_footer.append(unicode( translate(u'SongMediaItem', u'CCL Licence: ') + ccl )) service_item.raw_footer = raw_footer - service_item.audit = [service_item.title, author_list, ccl] + service_item.audit = [service_item.title, author_audit, ccl] return True