From 3bfe9ec77c8e430018d2dcafa34b20ff1eb1e9aa Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Wed, 6 Apr 2011 21:14:02 +0200 Subject: [PATCH 1/6] --- openlp/core/ui/printservicedialog.py | 4 + openlp/core/ui/printserviceform.py | 107 ++++++++++++++++++--------- 2 files changed, 77 insertions(+), 34 deletions(-) diff --git a/openlp/core/ui/printservicedialog.py b/openlp/core/ui/printservicedialog.py index 97f4b4060..b669c83ec 100644 --- a/openlp/core/ui/printservicedialog.py +++ b/openlp/core/ui/printservicedialog.py @@ -132,6 +132,8 @@ class Ui_PrintServiceDialog(object): self.groupLayout = QtGui.QVBoxLayout() self.slideTextCheckBox = QtGui.QCheckBox() self.groupLayout.addWidget(self.slideTextCheckBox) + self.pageBreakAfterText = QtGui.QCheckBox() + self.groupLayout.addWidget(self.pageBreakAfterText) self.notesCheckBox = QtGui.QCheckBox() self.groupLayout.addWidget(self.notesCheckBox) self.metaDataCheckBox = QtGui.QCheckBox() @@ -149,6 +151,8 @@ class Ui_PrintServiceDialog(object): printServiceDialog.setWindowTitle(UiStrings.PrintServiceOrder) self.slideTextCheckBox.setText(translate('OpenLP.PrintServiceForm', 'Include slide text if available')) + self.pageBreakAfterText.setText(translate('OpenLP.PrintServiceForm', + 'break')) self.notesCheckBox.setText(translate('OpenLP.PrintServiceForm', 'Include service item notes')) self.metaDataCheckBox.setText(translate('OpenLP.PrintServiceForm', diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index 4e0f018a4..03febc067 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -26,6 +26,7 @@ import datetime from PyQt4 import QtCore, QtGui +from lxml import html from openlp.core.lib import translate from openlp.core.lib.ui import UiStrings @@ -50,6 +51,10 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): settings.beginGroup(u'advanced') self.slideTextCheckBox.setChecked(settings.value( u'print slide text', QtCore.QVariant(False)).toBool()) + self.pageBreakAfterText.setChecked(settings.value( + u'enable page break', QtCore.QVariant(False)).toBool()) + if not self.slideTextCheckBox.isChecked(): + self.pageBreakAfterText.setDisabled(True) self.metaDataCheckBox.setChecked(settings.value( u'print file meta data', QtCore.QVariant(False)).toBool()) self.notesCheckBox.setChecked(settings.value( @@ -76,6 +81,9 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): QtCore.SIGNAL(u'triggered()'), self.copyText) QtCore.QObject.connect(self.htmlCopy, QtCore.SIGNAL(u'triggered()'), self.copyHtmlText) + QtCore.QObject.connect(self.slideTextCheckBox, + QtCore.SIGNAL(u'stateChanged(int)'), + self.onSlideTextCheckBoxChanged) self.updatePreviewText() def toggleOptions(self, checked): @@ -93,57 +101,80 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): """ Creates the html text and updates the html of *self.document*. """ - text = u'' - if self.titleLineEdit.text(): - text += u'

%s

' % unicode(self.titleLineEdit.text()) - for item in self.serviceManager.serviceItems: + html_data = html.fromstring( + u'%s' % unicode(self.titleLineEdit.text())) + html_data.append(html.Element(u'body')) + html_data.body.append(html.fromstring( + u'

%s

' % unicode(self.titleLineEdit.text()))) + for index, item in enumerate(self.serviceManager.serviceItems): item = item[u'service_item'] + div = html.Element(u'div') # Add the title of the service item. - text += u'

%s

' % (item.icon, - item.get_display_title()) - # Add slide text of the service item. + item_title = html.Element(u'h3') + icon = html.Element(u'img') + icon.set(u'src', item.icon) + item_title.append(icon) + item_title.append( + html.fromstring(u' %s' % item.get_display_title())) + div.append(item_title) if self.slideTextCheckBox.isChecked(): + # Add the text of the service item. if item.is_text(): - # Add the text of the service item. - verse = None + verse_def = None for slide in item.get_frames(): - if not verse: - text += u'

' + slide[u'html'] - verse = slide[u'verseTag'] - elif verse != slide[u'verseTag']: - text += u'<\p>

' + slide[u'html'] - verse = slide[u'verseTag'] + if not verse_def or verse_def != slide[u'verseTag']: + p = html.Element(u'p') + div.append(p) else: - text += u'
' + slide[u'html'] - text += u'

' + p.append(html.Element(u'br')) + p.append(html.fromstring( + u'%s' % slide[u'html'])) + verse_def = slide[u'verseTag'] + # Break the page before the div element. + if index != 0 and self.pageBreakAfterText.isChecked(): + div.set(u'style', u'page-break-before:always') + # Add the image names of the service item. elif item.is_image(): - # Add the image names of the service item. - text += u'
    ' + ol = html.Element(u'ol') for slide in range(len(item.get_frames())): - text += u'
  1. %s

  2. ' % \ - item.get_frame_title(slide) - text += u'
' + li = html.Element(u'li') + li.text = item.get_frame_title(slide) + ol.append(li) + div.append(ol) + # add footer if item.foot_text: - # add footer - text += u'

%s

' % item.foot_text + div.append(html.fromstring(item.foot_text)) # Add service items' notes. if self.notesCheckBox.isChecked(): if item.notes: - text += u'

%s

%s' % (translate( - 'OpenLP.ServiceManager', 'Notes:'), - item.notes.replace(u'\n', u'
')) + p = html.Element(u'p') + strong = html.Element(u'strong') + strong.text = unicode( + translate('OpenLP.ServiceManager', 'Notes:')) + p.append(strong) + p.append(html.fromstring(u'%s' % + item.notes.replace(u'\n', u'
'))) + div.append(p) # Add play length of media files. if item.is_media() and self.metaDataCheckBox.isChecked(): tme = item.media_length if item.end_time > 0: tme = item.end_time - item.start_time - text += u'

%s %s

' % (translate( - 'OpenLP.ServiceManager', u'Playing time:'), - unicode(datetime.timedelta(seconds=tme))) - if self.footerTextEdit.toPlainText(): - text += u'

%s

%s' % (translate('OpenLP.ServiceManager', - u'Custom Service Notes:'), self.footerTextEdit.toPlainText()) - self.document.setHtml(text) + p = html.fromstring(u'

%s

' % + translate('OpenLP.ServiceManager', 'Playing time:')) + p.append(html.fromstring(u'%s' % + unicode(datetime.timedelta(seconds=tme)))) + div.append(p) + html_data.body.append(div) + # Add the custom service notes: + if self.footerTextEdit.toPlainText(): + html_data.append(html.fromstring(u'

%

' % + translate('OpenLP.ServiceManager', u'Custom Service Notes:'))) + html_data.append(html.fromstring( + u'%s' % self.footerTextEdit.toPlainText())) + for div in html_data.body: + print len(div), html.tostring(div), u'\n' + self.document.setHtml(html.tostring(html_data)) self.previewWidget.updatePreview() def paintRequested(self, printer): @@ -232,6 +263,12 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): else: self.copyTextButton.setText(UiStrings.CopyToText) + def onSlideTextCheckBoxChanged(self, state): + """ + The ``slideTextCheckBox`` checkbox was either checked or unchecked. + """ + self.pageBreakAfterText.setDisabled(state == QtCore.Qt.Unchecked) + def saveOptions(self): """ Save the settings and close the dialog. @@ -241,6 +278,8 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): settings.beginGroup(u'advanced') settings.setValue(u'print slide text', QtCore.QVariant(self.slideTextCheckBox.isChecked())) + settings.setValue(u'enable page break', + QtCore.QVariant(self.pageBreakAfterText.isChecked())) settings.setValue(u'print file meta data', QtCore.QVariant(self.metaDataCheckBox.isChecked())) settings.setValue(u'print notes', From d207cf2243f8a2f9a2c354b6b4cdfa775d3532b5 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Wed, 13 Apr 2011 11:19:16 +0200 Subject: [PATCH 2/6] clean ups --- openlp.pyw | 2 +- openlp/core/lib/htmlbuilder.py | 5 +- openlp/core/ui/printserviceform.py | 109 ++++++++++++++--------------- 3 files changed, 57 insertions(+), 59 deletions(-) diff --git a/openlp.pyw b/openlp.pyw index 57dbcb698..5c3b8ca77 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -116,7 +116,7 @@ class OpenLP(QtGui.QApplication): self.processEvents() # start the main app window self.mainWindow = MainWindow(screens, self.clipboard(), - self.arguments()) + self.arguments()) self.mainWindow.show() if show_splash: # now kill the splashscreen diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index c4361a421..a80fedd06 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -452,7 +452,7 @@ def build_lyrics_css(item, webkitvers): .lyricsshadow { %s } - """ + """ theme = item.themedata lyricstable = u'' lyrics = u'' @@ -460,8 +460,7 @@ def build_lyrics_css(item, webkitvers): outline = u'' shadow = u'' if theme and item.main: - lyricstable = u'left: %spx; top: %spx;' % \ - (item.main.x(), item.main.y()) + lyricstable = u'left: %spx; top: %spx;' % (item.main.x(), item.main.y()) lyrics = build_lyrics_format_css(theme, item.main.width(), item.main.height()) # For performance reasons we want to show as few DIV's as possible, diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index 407b8e2b4..25a631ef3 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -29,7 +29,7 @@ import os from PyQt4 import QtCore, QtGui from lxml import html -from openlp.core.lib import translate +from openlp.core.lib import translate, get_text_file_string from openlp.core.lib.ui import UiStrings from openlp.core.ui.printservicedialog import Ui_PrintServiceDialog, ZoomSize from openlp.core.utils import AppLocation @@ -155,8 +155,6 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): """ html_data = html.fromstring( u'%s' % unicode(self.titleLineEdit.text())) - style = html.Element(u'style') - style.set(u'type', u'text/css') css_path = os.path.join( AppLocation.get_data_path(), u'servicePrint.css') if not os.path.isfile(css_path): @@ -164,96 +162,97 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): css_file = open(css_path, u'w') css_file.write(DEFAULT_CSS) css_file.close() - css_file = open(css_path, u'r') - style.text = u' '.join(css_file.readlines()) - css_file.close() - html_data.head.append(style) - html_data.append(html.Element(u'body')) - service_title = html.Element(u'span') + custom_css = get_text_file_string(css_path) + style = self._addChildToParent(u'style', custom_css, html_data.head) + style.set(u'type', u'text/css') + self._addChildToParent(u'body', parent=html_data) + service_title = self._addChildToParent( + u'span', unicode(self.titleLineEdit.text()), html_data.body) service_title.set(u'class', u'serviceTitle') - service_title.text = unicode(self.titleLineEdit.text()) - html_data.body.append(service_title) for index, item in enumerate(self.serviceManager.serviceItems): item = item[u'service_item'] - div = html.Element(u'div') + div = self._addChildToParent(u'div', parent=html_data.body) # Add the title of the service item. - item_title = html.Element(u'h2') + item_title = self._addChildToParent(u'h2', parent=div) item_title.set(u'class', u'itemTitle') - icon = html.Element(u'img') + icon = self._addChildToParent(u'img', parent=item_title) icon.set(u'src', item.icon) - item_title.append(icon) - item_title.append(html.fromstring( - u' %s' % item.get_display_title())) - div.append(item_title) + self._fromstring( + u' %s' % item.get_display_title(), item_title) if self.slideTextCheckBox.isChecked(): # Add the text of the service item. if item.is_text(): verse_def = None for slide in item.get_frames(): if not verse_def or verse_def != slide[u'verseTag']: - p = html.Element(u'p') + p = self._addChildToParent(u'p', parent=div) p.set(u'class', u'itemText') - div.append(p) else: - p.append(html.Element(u'br')) - p.append(html.fromstring( - u'%s' % slide[u'html'])) + self._addChildToParent(u'br', parent=p) + self._fromstring(u'%s' % slide[u'html'], p) verse_def = slide[u'verseTag'] # Break the page before the div element. if index != 0 and self.pageBreakAfterText.isChecked(): div.set(u'style', u'page-break-before:always') # Add the image names of the service item. elif item.is_image(): - ol = html.Element(u'ol') + ol = self._addChildToParent(u'ol', parent=div) for slide in range(len(item.get_frames())): - li = html.Element(u'li') - li.text = item.get_frame_title(slide) - ol.append(li) - div.append(ol) + self._addChildToParent(u'li', item.get_frame_title(slide), ol) # add footer if item.foot_text: - p = html.fromstring(item.foot_text) + p = self._fromstring(item.foot_text, div) p.set(u'class', u'itemFooter') - div.append(p) # Add service items' notes. if self.notesCheckBox.isChecked(): if item.notes: - p = html.Element(u'p') - title = html.Element(u'span') + p = self._addChildToParent(u'p', parent=div) + title = self._addChildToParent(u'span', unicode( + translate('OpenLP.ServiceManager', 'Notes:')), p) title.set(u'class', u'itemNotesTitle') - title.text = unicode( - translate('OpenLP.ServiceManager', 'Notes:')) - p.append(title) - text = html.fromstring(u' %s' % - item.notes.replace(u'\n', u'
')) + text = self._fromstring(u' %s' % + item.notes.replace(u'\n', u'
'), p) text.set(u'class', u'itemNotesText') - p.append(text) - div.append(p) # Add play length of media files. if item.is_media() and self.metaDataCheckBox.isChecked(): tme = item.media_length if item.end_time > 0: tme = item.end_time - item.start_time - p = html.fromstring(u'

%s

' % - translate('OpenLP.ServiceManager', 'Playing time:')) - p.append(html.fromstring(u'%s' % - unicode(datetime.timedelta(seconds=tme)))) - div.append(p) - html_data.body.append(div) + title = self._fromstring(u'

%s

' % + translate('OpenLP.ServiceManager', 'Playing time:'), div) + self._fromstring(u'%s' % + unicode(datetime.timedelta(seconds=tme)), title) # Add the custom service notes: - if self.footerTextEdit.toPlainText(): - title = html.Element(u'span') - title.set(u'class', u'customNotesTitle') - title.text = unicode( - translate('OpenLP.ServiceManager', u'Custom Service Notes:')) - div.append(title) - text = html.Element(u'span') - text.set(u'class', u'customNotesText') - text.text = u' %s' % self.footerTextEdit.toPlainText() - div.append(text) + if self.footerTextEdit.toPlainText(): + footer_title = self._addChildToParent(u'span', translate( + 'OpenLP.ServiceManager', u'Custom Service Notes:'), div) + footer_title.set(u'class', u'customNotesTitle') + footer_text = self._addChildToParent(u'span', + u' %s' % self.footerTextEdit.toPlainText(), div) + footer_text.set(u'class', u'customNotesText') self.document.setHtml(html.tostring(html_data)) self.previewWidget.updatePreview() + def _addChildToParent(self, tag, text=None, parent=None): + """ + Creates a html element. If ``text`` is given, the element's text will + set and if a ``parent`` is given, the element is appended. + """ + element = html.Element(tag) + if text is not None: + element.text = text + if parent is not None: + parent.append(element) + return element + + def _fromstring(self, string, parent): + """ + This is used to create a child html element from a string. + """ + element = html.fromstring(string) + parent.append(element) + return element + def paintRequested(self, printer): """ Paint the preview of the *self.document*. From 7d2719288a601256315ca0b607bdf2e8739ee684 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Wed, 13 Apr 2011 11:42:18 +0200 Subject: [PATCH 3/6] extended helper methods --- openlp/core/ui/printserviceform.py | 68 ++++++++++++++++++------------ 1 file changed, 42 insertions(+), 26 deletions(-) diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index 25a631ef3..5de12d78e 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -163,20 +163,19 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): css_file.write(DEFAULT_CSS) css_file.close() custom_css = get_text_file_string(css_path) - style = self._addChildToParent(u'style', custom_css, html_data.head) - style.set(u'type', u'text/css') + self._addChildToParent( + u'style', custom_css, html_data.head, u'type', u'text/css') self._addChildToParent(u'body', parent=html_data) - service_title = self._addChildToParent( - u'span', unicode(self.titleLineEdit.text()), html_data.body) - service_title.set(u'class', u'serviceTitle') + self._addChildToParent(u'span', unicode(self.titleLineEdit.text()), + html_data.body, u'class', u'serviceTitle') for index, item in enumerate(self.serviceManager.serviceItems): item = item[u'service_item'] div = self._addChildToParent(u'div', parent=html_data.body) # Add the title of the service item. - item_title = self._addChildToParent(u'h2', parent=div) - item_title.set(u'class', u'itemTitle') - icon = self._addChildToParent(u'img', parent=item_title) - icon.set(u'src', item.icon) + item_title = self._addChildToParent( + u'h2', parent=div, attribute=u'class', value=u'itemTitle') + self._addChildToParent( + u'img', parent=item_title, attribute=u'src', value=item.icon) self._fromstring( u' %s' % item.get_display_title(), item_title) if self.slideTextCheckBox.isChecked(): @@ -185,8 +184,8 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): verse_def = None for slide in item.get_frames(): if not verse_def or verse_def != slide[u'verseTag']: - p = self._addChildToParent(u'p', parent=div) - p.set(u'class', u'itemText') + p = self._addChildToParent(u'p', parent=div, + attribute=u'class', value=u'itemText') else: self._addChildToParent(u'br', parent=p) self._fromstring(u'%s' % slide[u'html'], p) @@ -201,18 +200,17 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): self._addChildToParent(u'li', item.get_frame_title(slide), ol) # add footer if item.foot_text: - p = self._fromstring(item.foot_text, div) - p.set(u'class', u'itemFooter') + self._fromstring( + item.foot_text, div, u'class', u'itemFooter') # Add service items' notes. if self.notesCheckBox.isChecked(): if item.notes: p = self._addChildToParent(u'p', parent=div) - title = self._addChildToParent(u'span', unicode( - translate('OpenLP.ServiceManager', 'Notes:')), p) - title.set(u'class', u'itemNotesTitle') - text = self._fromstring(u' %s' % - item.notes.replace(u'\n', u'
'), p) - text.set(u'class', u'itemNotesText') + self._addChildToParent(u'span', unicode( + translate('OpenLP.ServiceManager', 'Notes:')), p, + u'class', u'itemNotesTitle') + self._fromstring(u' %s' % item.notes.replace( + u'\n', u'
'), p, u'class', u'itemNotesText') # Add play length of media files. if item.is_media() and self.metaDataCheckBox.isChecked(): tme = item.media_length @@ -224,25 +222,43 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): unicode(datetime.timedelta(seconds=tme)), title) # Add the custom service notes: if self.footerTextEdit.toPlainText(): - footer_title = self._addChildToParent(u'span', translate( - 'OpenLP.ServiceManager', u'Custom Service Notes:'), div) - footer_title.set(u'class', u'customNotesTitle') - footer_text = self._addChildToParent(u'span', - u' %s' % self.footerTextEdit.toPlainText(), div) - footer_text.set(u'class', u'customNotesText') + self._addChildToParent(u'span', translate('OpenLP.ServiceManager', + u'Custom Service Notes:'), div, u'class', u'customNotesTitle') + self._addChildToParent( + u'span', u' %s' % self.footerTextEdit.toPlainText(), div, + u'class', u'customNotesText') self.document.setHtml(html.tostring(html_data)) self.previewWidget.updatePreview() - def _addChildToParent(self, tag, text=None, parent=None): + def _addChildToParent(self, tag, text=None, parent=None, attribute=None, + value=None): """ Creates a html element. If ``text`` is given, the element's text will set and if a ``parent`` is given, the element is appended. + + ``tag`` + The html tag, e. g. ``u'span'``. Defaults to ``None``. + + ``text`` + The text for the tag. Defaults to ``None``. + + ``parent`` + The parent element. Defaults to ``None``. + + ``attribute`` + An optional attribute, for instance ``u'class``. + + ``value`` + The value for the given ``attribute``. It does not have and meaning, + if the attribute is left to its default. """ element = html.Element(tag) if text is not None: element.text = text if parent is not None: parent.append(element) + if attribute is not None: + element.set(attribute, value if value is not None else u'') return element def _fromstring(self, string, parent): From 7d5ee8adf636cb3fc06a4fbd15facd63ec64a9cf Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Wed, 13 Apr 2011 11:53:57 +0200 Subject: [PATCH 4/6] spelling --- openlp/core/ui/printserviceform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index 5de12d78e..c41084b2f 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -249,7 +249,7 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): An optional attribute, for instance ``u'class``. ``value`` - The value for the given ``attribute``. It does not have and meaning, + The value for the given ``attribute``. It does not have a meaning, if the attribute is left to its default. """ element = html.Element(tag) From 8451d52f27c0042e67dba88356a5d076f4601b9a Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Wed, 13 Apr 2011 12:22:26 +0200 Subject: [PATCH 5/6] fixed _fromstring; changed setting name in config --- openlp/core/ui/printserviceform.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index c41084b2f..5348396d7 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -104,7 +104,7 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): self.slideTextCheckBox.setChecked(settings.value( u'print slide text', QtCore.QVariant(False)).toBool()) self.pageBreakAfterText.setChecked(settings.value( - u'enable page break', QtCore.QVariant(False)).toBool()) + u'add page break', QtCore.QVariant(False)).toBool()) if not self.slideTextCheckBox.isChecked(): self.pageBreakAfterText.setDisabled(True) self.metaDataCheckBox.setChecked(settings.value( @@ -261,11 +261,13 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): element.set(attribute, value if value is not None else u'') return element - def _fromstring(self, string, parent): + def _fromstring(self, string, parent, attribute=None, value=None): """ This is used to create a child html element from a string. """ element = html.fromstring(string) + if attribute is not None: + element.set(attribute, value if value is not None else u'') parent.append(element) return element @@ -371,7 +373,7 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): settings.beginGroup(u'advanced') settings.setValue(u'print slide text', QtCore.QVariant(self.slideTextCheckBox.isChecked())) - settings.setValue(u'enable page break', + settings.setValue(u'add page break', QtCore.QVariant(self.pageBreakAfterText.isChecked())) settings.setValue(u'print file meta data', QtCore.QVariant(self.metaDataCheckBox.isChecked())) From 01c286e50ef4ad6d30ea9b6f9f54b2da652e688f Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Wed, 13 Apr 2011 20:01:28 +0200 Subject: [PATCH 6/6] fixed crash --- openlp/core/ui/printserviceform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index 5348396d7..01b937d61 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -254,7 +254,7 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): """ element = html.Element(tag) if text is not None: - element.text = text + element.text = unicode(text) if parent is not None: parent.append(element) if attribute is not None: