print changes

This commit is contained in:
Tim Bentley 2011-02-18 17:38:39 +00:00
parent 33a77b72f7
commit e4876cd84c
4 changed files with 234 additions and 209 deletions

View File

@ -44,8 +44,6 @@ class UiStrings(object):
Advanced = translate('OpenLP.Ui', 'Advanced') Advanced = translate('OpenLP.Ui', 'Advanced')
AllFiles = translate('OpenLP.Ui', 'All Files') AllFiles = translate('OpenLP.Ui', 'All Files')
Authors = translate('OpenLP.Ui', 'Authors') Authors = translate('OpenLP.Ui', 'Authors')
CopyToHtml = translate('OpenLP.Ui', 'Copy to HTML')
CopyToText = translate('OpenLP.Ui', 'Copy to Text')
CreateService = translate('OpenLP.Ui', 'Create a new service.') CreateService = translate('OpenLP.Ui', 'Create a new service.')
Delete = translate('OpenLP.Ui', '&Delete') Delete = translate('OpenLP.Ui', '&Delete')
Edit = translate('OpenLP.Ui', '&Edit') Edit = translate('OpenLP.Ui', '&Edit')

View File

@ -32,6 +32,8 @@ from openlp.core.lib.ui import UiStrings
class Ui_PrintServiceOrderDialog(object): class Ui_PrintServiceOrderDialog(object):
def setupUi(self, printServiceOrderDialog): def setupUi(self, printServiceOrderDialog):
printServiceOrderDialog.setObjectName(u'printServiceOrderDialog') printServiceOrderDialog.setObjectName(u'printServiceOrderDialog')
self.verticalLayout = QtGui.QGridLayout(printServiceOrderDialog)
self.verticalLayout.setObjectName(u'verticalLayout')
self.dialogLayout = QtGui.QGridLayout(printServiceOrderDialog) self.dialogLayout = QtGui.QGridLayout(printServiceOrderDialog)
self.dialogLayout.setObjectName(u'dialogLayout') self.dialogLayout.setObjectName(u'dialogLayout')
self.perviewLayout = QtGui.QVBoxLayout() self.perviewLayout = QtGui.QVBoxLayout()
@ -76,9 +78,6 @@ class Ui_PrintServiceOrderDialog(object):
self.printMetaDataCheckBox = QtGui.QCheckBox(printServiceOrderDialog) self.printMetaDataCheckBox = QtGui.QCheckBox(printServiceOrderDialog)
self.printMetaDataCheckBox.setObjectName(u'printMetaDataCheckBox') self.printMetaDataCheckBox.setObjectName(u'printMetaDataCheckBox')
self.settingsLayout.addWidget(self.printMetaDataCheckBox) self.settingsLayout.addWidget(self.printMetaDataCheckBox)
self.copyMetaDataCheckBox = QtGui.QCheckBox(printServiceOrderDialog)
self.copyMetaDataCheckBox.setObjectName(u'copyMetaDataCheckBox')
self.settingsLayout.addWidget(self.copyMetaDataCheckBox)
spacerItem = QtGui.QSpacerItem(20, 40, spacerItem = QtGui.QSpacerItem(20, 40,
QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.settingsLayout.addItem(spacerItem) self.settingsLayout.addItem(spacerItem)
@ -94,6 +93,9 @@ class Ui_PrintServiceOrderDialog(object):
spacerItem = QtGui.QSpacerItem(40, 20, spacerItem = QtGui.QSpacerItem(40, 20,
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.buttonLayout.addItem(spacerItem) self.buttonLayout.addItem(spacerItem)
self.copyHtmlButton = QtGui.QPushButton(printServiceOrderDialog)
self.copyHtmlButton.setObjectName(u'copyHtmlButton')
self.buttonLayout.addWidget(self.copyHtmlButton)
self.copyTextButton = QtGui.QPushButton(printServiceOrderDialog) self.copyTextButton = QtGui.QPushButton(printServiceOrderDialog)
self.copyTextButton.setObjectName(u'copyTextButton') self.copyTextButton.setObjectName(u'copyTextButton')
self.buttonLayout.addWidget(self.copyTextButton) self.buttonLayout.addWidget(self.copyTextButton)
@ -103,7 +105,7 @@ class Ui_PrintServiceOrderDialog(object):
self.cancelButton = QtGui.QPushButton(printServiceOrderDialog) self.cancelButton = QtGui.QPushButton(printServiceOrderDialog)
self.cancelButton.setObjectName(u'cancelButton') self.cancelButton.setObjectName(u'cancelButton')
self.buttonLayout.addWidget(self.cancelButton) self.buttonLayout.addWidget(self.cancelButton)
self.dialogLayout.addLayout(self.buttonLayout, 1, 3, 1, 1) self.dialogLayout.addLayout(self.buttonLayout, 2, 2, 1, 1)
self.zoomButtonLayout = QtGui.QHBoxLayout() self.zoomButtonLayout = QtGui.QHBoxLayout()
self.zoomButtonLayout.setObjectName(u'zoomButtonLayout') self.zoomButtonLayout.setObjectName(u'zoomButtonLayout')
spacerItem = QtGui.QSpacerItem(40, 20, spacerItem = QtGui.QSpacerItem(40, 20,
@ -134,14 +136,14 @@ class Ui_PrintServiceOrderDialog(object):
self.printMetaDataCheckBox.setText( self.printMetaDataCheckBox.setText(
translate('OpenLP.PrintServiceOrderForm', translate('OpenLP.PrintServiceOrderForm',
'Include play length of media items')) 'Include play length of media items'))
self.copyMetaDataCheckBox.setText(
translate('OpenLP.PrintServiceOrderForm',
'Copy output as HTML'))
self.serviceTitleLabel.setText(translate( self.serviceTitleLabel.setText(translate(
'OpenLP.PrintServiceOrderForm', 'Title:')) 'OpenLP.PrintServiceOrderForm', 'Title:'))
self.serviceTitleLineEdit.setText(translate('OpenLP.ServiceManager', self.serviceTitleLineEdit.setText(translate('OpenLP.ServiceManager',
'Service Order Sheet')) 'Service Order Sheet'))
self.copyTextButton.setText(UiStrings.CopyToText) self.copyTextButton.setText(translate('OpenLP.ServiceManager',
'Copy to Clipboard as Text'))
self.copyHtmlButton.setText(translate('OpenLP.ServiceManager',
'Copy to Clipboard as Html'))
self.printButton.setText(translate('OpenLP.ServiceManager', 'Print')) self.printButton.setText(translate('OpenLP.ServiceManager', 'Print'))
self.cancelButton.setText(translate('OpenLP.ServiceManager', 'Cancel')) self.cancelButton.setText(translate('OpenLP.ServiceManager', 'Cancel'))
self.customNotesLabel.setText( self.customNotesLabel.setText(

View File

@ -53,10 +53,6 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog):
u'print file meta data', QtCore.QVariant(False)).toBool()) u'print file meta data', QtCore.QVariant(False)).toBool())
self.printNotesCheckBox.setChecked(settings.value( self.printNotesCheckBox.setChecked(settings.value(
u'print notes', QtCore.QVariant(False)).toBool()) u'print notes', QtCore.QVariant(False)).toBool())
self.copyMetaDataCheckBox.setChecked(settings.value(
u'html copy', QtCore.QVariant(False)).toBool())
if self.copyMetaDataCheckBox.isChecked():
self.copyTextButton.setText(UiStrings.CopyToHtml)
settings.endGroup() settings.endGroup()
# Signals # Signals
QtCore.QObject.connect(self.printButton, QtCore.QObject.connect(self.printButton,
@ -82,8 +78,8 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog):
QtCore.SIGNAL(u'clicked()'), self.reject) QtCore.SIGNAL(u'clicked()'), self.reject)
QtCore.QObject.connect(self.copyTextButton, QtCore.QObject.connect(self.copyTextButton,
QtCore.SIGNAL(u'clicked()'), self.copyText) QtCore.SIGNAL(u'clicked()'), self.copyText)
QtCore.QObject.connect(self.copyMetaDataCheckBox, QtCore.QObject.connect(self.copyHtmlButton,
QtCore.SIGNAL(u'stateChanged(int)'), self.updateTextFormat) QtCore.SIGNAL(u'clicked()'), self.copyHtmlText)
self.updatePreviewText() self.updatePreviewText()
def updatePreviewText(self): def updatePreviewText(self):
@ -150,11 +146,18 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog):
self.document.print_(printer) self.document.print_(printer)
def copyText(self): def copyText(self):
if self.copyMetaDataCheckBox.isChecked(): """
self.parent.clipboard.setText(self.document.toHtml()) Copies the display text to the clipboard as plain text
else: """
self.parent.clipboard.setText(self.document.toPlainText()) self.parent.clipboard.setText(self.document.toPlainText())
self.accept()
def copyHtmlText(self):
"""
Copies the display text to the clipboard as Html
"""
self.parent.clipboard.setText(self.document.toHtml())
def printServiceOrder(self): def printServiceOrder(self):
""" """
@ -200,8 +203,6 @@ class PrintServiceOrderForm(QtGui.QDialog, Ui_PrintServiceOrderDialog):
QtCore.QVariant(self.printMetaDataCheckBox.isChecked())) QtCore.QVariant(self.printMetaDataCheckBox.isChecked()))
settings.setValue(u'print notes', settings.setValue(u'print notes',
QtCore.QVariant(self.printNotesCheckBox.isChecked())) QtCore.QVariant(self.printNotesCheckBox.isChecked()))
settings.setValue(u'html copy',
QtCore.QVariant(self.copyMetaDataCheckBox.isChecked()))
settings.endGroup() settings.endGroup()
# Close the dialog. # Close the dialog.
return QtGui.QDialog.accept(self) return QtGui.QDialog.accept(self)

View File

@ -7,197 +7,221 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>494</width> <width>494</width>
<height>426</height> <height>434</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Dialog</string> <string>Dialog</string>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <widget class="QWidget" name="">
<item> <property name="geometry">
<layout class="QGridLayout" name="dialogLayout"> <rect>
<item row="0" column="3"> <x>4</x>
<layout class="QVBoxLayout" name="settingsLayout"> <y>4</y>
<item> <width>491</width>
<layout class="QGridLayout" name="serviceTitleLayout"> <height>432</height>
<item row="1" column="1"> </rect>
<widget class="QLineEdit" name="serviceTitleLineEdit"> </property>
<property name="sizePolicy"> <layout class="QVBoxLayout" name="verticalLayout">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <item>
<horstretch>0</horstretch> <layout class="QGridLayout" name="dialogLayout">
<verstretch>0</verstretch> <item row="0" column="3">
</sizepolicy> <layout class="QVBoxLayout" name="settingsLayout">
</property> <item>
</widget> <layout class="QGridLayout" name="serviceTitleLayout">
</item> <item row="1" column="1">
<item row="1" column="0"> <widget class="QLineEdit" name="serviceTitleLineEdit">
<widget class="QLabel" name="serviceTitleLabel"> <property name="sizePolicy">
<property name="sizePolicy"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <horstretch>0</horstretch>
<horstretch>0</horstretch> <verstretch>0</verstretch>
<verstretch>0</verstretch> </sizepolicy>
</sizepolicy> </property>
</property> </widget>
<property name="text"> </item>
<string>Service Title:</string> <item row="1" column="0">
</property> <widget class="QLabel" name="serviceTitleLabel">
</widget> <property name="sizePolicy">
</item> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
</layout> <horstretch>0</horstretch>
</item> <verstretch>0</verstretch>
<item> </sizepolicy>
<widget class="QCheckBox" name="printSlideTextCheckBox"> </property>
<property name="text"> <property name="text">
<string>Include slide text if avaialbe</string> <string>Service Title:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> </layout>
<widget class="QCheckBox" name="printNotesCheckBox"> </item>
<property name="text"> <item>
<string>Include service item notes</string> <widget class="QCheckBox" name="printSlideTextCheckBox">
</property> <property name="text">
</widget> <string>Include slide text if avaialbe</string>
</item> </property>
<item> </widget>
<widget class="QCheckBox" name="printMetaDataCheckBox"> </item>
<property name="text"> <item>
<string>Include play lenght of media items</string> <widget class="QCheckBox" name="printNotesCheckBox">
</property> <property name="text">
</widget> <string>Include service item notes</string>
</item> </property>
<item> </widget>
<spacer name="spacer_2"> </item>
<property name="orientation"> <item>
<enum>Qt::Vertical</enum> <widget class="QCheckBox" name="printMetaDataCheckBox">
</property> <property name="text">
<property name="sizeHint" stdset="0"> <string>Include play lenght of media items</string>
<size> </property>
<width>20</width> </widget>
<height>40</height> </item>
</size> <item>
</property> <spacer name="spacer_2">
</spacer> <property name="orientation">
</item> <enum>Qt::Vertical</enum>
<item> </property>
<widget class="QLabel" name="customNotesLabel"> <property name="sizeHint" stdset="0">
<property name="text"> <size>
<string>&lt;b&gt;Custom Notes:&lt;/b&gt;</string> <width>20</width>
</property> <height>40</height>
</widget> </size>
</item> </property>
<item> </spacer>
<widget class="QTextEdit" name="customNoteEdit"/> </item>
</item> <item>
</layout> <widget class="QLabel" name="customNotesLabel">
</item> <property name="text">
<item row="1" column="3"> <string>&lt;b&gt;Custom Notes:&lt;/b&gt;</string>
<layout class="QHBoxLayout" name="buttonLayout"> </property>
<item> </widget>
<spacer name="spacer_3"> </item>
<property name="orientation"> <item>
<enum>Qt::Horizontal</enum> <widget class="QTextEdit" name="customNoteEdit"/>
</property> </item>
<property name="sizeHint" stdset="0"> </layout>
<size> </item>
<width>40</width> <item row="1" column="0">
<height>20</height> <layout class="QHBoxLayout" name="zoomButtonLayout">
</size> <item>
</property> <spacer name="spacer">
</spacer> <property name="orientation">
</item> <enum>Qt::Horizontal</enum>
<item> </property>
<widget class="QPushButton" name="cancelButton"> <property name="sizeHint" stdset="0">
<property name="text"> <size>
<string>Cancel</string> <width>40</width>
</property> <height>20</height>
</widget> </size>
</item> </property>
<item> </spacer>
<widget class="QPushButton" name="printButton"> </item>
<property name="text"> <item>
<string>Print</string> <widget class="QToolButton" name="zoomOutButton">
</property> <property name="text">
</widget> <string>...</string>
</item> </property>
</layout> <property name="icon">
</item> <iconset resource="../images/openlp-2.qrc">
<item row="1" column="0"> <normaloff>:/general/general_zoom_out.png</normaloff>:/general/general_zoom_out.png</iconset>
<layout class="QHBoxLayout" name="zoomButtonLayout"> </property>
<item> </widget>
<spacer name="spacer"> </item>
<property name="orientation"> <item>
<enum>Qt::Horizontal</enum> <widget class="QToolButton" name="zoomInButton">
</property> <property name="icon">
<property name="sizeHint" stdset="0"> <iconset resource="../images/openlp-2.qrc">
<size> <normaloff>:/general/general_zoom_in.png</normaloff>:/general/general_zoom_in.png</iconset>
<width>40</width> </property>
<height>20</height> </widget>
</size> </item>
</property> </layout>
</spacer> </item>
</item> <item row="0" column="0">
<item> <layout class="QVBoxLayout" name="perviewLayout">
<widget class="QToolButton" name="zoomOutButton"> <item>
<property name="text"> <widget class="QLabel" name="previewLabel">
<string>...</string> <property name="sizePolicy">
</property> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<property name="icon"> <horstretch>0</horstretch>
<iconset resource="../images/openlp-2.qrc"> <verstretch>0</verstretch>
<normaloff>:/general/general_zoom_out.png</normaloff>:/general/general_zoom_out.png</iconset> </sizepolicy>
</property> </property>
</widget> <property name="text">
</item> <string>Preview:</string>
<item> </property>
<widget class="QToolButton" name="zoomInButton"> </widget>
<property name="icon"> </item>
<iconset resource="../images/openlp-2.qrc"> <item>
<normaloff>:/general/general_zoom_in.png</normaloff>:/general/general_zoom_in.png</iconset> <widget class="QWidget" name="previewWidget" native="true">
</property> <property name="enabled">
</widget> <bool>true</bool>
</item> </property>
</layout> <property name="sizePolicy">
</item> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<item row="0" column="0"> <horstretch>0</horstretch>
<layout class="QVBoxLayout" name="perviewLayout"> <verstretch>0</verstretch>
<item> </sizepolicy>
<widget class="QLabel" name="previewLabel"> </property>
<property name="sizePolicy"> <property name="minimumSize">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <size>
<horstretch>0</horstretch> <width>0</width>
<verstretch>0</verstretch> <height>0</height>
</sizepolicy> </size>
</property> </property>
<property name="text"> <zorder>spacer_3</zorder>
<string>Preview:</string> </widget>
</property> </item>
</widget> </layout>
</item> </item>
<item> </layout>
<widget class="QWidget" name="previewWidget" native="true"> </item>
<property name="enabled"> <item>
<bool>true</bool> <layout class="QHBoxLayout" name="buttonLayout">
</property> <item>
<property name="sizePolicy"> <spacer name="spacer_3">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <property name="orientation">
<horstretch>0</horstretch> <enum>Qt::Horizontal</enum>
<verstretch>0</verstretch> </property>
</sizepolicy> <property name="sizeHint" stdset="0">
</property> <size>
<property name="minimumSize"> <width>40</width>
<size> <height>20</height>
<width>0</width> </size>
<height>0</height> </property>
</size> </spacer>
</property> </item>
</widget> <item>
</item> <widget class="QPushButton" name="cancelButton_3">
</layout> <property name="text">
</item> <string>Cancel</string>
</layout> </property>
</item> </widget>
</layout> </item>
<zorder></zorder> <item>
<widget class="QPushButton" name="cancelButton_2">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="cancelButton">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="printButton">
<property name="text">
<string>Print</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget> </widget>
<resources> <resources>
<include location="../images/openlp-2.qrc"/> <include location="../images/openlp-2.qrc"/>