Merge lp:~trb143/openlp/audit into lp:openlp

Proposed by Tim Bentley
Status: Superseded
Proposed branch: lp:~trb143/openlp/audit
Merge into: lp:openlp
Diff against target: None lines
To merge this branch: bzr merge lp:~trb143/openlp/audit

This proposal supersedes a proposal from 2009-09-16.

This proposal has been superseded by a proposal from 2009-09-18.

To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) wrote : Posted in a previous version of this proposal

It's a new plugin called Audit.
It monitors items added to the live controller and generates as file so song info for ccl reporting.
It can be deactivated totally if not wanted (default position)
It can be stopped from recording if required by the UI.

Still needs work adding location of file and remembering recording state.

Revision history for this message
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal

This looks mostly fine, I just would rather you created a menu item somewhere (like in the Tools menu) with a checkable menu item that says "Auditing enabled". You could also just make that an option in the settings dialog. A blank media manager item is a bit silly. Also, then you could add more options to the Audit config dialog for things like filename formatting, file size, file location, and anything else you want.

review: Needs Fixing
Revision history for this message
Jonathan Corwin (j-corwin) wrote :

I haven't looked too closely, but it looks like you're outputting to a comma separated list.
E.g.
openlp/plugins/songs/lib/mediaitem.py
  service_item.audit = u'%s,%s,%s' % (service_item.title, author_list, ccl)

I expect the title and author_list could potentially contain commas also, so it could probably do with quoting the fields, something like the following, unless this is handled elsewhere?

service_item.audit = u'"%s","%s",%s' % (service_item.title.replace(u'"', u'""'), author_list.replace(u'"', u'""'), ccl)

lp:~trb143/openlp/audit updated
552. By Tim Bentley

head

553. By Tim Bentley

Fix data format

554. By Tim Bentley

Fix data format

555. By Tim Bentley

Fix plugin arrays 2

556. By Tim Bentley

updates

557. By Tim Bentley

head

558. By Tim Bentley

Plugin cleanups - Image and Audit

559. By Tim Bentley

Add database to audit

560. By Tim Bentley

head and merge fixes

561. By Tim Bentley

Audit database

562. By Tim Bentley

Audit database

563. By Tim Bentley

Audit database addition

564. By Tim Bentley

Audit database addition built

565. By Tim Bentley

Audit database addition insert 1

566. By Tim Bentley

Audit database addition insert 2

567. By Tim Bentley

Minor changes and clean ups

568. By Tim Bentley

Fix audit to not crash, add copyright to DB and fix CCL

569. By Tim Bentley

Force code to recompile

570. By Tim Bentley

Fix table for null fields

571. By Tim Bentley

Head

572. By Tim Bentley

Remore lines

573. By Tim Bentley

Head

574. By Tim Bentley

Bring Custom and Song editing in line

575. By Tim Bentley

Audit Menus

576. By Tim Bentley

Head

577. By Tim Bentley

Remove Powerpoint for Linux Users

578. By Tim Bentley

Add dialog forms to Audit

579. By Tim Bentley

More audit changes and dynamic image backgrounds

580. By Tim Bentley

Song Plugin Cleanup

581. By Tim Bentley

Plugin standardisation and clanups

582. By Tim Bentley

Head

583. By Tim Bentley

Audit Delete Date cleanup

584. By Tim Bentley

Audit Selective Delete complete

585. By Tim Bentley

translations for OSIS bibles

586. By Tim Bentley

General cleanups Jon missed

587. By Tim Bentley

Bible Plugin visual change and shorten delay

588. By Tim Bentley

Cleanups

589. By Tim Bentley

Head

590. By Tim Bentley

Head

591. By Tim Bentley

Jon missed these

592. By Tim Bentley

head

593. By Tim Bentley

Inspired by Jon

594. By Tim Bentley

Add Jon to about

595. By Tim Bentley

Add comments to correct layout

596. By Tim Bentley

Head

597. By Tim Bentley

Fix order of names

598. By Tim Bentley

Plugin abouts

599. By Tim Bentley

Plugin abouts 2

600. By Tim Bentley

Plugin abouts fixed

601. By Tim Bentley

More Plugin list work

602. By Tim Bentley

head

603. By Tim Bentley

Sort out text display on dialog

604. By Tim Bentley

Update UI

605. By Tim Bentley

Start of Active / Inactive work

606. By Tim Bentley

Plugin List Combo boxhandling finished

607. By Tim Bentley

Audit can now be disabled dynamically

608. By Tim Bentley

Sort out Initialistion order and Plugin Status code

609. By Tim Bentley

Media Itmes now hide them selves correctly

610. By Tim Bentley

Sort out Settings tab items

611. By Tim Bentley

Fix int issue

612. By Tim Bentley

Head

613. By Tim Bentley

Head

614. By Tim Bentley

Cleanup hinding code and move to disable for now

615. By Tim Bentley

New file

616. By Tim Bentley

Clean up disenablement

617. By Tim Bentley

More cleanups, Bibles and media done

618. By Tim Bentley

Songs now play hide and seek

619. By Tim Bentley

Presentations add code but leave for now - Angels fear to tread

620. By Tim Bentley

Fix Bible plugin rendering

621. By Tim Bentley

Bible New features and Clean up

622. By Tim Bentley

More dock hiding work

623. By Tim Bentley

Head

624. By Tim Bentley

More hiding changes

625. By Tim Bentley

Head

626. By Tim Bentley

Plugins now hide and reappear correctly

627. By Tim Bentley

Remove all print statements

628. By Tim Bentley

Theme improvements

629. By Tim Bentley

Latest Version checking added

630. By Tim Bentley

Correct Theme name for Export if default

631. By Tim Bentley

Quick code cleanup and fix test for version checking

632. By Tim Bentley

Servie Manager DnD part 1

633. By Tim Bentley

Servie Manager DnD part 2

634. By Tim Bentley

Audit Cleanup - part 1

635. By Tim Bentley

Small fix ups and corrections. Plugin list obeys can_be_diabled

636. By Tim Bentley

Fixes to last merge request

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'openlp/core/lib/eventreceiver.py'
--- openlp/core/lib/eventreceiver.py 2009-09-12 17:24:16 +0000
+++ openlp/core/lib/eventreceiver.py 2009-09-16 18:37:25 +0000
@@ -78,6 +78,8 @@
78 ``{plugin}_stop``78 ``{plugin}_stop``
79 Requests a plugin to handle a stop event79 Requests a plugin to handle a stop event
8080
81 ``audit_live``
82 Sends live song audit requests to the audit component
81 """83 """
82 global log84 global log
83 log = logging.getLogger(u'EventReceiver')85 log = logging.getLogger(u'EventReceiver')
8486
=== modified file 'openlp/core/lib/mediamanageritem.py'
--- openlp/core/lib/mediamanageritem.py 2009-09-12 18:27:17 +0000
+++ openlp/core/lib/mediamanageritem.py 2009-09-16 04:59:38 +0000
@@ -178,8 +178,16 @@
178 """178 """
179 # Add a toolbar179 # Add a toolbar
180 self.addToolbar()180 self.addToolbar()
181 #Allow the plugin to define it's own header181 #Allow the plugin to define buttons at start of bar
182 self.addStartHeaderBar()182 self.addStartHeaderBar()
183 #Add the middle of the tool bar (pre defined)
184 self.addMiddleHeaderBar()
185 #Allow the plugin to define buttons at end of bar
186 self.addEndHeaderBar()
187 #Add the list view
188 self.addListViewToToolBar()
189
190 def addMiddleHeaderBar(self):
183 # Create buttons for the toolbar191 # Create buttons for the toolbar
184 ## File Button ##192 ## File Button ##
185 if self.hasFileIcon:193 if self.hasFileIcon:
@@ -221,8 +229,8 @@
221 translate(self.TranslationContext, u'Add '+self.PluginTextShort+u' To Service'),229 translate(self.TranslationContext, u'Add '+self.PluginTextShort+u' To Service'),
222 translate(self.TranslationContext, u'Add the selected item(s) to the service'),230 translate(self.TranslationContext, u'Add the selected item(s) to the service'),
223 u':/system/system_add.png', self.onAddClick, self.PluginTextShort+u'AddItem')231 u':/system/system_add.png', self.onAddClick, self.PluginTextShort+u'AddItem')
224 #Allow the plugin to define it's own header232
225 self.addEndHeaderBar()233 def addListViewToToolBar(self):
226 #Add the List widget234 #Add the List widget
227 self.ListView = self.ListViewWithDnD_class()235 self.ListView = self.ListViewWithDnD_class()
228 self.ListView.uniformItemSizes = True236 self.ListView.uniformItemSizes = True
229237
=== modified file 'openlp/core/lib/plugin.py'
--- openlp/core/lib/plugin.py 2009-09-12 17:24:16 +0000
+++ openlp/core/lib/plugin.py 2009-09-17 18:24:13 +0000
@@ -166,6 +166,15 @@
166 """166 """
167 pass167 pass
168168
169 def add_tools_menu_item(self, tools_menu):
170 """
171 Create a menu item and add it to the "Tools" menu.
172
173 ``tools_menu``
174 The Tools menu
175 """
176 pass
177
169 def get_settings_tab(self):178 def get_settings_tab(self):
170 """179 """
171 Create a tab for the settings window.180 Create a tab for the settings window.
172181
=== modified file 'openlp/core/lib/pluginmanager.py'
--- openlp/core/lib/pluginmanager.py 2009-09-08 19:58:05 +0000
+++ openlp/core/lib/pluginmanager.py 2009-09-17 18:24:13 +0000
@@ -178,6 +178,18 @@
178 if plugin[u'status'] == u'Active':178 if plugin[u'status'] == u'Active':
179 plugin[u'plugin'].add_export_menu_item(export_menu)179 plugin[u'plugin'].add_export_menu_item(export_menu)
180180
181 def hook_tools_menu(self, tools_menu):
182 """
183 Loop through all the plugins and give them an opportunity to add an
184 item to the tools menu.
185
186 ``tools_menu``
187 The Tools menu.
188 """
189 for plugin in self.plugins:
190 if plugin[u'status'] == u'Active':
191 plugin[u'plugin'].add_tools_menu_item(tools_menu)
192
181 def initialise_plugins(self):193 def initialise_plugins(self):
182 """194 """
183 Loop through all the plugins and give them an opportunity to195 Loop through all the plugins and give them an opportunity to
184196
=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py 2009-09-15 19:06:40 +0000
+++ openlp/core/lib/serviceitem.py 2009-09-16 04:59:38 +0000
@@ -58,6 +58,7 @@
58 self.shortname = hostplugin.name58 self.shortname = hostplugin.name
59 self.name = self.plugin.name59 self.name = self.plugin.name
60 self.title = u''60 self.title = u''
61 self.audit = u''
61 self.items = []62 self.items = []
62 self.iconic_representation = None63 self.iconic_representation = None
63 self.raw_slides = None64 self.raw_slides = None
@@ -185,7 +186,8 @@
185 u'title':self.title,186 u'title':self.title,
186 u'icon':self.icon,187 u'icon':self.icon,
187 u'footer':self.raw_footer,188 u'footer':self.raw_footer,
188 u'type':self.service_item_type189 u'type':self.service_item_type,
190 u'audit':self.audit
189 }191 }
190 oos_data = []192 oos_data = []
191 if self.service_item_type == ServiceType.Text:193 if self.service_item_type == ServiceType.Text:
@@ -218,6 +220,7 @@
218 self.theme = header[u'theme']220 self.theme = header[u'theme']
219 self.addIcon(header[u'icon'])221 self.addIcon(header[u'icon'])
220 self.raw_footer = header[u'footer']222 self.raw_footer = header[u'footer']
223 self.audit = header[u'audit']
221 if self.service_item_type == ServiceType.Text:224 if self.service_item_type == ServiceType.Text:
222 for slide in serviceitem[u'serviceitem'][u'data']:225 for slide in serviceitem[u'serviceitem'][u'data']:
223 self.service_frames.append(slide)226 self.service_frames.append(slide)
224227
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2009-09-12 18:27:17 +0000
+++ openlp/core/ui/mainwindow.py 2009-09-17 18:24:13 +0000
@@ -545,6 +545,8 @@
545 self.plugin_manager.hook_import_menu(self.FileImportMenu)545 self.plugin_manager.hook_import_menu(self.FileImportMenu)
546 # Call the hook method to pull in export menus.546 # Call the hook method to pull in export menus.
547 self.plugin_manager.hook_export_menu(self.FileExportMenu)547 self.plugin_manager.hook_export_menu(self.FileExportMenu)
548 # Call the hook method to pull in tools menus.
549 self.plugin_manager.hook_tools_menu(self.ToolsMenu)
548 # Call the initialise method to setup plugins.550 # Call the initialise method to setup plugins.
549 log.info(u'initialise plugins')551 log.info(u'initialise plugins')
550 self.plugin_manager.initialise_plugins()552 self.plugin_manager.initialise_plugins()
551553
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py 2009-09-18 06:07:10 +0000
+++ openlp/core/ui/slidecontroller.py 2009-09-18 10:36:32 +0000
@@ -314,6 +314,7 @@
314 self.onSlideSelected()314 self.onSlideSelected()
315 self.PreviewListWidget.setFocus()315 self.PreviewListWidget.setFocus()
316 log.info(u'Display Rendering took %4s' % (time.time() - before))316 log.info(u'Display Rendering took %4s' % (time.time() - before))
317 Receiver().send_message(u'audit_live', self.serviceitem.audit)
317 log.debug(u'displayServiceManagerItems End')318 log.debug(u'displayServiceManagerItems End')
318319
319 #Screen event methods320 #Screen event methods
@@ -382,22 +383,28 @@
382383
383 def onStartLoop(self):384 def onStartLoop(self):
384 """385 """
385 Go to the last slide.386 Start the timer loop running and store the timer id
386 """387 """
387 if self.PreviewListWidget.rowCount() > 1:388 if self.PreviewListWidget.rowCount() > 1:
388 self.timer_id = self.startTimer(int(self.DelaySpinBox.value()) * 1000)389 self.timer_id = self.startTimer(int(self.DelaySpinBox.value()) * 1000)
389390
390 def onStopLoop(self):391 def onStopLoop(self):
391 """392 """
392 Go to the last slide.393 Stop the timer loop running
393 """394 """
394 self.killTimer(self.timer_id)395 self.killTimer(self.timer_id)
395396
396 def timerEvent(self, event):397 def timerEvent(self, event):
398 """
399 If the timer event is for this window select next slide
400 """
397 if event.timerId() == self.timer_id:401 if event.timerId() == self.timer_id:
398 self.onSlideSelectedNext()402 self.onSlideSelectedNext()
399403
400 def onGoLive(self):404 def onGoLive(self):
405 """
406 If preview copy slide item to live
407 """
401 row = self.PreviewListWidget.currentRow()408 row = self.PreviewListWidget.currentRow()
402 if row > -1 and row < self.PreviewListWidget.rowCount():409 if row > -1 and row < self.PreviewListWidget.rowCount():
403 self.parent.LiveController.addServiceManagerItem(self.commandItem, row)410 self.parent.LiveController.addServiceManagerItem(self.commandItem, row)
404411
=== added directory 'openlp/plugins/audit'
=== added file 'openlp/plugins/audit/__init__.py'
--- openlp/plugins/audit/__init__.py 1970-01-01 00:00:00 +0000
+++ openlp/plugins/audit/__init__.py 2009-09-16 05:01:11 +0000
@@ -0,0 +1,23 @@
1# -*- coding: utf-8 -*-
2# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
3
4###############################################################################
5# OpenLP - Open Source Lyrics Projection #
6# --------------------------------------------------------------------------- #
7# Copyright (c) 2008-2009 Raoul Snyman #
8# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten #
9# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri #
10# --------------------------------------------------------------------------- #
11# This program is free software; you can redistribute it and/or modify it #
12# under the terms of the GNU General Public License as published by the Free #
13# Software Foundation; version 2 of the License. #
14# #
15# This program is distributed in the hope that it will be useful, but WITHOUT #
16# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
17# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
18# more details. #
19# #
20# You should have received a copy of the GNU General Public License along #
21# with this program; if not, write to the Free Software Foundation, Inc., 59 #
22# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
23###############################################################################
024
=== added file 'openlp/plugins/audit/auditplugin.py'
--- openlp/plugins/audit/auditplugin.py 1970-01-01 00:00:00 +0000
+++ openlp/plugins/audit/auditplugin.py 2009-09-18 10:47:57 +0000
@@ -0,0 +1,112 @@
1# -*- coding: utf-8 -*-
2# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
3
4###############################################################################
5# OpenLP - Open Source Lyrics Projection #
6# --------------------------------------------------------------------------- #
7# Copyright (c) 2008-2009 Raoul Snyman #
8# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten #
9# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri #
10# --------------------------------------------------------------------------- #
11# This program is free software; you can redistribute it and/or modify it #
12# under the terms of the GNU General Public License as published by the Free #
13# Software Foundation; version 2 of the License. #
14# #
15# This program is distributed in the hope that it will be useful, but WITHOUT #
16# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
17# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
18# more details. #
19# #
20# You should have received a copy of the GNU General Public License along #
21# with this program; if not, write to the Free Software Foundation, Inc., 59 #
22# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
23###############################################################################
24
25import logging
26
27from PyQt4 import QtCore, QtGui
28from datetime import date
29
30from openlp.core.lib import Plugin, Receiver, translate
31from openlp.plugins.audit.lib import AuditTab
32
33class AuditPlugin(Plugin):
34 global log
35 log = logging.getLogger(u'AuditPlugin')
36 log.info(u'Audit Plugin loaded')
37
38 def __init__(self, plugin_helpers):
39 # Call the parent constructor
40 Plugin.__init__(self, u'Audit', u'1.9.0', plugin_helpers)
41 self.weight = -4
42 # Create the plugin icon
43 self.icon = QtGui.QIcon()
44 self.icon.addPixmap(QtGui.QPixmap(u':/media/media_image.png'),
45 QtGui.QIcon.Normal, QtGui.QIcon.Off)
46 self.auditfile = None
47
48 def check_pre_conditions(self):
49 """
50 Check to see if auditing is required
51 """
52 log.debug('check_pre_conditions')
53 #Lets see if audit is required
54 if int(self.config.get_config(u'startup', 0)) == QtCore.Qt.Checked:
55 return True
56 else:
57 return False
58
59 def add_tools_menu_item(self, tools_menu):
60 """
61 Give the Audit plugin the opportunity to add items to the
62 **Tools** menu.
63
64 ``tools_menu``
65 The actual **Tools** menu item, so that your actions can
66 use it as their parent.
67 """
68 AuditIcon = QtGui.QIcon()
69 AuditIcon.addPixmap(QtGui.QPixmap(u':/tools/tools_alert.png'),
70 QtGui.QIcon.Normal, QtGui.QIcon.Off)
71 self.ToolsAuditItem = QtGui.QAction(tools_menu)
72 self.ToolsAuditItem.setIcon(AuditIcon)
73 self.ToolsAuditItem.setCheckable(True)
74 self.ToolsAuditItem.setChecked(False)
75 self.ToolsAuditItem.setText(translate(u'AuditPlugin', u'A&udit'))
76 self.ToolsAuditItem.setStatusTip(
77 translate(u'AuditPlugin', u'Start/Stop live song auditing'))
78 self.ToolsAuditItem.setShortcut(translate(u'AuditPlugin', u'F4'))
79 self.ToolsAuditItem.setObjectName(u'ToolsAuditItem')
80 tools_menu.addSeparator()
81 tools_menu.addAction(self.ToolsAuditItem)
82 # Signals and slots
83 QtCore.QObject.connect(self.ToolsAuditItem,
84 QtCore.SIGNAL(u'visibilityChanged(bool)'),
85 self.ToolsAuditItem.setChecked)
86 QtCore.QObject.connect(self.ToolsAuditItem,
87 QtCore.SIGNAL(u'triggered(bool)'),
88 self.toggleAuditState)
89
90 def get_settings_tab(self):
91 self.AuditTab = AuditTab()
92 return self.AuditTab
93
94 def initialise(self):
95 log.info(u'Plugin Initialising')
96 QtCore.QObject.connect(Receiver.get_receiver(),
97 QtCore.SIGNAL(u'audit_live'), self.onReceiveAudit)
98 self.auditFile = open(u'openlp.aud', 'a')
99 self.auditActive = False
100
101 def toggleAuditState(self):
102 self.auditActive = not self.auditActive
103
104 def onReceiveAudit(self, auditData):
105 if self.auditActive:
106 self.auditFile.write(u'%s,%s\n' % (date.today(), auditData))
107 self.auditFile.flush()
108
109 def finalise(self):
110 log.debug(u'Finalise')
111 if self.auditFile is not None:
112 self.auditFile.close()
0113
=== added directory 'openlp/plugins/audit/lib'
=== added file 'openlp/plugins/audit/lib/__init__.py'
--- openlp/plugins/audit/lib/__init__.py 1970-01-01 00:00:00 +0000
+++ openlp/plugins/audit/lib/__init__.py 2009-09-17 18:24:13 +0000
@@ -0,0 +1,25 @@
1# -*- coding: utf-8 -*-
2# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
3
4###############################################################################
5# OpenLP - Open Source Lyrics Projection #
6# --------------------------------------------------------------------------- #
7# Copyright (c) 2008-2009 Raoul Snyman #
8# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten #
9# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri #
10# --------------------------------------------------------------------------- #
11# This program is free software; you can redistribute it and/or modify it #
12# under the terms of the GNU General Public License as published by the Free #
13# Software Foundation; version 2 of the License. #
14# #
15# This program is distributed in the hope that it will be useful, but WITHOUT #
16# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
17# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
18# more details. #
19# #
20# You should have received a copy of the GNU General Public License along #
21# with this program; if not, write to the Free Software Foundation, Inc., 59 #
22# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
23###############################################################################
24
25from audittab import AuditTab
026
=== added file 'openlp/plugins/audit/lib/audittab.py'
--- openlp/plugins/audit/lib/audittab.py 1970-01-01 00:00:00 +0000
+++ openlp/plugins/audit/lib/audittab.py 2009-09-16 18:37:25 +0000
@@ -0,0 +1,70 @@
1# -*- coding: utf-8 -*-
2# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
3
4###############################################################################
5# OpenLP - Open Source Lyrics Projection #
6# --------------------------------------------------------------------------- #
7# Copyright (c) 2008-2009 Raoul Snyman #
8# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten #
9# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri #
10# --------------------------------------------------------------------------- #
11# This program is free software; you can redistribute it and/or modify it #
12# under the terms of the GNU General Public License as published by the Free #
13# Software Foundation; version 2 of the License. #
14# #
15# This program is distributed in the hope that it will be useful, but WITHOUT #
16# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
17# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
18# more details. #
19# #
20# You should have received a copy of the GNU General Public License along #
21# with this program; if not, write to the Free Software Foundation, Inc., 59 #
22# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
23###############################################################################
24
25from PyQt4 import QtCore, QtGui
26
27from openlp.core.lib import SettingsTab, str_to_bool, translate, Receiver
28
29class AuditTab(SettingsTab):
30 """
31 AuditTab is the Audit settings tab in the settings dialog.
32 """
33 def __init__(self):
34 SettingsTab.__init__(self, translate(u'AuditTab', u'Audit'), u'Audit')
35
36 def setupUi(self):
37 self.setObjectName(u'AuditTab')
38 self.AuditLayout = QtGui.QFormLayout(self)
39 self.AuditLayout.setObjectName(u'AuditLayout')
40 self.AuditModeGroupBox = QtGui.QGroupBox(self)
41 self.AuditModeGroupBox.setObjectName(u'AuditModeGroupBox')
42 self.AuditModeLayout = QtGui.QVBoxLayout(self.AuditModeGroupBox)
43 self.AuditModeLayout.setSpacing(8)
44 self.AuditModeLayout.setMargin(8)
45 self.AuditModeLayout.setObjectName(u'AuditModeLayout')
46 self.AuditPortSpinBox = QtGui.QSpinBox(self.AuditModeGroupBox)
47 self.AuditPortSpinBox.setObjectName(u'AuditPortSpinBox')
48 self.AuditPortSpinBox.setMaximum(32767)
49 self.AuditModeLayout.addWidget(self.AuditPortSpinBox)
50 self.AuditActive = QtGui.QCheckBox(self.AuditModeGroupBox)
51 self.AuditActive.setObjectName(u'AuditPortSpinBox')
52 self.AuditModeLayout.addWidget(self.AuditActive)
53 self.WarningLabel = QtGui.QLabel(self.AuditModeGroupBox)
54 self.WarningLabel.setObjectName(u'WarningLabel')
55 self.AuditModeLayout.addWidget(self.WarningLabel)
56 self.AuditLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.AuditModeGroupBox)
57
58 def retranslateUi(self):
59 self.AuditModeGroupBox.setTitle(translate(u'AuditTab', u'Audit File'))
60 self.AuditActive.setText(translate(u'AuditTab', 'Audit available:'))
61 self.WarningLabel.setText(translate(u'AuditTab', u'A restart is needed for this change to become effective'))
62
63 def load(self):
64 self.AuditPortSpinBox.setValue(int(self.config.get_config(u'Audit port', 4316)))
65 self.AuditActive.setChecked(int(self.config.get_config(u'startup', 0)))
66
67 def save(self):
68 self.config.set_config(u'Audit port', unicode(self.AuditPortSpinBox.value()))
69 self.config.set_config(u'startup', unicode(self.AuditActive.checkState()))
70
071
=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py 2009-09-16 10:50:13 +0000
+++ openlp/plugins/songs/lib/mediaitem.py 2009-09-16 19:03:11 +0000
@@ -269,12 +269,6 @@
269 self.parent.songmanager.delete_song(item_id)269 self.parent.songmanager.delete_song(item_id)
270 row = self.ListView.row(item)270 row = self.ListView.row(item)
271 self.ListView.takeItem(row)271 self.ListView.takeItem(row)
272#
273# def onSongPreviewClick(self):
274# service_item = ServiceItem(self.parent)
275# service_item.addIcon(u':/media/media_song.png')
276# self.generateSlideData(service_item)
277# self.parent.preview_controller.addServiceItem(service_item)
278272
279 def generateSlideData(self, service_item):273 def generateSlideData(self, service_item):
280 raw_slides =[]274 raw_slides =[]
@@ -312,16 +306,5 @@
312 raw_footer.append(unicode(306 raw_footer.append(unicode(
313 translate(u'SongMediaItem', u'CCL Licence: ') + ccl ))307 translate(u'SongMediaItem', u'CCL Licence: ') + ccl ))
314 service_item.raw_footer = raw_footer308 service_item.raw_footer = raw_footer
309 service_item.audit = u'%s,%s,%s' % (service_item.title, author_list, ccl)
315 return True310 return True
316
317# def onSongLiveClick(self):
318# service_item = ServiceItem(self.parent)
319# service_item.addIcon(u':/media/media_song.png')
320# self.generateSlideData(service_item)
321# self.parent.live_controller.addServiceItem(service_item)
322#
323# def onSongAddClick(self):
324# service_item = ServiceItem(self.parent)
325# service_item.addIcon( u':/media/media_song.png')
326# self.generateSlideData(service_item)
327# self.parent.service_manager.addServiceItem(service_item)
328311
=== modified file 'resources/images/openlp-2.qrc'
--- resources/images/openlp-2.qrc 2009-07-24 22:13:40 +0000
+++ resources/images/openlp-2.qrc 2009-09-16 04:59:38 +0000
@@ -49,6 +49,10 @@
49 <file>import_remove.png</file>49 <file>import_remove.png</file>
50 <file>import_load.png</file>50 <file>import_load.png</file>
51 </qresource>51 </qresource>
52 <qresource prefix="audit" >
53 <file>audit_start.png</file>
54 <file>audit_stop.png</file>
55 </qresource>
52 <qresource prefix="exports" >56 <qresource prefix="exports" >
53 <file>export_selectall.png</file>57 <file>export_selectall.png</file>
54 <file>export_remove.png</file>58 <file>export_remove.png</file>