diff --git a/openlp/core/ui/__init__.py b/openlp/core/ui/__init__.py index eb0e89775..9de96e9b5 100644 --- a/openlp/core/ui/__init__.py +++ b/openlp/core/ui/__init__.py @@ -70,6 +70,7 @@ from shortcutlistform import ShortcutListForm from mediadockmanager import MediaDockManager from servicemanager import ServiceManager from thememanager import ThemeManager +from printserviceorderform import PrintServiceOrderForm __all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'MainDisplay', 'SlideController', 'ServiceManager', 'ThemeManager', 'MediaDockManager', diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index ec1025d45..05171daf7 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -25,15 +25,13 @@ ############################################################################### import cPickle -import datetime import logging -import mutagen import os import zipfile log = logging.getLogger(__name__) -from PyQt4 import QtCore, QtGui +from PyQt4 import QtCore, QtGui, QtWebKit from openlp.core.lib import OpenLPToolbar, ServiceItem, context_menu_action, \ Receiver, build_icon, ItemCapabilities, SettingsManager, translate, \ @@ -1190,52 +1188,9 @@ class ServiceManager(QtGui.QWidget): """ Print a Service Order Sheet. """ - printDialog = QtGui.QPrintDialog() - if not printDialog.exec_(): - return - text = u'

%s

' % translate('OpenLP.ServiceManager', - 'Service Order Sheet') - for item in self.serviceItems: - item = item[u'service_item'] - # Add the title of the service item. - text += u'

%s

' % (item.icon, - item.get_display_title()) - # Add slide text of the service item. - if QtCore.QSettings().value(u'advanced' + - u'/print slide text', QtCore.QVariant(False)).toBool(): - if item.is_text(): - # Add the text of the service item. - for slide in item.get_frames(): - text += u'

' + slide[u'text'] + u'

' - elif item.is_image(): - # Add the image names of the service item. - text += u'
    ' - for slide in range(len(item.get_frames())): - text += u'
  1. %s

  2. ' % \ - item.get_frame_title(slide) - text += u'
' - if item.foot_text: - # add footer - text += u'

%s

' % item.foot_text - # Add service items' notes. - if QtCore.QSettings().value(u'advanced' + - u'/print notes', QtCore.QVariant(False)).toBool(): - if item.notes: - text += u'

%s %s

' % (translate( - 'OpenLP.ServiceManager', 'Notes:'), item.notes) - # Add play length of media files. - if item.is_media() and QtCore.QSettings().value(u'advanced' + - u'/print file meta data', QtCore.QVariant(False)).toBool(): - path = os.path.join(item.get_frames()[0][u'path'], - item.get_frames()[0][u'title']) - if not os.path.isfile(path): - continue - file = mutagen.File(path) - if file is not None: - length = int(file.info.length) - text += u'

%s %s

' % (translate( - 'OpenLP.ServiceManager', u'Playing time:'), - unicode(datetime.timedelta(seconds=length))) - serviceDocument = QtGui.QTextDocument() - serviceDocument.setHtml(text) - serviceDocument.print_(printDialog.printer()) + from openlp.core.ui import PrintServiceOrderForm + dialog = PrintServiceOrderForm(self) + dialog.exec_() +# printer = QtGui.QPrinter() +# serviceDocument = QtGui.QTextDocument() +# serviceDocument.setHtml(text)