openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #05946
[Merge] lp:~googol-hush/openlp/printServiceOrder into lp:openlp
Andreas Preikschat has proposed merging lp:~googol-hush/openlp/printServiceOrder into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~googol-hush/openlp/printServiceOrder/+merge/48213
Hello!
- added the service order print
- fixed the icon of "media" items. (The plugin provides its own icon. There is no need for such a large icon.) And since self.serviceItemIconName was not used anywhere else I removed it.
- fixed a bug, which will prevent service items to be loaded (they are marked as invalid) when the contain paths like foo.bar.extension.
Note: I know that changes to mainwindow.py are not conform with the coding standards. But:
- the whole file does not conform with it -> needs to be fixed (as well as other file(s) which use variables from mainwindow.py).
- I do not have the time to fix that, so I hope you let it pass and someone who has the time for it will fixe it.
I have two sample pdfs (but ubuntu one is down for maintenance).
--
https://code.launchpad.net/~googol-hush/openlp/printServiceOrder/+merge/48213
Your team OpenLP Core is requested to review the proposed merge of lp:~googol-hush/openlp/printServiceOrder into lp:openlp.
=== modified file 'openlp/core/lib/mediamanageritem.py'
--- openlp/core/lib/mediamanageritem.py 2011-02-01 00:33:50 +0000
+++ openlp/core/lib/mediamanageritem.py 2011-02-01 18:09:22 +0000
@@ -103,7 +103,6 @@
self.icon = build_icon(icon)
self.toolbar = None
self.remoteTriggered = None
- self.serviceItemIconName = None
self.singleServiceItem = True
self.pageLayout = QtGui.QVBoxLayout(self)
self.pageLayout.setSpacing(0)
@@ -525,10 +524,7 @@
Common method for generating a service item
"""
serviceItem = ServiceItem(self.parent)
- if self.serviceItemIconName:
- serviceItem.add_icon(self.serviceItemIconName)
- else:
- serviceItem.add_icon(self.parent.icon_path)
+ serviceItem.add_icon(self.parent.icon_path)
if self.generateSlideData(serviceItem, item, xmlVersion):
return serviceItem
else:
=== modified file 'openlp/core/lib/toolbar.py'
--- openlp/core/lib/toolbar.py 2011-01-21 19:09:56 +0000
+++ openlp/core/lib/toolbar.py 2011-02-01 18:09:22 +0000
@@ -73,13 +73,13 @@
``checkable``
If *True* the button has two, *off* and *on*, states. Default is
*False*, which means the buttons has only one state.
-
+
``shortcut``
The primary shortcut for this action
-
+
``alternate``
The alternate shortcut for this action
-
+
``context``
Specify the context in which this shortcut is valid
"""
=== modified file 'openlp/core/ui/advancedtab.py'
--- openlp/core/ui/advancedtab.py 2011-01-18 00:04:12 +0000
+++ openlp/core/ui/advancedtab.py 2011-02-01 18:09:22 +0000
@@ -80,6 +80,16 @@
self.hideMouseCheckBox.setObjectName(u'hideMouseCheckBox')
self.hideMouseLayout.addWidget(self.hideMouseCheckBox)
self.leftLayout.addWidget(self.hideMouseGroupBox)
+ self.serviceOrderGroupBox = QtGui.QGroupBox(self.leftColumn)
+ self.serviceOrderGroupBox.setObjectName(u'serviceOrderGroupBox')
+ self.serviceOrderLayout = QtGui.QVBoxLayout(self.serviceOrderGroupBox)
+ self.serviceOrderLayout.setObjectName(u'serviceOrderLayout')
+ self.detailedServicePrintCheckBox = QtGui.QCheckBox(
+ self.serviceOrderGroupBox)
+ self.detailedServicePrintCheckBox.setObjectName(
+ u'detailedServicePrintCheckBox')
+ self.serviceOrderLayout.addWidget(self.detailedServicePrintCheckBox)
+ self.leftLayout.addWidget(self.serviceOrderGroupBox)
# self.sharedDirGroupBox = QtGui.QGroupBox(self.leftColumn)
# self.sharedDirGroupBox.setObjectName(u'sharedDirGroupBox')
# self.sharedDirLayout = QtGui.QFormLayout(self.sharedDirGroupBox)
@@ -129,6 +139,10 @@
'Mouse Cursor'))
self.hideMouseCheckBox.setText(translate('OpenLP.AdvancedTab',
'Hide the mouse cursor when moved over the display window'))
+ self.serviceOrderGroupBox.setTitle(translate('OpenLP.AdvancedTab',
+ 'Service Order Print'))
+ self.detailedServicePrintCheckBox.setText(translate('OpenLP.AdvancedTab',
+ 'Print slide texts and service item notes as well'))
# self.sharedDirGroupBox.setTitle(
# translate('AdvancedTab', 'Central Data Store'))
# self.sharedCheckBox.setText(
@@ -164,6 +178,8 @@
QtCore.QVariant(True)).toBool())
self.hideMouseCheckBox.setChecked(
settings.value(u'hide mouse', QtCore.QVariant(False)).toBool())
+ self.detailedServicePrintCheckBox.setChecked(settings.value(
+ u'detailed service print', QtCore.QVariant(False)).toBool())
settings.endGroup()
def save(self):
@@ -184,6 +200,8 @@
QtCore.QVariant(self.enableAutoCloseCheckBox.isChecked()))
settings.setValue(u'hide mouse',
QtCore.QVariant(self.hideMouseCheckBox.isChecked()))
+ settings.setValue(u'detailed service print',
+ QtCore.QVariant(self.detailedServicePrintCheckBox.isChecked()))
settings.endGroup()
# def onSharedCheckBoxChanged(self, checked):
=== modified file 'openlp/core/ui/generaltab.py'
--- openlp/core/ui/generaltab.py 2011-01-23 15:55:59 +0000
+++ openlp/core/ui/generaltab.py 2011-02-01 18:09:22 +0000
@@ -51,6 +51,7 @@
else:
return self.text()
+
class GeneralTab(SettingsTab):
"""
GeneralTab is the general settings tab in the settings dialog.
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2011-01-26 16:05:55 +0000
+++ openlp/core/ui/mainwindow.py 2011-02-01 18:09:22 +0000
@@ -175,6 +175,10 @@
self.FileSaveAsItem = QtGui.QAction(mainWindow)
self.FileSaveAsItem.setObjectName(u'FileSaveAsItem')
mainWindow.actionList.add_action(self.FileSaveAsItem, u'File')
+ self.PrintServiceOrderItem = QtGui.QAction(mainWindow)
+ self.PrintServiceOrderItem.setObjectName(u'PrintServiceItem')
+ mainWindow.actionList.add_action(
+ self.PrintServiceOrderItem, u'Print Service Order')
self.FileExitItem = QtGui.QAction(mainWindow)
self.FileExitItem.setIcon(build_icon(u':/system/system_exit.png'))
self.FileExitItem.setObjectName(u'FileExitItem')
@@ -302,8 +306,8 @@
(self.ExportThemeItem, self.ExportLanguageItem))
self.FileMenuActions = (self.FileNewItem, self.FileOpenItem,
self.FileSaveItem, self.FileSaveAsItem, None,
- self.FileImportMenu.menuAction(), self.FileExportMenu.menuAction(),
- self.FileExitItem)
+ self.PrintServiceOrderItem, None, self.FileImportMenu.menuAction(),
+ self.FileExportMenu.menuAction(), self.FileExitItem)
add_actions(self.ViewModeMenu, (self.ModeDefaultItem,
self.ModeSetupItem, self.ModeLiveItem))
add_actions(self.ViewMenu, (self.ViewModeMenu.menuAction(),
@@ -381,6 +385,12 @@
'Save the current service under a new name.'))
self.FileSaveAsItem.setShortcut(
translate('OpenLP.MainWindow', 'Ctrl+Shift+S'))
+ self.PrintServiceOrderItem.setText(
+ translate('OpenLP.MainWindow', 'Print Service Order'))
+ self.PrintServiceOrderItem.setStatusTip(translate('OpenLP.MainWindow',
+ 'Print the current Service Order.'))
+ self.PrintServiceOrderItem.setShortcut(
+ translate('OpenLP.MainWindow', 'Ctrl+P'))
self.FileExitItem.setText(
translate('OpenLP.MainWindow', 'E&xit'))
self.FileExitItem.setStatusTip(
@@ -567,6 +577,9 @@
QtCore.QObject.connect(self.FileSaveAsItem,
QtCore.SIGNAL(u'triggered()'),
self.ServiceManagerContents.saveFileAs)
+ QtCore.QObject.connect(self.PrintServiceOrderItem,
+ QtCore.SIGNAL(u'triggered()'),
+ self.ServiceManagerContents.printServiceOrder)
# i18n set signals for languages
QtCore.QObject.connect(self.AutoLanguageItem,
QtCore.SIGNAL(u'toggled(bool)'), self.setAutoLanguage)
=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py 2011-01-29 09:56:05 +0000
+++ openlp/core/ui/servicemanager.py 2011-02-01 18:09:22 +0000
@@ -856,7 +856,7 @@
one it allows the item to be displayed.
"""
if serviceItem.is_command():
- type = serviceItem._raw_frames[0][u'title'].split(u'.')[1]
+ type = serviceItem._raw_frames[0][u'title'].split(u'.')[-1]
if type not in self.suffixes:
serviceItem.is_valid = False
@@ -1182,3 +1182,46 @@
data_item[u'selected'] = (item == curitem)
data.append(data_item)
Receiver.send_message(u'servicemanager_list_response', data)
+
+ def printServiceOrder(self):
+ """
+ Print a Service Order Sheet.
+ """
+ if not self.serviceItems:
+ criticalErrorMessageBox(
+ message=translate('OpenLP.ServiceManager',
+ 'There is no service item in this service.'))
+ return
+ printDialog = QtGui.QPrintDialog()
+ if not printDialog.exec_():
+ return
+ text = u'<h2>%s</h2>' % translate('OpenLP.ServiceManager',
+ 'Service Order Sheet')
+ for item in self.serviceItems:
+ item = item[u'service_item']
+ # add the title
+ text += u'<h4><img src="%s" /> %s</h4>' % (item.icon,
+ item.get_display_title())
+ if not QtCore.QSettings().value(u'advanced' +
+ u'/detailed service print', QtCore.QVariant(True)).toBool():
+ continue
+ if item.is_text():
+ # Add the text of the service item.
+ for slide in item.get_frames():
+ text += u'<p>' + slide[u'text'] + u'</p>'
+ elif item.is_image():
+ # Add the image names of the service item.
+ text += u'<ol>'
+ for slide in range(len(item.get_frames())):
+ text += u'<li><p>%s</p></li>' % item.get_frame_title(slide)
+ text += u'</ol>'
+ if item.foot_text:
+ # add footer
+ text += u'<p>%s</p>' % item.foot_text
+ if item.notes:
+ # add notes
+ text += u'<p><b>%s</b> %s</p>' % (translate(
+ 'OpenLP.ServiceManager', 'Notes:'), item.notes)
+ serviceDocument = QtGui.QTextDocument()
+ serviceDocument.setHtml(text)
+ serviceDocument.print_(printDialog.printer())
=== modified file 'openlp/plugins/media/lib/mediaitem.py'
--- openlp/plugins/media/lib/mediaitem.py 2011-01-26 23:26:09 +0000
+++ openlp/plugins/media/lib/mediaitem.py 2011-02-01 18:09:22 +0000
@@ -57,7 +57,6 @@
u':/media/media_video.png').toImage()
MediaManagerItem.__init__(self, parent, self, icon)
self.singleServiceItem = False
- self.serviceItemIconName = u':/media/image_clapperboard.png'
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'video_background_replaced'),
self.videobackgroundReplaced)
Follow ups