2011-02-06 13:57:57 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# OpenLP - Open Source Lyrics Projection #
|
|
|
|
# --------------------------------------------------------------------------- #
|
|
|
|
# Copyright (c) 2008-2011 Raoul Snyman #
|
|
|
|
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
2011-03-24 19:04:02 +00:00
|
|
|
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
|
|
|
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
|
|
|
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund #
|
2011-02-06 13:57:57 +00:00
|
|
|
# --------------------------------------------------------------------------- #
|
|
|
|
# This program is free software; you can redistribute it and/or modify it #
|
|
|
|
# under the terms of the GNU General Public License as published by the Free #
|
|
|
|
# Software Foundation; version 2 of the License. #
|
|
|
|
# #
|
|
|
|
# This program is distributed in the hope that it will be useful, but WITHOUT #
|
|
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
|
|
|
|
# more details. #
|
|
|
|
# #
|
|
|
|
# You should have received a copy of the GNU General Public License along #
|
|
|
|
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
|
|
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
from PyQt4 import QtCore, QtGui
|
|
|
|
|
2011-02-07 17:19:54 +00:00
|
|
|
from openlp.core.lib import build_icon, translate, SpellTextEdit
|
2011-02-15 18:51:37 +00:00
|
|
|
from openlp.core.lib.ui import UiStrings
|
2011-02-06 13:57:57 +00:00
|
|
|
|
2011-02-20 14:25:14 +00:00
|
|
|
class ZoomSize(object):
|
2011-02-19 17:33:24 +00:00
|
|
|
"""
|
|
|
|
Type enumeration for Combo Box sizes
|
|
|
|
"""
|
|
|
|
Page = 0
|
|
|
|
Width = 1
|
|
|
|
OneHundred = 2
|
|
|
|
SeventyFive = 3
|
|
|
|
Fifty = 4
|
|
|
|
TwentyFive = 5
|
|
|
|
|
|
|
|
Sizes = [
|
|
|
|
translate('OpenLP.PrintServiceDialog', 'Fit Page'),
|
|
|
|
translate('OpenLP.PrintServiceDialog', 'Fit Width'),
|
|
|
|
u'100%', u'75%', u'50%', u'25%']
|
|
|
|
|
2011-02-20 14:25:14 +00:00
|
|
|
|
2011-02-19 17:33:24 +00:00
|
|
|
class Ui_PrintServiceDialog(object):
|
2011-02-19 08:36:24 +00:00
|
|
|
def setupUi(self, printServiceDialog):
|
|
|
|
printServiceDialog.setObjectName(u'printServiceDialog')
|
|
|
|
printServiceDialog.resize(664, 594)
|
|
|
|
self.mainLayout = QtGui.QVBoxLayout(printServiceDialog)
|
|
|
|
self.mainLayout.setSpacing(0)
|
|
|
|
self.mainLayout.setMargin(0)
|
|
|
|
self.mainLayout.setObjectName(u'mainLayout')
|
|
|
|
self.toolbar = QtGui.QToolBar(printServiceDialog)
|
|
|
|
self.toolbar.setIconSize(QtCore.QSize(22, 22))
|
|
|
|
self.toolbar.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
|
2011-02-19 17:33:24 +00:00
|
|
|
self.printButton = self.toolbar.addAction(
|
2011-02-20 07:37:44 +00:00
|
|
|
build_icon(u':/general/general_print.png'), 'Print')
|
2011-02-19 08:36:24 +00:00
|
|
|
self.optionsButton = QtGui.QToolButton(self.toolbar)
|
2011-02-19 20:23:23 +00:00
|
|
|
self.optionsButton.setText(translate('OpenLP.PrintServiceForm',
|
|
|
|
'Options'))
|
2011-02-19 17:33:24 +00:00
|
|
|
self.optionsButton.setToolButtonStyle(
|
|
|
|
QtCore.Qt.ToolButtonTextBesideIcon)
|
2011-03-24 16:43:08 +00:00
|
|
|
self.optionsButton.setIcon(build_icon(u':/system/system_configure.png'))
|
2011-02-19 08:36:24 +00:00
|
|
|
self.optionsButton.setCheckable(True)
|
|
|
|
self.toolbar.addWidget(self.optionsButton)
|
2011-02-19 17:33:24 +00:00
|
|
|
self.closeButton = self.toolbar.addAction(
|
2011-02-20 07:37:44 +00:00
|
|
|
build_icon(u':/system/system_close.png'),
|
2011-02-19 20:23:23 +00:00
|
|
|
translate('OpenLP.PrintServiceForm', 'Close'))
|
2011-02-19 08:36:24 +00:00
|
|
|
self.toolbar.addSeparator()
|
2011-02-19 17:33:24 +00:00
|
|
|
self.plainCopy = self.toolbar.addAction(
|
2011-02-20 07:37:44 +00:00
|
|
|
build_icon(u':/system/system_edit_copy.png'),
|
2011-02-19 20:23:23 +00:00
|
|
|
translate('OpenLP.PrintServiceForm', 'Copy'))
|
2011-02-19 17:33:24 +00:00
|
|
|
self.htmlCopy = self.toolbar.addAction(
|
2011-02-20 07:37:44 +00:00
|
|
|
build_icon(u':/system/system_edit_copy.png'),
|
2011-02-19 20:23:23 +00:00
|
|
|
translate('OpenLP.PrintServiceForm', 'Copy as HTML'))
|
2011-02-19 08:36:24 +00:00
|
|
|
self.toolbar.addSeparator()
|
|
|
|
self.zoomInButton = QtGui.QToolButton(self.toolbar)
|
2011-03-24 16:43:08 +00:00
|
|
|
self.zoomInButton.setIcon(build_icon(u':/general/general_zoom_in.png'))
|
2011-02-19 20:23:23 +00:00
|
|
|
self.zoomInButton.setToolTip(translate('OpenLP.PrintServiceForm',
|
|
|
|
'Zoom In'))
|
2011-02-06 13:57:57 +00:00
|
|
|
self.zoomInButton.setObjectName(u'zoomInButton')
|
2011-02-19 08:36:24 +00:00
|
|
|
self.zoomInButton.setIconSize(QtCore.QSize(22, 22))
|
|
|
|
self.toolbar.addWidget(self.zoomInButton)
|
|
|
|
self.zoomOutButton = QtGui.QToolButton(self.toolbar)
|
2011-03-24 16:43:08 +00:00
|
|
|
self.zoomOutButton.setIcon(
|
|
|
|
build_icon(u':/general/general_zoom_out.png'))
|
2011-02-19 20:23:23 +00:00
|
|
|
self.zoomOutButton.setToolTip(translate('OpenLP.PrintServiceForm',
|
|
|
|
'Zoom Out'))
|
2011-02-19 08:36:24 +00:00
|
|
|
self.zoomOutButton.setObjectName(u'zoomOutButton')
|
|
|
|
self.zoomOutButton.setIconSize(QtCore.QSize(22, 22))
|
|
|
|
self.toolbar.addWidget(self.zoomOutButton)
|
|
|
|
self.zoomOriginalButton = QtGui.QToolButton(self.toolbar)
|
2011-03-24 16:43:08 +00:00
|
|
|
self.zoomOriginalButton.setIcon(
|
|
|
|
build_icon(u':/general/general_zoom_original.png'))
|
2011-02-19 20:23:23 +00:00
|
|
|
self.zoomOriginalButton.setToolTip(translate('OpenLP.PrintServiceForm',
|
|
|
|
'Zoom Original'))
|
2011-02-19 08:36:24 +00:00
|
|
|
self.zoomOriginalButton.setObjectName(u'zoomOriginalButton')
|
|
|
|
self.zoomOriginalButton.setIconSize(QtCore.QSize(22, 22))
|
|
|
|
self.toolbar.addWidget(self.zoomOriginalButton)
|
|
|
|
self.zoomComboBox = QtGui.QComboBox(printServiceDialog)
|
2011-02-19 20:23:23 +00:00
|
|
|
self.zoomComboBox.setObjectName(u'zoomComboBox')
|
2011-02-19 08:36:24 +00:00
|
|
|
self.toolbar.addWidget(self.zoomComboBox)
|
|
|
|
self.mainLayout.addWidget(self.toolbar)
|
2011-02-19 17:33:24 +00:00
|
|
|
self.previewWidget = QtGui.QPrintPreviewWidget(printServiceDialog)
|
|
|
|
self.mainLayout.addWidget(self.previewWidget)
|
2011-02-19 08:36:24 +00:00
|
|
|
self.optionsWidget = QtGui.QWidget(printServiceDialog)
|
|
|
|
self.optionsWidget.hide()
|
|
|
|
self.optionsWidget.resize(400, 300)
|
|
|
|
self.optionsWidget.setAutoFillBackground(True)
|
|
|
|
self.optionsLayout = QtGui.QVBoxLayout(self.optionsWidget)
|
|
|
|
self.optionsLayout.setContentsMargins(8, 8, 8, 8)
|
|
|
|
self.titleLabel = QtGui.QLabel(self.optionsWidget)
|
2011-02-19 20:23:23 +00:00
|
|
|
self.titleLabel.setObjectName(u'titleLabel')
|
2011-02-19 08:36:24 +00:00
|
|
|
self.titleLabel.setText(u'Title:')
|
|
|
|
self.optionsLayout.addWidget(self.titleLabel)
|
|
|
|
self.titleLineEdit = QtGui.QLineEdit(self.optionsWidget)
|
|
|
|
self.titleLineEdit.setObjectName(u'titleLineEdit')
|
|
|
|
self.optionsLayout.addWidget(self.titleLineEdit)
|
|
|
|
self.footerLabel = QtGui.QLabel(self.optionsWidget)
|
|
|
|
self.footerLabel.setObjectName(u'footerLabel')
|
|
|
|
self.footerLabel.setText(u'Custom Footer Text:')
|
|
|
|
self.optionsLayout.addWidget(self.footerLabel)
|
2011-02-19 20:23:23 +00:00
|
|
|
self.footerTextEdit = SpellTextEdit(self.optionsWidget)
|
2011-02-19 08:36:24 +00:00
|
|
|
self.footerTextEdit.setObjectName(u'footerTextEdit')
|
|
|
|
self.optionsLayout.addWidget(self.footerTextEdit)
|
2011-02-19 20:23:23 +00:00
|
|
|
self.optionsGroupBox = QtGui.QGroupBox(
|
|
|
|
translate('OpenLP.PrintServiceForm','Other Options'))
|
2011-02-19 08:36:24 +00:00
|
|
|
self.groupLayout = QtGui.QVBoxLayout()
|
|
|
|
self.slideTextCheckBox = QtGui.QCheckBox()
|
|
|
|
self.groupLayout.addWidget(self.slideTextCheckBox)
|
2011-04-06 19:14:02 +00:00
|
|
|
self.pageBreakAfterText = QtGui.QCheckBox()
|
|
|
|
self.groupLayout.addWidget(self.pageBreakAfterText)
|
2011-02-19 17:33:24 +00:00
|
|
|
self.notesCheckBox = QtGui.QCheckBox()
|
2011-02-19 08:36:24 +00:00
|
|
|
self.groupLayout.addWidget(self.notesCheckBox)
|
|
|
|
self.metaDataCheckBox = QtGui.QCheckBox()
|
|
|
|
self.groupLayout.addWidget(self.metaDataCheckBox)
|
|
|
|
self.groupLayout.addStretch(1)
|
|
|
|
self.optionsGroupBox.setLayout(self.groupLayout)
|
|
|
|
self.optionsLayout.addWidget(self.optionsGroupBox)
|
|
|
|
|
|
|
|
self.retranslateUi(printServiceDialog)
|
|
|
|
QtCore.QMetaObject.connectSlotsByName(printServiceDialog)
|
|
|
|
QtCore.QObject.connect(self.optionsButton,
|
|
|
|
QtCore.SIGNAL(u'toggled(bool)'), self.toggleOptions)
|
|
|
|
|
|
|
|
def retranslateUi(self, printServiceDialog):
|
2011-04-15 21:43:59 +00:00
|
|
|
printServiceDialog.setWindowTitle(UiStrings().PrintServiceOrder)
|
2011-02-19 17:33:24 +00:00
|
|
|
self.slideTextCheckBox.setText(translate('OpenLP.PrintServiceForm',
|
|
|
|
'Include slide text if available'))
|
2011-04-06 19:14:02 +00:00
|
|
|
self.pageBreakAfterText.setText(translate('OpenLP.PrintServiceForm',
|
2011-05-06 07:38:51 +00:00
|
|
|
'Add page break before each text item'))
|
2011-02-19 17:33:24 +00:00
|
|
|
self.notesCheckBox.setText(translate('OpenLP.PrintServiceForm',
|
|
|
|
'Include service item notes'))
|
|
|
|
self.metaDataCheckBox.setText(translate('OpenLP.PrintServiceForm',
|
2011-02-07 18:02:13 +00:00
|
|
|
'Include play length of media items'))
|
2011-02-19 20:23:23 +00:00
|
|
|
self.titleLineEdit.setText(translate('OpenLP.PrintServiceForm',
|
|
|
|
'Service Order Sheet'))
|
2011-02-19 17:33:24 +00:00
|
|
|
self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Page])
|
|
|
|
self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Width])
|
|
|
|
self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.OneHundred])
|
|
|
|
self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.SeventyFive])
|
|
|
|
self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.Fifty])
|
2011-05-06 07:38:51 +00:00
|
|
|
self.zoomComboBox.addItem(ZoomSize.Sizes[ZoomSize.TwentyFive])
|
2011-05-06 07:41:29 +00:00
|
|
|
|