Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~trb143/openlp/audit |
Merge into: | lp:openlp |
Diff against target: |
1778 lines 19 files modified
openlp/core/lib/mediamanageritem.py (+20/-6) openlp/core/lib/renderer.py (+0/-1) openlp/core/lib/rendermanager.py (+17/-0) openlp/plugins/audit/auditplugin.py (+27/-2) openlp/plugins/audit/forms/__init__.py (+26/-0) openlp/plugins/audit/forms/auditdeletedialog.py (+39/-0) openlp/plugins/audit/forms/auditdeleteform.py (+240/-0) openlp/plugins/audit/forms/auditdetaildialog.py (+163/-0) openlp/plugins/audit/forms/auditdetailform.py (+240/-0) openlp/plugins/audit/lib/manager.py (+26/-0) openlp/plugins/bibles/lib/mediaitem.py (+11/-48) openlp/plugins/custom/forms/__init__.py (+0/-2) openlp/plugins/custom/lib/mediaitem.py (+4/-3) openlp/plugins/images/lib/mediaitem.py (+60/-4) openlp/plugins/media/lib/mediaitem.py (+6/-3) openlp/plugins/presentations/lib/mediaitem.py (+6/-3) openlp/plugins/songs/lib/mediaitem.py (+12/-60) resources/forms/auditdeletedialog.ui (+87/-0) resources/forms/auditdetaildialog.ui (+343/-0) |
To merge this branch: | bzr merge lp:~trb143/openlp/audit |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jon Tibble (community) | Approve | ||
Review via email:
|
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Tim Bentley (trb143) wrote : | # |
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jon Tibble (meths) wrote : | # |
Looks good
Is all the commented out code not ready yet?
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'openlp/core/lib/mediamanageritem.py' |
2 | --- openlp/core/lib/mediamanageritem.py 2009-09-21 19:57:36 +0000 |
3 | +++ openlp/core/lib/mediamanageritem.py 2009-09-26 09:20:25 +0000 |
4 | @@ -115,10 +115,23 @@ |
5 | self.PageLayout = QtGui.QVBoxLayout(self) |
6 | self.PageLayout.setSpacing(0) |
7 | self.PageLayout.setMargin(0) |
8 | + self.requiredIcons() |
9 | self.setupUi() |
10 | self.retranslateUi() |
11 | self.initialise() |
12 | |
13 | + def requiredIcons(self): |
14 | + """ |
15 | + This method is called to define the icons for the plugin. |
16 | + It provides a default set and the plugin is able to override |
17 | + the if required. |
18 | + """ |
19 | + self.hasNewIcon = True |
20 | + self.hasEditIcon = True |
21 | + self.hasFileIcon = False |
22 | + self.hasDeleteIcon = True |
23 | + |
24 | + |
25 | def retranslateUi(self): |
26 | """ |
27 | This method is called automatically to provide OpenLP with the |
28 | @@ -221,12 +234,13 @@ |
29 | u':' + self.IconPath + u'_edit.png', self.onEditClick, |
30 | self.PluginTextShort + u'EditItem') |
31 | ## Delete Button ## |
32 | - self.addToolbarButton( |
33 | - translate( |
34 | - self.TranslationContext, u'Delete ' + self.PluginTextShort), |
35 | - translate(self.TranslationContext, u'Delete the selected item'), |
36 | - u':' + self.IconPath + u'_delete.png', self.onDeleteClick, |
37 | - self.PluginTextShort + u'DeleteItem') |
38 | + if self.hasDeleteIcon: |
39 | + self.addToolbarButton( |
40 | + translate( |
41 | + self.TranslationContext, u'Delete ' + self.PluginTextShort), |
42 | + translate(self.TranslationContext, u'Delete the selected item'), |
43 | + u':' + self.IconPath + u'_delete.png', self.onDeleteClick, |
44 | + self.PluginTextShort + u'DeleteItem') |
45 | ## Separator Line ## |
46 | self.addToolbarSeparator() |
47 | ## Preview ## |
48 | |
49 | === modified file 'openlp/core/lib/renderer.py' |
50 | --- openlp/core/lib/renderer.py 2009-09-25 00:43:42 +0000 |
51 | +++ openlp/core/lib/renderer.py 2009-09-26 09:20:25 +0000 |
52 | @@ -51,7 +51,6 @@ |
53 | self._frame = None |
54 | self.bg_frame = None |
55 | self.bg_image = None |
56 | - #self.bg_frame_small = None |
57 | |
58 | def set_debug(self, debug): |
59 | """ |
60 | |
61 | === modified file 'openlp/core/lib/rendermanager.py' |
62 | --- openlp/core/lib/rendermanager.py 2009-09-25 00:43:42 +0000 |
63 | +++ openlp/core/lib/rendermanager.py 2009-09-26 09:20:25 +0000 |
64 | @@ -64,6 +64,9 @@ |
65 | self.theme = u'' |
66 | self.service_theme = u'' |
67 | self.global_style = u'' |
68 | + self.override_background = None |
69 | + self.save_bg_frame = None |
70 | + self.override_background_changed = False |
71 | |
72 | def update_display(self, screen_number): |
73 | """ |
74 | @@ -134,6 +137,20 @@ |
75 | self.screen_list[self.current_display][u'size']) |
76 | self.renderer.set_theme(self.themedata) |
77 | self.build_text_rectangle(self.themedata) |
78 | + #Replace the backgrount image from renderer with one from image |
79 | + if self.override_background is not None: |
80 | + if self.save_bg_frame is None: |
81 | + self.save_bg_frame = self.renderer.bg_frame |
82 | + if self.override_background_changed: |
83 | + self.renderer.bg_frame = self.resize_image(self.override_background) |
84 | + self.override_background_changed = False |
85 | + else: |
86 | + if self.override_background_changed: |
87 | + self.renderer.bg_frame = self.resize_image(self.override_background) |
88 | + self.override_background_changed = False |
89 | + if self.save_bg_frame is not None: |
90 | + self.renderer.bg_frame = self.save_bg_frame |
91 | + self.save_bg_frame = None |
92 | |
93 | def build_text_rectangle(self, theme): |
94 | """ |
95 | |
96 | === modified file 'openlp/plugins/audit/auditplugin.py' |
97 | --- openlp/plugins/audit/auditplugin.py 2009-09-25 05:16:01 +0000 |
98 | +++ openlp/plugins/audit/auditplugin.py 2009-09-26 09:20:25 +0000 |
99 | @@ -29,6 +29,7 @@ |
100 | |
101 | from openlp.core.lib import Plugin, Receiver, translate, str_to_bool |
102 | from openlp.plugins.audit.lib import AuditTab, AuditManager |
103 | +from openlp.plugins.audit.forms import AuditDetailForm, AuditDeleteForm |
104 | from openlp.plugins.audit.lib.models import AuditItem |
105 | |
106 | class AuditPlugin(Plugin): |
107 | @@ -73,7 +74,7 @@ |
108 | #Audit Delete All |
109 | self.AuditDeleteAll = QtGui.QAction(tools_menu) |
110 | self.AuditDeleteAll.setText( |
111 | - translate(u'AuditPlugin', u'Au&dit Delete All')) |
112 | + translate(u'AuditPlugin', u'Au&dit Delete all')) |
113 | self.AuditDeleteAll.setStatusTip( |
114 | translate(u'AuditPlugin', u'Deleted all Audit records')) |
115 | self.AuditDeleteAll.setObjectName(u'AuditDeleteAll') |
116 | @@ -119,6 +120,12 @@ |
117 | QtCore.QObject.connect(self.AuditStatus, |
118 | QtCore.SIGNAL(u'triggered(bool)'), |
119 | self.toggleAuditState) |
120 | + QtCore.QObject.connect(self.AuditDeleteAll, |
121 | + QtCore.SIGNAL(u'triggered()'), self.onAuditDeleteAll) |
122 | + QtCore.QObject.connect(self.AuditDelete, |
123 | + QtCore.SIGNAL(u'triggered()'), self.onAuditDelete) |
124 | + QtCore.QObject.connect(self.AuditReport, |
125 | + QtCore.SIGNAL(u'triggered()'), self.onAuditReport) |
126 | |
127 | def get_settings_tab(self): |
128 | self.AuditTab = AuditTab() |
129 | @@ -134,6 +141,8 @@ |
130 | self.config.get_config(u'audit active', False)) |
131 | self.AuditStatus.setChecked(self.auditActive) |
132 | self.auditmanager = AuditManager(self.config) |
133 | + self.auditdeleteform = AuditDeleteForm(self.auditmanager) |
134 | + self.auditdetailform = AuditDetailForm(self.auditmanager) |
135 | |
136 | def toggleAuditState(self): |
137 | self.auditActive = not self.auditActive |
138 | @@ -162,5 +171,21 @@ |
139 | """ |
140 | self.auditActive = str_to_bool( |
141 | self.config.get_config(u'audit active', False)) |
142 | -# self.AuditStatus.setChecked(self.auditActive) |
143 | self.AuditStatus.setEnabled(True) |
144 | + |
145 | + def onAuditDeleteAll(self): |
146 | + ret = QtGui.QMessageBox.question(None, |
147 | + translate(u'mainWindow', u'Delete All Audit Events?'), |
148 | + translate(u'mainWindow', u'Are you sure you want to delete all Audit Data?'), |
149 | + QtGui.QMessageBox.StandardButtons( |
150 | + QtGui.QMessageBox.Ok | |
151 | + QtGui.QMessageBox.Cancel), |
152 | + QtGui.QMessageBox.Cancel) |
153 | + if ret == QtGui.QMessageBox.Ok: |
154 | + self.auditmanager.delete_all() |
155 | + |
156 | + def onAuditDelete(self): |
157 | + self.auditdeleteform.exec_() |
158 | + |
159 | + def onAuditReport(self): |
160 | + self.auditdetailform.exec_() |
161 | |
162 | === added directory 'openlp/plugins/audit/forms' |
163 | === added file 'openlp/plugins/audit/forms/__init__.py' |
164 | --- openlp/plugins/audit/forms/__init__.py 1970-01-01 00:00:00 +0000 |
165 | +++ openlp/plugins/audit/forms/__init__.py 2009-09-26 09:20:25 +0000 |
166 | @@ -0,0 +1,26 @@ |
167 | +# -*- coding: utf-8 -*- |
168 | +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 |
169 | + |
170 | +############################################################################### |
171 | +# OpenLP - Open Source Lyrics Projection # |
172 | +# --------------------------------------------------------------------------- # |
173 | +# Copyright (c) 2008-2009 Raoul Snyman # |
174 | +# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten # |
175 | +# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri # |
176 | +# --------------------------------------------------------------------------- # |
177 | +# This program is free software; you can redistribute it and/or modify it # |
178 | +# under the terms of the GNU General Public License as published by the Free # |
179 | +# Software Foundation; version 2 of the License. # |
180 | +# # |
181 | +# This program is distributed in the hope that it will be useful, but WITHOUT # |
182 | +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # |
183 | +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # |
184 | +# more details. # |
185 | +# # |
186 | +# You should have received a copy of the GNU General Public License along # |
187 | +# with this program; if not, write to the Free Software Foundation, Inc., 59 # |
188 | +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # |
189 | +############################################################################### |
190 | + |
191 | +from auditdeleteform import AuditDeleteForm |
192 | +from auditdetailform import AuditDetailForm |
193 | |
194 | === added file 'openlp/plugins/audit/forms/auditdeletedialog.py' |
195 | --- openlp/plugins/audit/forms/auditdeletedialog.py 1970-01-01 00:00:00 +0000 |
196 | +++ openlp/plugins/audit/forms/auditdeletedialog.py 2009-09-26 09:20:25 +0000 |
197 | @@ -0,0 +1,39 @@ |
198 | +# -*- coding: utf-8 -*- |
199 | + |
200 | +# Form implementation generated from reading ui file 'auditdeletedialog.ui' |
201 | +# |
202 | +# Created: Fri Sep 25 21:03:48 2009 |
203 | +# by: PyQt4 UI code generator 4.5.4 |
204 | +# |
205 | +# WARNING! All changes made in this file will be lost! |
206 | + |
207 | +from PyQt4 import QtCore, QtGui |
208 | + |
209 | +class Ui_AuditDeleteDialog(object): |
210 | + def setupUi(self, AuditDeleteDialog): |
211 | + AuditDeleteDialog.setObjectName("AuditDeleteDialog") |
212 | + AuditDeleteDialog.resize(291, 202) |
213 | + self.layoutWidget = QtGui.QWidget(AuditDeleteDialog) |
214 | + self.layoutWidget.setGeometry(QtCore.QRect(20, 10, 247, 181)) |
215 | + self.layoutWidget.setObjectName("layoutWidget") |
216 | + self.verticalLayout = QtGui.QVBoxLayout(self.layoutWidget) |
217 | + self.verticalLayout.setObjectName("verticalLayout") |
218 | + self.DeleteCalendar = QtGui.QCalendarWidget(self.layoutWidget) |
219 | + self.DeleteCalendar.setFirstDayOfWeek(QtCore.Qt.Sunday) |
220 | + self.DeleteCalendar.setGridVisible(True) |
221 | + self.DeleteCalendar.setVerticalHeaderFormat(QtGui.QCalendarWidget.NoVerticalHeader) |
222 | + self.DeleteCalendar.setObjectName("DeleteCalendar") |
223 | + self.verticalLayout.addWidget(self.DeleteCalendar) |
224 | + self.buttonBox = QtGui.QDialogButtonBox(self.layoutWidget) |
225 | + self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) |
226 | + self.buttonBox.setObjectName("buttonBox") |
227 | + self.verticalLayout.addWidget(self.buttonBox) |
228 | + |
229 | + self.retranslateUi(AuditDeleteDialog) |
230 | + QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), AuditDeleteDialog.accept) |
231 | + QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), AuditDeleteDialog.close) |
232 | + QtCore.QMetaObject.connectSlotsByName(AuditDeleteDialog) |
233 | + |
234 | + def retranslateUi(self, AuditDeleteDialog): |
235 | + AuditDeleteDialog.setWindowTitle(QtGui.QApplication.translate("AuditDeleteDialog", "Audit Delete ", None, QtGui.QApplication.UnicodeUTF8)) |
236 | + |
237 | |
238 | === added file 'openlp/plugins/audit/forms/auditdeleteform.py' |
239 | --- openlp/plugins/audit/forms/auditdeleteform.py 1970-01-01 00:00:00 +0000 |
240 | +++ openlp/plugins/audit/forms/auditdeleteform.py 2009-09-26 09:20:25 +0000 |
241 | @@ -0,0 +1,240 @@ |
242 | +# -*- coding: utf-8 -*- |
243 | +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 |
244 | + |
245 | +############################################################################### |
246 | +# OpenLP - Open Source Lyrics Projection # |
247 | +# --------------------------------------------------------------------------- # |
248 | +# Copyright (c) 2008-2009 Raoul Snyman # |
249 | +# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten # |
250 | +# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri # |
251 | +# --------------------------------------------------------------------------- # |
252 | +# This program is free software; you can redistribute it and/or modify it # |
253 | +# under the terms of the GNU General Public License as published by the Free # |
254 | +# Software Foundation; version 2 of the License. # |
255 | +# # |
256 | +# This program is distributed in the hope that it will be useful, but WITHOUT # |
257 | +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # |
258 | +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # |
259 | +# more details. # |
260 | +# # |
261 | +# You should have received a copy of the GNU General Public License along # |
262 | +# with this program; if not, write to the Free Software Foundation, Inc., 59 # |
263 | +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # |
264 | +############################################################################### |
265 | + |
266 | +from PyQt4 import QtCore, QtGui |
267 | + |
268 | +from auditdeletedialog import Ui_AuditDeleteDialog |
269 | +from openlp.core.lib import translate |
270 | +#from openlp.plugins.audit.lib.models import CustomSlide |
271 | + |
272 | +class AuditDeleteForm(QtGui.QDialog, Ui_AuditDeleteDialog): |
273 | + """ |
274 | + Class documentation goes here. |
275 | + """ |
276 | + def __init__(self, auditmanager, parent = None): |
277 | + """ |
278 | + Constructor |
279 | + """ |
280 | + QtGui.QDialog.__init__(self, parent) |
281 | + #self.parent = parent |
282 | + self.setupUi(self) |
283 | +# # Connecting signals and slots |
284 | +# QtCore.QObject.connect(self.buttonBox, |
285 | +# QtCore.SIGNAL(u'rejected()'), self.rejected) |
286 | +# QtCore.QObject.connect(self.buttonBox, |
287 | +# QtCore.SIGNAL(u'accepted()'), self.accept) |
288 | +# QtCore.QObject.connect(self.AddButton, |
289 | +# QtCore.SIGNAL(u'pressed()'), self.onAddButtonPressed) |
290 | +# QtCore.QObject.connect(self.EditButton, |
291 | +# QtCore.SIGNAL(u'pressed()'), self.onEditButtonPressed) |
292 | +# QtCore.QObject.connect(self.EditAllButton, |
293 | +# QtCore.SIGNAL(u'pressed()'), self.onEditAllButtonPressed) |
294 | +# QtCore.QObject.connect(self.SaveButton, |
295 | +# QtCore.SIGNAL(u'pressed()'), self.onSaveButtonPressed) |
296 | +# QtCore.QObject.connect(self.DeleteButton, |
297 | +# QtCore.SIGNAL(u'pressed()'), self.onDeleteButtonPressed) |
298 | +# QtCore.QObject.connect(self.ClearButton, |
299 | +# QtCore.SIGNAL(u'pressed()'), self.onClearButtonPressed) |
300 | +# QtCore.QObject.connect(self.UpButton, |
301 | +# QtCore.SIGNAL(u'pressed()'), self.onUpButtonPressed) |
302 | +# QtCore.QObject.connect(self.DownButton, |
303 | +# QtCore.SIGNAL(u'pressed()'), self.onDownButtonPressed) |
304 | +# |
305 | +# QtCore.QObject.connect(self.VerseListView, |
306 | +# QtCore.SIGNAL(u'itemDoubleClicked(QListWidgetItem*)'), |
307 | +# self.onVerseListViewSelected) |
308 | +# QtCore.QObject.connect(self.VerseListView, |
309 | +# QtCore.SIGNAL(u'itemClicked(QListWidgetItem*)'), |
310 | +# self.onVerseListViewPressed) |
311 | +# QtCore.QObject.connect(Receiver.get_receiver(), |
312 | +# QtCore.SIGNAL(u'update_themes'), self.loadThemes) |
313 | +# # Create other objects and forms |
314 | +# self.custommanager = custommanager |
315 | + self.initialise() |
316 | + |
317 | + def initialise(self): |
318 | + pass |
319 | +# self.editAll = False |
320 | +# self.DeleteButton.setEnabled(False) |
321 | +# self.EditButton.setEnabled(False) |
322 | +# self.EditAllButton.setEnabled(True) |
323 | +# self.SaveButton.setEnabled(False) |
324 | +# self.ClearButton.setEnabled(False) |
325 | +# self.TitleEdit.setText(u'') |
326 | +# self.CreditEdit.setText(u'') |
327 | +# self.VerseTextEdit.clear() |
328 | +# self.VerseListView.clear() |
329 | +# #make sure we have a new item |
330 | +# self.customSlide = CustomSlide() |
331 | +# self.ThemeComboBox.addItem(u'') |
332 | +# |
333 | +# def loadThemes(self, themelist): |
334 | +# self.ThemeComboBox.clear() |
335 | +# self.ThemeComboBox.addItem(u'') |
336 | +# for themename in themelist: |
337 | +# self.ThemeComboBox.addItem(themename) |
338 | +# |
339 | +# def loadCustom(self, id): |
340 | +# self.customSlide = CustomSlide() |
341 | +# self.initialise() |
342 | +# if id != 0: |
343 | +# self.customSlide = self.custommanager.get_custom(id) |
344 | +# self.TitleEdit.setText(self.customSlide.title) |
345 | +# self.CreditEdit.setText(self.customSlide.credits) |
346 | +# |
347 | +# songXML = SongXMLParser(self.customSlide.text) |
348 | +# verseList = songXML.get_verses() |
349 | +# for verse in verseList: |
350 | +# self.VerseListView.addItem(verse[1]) |
351 | +# theme = unicode(self.customSlide.theme_name) |
352 | +# id = self.ThemeComboBox.findText(theme, QtCore.Qt.MatchExactly) |
353 | +# if id == -1: |
354 | +# id = 0 # Not Found |
355 | +# self.ThemeComboBox.setCurrentIndex(id) |
356 | +# else: |
357 | +# self.ThemeComboBox.setCurrentIndex(0) |
358 | +# |
359 | +# def accept(self): |
360 | +# valid, message = self._validate() |
361 | +# if not valid: |
362 | +# QtGui.QMessageBox.critical(self, |
363 | +# translate(u'customEditDialog', u'Error'), message, |
364 | +# QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) |
365 | +# return |
366 | +# sxml = SongXMLBuilder() |
367 | +# sxml.new_document() |
368 | +# sxml.add_lyrics_to_song() |
369 | +# count = 1 |
370 | +# for i in range (0, self.VerseListView.count()): |
371 | +# sxml.add_verse_to_lyrics( |
372 | +# u'custom', unicode(count), |
373 | +# unicode(self.VerseListView.item(i).text())) |
374 | +# count += 1 |
375 | +# self.customSlide.title = unicode(self.TitleEdit.displayText()) |
376 | +# self.customSlide.text = unicode(sxml.extract_xml()) |
377 | +# self.customSlide.credits = unicode(self.CreditEdit.displayText()) |
378 | +# self.customSlide.theme_name = unicode(self.ThemeComboBox.currentText()) |
379 | +# self.custommanager.save_slide(self.customSlide) |
380 | +# self.close() |
381 | +# |
382 | +# def rejected(self): |
383 | +# self.close() |
384 | +# |
385 | +# def onUpButtonPressed(self): |
386 | +# selectedRow = self.VerseListView.currentRow() |
387 | +# if selectedRow != 0: |
388 | +# qw = self.VerseListView.takeItem(selectedRow) |
389 | +# self.VerseListView.insertItem(selectedRow - 1, qw) |
390 | +# self.VerseListView.setCurrentRow(selectedRow - 1) |
391 | +# |
392 | +# def onDownButtonPressed(self): |
393 | +# selectedRow = self.VerseListView.currentRow() |
394 | +# # zero base arrays |
395 | +# if selectedRow != self.VerseListView.count() - 1: |
396 | +# qw = self.VerseListView.takeItem(selectedRow) |
397 | +# self.VerseListView.insertItem(selectedRow + 1, qw) |
398 | +# self.VerseListView.setCurrentRow(selectedRow + 1) |
399 | +# |
400 | +# def onClearButtonPressed(self): |
401 | +# self.VerseTextEdit.clear() |
402 | +# self.editAll = False |
403 | +# self.AddButton.setEnabled(True) |
404 | +# self.EditAllButton.setEnabled(True) |
405 | +# self.SaveButton.setEnabled(False) |
406 | +# |
407 | +# def onVerseListViewPressed(self, item): |
408 | +# self.DeleteButton.setEnabled(True) |
409 | +# self.EditButton.setEnabled(True) |
410 | +# |
411 | +# def onVerseListViewSelected(self, item): |
412 | +# self.editText(item.text()) |
413 | +# |
414 | +# def onAddButtonPressed(self): |
415 | +# self.VerseListView.addItem(self.VerseTextEdit.toPlainText()) |
416 | +# self.DeleteButton.setEnabled(False) |
417 | +# self.VerseTextEdit.clear() |
418 | +# |
419 | +# def onEditButtonPressed(self): |
420 | +# self.editText(self.VerseListView.currentItem().text()) |
421 | +# |
422 | +# def onEditAllButtonPressed(self): |
423 | +# self.editAll = True |
424 | +# self.AddButton.setEnabled(False) |
425 | +# if self.VerseListView.count() > 0: |
426 | +# verse_list = u'' |
427 | +# for row in range(0, self.VerseListView.count()): |
428 | +# item = self.VerseListView.item(row) |
429 | +# verse_list += item.text() |
430 | +# verse_list += u'\n---\n' |
431 | +# self.editText(verse_list) |
432 | +# |
433 | +# def editText(self, text): |
434 | +# self.beforeText = text |
435 | +# self.VerseTextEdit.setPlainText(text) |
436 | +# self.DeleteButton.setEnabled(False) |
437 | +# self.EditButton.setEnabled(False) |
438 | +# self.EditAllButton.setEnabled(False) |
439 | +# self.SaveButton.setEnabled(True) |
440 | +# self.ClearButton.setEnabled(True) |
441 | +# |
442 | +# def onSaveButtonPressed(self): |
443 | +# if self.editAll: |
444 | +# self.VerseListView.clear() |
445 | +# for row in unicode(self.VerseTextEdit.toPlainText()).split(u'\n---\n'): |
446 | +# self.VerseListView.addItem(row) |
447 | +# else: |
448 | +# self.VerseListView.currentItem().setText( |
449 | +# self.VerseTextEdit.toPlainText()) |
450 | +# #number of lines has change |
451 | +# if len(self.beforeText.split(u'\n')) != \ |
452 | +# len(self.VerseTextEdit.toPlainText().split(u'\n')): |
453 | +# tempList = {} |
454 | +# for row in range(0, self.VerseListView.count()): |
455 | +# tempList[row] = self.VerseListView.item(row).text() |
456 | +# self.VerseListView.clear() |
457 | +# for row in range (0, len(tempList)): |
458 | +# self.VerseListView.addItem(tempList[row]) |
459 | +# self.VerseListView.repaint() |
460 | +# self.AddButton.setEnabled(True) |
461 | +# self.SaveButton.setEnabled(False) |
462 | +# self.EditButton.setEnabled(False) |
463 | +# self.EditAllButton.setEnabled(True) |
464 | +# self.VerseTextEdit.clear() |
465 | +# |
466 | +# def onDeleteButtonPressed(self): |
467 | +# self.VerseListView.takeItem(self.VerseListView.currentRow()) |
468 | +# self.EditButton.setEnabled(False) |
469 | +# self.EditAllButton.setEnabled(True) |
470 | +# |
471 | +# def _validate(self): |
472 | +# if len(self.TitleEdit.displayText()) == 0: |
473 | +# self.TitleEdit.setFocus() |
474 | +# return False, translate( |
475 | +# u'customEditDialog', u'You need to enter a title \n') |
476 | +# # must have 1 slide |
477 | +# if self.VerseListView.count() == 0: |
478 | +# self.VerseTextEdit.setFocus() |
479 | +# return False, translate( |
480 | +# u'customEditDialog', u'You need to enter a slide \n') |
481 | +# return True, u'' |
482 | |
483 | === added file 'openlp/plugins/audit/forms/auditdetaildialog.py' |
484 | --- openlp/plugins/audit/forms/auditdetaildialog.py 1970-01-01 00:00:00 +0000 |
485 | +++ openlp/plugins/audit/forms/auditdetaildialog.py 2009-09-26 09:20:25 +0000 |
486 | @@ -0,0 +1,163 @@ |
487 | +# -*- coding: utf-8 -*- |
488 | + |
489 | +# Form implementation generated from reading ui file 'auditdetaildialog.ui' |
490 | +# |
491 | +# Created: Fri Sep 25 21:04:08 2009 |
492 | +# by: PyQt4 UI code generator 4.5.4 |
493 | +# |
494 | +# WARNING! All changes made in this file will be lost! |
495 | + |
496 | +from PyQt4 import QtCore, QtGui |
497 | + |
498 | +class Ui_AuditDetailDialog(object): |
499 | + def setupUi(self, AuditDetailDialog): |
500 | + AuditDetailDialog.setObjectName("AuditDetailDialog") |
501 | + AuditDetailDialog.resize(593, 501) |
502 | + self.buttonBox = QtGui.QDialogButtonBox(AuditDetailDialog) |
503 | + self.buttonBox.setGeometry(QtCore.QRect(420, 470, 170, 25)) |
504 | + self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) |
505 | + self.buttonBox.setObjectName("buttonBox") |
506 | + self.FileGroupBox = QtGui.QGroupBox(AuditDetailDialog) |
507 | + self.FileGroupBox.setGeometry(QtCore.QRect(10, 370, 571, 70)) |
508 | + self.FileGroupBox.setObjectName("FileGroupBox") |
509 | + self.verticalLayout_4 = QtGui.QVBoxLayout(self.FileGroupBox) |
510 | + self.verticalLayout_4.setObjectName("verticalLayout_4") |
511 | + self.horizontalLayout = QtGui.QHBoxLayout() |
512 | + self.horizontalLayout.setObjectName("horizontalLayout") |
513 | + self.FileLineEdit = QtGui.QLineEdit(self.FileGroupBox) |
514 | + self.FileLineEdit.setObjectName("FileLineEdit") |
515 | + self.horizontalLayout.addWidget(self.FileLineEdit) |
516 | + self.SaveFilePushButton = QtGui.QPushButton(self.FileGroupBox) |
517 | + icon = QtGui.QIcon() |
518 | + icon.addPixmap(QtGui.QPixmap(":/exports/export_load.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
519 | + self.SaveFilePushButton.setIcon(icon) |
520 | + self.SaveFilePushButton.setObjectName("SaveFilePushButton") |
521 | + self.horizontalLayout.addWidget(self.SaveFilePushButton) |
522 | + self.verticalLayout_4.addLayout(self.horizontalLayout) |
523 | + self.layoutWidget = QtGui.QWidget(AuditDetailDialog) |
524 | + self.layoutWidget.setGeometry(QtCore.QRect(10, 10, 561, 361)) |
525 | + self.layoutWidget.setObjectName("layoutWidget") |
526 | + self.verticalLayout_3 = QtGui.QVBoxLayout(self.layoutWidget) |
527 | + self.verticalLayout_3.setObjectName("verticalLayout_3") |
528 | + self.ReportTypeGroup = QtGui.QGroupBox(self.layoutWidget) |
529 | + self.ReportTypeGroup.setObjectName("ReportTypeGroup") |
530 | + self.layoutWidget1 = QtGui.QWidget(self.ReportTypeGroup) |
531 | + self.layoutWidget1.setGeometry(QtCore.QRect(50, 40, 481, 23)) |
532 | + self.layoutWidget1.setObjectName("layoutWidget1") |
533 | + self.ReportHorizontalLayout = QtGui.QHBoxLayout(self.layoutWidget1) |
534 | + self.ReportHorizontalLayout.setObjectName("ReportHorizontalLayout") |
535 | + self.SummaryReport = QtGui.QRadioButton(self.layoutWidget1) |
536 | + self.SummaryReport.setObjectName("SummaryReport") |
537 | + self.ReportHorizontalLayout.addWidget(self.SummaryReport) |
538 | + self.DetailedReport = QtGui.QRadioButton(self.layoutWidget1) |
539 | + self.DetailedReport.setChecked(True) |
540 | + self.DetailedReport.setObjectName("DetailedReport") |
541 | + self.ReportHorizontalLayout.addWidget(self.DetailedReport) |
542 | + self.verticalLayout_3.addWidget(self.ReportTypeGroup) |
543 | + self.DateRangeGroupBox = QtGui.QGroupBox(self.layoutWidget) |
544 | + self.DateRangeGroupBox.setObjectName("DateRangeGroupBox") |
545 | + self.verticalLayout_2 = QtGui.QVBoxLayout(self.DateRangeGroupBox) |
546 | + self.verticalLayout_2.setObjectName("verticalLayout_2") |
547 | + self.DateHorizontalLayout = QtGui.QHBoxLayout() |
548 | + self.DateHorizontalLayout.setObjectName("DateHorizontalLayout") |
549 | + self.FromDateEdit = QtGui.QDateEdit(self.DateRangeGroupBox) |
550 | + self.FromDateEdit.setCalendarPopup(True) |
551 | + self.FromDateEdit.setObjectName("FromDateEdit") |
552 | + self.DateHorizontalLayout.addWidget(self.FromDateEdit) |
553 | + self.To = QtGui.QLabel(self.DateRangeGroupBox) |
554 | + self.To.setObjectName("To") |
555 | + self.DateHorizontalLayout.addWidget(self.To) |
556 | + self.ToDateEdit = QtGui.QDateEdit(self.DateRangeGroupBox) |
557 | + self.ToDateEdit.setCalendarPopup(True) |
558 | + self.ToDateEdit.setObjectName("ToDateEdit") |
559 | + self.DateHorizontalLayout.addWidget(self.ToDateEdit) |
560 | + self.verticalLayout_2.addLayout(self.DateHorizontalLayout) |
561 | + self.verticalLayout_3.addWidget(self.DateRangeGroupBox) |
562 | + self.TimePeriodGroupBox = QtGui.QGroupBox(self.layoutWidget) |
563 | + self.TimePeriodGroupBox.setObjectName("TimePeriodGroupBox") |
564 | + self.verticalLayout = QtGui.QVBoxLayout(self.TimePeriodGroupBox) |
565 | + self.verticalLayout.setObjectName("verticalLayout") |
566 | + self.FirstHorizontalLayout = QtGui.QHBoxLayout() |
567 | + self.FirstHorizontalLayout.setObjectName("FirstHorizontalLayout") |
568 | + self.FirstCheckBox = QtGui.QCheckBox(self.TimePeriodGroupBox) |
569 | + self.FirstCheckBox.setChecked(True) |
570 | + self.FirstCheckBox.setObjectName("FirstCheckBox") |
571 | + self.FirstHorizontalLayout.addWidget(self.FirstCheckBox) |
572 | + self.FirstFromTimeEdit = QtGui.QTimeEdit(self.TimePeriodGroupBox) |
573 | + self.FirstFromTimeEdit.setTime(QtCore.QTime(9, 0, 0)) |
574 | + self.FirstFromTimeEdit.setObjectName("FirstFromTimeEdit") |
575 | + self.FirstHorizontalLayout.addWidget(self.FirstFromTimeEdit) |
576 | + self.FirstTo = QtGui.QLabel(self.TimePeriodGroupBox) |
577 | + self.FirstTo.setObjectName("FirstTo") |
578 | + self.FirstHorizontalLayout.addWidget(self.FirstTo) |
579 | + self.FirstToTimeEdit = QtGui.QTimeEdit(self.TimePeriodGroupBox) |
580 | + self.FirstToTimeEdit.setCalendarPopup(True) |
581 | + self.FirstToTimeEdit.setTime(QtCore.QTime(10, 0, 0)) |
582 | + self.FirstToTimeEdit.setObjectName("FirstToTimeEdit") |
583 | + self.FirstHorizontalLayout.addWidget(self.FirstToTimeEdit) |
584 | + self.verticalLayout.addLayout(self.FirstHorizontalLayout) |
585 | + self.SecondHorizontalLayout = QtGui.QHBoxLayout() |
586 | + self.SecondHorizontalLayout.setObjectName("SecondHorizontalLayout") |
587 | + self.SecondCheckBox = QtGui.QCheckBox(self.TimePeriodGroupBox) |
588 | + self.SecondCheckBox.setChecked(True) |
589 | + self.SecondCheckBox.setObjectName("SecondCheckBox") |
590 | + self.SecondHorizontalLayout.addWidget(self.SecondCheckBox) |
591 | + self.SecondFromTimeEdit = QtGui.QTimeEdit(self.TimePeriodGroupBox) |
592 | + self.SecondFromTimeEdit.setTime(QtCore.QTime(10, 45, 0)) |
593 | + self.SecondFromTimeEdit.setObjectName("SecondFromTimeEdit") |
594 | + self.SecondHorizontalLayout.addWidget(self.SecondFromTimeEdit) |
595 | + self.SecondTo = QtGui.QLabel(self.TimePeriodGroupBox) |
596 | + self.SecondTo.setObjectName("SecondTo") |
597 | + self.SecondHorizontalLayout.addWidget(self.SecondTo) |
598 | + self.SecondToTimeEdit = QtGui.QTimeEdit(self.TimePeriodGroupBox) |
599 | + self.SecondToTimeEdit.setObjectName("SecondToTimeEdit") |
600 | + self.SecondHorizontalLayout.addWidget(self.SecondToTimeEdit) |
601 | + self.verticalLayout.addLayout(self.SecondHorizontalLayout) |
602 | + self.ThirdHorizontalLayout = QtGui.QHBoxLayout() |
603 | + self.ThirdHorizontalLayout.setObjectName("ThirdHorizontalLayout") |
604 | + self.ThirdCheckBox = QtGui.QCheckBox(self.TimePeriodGroupBox) |
605 | + self.ThirdCheckBox.setChecked(True) |
606 | + self.ThirdCheckBox.setObjectName("ThirdCheckBox") |
607 | + self.ThirdHorizontalLayout.addWidget(self.ThirdCheckBox) |
608 | + self.ThirdFromTimeEdit = QtGui.QTimeEdit(self.TimePeriodGroupBox) |
609 | + self.ThirdFromTimeEdit.setTime(QtCore.QTime(18, 30, 0)) |
610 | + self.ThirdFromTimeEdit.setObjectName("ThirdFromTimeEdit") |
611 | + self.ThirdHorizontalLayout.addWidget(self.ThirdFromTimeEdit) |
612 | + self.ThirdTo = QtGui.QLabel(self.TimePeriodGroupBox) |
613 | + self.ThirdTo.setObjectName("ThirdTo") |
614 | + self.ThirdHorizontalLayout.addWidget(self.ThirdTo) |
615 | + self.ThirdToTimeEdit = QtGui.QTimeEdit(self.TimePeriodGroupBox) |
616 | + self.ThirdToTimeEdit.setTime(QtCore.QTime(19, 30, 0)) |
617 | + self.ThirdToTimeEdit.setObjectName("ThirdToTimeEdit") |
618 | + self.ThirdHorizontalLayout.addWidget(self.ThirdToTimeEdit) |
619 | + self.verticalLayout.addLayout(self.ThirdHorizontalLayout) |
620 | + self.verticalLayout_3.addWidget(self.TimePeriodGroupBox) |
621 | + |
622 | + self.retranslateUi(AuditDetailDialog) |
623 | + QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), AuditDetailDialog.accept) |
624 | + QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), AuditDetailDialog.close) |
625 | + QtCore.QMetaObject.connectSlotsByName(AuditDetailDialog) |
626 | + |
627 | + def retranslateUi(self, AuditDetailDialog): |
628 | + AuditDetailDialog.setWindowTitle(QtGui.QApplication.translate("AuditDetailDialog", "Audit Detail Extraction", None, QtGui.QApplication.UnicodeUTF8)) |
629 | + self.FileGroupBox.setTitle(QtGui.QApplication.translate("AuditDetailDialog", "Report Location", None, QtGui.QApplication.UnicodeUTF8)) |
630 | + self.ReportTypeGroup.setTitle(QtGui.QApplication.translate("AuditDetailDialog", "Report Type", None, QtGui.QApplication.UnicodeUTF8)) |
631 | + self.SummaryReport.setText(QtGui.QApplication.translate("AuditDetailDialog", "Summary", None, QtGui.QApplication.UnicodeUTF8)) |
632 | + self.DetailedReport.setText(QtGui.QApplication.translate("AuditDetailDialog", "Detailed", None, QtGui.QApplication.UnicodeUTF8)) |
633 | + self.DateRangeGroupBox.setTitle(QtGui.QApplication.translate("AuditDetailDialog", "Date Range", None, QtGui.QApplication.UnicodeUTF8)) |
634 | + self.FromDateEdit.setDisplayFormat(QtGui.QApplication.translate("AuditDetailDialog", "dd/MM/yyyy", None, QtGui.QApplication.UnicodeUTF8)) |
635 | + self.To.setText(QtGui.QApplication.translate("AuditDetailDialog", "to", None, QtGui.QApplication.UnicodeUTF8)) |
636 | + self.ToDateEdit.setDisplayFormat(QtGui.QApplication.translate("AuditDetailDialog", "dd/MM/yyyy", None, QtGui.QApplication.UnicodeUTF8)) |
637 | + self.TimePeriodGroupBox.setTitle(QtGui.QApplication.translate("AuditDetailDialog", "Time Periods", None, QtGui.QApplication.UnicodeUTF8)) |
638 | + self.FirstCheckBox.setText(QtGui.QApplication.translate("AuditDetailDialog", "First Service", None, QtGui.QApplication.UnicodeUTF8)) |
639 | + self.FirstFromTimeEdit.setDisplayFormat(QtGui.QApplication.translate("AuditDetailDialog", "hh:mm AP", None, QtGui.QApplication.UnicodeUTF8)) |
640 | + self.FirstTo.setText(QtGui.QApplication.translate("AuditDetailDialog", "to", None, QtGui.QApplication.UnicodeUTF8)) |
641 | + self.FirstToTimeEdit.setDisplayFormat(QtGui.QApplication.translate("AuditDetailDialog", "hh:mm AP", None, QtGui.QApplication.UnicodeUTF8)) |
642 | + self.SecondCheckBox.setText(QtGui.QApplication.translate("AuditDetailDialog", "Second Service", None, QtGui.QApplication.UnicodeUTF8)) |
643 | + self.SecondFromTimeEdit.setDisplayFormat(QtGui.QApplication.translate("AuditDetailDialog", "hh:mm AP", None, QtGui.QApplication.UnicodeUTF8)) |
644 | + self.SecondTo.setText(QtGui.QApplication.translate("AuditDetailDialog", "to", None, QtGui.QApplication.UnicodeUTF8)) |
645 | + self.SecondToTimeEdit.setDisplayFormat(QtGui.QApplication.translate("AuditDetailDialog", "hh:mm AP", None, QtGui.QApplication.UnicodeUTF8)) |
646 | + self.ThirdCheckBox.setText(QtGui.QApplication.translate("AuditDetailDialog", "Third Service", None, QtGui.QApplication.UnicodeUTF8)) |
647 | + self.ThirdFromTimeEdit.setDisplayFormat(QtGui.QApplication.translate("AuditDetailDialog", "hh:mm AP", None, QtGui.QApplication.UnicodeUTF8)) |
648 | + self.ThirdTo.setText(QtGui.QApplication.translate("AuditDetailDialog", "to", None, QtGui.QApplication.UnicodeUTF8)) |
649 | + self.ThirdToTimeEdit.setDisplayFormat(QtGui.QApplication.translate("AuditDetailDialog", "hh:mm AP", None, QtGui.QApplication.UnicodeUTF8)) |
650 | |
651 | === added file 'openlp/plugins/audit/forms/auditdetailform.py' |
652 | --- openlp/plugins/audit/forms/auditdetailform.py 1970-01-01 00:00:00 +0000 |
653 | +++ openlp/plugins/audit/forms/auditdetailform.py 2009-09-26 09:20:25 +0000 |
654 | @@ -0,0 +1,240 @@ |
655 | +# -*- coding: utf-8 -*- |
656 | +# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 |
657 | + |
658 | +############################################################################### |
659 | +# OpenLP - Open Source Lyrics Projection # |
660 | +# --------------------------------------------------------------------------- # |
661 | +# Copyright (c) 2008-2009 Raoul Snyman # |
662 | +# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten # |
663 | +# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri # |
664 | +# --------------------------------------------------------------------------- # |
665 | +# This program is free software; you can redistribute it and/or modify it # |
666 | +# under the terms of the GNU General Public License as published by the Free # |
667 | +# Software Foundation; version 2 of the License. # |
668 | +# # |
669 | +# This program is distributed in the hope that it will be useful, but WITHOUT # |
670 | +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # |
671 | +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # |
672 | +# more details. # |
673 | +# # |
674 | +# You should have received a copy of the GNU General Public License along # |
675 | +# with this program; if not, write to the Free Software Foundation, Inc., 59 # |
676 | +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # |
677 | +############################################################################### |
678 | + |
679 | +from PyQt4 import QtCore, QtGui |
680 | + |
681 | +from auditdetaildialog import Ui_AuditDetailDialog |
682 | +from openlp.core.lib import translate |
683 | +#from openlp.plugins.audit.lib.models import CustomSlide |
684 | + |
685 | +class AuditDetailForm(QtGui.QDialog, Ui_AuditDetailDialog): |
686 | + """ |
687 | + Class documentation goes here. |
688 | + """ |
689 | + def __init__(self, auditmanager, parent = None): |
690 | + """ |
691 | + Constructor |
692 | + """ |
693 | + QtGui.QDialog.__init__(self, parent) |
694 | + #self.parent = parent |
695 | + self.setupUi(self) |
696 | +# # Connecting signals and slots |
697 | +# QtCore.QObject.connect(self.buttonBox, |
698 | +# QtCore.SIGNAL(u'rejected()'), self.rejected) |
699 | +# QtCore.QObject.connect(self.buttonBox, |
700 | +# QtCore.SIGNAL(u'accepted()'), self.accept) |
701 | +# QtCore.QObject.connect(self.AddButton, |
702 | +# QtCore.SIGNAL(u'pressed()'), self.onAddButtonPressed) |
703 | +# QtCore.QObject.connect(self.EditButton, |
704 | +# QtCore.SIGNAL(u'pressed()'), self.onEditButtonPressed) |
705 | +# QtCore.QObject.connect(self.EditAllButton, |
706 | +# QtCore.SIGNAL(u'pressed()'), self.onEditAllButtonPressed) |
707 | +# QtCore.QObject.connect(self.SaveButton, |
708 | +# QtCore.SIGNAL(u'pressed()'), self.onSaveButtonPressed) |
709 | +# QtCore.QObject.connect(self.DeleteButton, |
710 | +# QtCore.SIGNAL(u'pressed()'), self.onDeleteButtonPressed) |
711 | +# QtCore.QObject.connect(self.ClearButton, |
712 | +# QtCore.SIGNAL(u'pressed()'), self.onClearButtonPressed) |
713 | +# QtCore.QObject.connect(self.UpButton, |
714 | +# QtCore.SIGNAL(u'pressed()'), self.onUpButtonPressed) |
715 | +# QtCore.QObject.connect(self.DownButton, |
716 | +# QtCore.SIGNAL(u'pressed()'), self.onDownButtonPressed) |
717 | +# |
718 | +# QtCore.QObject.connect(self.VerseListView, |
719 | +# QtCore.SIGNAL(u'itemDoubleClicked(QListWidgetItem*)'), |
720 | +# self.onVerseListViewSelected) |
721 | +# QtCore.QObject.connect(self.VerseListView, |
722 | +# QtCore.SIGNAL(u'itemClicked(QListWidgetItem*)'), |
723 | +# self.onVerseListViewPressed) |
724 | +# QtCore.QObject.connect(Receiver.get_receiver(), |
725 | +# QtCore.SIGNAL(u'update_themes'), self.loadThemes) |
726 | +# # Create other objects and forms |
727 | +# self.custommanager = custommanager |
728 | + self.initialise() |
729 | + |
730 | + def initialise(self): |
731 | + pass |
732 | +# self.editAll = False |
733 | +# self.DeleteButton.setEnabled(False) |
734 | +# self.EditButton.setEnabled(False) |
735 | +# self.EditAllButton.setEnabled(True) |
736 | +# self.SaveButton.setEnabled(False) |
737 | +# self.ClearButton.setEnabled(False) |
738 | +# self.TitleEdit.setText(u'') |
739 | +# self.CreditEdit.setText(u'') |
740 | +# self.VerseTextEdit.clear() |
741 | +# self.VerseListView.clear() |
742 | +# #make sure we have a new item |
743 | +# self.customSlide = CustomSlide() |
744 | +# self.ThemeComboBox.addItem(u'') |
745 | +# |
746 | +# def loadThemes(self, themelist): |
747 | +# self.ThemeComboBox.clear() |
748 | +# self.ThemeComboBox.addItem(u'') |
749 | +# for themename in themelist: |
750 | +# self.ThemeComboBox.addItem(themename) |
751 | +# |
752 | +# def loadCustom(self, id): |
753 | +# self.customSlide = CustomSlide() |
754 | +# self.initialise() |
755 | +# if id != 0: |
756 | +# self.customSlide = self.custommanager.get_custom(id) |
757 | +# self.TitleEdit.setText(self.customSlide.title) |
758 | +# self.CreditEdit.setText(self.customSlide.credits) |
759 | +# |
760 | +# songXML = SongXMLParser(self.customSlide.text) |
761 | +# verseList = songXML.get_verses() |
762 | +# for verse in verseList: |
763 | +# self.VerseListView.addItem(verse[1]) |
764 | +# theme = unicode(self.customSlide.theme_name) |
765 | +# id = self.ThemeComboBox.findText(theme, QtCore.Qt.MatchExactly) |
766 | +# if id == -1: |
767 | +# id = 0 # Not Found |
768 | +# self.ThemeComboBox.setCurrentIndex(id) |
769 | +# else: |
770 | +# self.ThemeComboBox.setCurrentIndex(0) |
771 | +# |
772 | +# def accept(self): |
773 | +# valid, message = self._validate() |
774 | +# if not valid: |
775 | +# QtGui.QMessageBox.critical(self, |
776 | +# translate(u'customEditDialog', u'Error'), message, |
777 | +# QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) |
778 | +# return |
779 | +# sxml = SongXMLBuilder() |
780 | +# sxml.new_document() |
781 | +# sxml.add_lyrics_to_song() |
782 | +# count = 1 |
783 | +# for i in range (0, self.VerseListView.count()): |
784 | +# sxml.add_verse_to_lyrics( |
785 | +# u'custom', unicode(count), |
786 | +# unicode(self.VerseListView.item(i).text())) |
787 | +# count += 1 |
788 | +# self.customSlide.title = unicode(self.TitleEdit.displayText()) |
789 | +# self.customSlide.text = unicode(sxml.extract_xml()) |
790 | +# self.customSlide.credits = unicode(self.CreditEdit.displayText()) |
791 | +# self.customSlide.theme_name = unicode(self.ThemeComboBox.currentText()) |
792 | +# self.custommanager.save_slide(self.customSlide) |
793 | +# self.close() |
794 | +# |
795 | +# def rejected(self): |
796 | +# self.close() |
797 | +# |
798 | +# def onUpButtonPressed(self): |
799 | +# selectedRow = self.VerseListView.currentRow() |
800 | +# if selectedRow != 0: |
801 | +# qw = self.VerseListView.takeItem(selectedRow) |
802 | +# self.VerseListView.insertItem(selectedRow - 1, qw) |
803 | +# self.VerseListView.setCurrentRow(selectedRow - 1) |
804 | +# |
805 | +# def onDownButtonPressed(self): |
806 | +# selectedRow = self.VerseListView.currentRow() |
807 | +# # zero base arrays |
808 | +# if selectedRow != self.VerseListView.count() - 1: |
809 | +# qw = self.VerseListView.takeItem(selectedRow) |
810 | +# self.VerseListView.insertItem(selectedRow + 1, qw) |
811 | +# self.VerseListView.setCurrentRow(selectedRow + 1) |
812 | +# |
813 | +# def onClearButtonPressed(self): |
814 | +# self.VerseTextEdit.clear() |
815 | +# self.editAll = False |
816 | +# self.AddButton.setEnabled(True) |
817 | +# self.EditAllButton.setEnabled(True) |
818 | +# self.SaveButton.setEnabled(False) |
819 | +# |
820 | +# def onVerseListViewPressed(self, item): |
821 | +# self.DeleteButton.setEnabled(True) |
822 | +# self.EditButton.setEnabled(True) |
823 | +# |
824 | +# def onVerseListViewSelected(self, item): |
825 | +# self.editText(item.text()) |
826 | +# |
827 | +# def onAddButtonPressed(self): |
828 | +# self.VerseListView.addItem(self.VerseTextEdit.toPlainText()) |
829 | +# self.DeleteButton.setEnabled(False) |
830 | +# self.VerseTextEdit.clear() |
831 | +# |
832 | +# def onEditButtonPressed(self): |
833 | +# self.editText(self.VerseListView.currentItem().text()) |
834 | +# |
835 | +# def onEditAllButtonPressed(self): |
836 | +# self.editAll = True |
837 | +# self.AddButton.setEnabled(False) |
838 | +# if self.VerseListView.count() > 0: |
839 | +# verse_list = u'' |
840 | +# for row in range(0, self.VerseListView.count()): |
841 | +# item = self.VerseListView.item(row) |
842 | +# verse_list += item.text() |
843 | +# verse_list += u'\n---\n' |
844 | +# self.editText(verse_list) |
845 | +# |
846 | +# def editText(self, text): |
847 | +# self.beforeText = text |
848 | +# self.VerseTextEdit.setPlainText(text) |
849 | +# self.DeleteButton.setEnabled(False) |
850 | +# self.EditButton.setEnabled(False) |
851 | +# self.EditAllButton.setEnabled(False) |
852 | +# self.SaveButton.setEnabled(True) |
853 | +# self.ClearButton.setEnabled(True) |
854 | +# |
855 | +# def onSaveButtonPressed(self): |
856 | +# if self.editAll: |
857 | +# self.VerseListView.clear() |
858 | +# for row in unicode(self.VerseTextEdit.toPlainText()).split(u'\n---\n'): |
859 | +# self.VerseListView.addItem(row) |
860 | +# else: |
861 | +# self.VerseListView.currentItem().setText( |
862 | +# self.VerseTextEdit.toPlainText()) |
863 | +# #number of lines has change |
864 | +# if len(self.beforeText.split(u'\n')) != \ |
865 | +# len(self.VerseTextEdit.toPlainText().split(u'\n')): |
866 | +# tempList = {} |
867 | +# for row in range(0, self.VerseListView.count()): |
868 | +# tempList[row] = self.VerseListView.item(row).text() |
869 | +# self.VerseListView.clear() |
870 | +# for row in range (0, len(tempList)): |
871 | +# self.VerseListView.addItem(tempList[row]) |
872 | +# self.VerseListView.repaint() |
873 | +# self.AddButton.setEnabled(True) |
874 | +# self.SaveButton.setEnabled(False) |
875 | +# self.EditButton.setEnabled(False) |
876 | +# self.EditAllButton.setEnabled(True) |
877 | +# self.VerseTextEdit.clear() |
878 | +# |
879 | +# def onDeleteButtonPressed(self): |
880 | +# self.VerseListView.takeItem(self.VerseListView.currentRow()) |
881 | +# self.EditButton.setEnabled(False) |
882 | +# self.EditAllButton.setEnabled(True) |
883 | +# |
884 | +# def _validate(self): |
885 | +# if len(self.TitleEdit.displayText()) == 0: |
886 | +# self.TitleEdit.setFocus() |
887 | +# return False, translate( |
888 | +# u'customEditDialog', u'You need to enter a title \n') |
889 | +# # must have 1 slide |
890 | +# if self.VerseListView.count() == 0: |
891 | +# self.VerseTextEdit.setFocus() |
892 | +# return False, translate( |
893 | +# u'customEditDialog', u'You need to enter a slide \n') |
894 | +# return True, u'' |
895 | |
896 | === modified file 'openlp/plugins/audit/lib/manager.py' |
897 | --- openlp/plugins/audit/lib/manager.py 2009-09-25 00:43:42 +0000 |
898 | +++ openlp/plugins/audit/lib/manager.py 2009-09-26 09:20:25 +0000 |
899 | @@ -104,3 +104,29 @@ |
900 | return False |
901 | else: |
902 | return True |
903 | + |
904 | + def delete_all(self): |
905 | + """ |
906 | + Delete all audit records |
907 | + """ |
908 | + try: |
909 | + self.session.query(AuditItem).delete(synchronize_session=False) |
910 | + self.session.commit() |
911 | + return True |
912 | + except: |
913 | + self.session.rollback() |
914 | + log.excertion(u'Failed to delete all audit items') |
915 | + return False |
916 | + |
917 | + def delete_to_date(self, date): |
918 | + """ |
919 | + Delete audit records before given date |
920 | + """ |
921 | + try: |
922 | + self.session.query(AuditItem).filter(AuditItem.auditdate <= date).delete(synchronize_session=False) |
923 | + self.session.commit() |
924 | + return True |
925 | + except: |
926 | + self.session.rollback() |
927 | + log.excertion(u'Failed to delete all audit items to %s' % date) |
928 | + return False |
929 | |
930 | === modified file 'openlp/plugins/bibles/lib/mediaitem.py' |
931 | --- openlp/plugins/bibles/lib/mediaitem.py 2009-09-25 00:43:42 +0000 |
932 | +++ openlp/plugins/bibles/lib/mediaitem.py 2009-09-26 09:20:25 +0000 |
933 | @@ -49,38 +49,21 @@ |
934 | self.TranslationContext = u'BiblePlugin' |
935 | self.PluginTextShort = u'Bible' |
936 | self.ConfigSection = u'bibles' |
937 | + self.IconPath = u'songs/song' |
938 | + self.ListViewWithDnD_class = BibleListView |
939 | + self.ServiceItemIconName = u':/media/bible_image.png' |
940 | + self.servicePath = None |
941 | MediaManagerItem.__init__(self, parent, icon, title) |
942 | self.search_results = {} # place to store the search results |
943 | QtCore.QObject.connect(Receiver().get_receiver(), |
944 | QtCore.SIGNAL(u'openlpreloadbibles'), self.reloadBibles) |
945 | |
946 | - def setupUi(self): |
947 | - # Add a toolbar |
948 | - self.addToolbar() |
949 | - # Create buttons for the toolbar |
950 | - ## New Bible Button ## |
951 | - self.addToolbarButton(translate(u'BibleMediaItem', u'New Bible'), |
952 | - translate(u'BibleMediaItem', u'Register a new Bible'), |
953 | - u':/themes/theme_import.png', self.onBibleNewClick, u'BibleNewItem') |
954 | - ## Separator Line ## |
955 | - self.addToolbarSeparator() |
956 | - ## Preview Bible Button ## |
957 | - self.addToolbarButton(translate(u'BibleMediaItem', u'Preview Bible'), |
958 | - translate(u'BibleMediaItem', u'Preview the selected Bible Verse'), |
959 | - u':/system/system_preview.png', self.onPreviewClick, |
960 | - u'BiblePreviewItem') |
961 | - ## Live Bible Button ## |
962 | - self.addToolbarButton(translate(u'BibleMediaItem',u'Go Live'), |
963 | - translate(u'BibleMediaItem', |
964 | - u'Send the selected Bible Verse(s) live'), |
965 | - u':/system/system_live.png', self.onLiveClick, u'BibleLiveItem') |
966 | - ## Add Bible Button ## |
967 | - self.addToolbarButton( |
968 | - translate(u'BibleMediaItem', u'Add Bible Verse(s) To Service'), |
969 | - translate(u'BibleMediaItem', |
970 | - u'Add the selected Bible(s) to the service'), |
971 | - u':/system/system_add.png', self.onAddClick, u'BibleAddItem') |
972 | - # Create the tab widget |
973 | + def requiredIcons(self): |
974 | + MediaManagerItem.requiredIcons(self) |
975 | + self.hasEditIcon = False |
976 | + self.hasDeleteIcon = False |
977 | + |
978 | + def addEndHeaderBar(self): |
979 | self.SearchTabWidget = QtGui.QTabWidget(self) |
980 | sizePolicy = QtGui.QSizePolicy( |
981 | QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
982 | @@ -191,12 +174,6 @@ |
983 | self.SearchTabWidget.addTab(self.AdvancedTab, u'Advanced') |
984 | # Add the search tab widget to the page layout |
985 | self.PageLayout.addWidget(self.SearchTabWidget) |
986 | - self.ListView = BibleListView() |
987 | - self.ListView.setAlternatingRowColors(True) |
988 | - self.ListView.setSelectionMode( |
989 | - QtGui.QAbstractItemView.ExtendedSelection) |
990 | - self.ListView.setDragEnabled(True) |
991 | - self.PageLayout.addWidget(self.ListView) |
992 | # Combo Boxes |
993 | QtCore.QObject.connect(self.AdvancedVersionComboBox, |
994 | QtCore.SIGNAL(u'activated(int)'), self.onAdvancedVersionComboBox) |
995 | @@ -213,20 +190,6 @@ |
996 | QtCore.SIGNAL(u'pressed()'), self.onAdvancedSearchButton) |
997 | QtCore.QObject.connect(self.QuickSearchButton, |
998 | QtCore.SIGNAL(u'pressed()'), self.onQuickSearchButton) |
999 | - QtCore.QObject.connect(self.ListView, |
1000 | - QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.onPreviewClick) |
1001 | - # Context Menus |
1002 | - self.ListView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) |
1003 | - self.ListView.addAction(contextMenuAction( |
1004 | - self.ListView, u':/system/system_preview.png', |
1005 | - translate(u'BibleMediaItem',u'&Preview Verse'), |
1006 | - self.onPreviewClick)) |
1007 | - self.ListView.addAction(contextMenuAction( |
1008 | - self.ListView, u':/system/system_live.png', |
1009 | - translate(u'BibleMediaItem',u'&Show Live'), self.onLiveClick)) |
1010 | - self.ListView.addAction(contextMenuAction( |
1011 | - self.ListView, u':/system/system_add.png', |
1012 | - translate(u'BibleMediaItem',u'&Add to Service'), self.onAddClick)) |
1013 | |
1014 | def retranslateUi(self): |
1015 | log.debug(u'retranslateUi') |
1016 | @@ -304,7 +267,7 @@ |
1017 | unicode(self.AdvancedVersionComboBox.currentText()), |
1018 | unicode(self.AdvancedBookComboBox.currentText())) |
1019 | |
1020 | - def onBibleNewClick(self): |
1021 | + def onNewClick(self): |
1022 | self.bibleimportform = BibleImportForm( |
1023 | self.parent.config, self.parent.biblemanager, self) |
1024 | self.bibleimportform.exec_() |
1025 | |
1026 | === modified file 'openlp/plugins/custom/forms/__init__.py' |
1027 | --- openlp/plugins/custom/forms/__init__.py 2009-09-08 19:58:05 +0000 |
1028 | +++ openlp/plugins/custom/forms/__init__.py 2009-09-26 09:20:25 +0000 |
1029 | @@ -23,5 +23,3 @@ |
1030 | ############################################################################### |
1031 | |
1032 | from editcustomform import EditCustomForm |
1033 | - |
1034 | -__all__ = ['EditCustomForm'] |
1035 | |
1036 | === modified file 'openlp/plugins/custom/lib/mediaitem.py' |
1037 | --- openlp/plugins/custom/lib/mediaitem.py 2009-09-25 00:43:42 +0000 |
1038 | +++ openlp/plugins/custom/lib/mediaitem.py 2009-09-26 09:20:25 +0000 |
1039 | @@ -46,9 +46,6 @@ |
1040 | self.PluginTextShort = u'Custom' |
1041 | self.ConfigSection = u'custom' |
1042 | self.IconPath = u'custom/custom' |
1043 | - self.hasFileIcon = False |
1044 | - self.hasNewIcon = True |
1045 | - self.hasEditIcon = True |
1046 | # this next is a class, not an instance of a class - it will |
1047 | # be instanced by the base MediaManagerItem |
1048 | self.ListViewWithDnD_class = CustomListView |
1049 | @@ -57,6 +54,10 @@ |
1050 | MediaManagerItem.__init__(self, parent, icon, title) |
1051 | self.parent = parent |
1052 | |
1053 | + def requiredIcons(self): |
1054 | + MediaManagerItem.requiredIcons(self) |
1055 | + self.hasFileIcon = False |
1056 | + |
1057 | def initialise(self): |
1058 | self.loadCustomListView(self.parent.custommanager.get_all_slides()) |
1059 | |
1060 | |
1061 | === modified file 'openlp/plugins/images/lib/mediaitem.py' |
1062 | --- openlp/plugins/images/lib/mediaitem.py 2009-09-25 00:43:42 +0000 |
1063 | +++ openlp/plugins/images/lib/mediaitem.py 2009-09-26 09:20:25 +0000 |
1064 | @@ -26,7 +26,7 @@ |
1065 | import os |
1066 | |
1067 | from PyQt4 import QtCore, QtGui |
1068 | -from openlp.core.lib import MediaManagerItem, BaseListWithDnD, buildIcon |
1069 | +from openlp.core.lib import MediaManagerItem, BaseListWithDnD, buildIcon, translate |
1070 | |
1071 | # We have to explicitly create separate classes for each plugin |
1072 | # in order for DnD to the Service manager to work correctly. |
1073 | @@ -48,9 +48,6 @@ |
1074 | self.PluginTextShort = u'Image' |
1075 | self.ConfigSection = u'images' |
1076 | self.IconPath = u'images/image' |
1077 | - self.hasFileIcon = True |
1078 | - self.hasNewIcon = False |
1079 | - self.hasEditIcon = False |
1080 | self.OnNewPrompt = u'Select Image(s)' |
1081 | self.OnNewFileMasks = u'Images (*.jpg *jpeg *.gif *.png *.bmp)' |
1082 | # this next is a class, not an instance of a class - it will |
1083 | @@ -59,6 +56,13 @@ |
1084 | self.ServiceItemIconName = u':/media/media_image.png' |
1085 | self.servicePath = None |
1086 | MediaManagerItem.__init__(self, parent, icon, title) |
1087 | + self.overrideActive = False |
1088 | + |
1089 | + def requiredIcons(self): |
1090 | + MediaManagerItem.requiredIcons(self) |
1091 | + self.hasFileIcon = True |
1092 | + self.hasNewIcon = False |
1093 | + self.hasEditIcon = False |
1094 | |
1095 | def initialise(self): |
1096 | self.ListView.setSelectionMode( |
1097 | @@ -70,6 +74,37 @@ |
1098 | os.mkdir(self.servicePath) |
1099 | self.loadList(self.parent.config.load_list(self.ConfigSection)) |
1100 | |
1101 | + def addEndHeaderBar(self): |
1102 | + self.ImageWidget = QtGui.QWidget(self) |
1103 | + sizePolicy = QtGui.QSizePolicy( |
1104 | + QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
1105 | + sizePolicy.setHorizontalStretch(0) |
1106 | + sizePolicy.setVerticalStretch(0) |
1107 | + sizePolicy.setHeightForWidth( |
1108 | + self.ImageWidget.sizePolicy().hasHeightForWidth()) |
1109 | + self.ImageWidget.setSizePolicy(sizePolicy) |
1110 | + self.ImageWidget.setObjectName(u'ImageWidget') |
1111 | + self.OverrideLayout = QtGui.QVBoxLayout(self.ImageWidget) |
1112 | + self.OverrideLayout.setMargin(5) |
1113 | + self.OverrideLayout.setSpacing(4) |
1114 | + self.OverrideLayout.setObjectName(u'OverrideLayout') |
1115 | + self.OverrideCheckBox = QtGui.QCheckBox(self.ImageWidget) |
1116 | + self.OverrideCheckBox.setObjectName(u'OverrideCheckBox') |
1117 | + self.OverrideCheckBox.setCheckable(True) |
1118 | + self.OverrideCheckBox.setChecked(False) |
1119 | + self.OverrideCheckBox.setText(translate(u'ImagePlugin', u'Override background')) |
1120 | + self.OverrideCheckBox.setStatusTip( |
1121 | + translate(u'ImageMedia', u'Allow background of live slide to be overridden')) |
1122 | + self.OverrideLayout.addWidget(self.OverrideCheckBox) |
1123 | + self.OverrideLabel = QtGui.QLabel(self.ImageWidget) |
1124 | + self.OverrideLabel.setObjectName(u'OverrideLabel') |
1125 | + self.OverrideLayout.addWidget(self.OverrideLabel) |
1126 | + # Add the song widget to the page layout |
1127 | + self.PageLayout.addWidget(self.ImageWidget) |
1128 | + QtCore.QObject.connect(self.OverrideCheckBox, |
1129 | + QtCore.SIGNAL(u'stateChanged(int)'), |
1130 | + self.toggleOverrideState) |
1131 | + |
1132 | def onDeleteClick(self): |
1133 | item = self.ListView.currentItem() |
1134 | if item is not None: |
1135 | @@ -111,3 +146,24 @@ |
1136 | (path, name) = os.path.split(filename) |
1137 | service_item.add_from_image(path, name, frame) |
1138 | return True |
1139 | + |
1140 | + def toggleOverrideState(self): |
1141 | + self.overrideActive = not self.overrideActive |
1142 | + if not self.overrideActive: |
1143 | + self.OverrideLabel.setText(u'') |
1144 | + self.parent.render_manager.override_background = None |
1145 | + |
1146 | + def onPreviewClick(self): |
1147 | + if self.overrideActive: |
1148 | + items = self.ListView.selectedIndexes() |
1149 | + if len(items) == 0: |
1150 | + return False |
1151 | + for item in items: |
1152 | + bitem = self.ListView.item(item.row()) |
1153 | + filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString()) |
1154 | + self.OverrideLabel.setText(bitem.text()) |
1155 | + frame = QtGui.QImage(unicode(filename)) |
1156 | + self.parent.render_manager.override_background = frame |
1157 | + self.parent.render_manager.override_background_changed = True |
1158 | + else: |
1159 | + MediaManagerItem.onPreviewClick(self) |
1160 | |
1161 | === modified file 'openlp/plugins/media/lib/mediaitem.py' |
1162 | --- openlp/plugins/media/lib/mediaitem.py 2009-09-25 00:43:42 +0000 |
1163 | +++ openlp/plugins/media/lib/mediaitem.py 2009-09-26 09:20:25 +0000 |
1164 | @@ -44,9 +44,6 @@ |
1165 | |
1166 | def __init__(self, parent, icon, title): |
1167 | self.TranslationContext = u'MediaPlugin' |
1168 | - self.hasFileIcon = True |
1169 | - self.hasNewIcon = False |
1170 | - self.hasEditIcon = False |
1171 | self.IconPath = u'images/image' |
1172 | self.PluginTextShort = u'Media' |
1173 | self.ConfigSection = u'images' |
1174 | @@ -59,6 +56,12 @@ |
1175 | self.PreviewFunction = self.video_get_preview |
1176 | MediaManagerItem.__init__(self, parent, icon, title) |
1177 | |
1178 | + def requiredIcons(self): |
1179 | + MediaManagerItem.requiredIcons(self) |
1180 | + self.hasFileIcon = True |
1181 | + self.hasNewIcon = False |
1182 | + self.hasEditIcon = False |
1183 | + |
1184 | def video_get_preview(self, filename): |
1185 | # |
1186 | # For now cross platform is an icon. Phonon does not support |
1187 | |
1188 | === modified file 'openlp/plugins/presentations/lib/mediaitem.py' |
1189 | --- openlp/plugins/presentations/lib/mediaitem.py 2009-09-25 00:43:42 +0000 |
1190 | +++ openlp/plugins/presentations/lib/mediaitem.py 2009-09-26 09:20:25 +0000 |
1191 | @@ -51,9 +51,6 @@ |
1192 | self.TranslationContext = u'PresentationPlugin' |
1193 | self.PluginTextShort = u'Presentation' |
1194 | self.ConfigSection = u'presentations' |
1195 | - self.hasFileIcon = True |
1196 | - self.hasNewIcon = False |
1197 | - self.hasEditIcon = False |
1198 | self.IconPath = u'presentations/presentation' |
1199 | self.OnNewPrompt = u'Select Presentation(s)' |
1200 | self.OnNewFileMasks = u'Presentations (*.ppt *.pps *.odp)' |
1201 | @@ -63,6 +60,12 @@ |
1202 | MediaManagerItem.__init__(self, parent, icon, title) |
1203 | self.message_listener = MessageListener(controllers) |
1204 | |
1205 | + def requiredIcons(self): |
1206 | + MediaManagerItem.requiredIcons(self) |
1207 | + self.hasFileIcon = True |
1208 | + self.hasNewIcon = False |
1209 | + self.hasEditIcon = False |
1210 | + |
1211 | def addEndHeaderBar(self): |
1212 | self.PresentationWidget = QtGui.QWidget(self) |
1213 | sizePolicy = QtGui.QSizePolicy( |
1214 | |
1215 | === modified file 'openlp/plugins/songs/lib/mediaitem.py' |
1216 | --- openlp/plugins/songs/lib/mediaitem.py 2009-09-25 00:43:42 +0000 |
1217 | +++ openlp/plugins/songs/lib/mediaitem.py 2009-09-26 09:20:25 +0000 |
1218 | @@ -47,44 +47,20 @@ |
1219 | self.TranslationContext = u'SongPlugin' |
1220 | self.PluginTextShort = u'Song' |
1221 | self.ConfigSection = u'song' |
1222 | + self.IconPath = u'songs/song' |
1223 | + self.ListViewWithDnD_class = SongListView |
1224 | + self.ServiceItemIconName = u':/media/song_image.png' |
1225 | + self.servicePath = None |
1226 | MediaManagerItem.__init__(self, parent, icon, title) |
1227 | self.edit_song_form = EditSongForm(self.parent.songmanager, self) |
1228 | self.song_maintenance_form = SongMaintenanceForm( |
1229 | self.parent.songmanager, self) |
1230 | |
1231 | - def setupUi(self): |
1232 | - # Add a toolbar |
1233 | - self.addToolbar() |
1234 | - # Create buttons for the toolbar |
1235 | - ## New Song Button ## |
1236 | - self.addToolbarButton(translate(u'SongMediaItem', u'New Song'), |
1237 | - translate(u'SongMediaItem', u'Add a new song'), |
1238 | - ':/songs/song_new.png', self.onSongNewClick, 'SongNewItem') |
1239 | - ## Edit Song Button ## |
1240 | - self.addToolbarButton(translate(u'SongMediaItem', u'Edit Song'), |
1241 | - translate(u'SongMediaItem', u'Edit the selected song'), |
1242 | - ':/songs/song_edit.png', self.onSongEditClick, 'SongEditItem') |
1243 | - ## Delete Song Button ## |
1244 | - self.addToolbarButton(translate(u'SongMediaItem', u'Delete Song'), |
1245 | - translate(u'SongMediaItem', u'Delete the selected song'), |
1246 | - ':/songs/song_delete.png', self.onSongDeleteClick, 'SongDeleteItem') |
1247 | - ## Separator Line ## |
1248 | - self.addToolbarSeparator() |
1249 | - ## Preview Song Button ## |
1250 | - self.addToolbarButton(translate(u'SongMediaItem', u'Preview Song'), |
1251 | - translate(u'SongMediaItem', u'Preview the selected song'), |
1252 | - ':/system/system_preview.png', self.onPreviewClick, |
1253 | - 'SongPreviewItem') |
1254 | - ## Live Song Button ## |
1255 | - self.addToolbarButton(translate(u'SongMediaItem', u'Go Live'), |
1256 | - translate(u'SongMediaItem', u'Send the selected song live'), |
1257 | - ':/system/system_live.png', self.onLiveClick, 'SongLiveItem') |
1258 | - ## Add Song Button ## |
1259 | - self.addToolbarButton( |
1260 | - translate(u'SongMediaItem', u'Add Song To Service'), |
1261 | - translate(u'SongMediaItem', |
1262 | - u'Add the selected song(s) to the service'), |
1263 | - ':/system/system_add.png', self.onAddClick, 'SongAddItem') |
1264 | + def requiredIcons(self): |
1265 | + MediaManagerItem.requiredIcons(self) |
1266 | + self.hasFileIcon = False |
1267 | + |
1268 | + def addEndHeaderBar(self): |
1269 | self.addToolbarSeparator() |
1270 | ## Song Maintenance Button ## |
1271 | self.addToolbarButton(translate(u'SongMediaItem', u'Song Maintenance'), |
1272 | @@ -127,12 +103,6 @@ |
1273 | self.SearchLayout.addWidget(self.SearchTextButton, 3, 2, 1, 1) |
1274 | # Add the song widget to the page layout |
1275 | self.PageLayout.addWidget(self.SongWidget) |
1276 | - self.ListView = SongListView() |
1277 | - self.ListView.setAlternatingRowColors(True) |
1278 | - self.ListView.setDragEnabled(True) |
1279 | - self.ListView.setObjectName(u'ListView') |
1280 | - self.PageLayout.addWidget(self.ListView) |
1281 | - self.ListView.setDragEnabled(True) |
1282 | # Signals and slots |
1283 | QtCore.QObject.connect(self.SearchTextButton, |
1284 | QtCore.SIGNAL(u'pressed()'), self.onSearchTextButtonClick) |
1285 | @@ -141,27 +111,9 @@ |
1286 | QtCore.QObject.connect(self.SearchTextEdit, |
1287 | QtCore.SIGNAL(u'textChanged(const QString&)'), |
1288 | self.onSearchTextEditChanged) |
1289 | - QtCore.QObject.connect(self.ListView, |
1290 | - QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.onPreviewClick) |
1291 | QtCore.QObject.connect(Receiver.get_receiver(), |
1292 | QtCore.SIGNAL(u'load_song_list'), self.onSearchTextButtonClick) |
1293 | |
1294 | - #define and add the context menu |
1295 | - self.ListView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) |
1296 | - self.ListView.addAction(contextMenuAction(self.ListView, |
1297 | - ':/songs/song_new.png', translate(u'SongMediaItem', u'&Edit Song'), |
1298 | - self.onSongEditClick)) |
1299 | - self.ListView.addAction(contextMenuSeparator(self.ListView)) |
1300 | - self.ListView.addAction(contextMenuAction(self.ListView, |
1301 | - ':/system/system_preview.png', |
1302 | - translate(u'SongMediaItem', u'&Preview Song'), self.onPreviewClick)) |
1303 | - self.ListView.addAction(contextMenuAction(self.ListView, |
1304 | - ':/system/system_live.png', |
1305 | - translate(u'SongMediaItem', u'&Show Live'), self.onLiveClick)) |
1306 | - self.ListView.addAction(contextMenuAction(self.ListView, |
1307 | - ':/system/system_add.png', |
1308 | - translate(u'SongMediaItem', u'&Add to Service'), self.onAddClick)) |
1309 | - |
1310 | def retranslateUi(self): |
1311 | self.SearchTypeLabel.setText( |
1312 | translate(u'SongMediaItem', u'Search Type:')) |
1313 | @@ -235,7 +187,7 @@ |
1314 | if len(text) > search_length: |
1315 | self.onSearchTextButtonClick() |
1316 | |
1317 | - def onSongNewClick(self): |
1318 | + def onNewClick(self): |
1319 | self.edit_song_form.newSong() |
1320 | self.edit_song_form.exec_() |
1321 | |
1322 | @@ -254,14 +206,14 @@ |
1323 | def onSongMaintenanceClick(self): |
1324 | self.song_maintenance_form.exec_() |
1325 | |
1326 | - def onSongEditClick(self): |
1327 | + def onEditClick(self): |
1328 | item = self.ListView.currentItem() |
1329 | if item is not None: |
1330 | item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] |
1331 | self.edit_song_form.loadSong(item_id) |
1332 | self.edit_song_form.exec_() |
1333 | |
1334 | - def onSongDeleteClick(self): |
1335 | + def onDeleteClick(self): |
1336 | item = self.ListView.currentItem() |
1337 | if item is not None: |
1338 | item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0] |
1339 | |
1340 | === added file 'resources/forms/auditdeletedialog.ui' |
1341 | --- resources/forms/auditdeletedialog.ui 1970-01-01 00:00:00 +0000 |
1342 | +++ resources/forms/auditdeletedialog.ui 2009-09-26 09:20:25 +0000 |
1343 | @@ -0,0 +1,87 @@ |
1344 | +<?xml version="1.0" encoding="UTF-8"?> |
1345 | +<ui version="4.0"> |
1346 | + <class>AuditDeleteDialog</class> |
1347 | + <widget class="QWidget" name="AuditDeleteDialog"> |
1348 | + <property name="geometry"> |
1349 | + <rect> |
1350 | + <x>0</x> |
1351 | + <y>0</y> |
1352 | + <width>291</width> |
1353 | + <height>202</height> |
1354 | + </rect> |
1355 | + </property> |
1356 | + <property name="windowTitle"> |
1357 | + <string>Audit Delete </string> |
1358 | + </property> |
1359 | + <widget class="QWidget" name="layoutWidget"> |
1360 | + <property name="geometry"> |
1361 | + <rect> |
1362 | + <x>20</x> |
1363 | + <y>10</y> |
1364 | + <width>247</width> |
1365 | + <height>181</height> |
1366 | + </rect> |
1367 | + </property> |
1368 | + <layout class="QVBoxLayout" name="verticalLayout"> |
1369 | + <item> |
1370 | + <widget class="QCalendarWidget" name="DeleteCalendar"> |
1371 | + <property name="firstDayOfWeek"> |
1372 | + <enum>Qt::Sunday</enum> |
1373 | + </property> |
1374 | + <property name="gridVisible"> |
1375 | + <bool>true</bool> |
1376 | + </property> |
1377 | + <property name="verticalHeaderFormat"> |
1378 | + <enum>QCalendarWidget::NoVerticalHeader</enum> |
1379 | + </property> |
1380 | + </widget> |
1381 | + </item> |
1382 | + <item> |
1383 | + <widget class="QDialogButtonBox" name="buttonBox"> |
1384 | + <property name="standardButtons"> |
1385 | + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> |
1386 | + </property> |
1387 | + </widget> |
1388 | + </item> |
1389 | + </layout> |
1390 | + </widget> |
1391 | + </widget> |
1392 | + <resources/> |
1393 | + <connections> |
1394 | + <connection> |
1395 | + <sender>buttonBox</sender> |
1396 | + <signal>accepted()</signal> |
1397 | + <receiver>AuditDeleteDialog</receiver> |
1398 | + <slot>accept()</slot> |
1399 | + <hints> |
1400 | + <hint type="sourcelabel"> |
1401 | + <x>133</x> |
1402 | + <y>178</y> |
1403 | + </hint> |
1404 | + <hint type="destinationlabel"> |
1405 | + <x>125</x> |
1406 | + <y>374</y> |
1407 | + </hint> |
1408 | + </hints> |
1409 | + </connection> |
1410 | + <connection> |
1411 | + <sender>buttonBox</sender> |
1412 | + <signal>rejected()</signal> |
1413 | + <receiver>AuditDeleteDialog</receiver> |
1414 | + <slot>close()</slot> |
1415 | + <hints> |
1416 | + <hint type="sourcelabel"> |
1417 | + <x>200</x> |
1418 | + <y>175</y> |
1419 | + </hint> |
1420 | + <hint type="destinationlabel"> |
1421 | + <x>189</x> |
1422 | + <y>393</y> |
1423 | + </hint> |
1424 | + </hints> |
1425 | + </connection> |
1426 | + </connections> |
1427 | + <slots> |
1428 | + <slot>accept()</slot> |
1429 | + </slots> |
1430 | +</ui> |
1431 | |
1432 | === added file 'resources/forms/auditdetaildialog.ui' |
1433 | --- resources/forms/auditdetaildialog.ui 1970-01-01 00:00:00 +0000 |
1434 | +++ resources/forms/auditdetaildialog.ui 2009-09-26 09:20:25 +0000 |
1435 | @@ -0,0 +1,343 @@ |
1436 | +<?xml version="1.0" encoding="UTF-8"?> |
1437 | +<ui version="4.0"> |
1438 | + <class>AuditDetailDialog</class> |
1439 | + <widget class="QWidget" name="AuditDetailDialog"> |
1440 | + <property name="geometry"> |
1441 | + <rect> |
1442 | + <x>0</x> |
1443 | + <y>0</y> |
1444 | + <width>593</width> |
1445 | + <height>501</height> |
1446 | + </rect> |
1447 | + </property> |
1448 | + <property name="windowTitle"> |
1449 | + <string>Audit Detail Extraction</string> |
1450 | + </property> |
1451 | + <widget class="QDialogButtonBox" name="buttonBox"> |
1452 | + <property name="geometry"> |
1453 | + <rect> |
1454 | + <x>420</x> |
1455 | + <y>470</y> |
1456 | + <width>170</width> |
1457 | + <height>25</height> |
1458 | + </rect> |
1459 | + </property> |
1460 | + <property name="standardButtons"> |
1461 | + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> |
1462 | + </property> |
1463 | + </widget> |
1464 | + <widget class="QGroupBox" name="FileGroupBox"> |
1465 | + <property name="geometry"> |
1466 | + <rect> |
1467 | + <x>10</x> |
1468 | + <y>370</y> |
1469 | + <width>571</width> |
1470 | + <height>70</height> |
1471 | + </rect> |
1472 | + </property> |
1473 | + <property name="title"> |
1474 | + <string>Report Location</string> |
1475 | + </property> |
1476 | + <layout class="QVBoxLayout" name="verticalLayout_4"> |
1477 | + <item> |
1478 | + <layout class="QHBoxLayout" name="horizontalLayout"> |
1479 | + <item> |
1480 | + <widget class="QLineEdit" name="FileLineEdit"/> |
1481 | + </item> |
1482 | + <item> |
1483 | + <widget class="QPushButton" name="SaveFilePushButton"> |
1484 | + <property name="text"> |
1485 | + <string/> |
1486 | + </property> |
1487 | + <property name="icon"> |
1488 | + <iconset resource="../images/openlp-2.qrc"> |
1489 | + <normaloff>:/exports/export_load.png</normaloff>:/exports/export_load.png</iconset> |
1490 | + </property> |
1491 | + </widget> |
1492 | + </item> |
1493 | + </layout> |
1494 | + </item> |
1495 | + </layout> |
1496 | + </widget> |
1497 | + <widget class="QWidget" name="layoutWidget"> |
1498 | + <property name="geometry"> |
1499 | + <rect> |
1500 | + <x>10</x> |
1501 | + <y>10</y> |
1502 | + <width>561</width> |
1503 | + <height>361</height> |
1504 | + </rect> |
1505 | + </property> |
1506 | + <layout class="QVBoxLayout" name="verticalLayout_3"> |
1507 | + <item> |
1508 | + <widget class="QGroupBox" name="ReportTypeGroup"> |
1509 | + <property name="title"> |
1510 | + <string>Report Type</string> |
1511 | + </property> |
1512 | + <widget class="QWidget" name="layoutWidget"> |
1513 | + <property name="geometry"> |
1514 | + <rect> |
1515 | + <x>50</x> |
1516 | + <y>40</y> |
1517 | + <width>481</width> |
1518 | + <height>23</height> |
1519 | + </rect> |
1520 | + </property> |
1521 | + <layout class="QHBoxLayout" name="ReportHorizontalLayout"> |
1522 | + <item> |
1523 | + <widget class="QRadioButton" name="SummaryReport"> |
1524 | + <property name="text"> |
1525 | + <string>Summary</string> |
1526 | + </property> |
1527 | + </widget> |
1528 | + </item> |
1529 | + <item> |
1530 | + <widget class="QRadioButton" name="DetailedReport"> |
1531 | + <property name="text"> |
1532 | + <string>Detailed</string> |
1533 | + </property> |
1534 | + <property name="checked"> |
1535 | + <bool>true</bool> |
1536 | + </property> |
1537 | + </widget> |
1538 | + </item> |
1539 | + </layout> |
1540 | + </widget> |
1541 | + </widget> |
1542 | + </item> |
1543 | + <item> |
1544 | + <widget class="QGroupBox" name="DateRangeGroupBox"> |
1545 | + <property name="title"> |
1546 | + <string>Date Range</string> |
1547 | + </property> |
1548 | + <layout class="QVBoxLayout" name="verticalLayout_2"> |
1549 | + <item> |
1550 | + <layout class="QHBoxLayout" name="DateHorizontalLayout"> |
1551 | + <item> |
1552 | + <widget class="QDateEdit" name="FromDateEdit"> |
1553 | + <property name="displayFormat"> |
1554 | + <string>dd/MM/yyyy</string> |
1555 | + </property> |
1556 | + <property name="calendarPopup"> |
1557 | + <bool>true</bool> |
1558 | + </property> |
1559 | + </widget> |
1560 | + </item> |
1561 | + <item> |
1562 | + <widget class="QLabel" name="To"> |
1563 | + <property name="text"> |
1564 | + <string>to</string> |
1565 | + </property> |
1566 | + </widget> |
1567 | + </item> |
1568 | + <item> |
1569 | + <widget class="QDateEdit" name="ToDateEdit"> |
1570 | + <property name="displayFormat"> |
1571 | + <string>dd/MM/yyyy</string> |
1572 | + </property> |
1573 | + <property name="calendarPopup"> |
1574 | + <bool>true</bool> |
1575 | + </property> |
1576 | + </widget> |
1577 | + </item> |
1578 | + </layout> |
1579 | + </item> |
1580 | + </layout> |
1581 | + </widget> |
1582 | + </item> |
1583 | + <item> |
1584 | + <widget class="QGroupBox" name="TimePeriodGroupBox"> |
1585 | + <property name="title"> |
1586 | + <string>Time Periods</string> |
1587 | + </property> |
1588 | + <layout class="QVBoxLayout" name="verticalLayout"> |
1589 | + <item> |
1590 | + <layout class="QHBoxLayout" name="FirstHorizontalLayout"> |
1591 | + <item> |
1592 | + <widget class="QCheckBox" name="FirstCheckBox"> |
1593 | + <property name="text"> |
1594 | + <string>First Service</string> |
1595 | + </property> |
1596 | + <property name="checked"> |
1597 | + <bool>true</bool> |
1598 | + </property> |
1599 | + </widget> |
1600 | + </item> |
1601 | + <item> |
1602 | + <widget class="QTimeEdit" name="FirstFromTimeEdit"> |
1603 | + <property name="displayFormat"> |
1604 | + <string>hh:mm AP</string> |
1605 | + </property> |
1606 | + <property name="time"> |
1607 | + <time> |
1608 | + <hour>9</hour> |
1609 | + <minute>0</minute> |
1610 | + <second>0</second> |
1611 | + </time> |
1612 | + </property> |
1613 | + </widget> |
1614 | + </item> |
1615 | + <item> |
1616 | + <widget class="QLabel" name="FirstTo"> |
1617 | + <property name="text"> |
1618 | + <string>to</string> |
1619 | + </property> |
1620 | + </widget> |
1621 | + </item> |
1622 | + <item> |
1623 | + <widget class="QTimeEdit" name="FirstToTimeEdit"> |
1624 | + <property name="displayFormat"> |
1625 | + <string>hh:mm AP</string> |
1626 | + </property> |
1627 | + <property name="calendarPopup"> |
1628 | + <bool>true</bool> |
1629 | + </property> |
1630 | + <property name="time"> |
1631 | + <time> |
1632 | + <hour>10</hour> |
1633 | + <minute>0</minute> |
1634 | + <second>0</second> |
1635 | + </time> |
1636 | + </property> |
1637 | + </widget> |
1638 | + </item> |
1639 | + </layout> |
1640 | + </item> |
1641 | + <item> |
1642 | + <layout class="QHBoxLayout" name="SecondHorizontalLayout"> |
1643 | + <item> |
1644 | + <widget class="QCheckBox" name="SecondCheckBox"> |
1645 | + <property name="text"> |
1646 | + <string>Second Service</string> |
1647 | + </property> |
1648 | + <property name="checked"> |
1649 | + <bool>true</bool> |
1650 | + </property> |
1651 | + </widget> |
1652 | + </item> |
1653 | + <item> |
1654 | + <widget class="QTimeEdit" name="SecondFromTimeEdit"> |
1655 | + <property name="displayFormat"> |
1656 | + <string>hh:mm AP</string> |
1657 | + </property> |
1658 | + <property name="time"> |
1659 | + <time> |
1660 | + <hour>10</hour> |
1661 | + <minute>45</minute> |
1662 | + <second>0</second> |
1663 | + </time> |
1664 | + </property> |
1665 | + </widget> |
1666 | + </item> |
1667 | + <item> |
1668 | + <widget class="QLabel" name="SecondTo"> |
1669 | + <property name="text"> |
1670 | + <string>to</string> |
1671 | + </property> |
1672 | + </widget> |
1673 | + </item> |
1674 | + <item> |
1675 | + <widget class="QTimeEdit" name="SecondToTimeEdit"> |
1676 | + <property name="displayFormat"> |
1677 | + <string>hh:mm AP</string> |
1678 | + </property> |
1679 | + </widget> |
1680 | + </item> |
1681 | + </layout> |
1682 | + </item> |
1683 | + <item> |
1684 | + <layout class="QHBoxLayout" name="ThirdHorizontalLayout"> |
1685 | + <item> |
1686 | + <widget class="QCheckBox" name="ThirdCheckBox"> |
1687 | + <property name="text"> |
1688 | + <string>Third Service</string> |
1689 | + </property> |
1690 | + <property name="checked"> |
1691 | + <bool>true</bool> |
1692 | + </property> |
1693 | + </widget> |
1694 | + </item> |
1695 | + <item> |
1696 | + <widget class="QTimeEdit" name="ThirdFromTimeEdit"> |
1697 | + <property name="displayFormat"> |
1698 | + <string>hh:mm AP</string> |
1699 | + </property> |
1700 | + <property name="time"> |
1701 | + <time> |
1702 | + <hour>18</hour> |
1703 | + <minute>30</minute> |
1704 | + <second>0</second> |
1705 | + </time> |
1706 | + </property> |
1707 | + </widget> |
1708 | + </item> |
1709 | + <item> |
1710 | + <widget class="QLabel" name="ThirdTo"> |
1711 | + <property name="text"> |
1712 | + <string>to</string> |
1713 | + </property> |
1714 | + </widget> |
1715 | + </item> |
1716 | + <item> |
1717 | + <widget class="QTimeEdit" name="ThirdToTimeEdit"> |
1718 | + <property name="displayFormat"> |
1719 | + <string>hh:mm AP</string> |
1720 | + </property> |
1721 | + <property name="time"> |
1722 | + <time> |
1723 | + <hour>19</hour> |
1724 | + <minute>30</minute> |
1725 | + <second>0</second> |
1726 | + </time> |
1727 | + </property> |
1728 | + </widget> |
1729 | + </item> |
1730 | + </layout> |
1731 | + </item> |
1732 | + </layout> |
1733 | + </widget> |
1734 | + </item> |
1735 | + </layout> |
1736 | + </widget> |
1737 | + </widget> |
1738 | + <resources> |
1739 | + <include location="../images/openlp-2.qrc"/> |
1740 | + </resources> |
1741 | + <connections> |
1742 | + <connection> |
1743 | + <sender>buttonBox</sender> |
1744 | + <signal>accepted()</signal> |
1745 | + <receiver>AuditDetailDialog</receiver> |
1746 | + <slot>accept()</slot> |
1747 | + <hints> |
1748 | + <hint type="sourcelabel"> |
1749 | + <x>455</x> |
1750 | + <y>483</y> |
1751 | + </hint> |
1752 | + <hint type="destinationlabel"> |
1753 | + <x>445</x> |
1754 | + <y>575</y> |
1755 | + </hint> |
1756 | + </hints> |
1757 | + </connection> |
1758 | + <connection> |
1759 | + <sender>buttonBox</sender> |
1760 | + <signal>rejected()</signal> |
1761 | + <receiver>AuditDetailDialog</receiver> |
1762 | + <slot>close()</slot> |
1763 | + <hints> |
1764 | + <hint type="sourcelabel"> |
1765 | + <x>528</x> |
1766 | + <y>484</y> |
1767 | + </hint> |
1768 | + <hint type="destinationlabel"> |
1769 | + <x>526</x> |
1770 | + <y>531</y> |
1771 | + </hint> |
1772 | + </hints> |
1773 | + </connection> |
1774 | + </connections> |
1775 | + <slots> |
1776 | + <slot>accept()</slot> |
1777 | + </slots> |
1778 | +</ui> |
Plugin cleanups removing duplicate code and using MediaManagerItem
Clean up setting the required icons
Add menus to Audit
Add dynamic rendered backgrounds from Image