forked from openlp/openlp
More Registry cleanups and bug fixes
This commit is contained in:
parent
96afb2a737
commit
183c0c700d
@ -536,7 +536,7 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
translate('OpenLP.MediaManagerItem', 'You must select one or more items.'))
|
||||
else:
|
||||
log.debug(u'%s Add requested', self.plugin.name)
|
||||
serviceItem = self.plugin.serviceManager.getServiceItem()
|
||||
serviceItem = self.service_manager.getServiceItem()
|
||||
if not serviceItem:
|
||||
QtGui.QMessageBox.information(self, UiStrings().NISs,
|
||||
translate('OpenLP.MediaManagerItem', 'You must select an existing service item to add to.'))
|
||||
@ -681,10 +681,11 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
|
||||
def _get_service_manager(self):
|
||||
"""
|
||||
Adds the plugin manager to the class dynamically
|
||||
Adds the service manager to the class dynamically
|
||||
"""
|
||||
if not hasattr(self, u'_service_manager'):
|
||||
self._service_manager = Registry().get(u'service_manager')
|
||||
return self._service_manager
|
||||
|
||||
service_manager = property(_get_service_manager)
|
||||
|
||||
|
@ -33,7 +33,7 @@ import os
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from lxml import html
|
||||
|
||||
from openlp.core.lib import translate, get_text_file_string, Receiver, Settings, UiStrings
|
||||
from openlp.core.lib import translate, get_text_file_string, Receiver, Settings, UiStrings, Registry
|
||||
from openlp.core.ui.printservicedialog import Ui_PrintServiceDialog, ZoomSize
|
||||
from openlp.core.utils import AppLocation
|
||||
|
||||
@ -108,13 +108,11 @@ http://doc.trolltech.com/4.7/richtext-html-subset.html#css-properties
|
||||
|
||||
class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
|
||||
|
||||
def __init__(self, mainWindow, serviceManager):
|
||||
def __init__(self):
|
||||
"""
|
||||
Constructor
|
||||
"""
|
||||
QtGui.QDialog.__init__(self, mainWindow)
|
||||
self.mainWindow = mainWindow
|
||||
self.serviceManager = serviceManager
|
||||
QtGui.QDialog.__init__(self, self.main_window)
|
||||
self.printer = QtGui.QPrinter()
|
||||
self.printDialog = QtGui.QPrintDialog(self.printer, self)
|
||||
self.document = QtGui.QTextDocument()
|
||||
@ -170,7 +168,7 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
|
||||
self._addElement(u'body', parent=html_data)
|
||||
self._addElement(u'h1', cgi.escape(self.titleLineEdit.text()),
|
||||
html_data.body, classId=u'serviceTitle')
|
||||
for index, item in enumerate(self.serviceManager.serviceItems):
|
||||
for index, item in enumerate(self.service_manager.serviceItems):
|
||||
self._addPreviewItem(html_data.body, item[u'service_item'], index)
|
||||
# Add the custom service notes:
|
||||
if self.footerTextEdit.toPlainText():
|
||||
@ -319,14 +317,14 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
|
||||
# remove the icon from the text
|
||||
clipboard_text = clipboard_text.replace(u'\ufffc\xa0', u'')
|
||||
# and put it all on the clipboard
|
||||
self.mainWindow.clipboard.setText(clipboard_text)
|
||||
self.main_window.clipboard.setText(clipboard_text)
|
||||
|
||||
def copyHtmlText(self):
|
||||
"""
|
||||
Copies the display text to the clipboard as Html
|
||||
"""
|
||||
self.update_song_usage()
|
||||
self.mainWindow.clipboard.setText(self.document.toHtml())
|
||||
self.main_window.clipboard.setText(self.document.toHtml())
|
||||
|
||||
def printServiceOrder(self):
|
||||
"""
|
||||
@ -392,6 +390,26 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
|
||||
# Only continue when we include the song's text.
|
||||
if not self.slideTextCheckBox.isChecked():
|
||||
return
|
||||
for item in self.serviceManager.serviceItems:
|
||||
for item in self.service_manager.serviceItems:
|
||||
# Trigger Audit requests
|
||||
Receiver.send_message(u'print_service_started', [item[u'service_item']])
|
||||
|
||||
def _get_service_manager(self):
|
||||
"""
|
||||
Adds the service manager to the class dynamically
|
||||
"""
|
||||
if not hasattr(self, u'_service_manager'):
|
||||
self._service_manager = Registry().get(u'service_manager')
|
||||
return self._service_manager
|
||||
|
||||
service_manager = property(_get_service_manager)
|
||||
|
||||
def _get_main_window(self):
|
||||
"""
|
||||
Adds the main window to the class dynamically
|
||||
"""
|
||||
if not hasattr(self, u'_main_window'):
|
||||
self._main_window = Registry().get(u'main_window')
|
||||
return self._main_window
|
||||
|
||||
main_window = property(_get_main_window)
|
@ -1545,7 +1545,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
"""
|
||||
Print a Service Order Sheet.
|
||||
"""
|
||||
settingDialog = PrintServiceForm(self.main_window, self)
|
||||
settingDialog = PrintServiceForm()
|
||||
settingDialog.exec_()
|
||||
|
||||
def _get_renderer(self):
|
||||
|
@ -1190,7 +1190,7 @@ class SlideController(DisplayController):
|
||||
From the preview display request the Item to be added to service
|
||||
"""
|
||||
if self.serviceItem:
|
||||
self.parent().serviceManagerContents.addServiceItem(self.serviceItem)
|
||||
self.service_manager.addServiceItem(self.serviceItem)
|
||||
|
||||
def onGoLiveClick(self):
|
||||
"""
|
||||
@ -1215,7 +1215,7 @@ class SlideController(DisplayController):
|
||||
Receiver.send_message('servicemanager_preview_live', u'%s:%s' %
|
||||
(self.serviceItem.unique_identifier, row))
|
||||
else:
|
||||
self.parent().liveController.addServiceManagerItem(self.serviceItem, row)
|
||||
self.live_controller.addServiceManagerItem(self.serviceItem, row)
|
||||
|
||||
def onMediaStart(self, item):
|
||||
"""
|
||||
@ -1309,3 +1309,22 @@ class SlideController(DisplayController):
|
||||
|
||||
media_controller = property(_get_media_controller)
|
||||
|
||||
def _get_service_manager(self):
|
||||
"""
|
||||
Adds the service manager to the class dynamically
|
||||
"""
|
||||
if not hasattr(self, u'_service_manager'):
|
||||
self._service_manager = Registry().get(u'service_manager')
|
||||
return self._service_manager
|
||||
|
||||
service_manager = property(_get_service_manager)
|
||||
|
||||
def _get_live_controller(self):
|
||||
"""
|
||||
Adds the live controller to the class dynamically
|
||||
"""
|
||||
if not hasattr(self, u'_live_controller'):
|
||||
self._live_controller = Registry().get(u'live_controller')
|
||||
return self._live_controller
|
||||
|
||||
live_controller = property(_get_live_controller)
|
@ -85,7 +85,7 @@ class PresentationMediaItem(MediaManagerItem):
|
||||
for type in types:
|
||||
if fileType.find(type) == -1:
|
||||
fileType += u'*.%s ' % type
|
||||
self.plugin.serviceManager.supportedSuffixes(type)
|
||||
self.service_manager.supportedSuffixes(type)
|
||||
self.onNewFileMasks = translate('PresentationPlugin.MediaItem', 'Presentations (%s)') % fileType
|
||||
|
||||
def requiredIcons(self):
|
||||
|
Loading…
Reference in New Issue
Block a user