More Cleanups

This commit is contained in:
Tim Bentley 2011-03-28 19:56:39 +01:00
parent c8a7594685
commit 2ba0d410fc
12 changed files with 30 additions and 30 deletions

View File

@ -160,7 +160,7 @@ class Plugin(QtCore.QObject):
self.log = logging.getLogger(self.name)
self.previewController = pluginHelpers[u'preview']
self.liveController = pluginHelpers[u'live']
self.renderManager = pluginHelpers[u'render']
self.renderer = pluginHelpers[u'renderer']
self.serviceManager = pluginHelpers[u'service']
self.settingsForm = pluginHelpers[u'settings form']
self.mediadock = pluginHelpers[u'toolbox']

View File

@ -60,7 +60,7 @@ class Renderer(object):
``screen_number``
Defaults to *0*. The index of the output/display screen.
"""
log.info(u'RenderManager Loaded')
log.info(u'Renderer Loaded')
def __init__(self, theme_manager, screens):
"""

View File

@ -83,7 +83,7 @@ class ServiceItem(object):
The plugin that this service item belongs to.
"""
if plugin:
self.renderer = plugin.renderManager
self.renderer = plugin.renderer
self.name = plugin.name
self.title = u''
self.shortname = u''

View File

@ -588,7 +588,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
self.onInformationMessage)
# warning cyclic dependency
# renderer needs to call ThemeManager and
# ThemeManager needs to call renderer
# ThemeManager needs to call Renderer
self.renderer = Renderer(
self.themeManagerContents, self.screens)
# Define the media Dock Manager
@ -597,7 +597,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
# make the controllers available to the plugins
self.pluginHelpers[u'preview'] = self.previewController
self.pluginHelpers[u'live'] = self.liveController
self.pluginHelpers[u'render'] = self.renderer
self.pluginHelpers[u'renderer'] = self.renderer
self.pluginHelpers[u'service'] = self.ServiceManagerContents
self.pluginHelpers[u'settings form'] = self.settingsForm
self.pluginHelpers[u'toolbox'] = self.mediaDockManager

View File

@ -564,7 +564,7 @@ class ServiceManager(QtGui.QWidget):
for item in items:
serviceItem = ServiceItem()
serviceItem.from_service = True
serviceItem.render_manager = self.mainwindow.renderManager
serviceItem.renderer = self.mainwindow.renderer
serviceItem.set_from_service(item, self.servicePath)
self.validateItem(serviceItem)
self.addServiceItem(serviceItem)
@ -958,7 +958,7 @@ class ServiceManager(QtGui.QWidget):
"""
log.debug(u'onThemeComboBoxSelected')
self.service_theme = unicode(self.themeComboBox.currentText())
self.mainwindow.renderManager.set_service_theme(self.service_theme)
self.mainwindow.renderer.set_service_theme(self.service_theme)
QtCore.QSettings().setValue(
self.mainwindow.serviceSettingsSection + u'/service theme',
QtCore.QVariant(self.service_theme))

View File

@ -618,19 +618,19 @@ class SlideController(QtGui.QWidget):
label.setScaledContents(True)
if self.serviceItem.is_command():
image = resize_image(frame[u'image'],
self.parent.renderManager.width,
self.parent.renderManager.height)
self.parent.renderer.width,
self.parent.renderer.height)
else:
# If current slide set background to image
if framenumber == slideno:
self.serviceItem.bg_image_bytes = \
self.parent.renderManager.image_manager. \
self.parent.renderer.image_manager. \
get_image_bytes(frame[u'title'])
image = self.parent.renderManager.image_manager. \
image = self.parent.renderer.image_manager. \
get_image(frame[u'title'])
label.setPixmap(QtGui.QPixmap.fromImage(image))
self.previewListWidget.setCellWidget(framenumber, 0, label)
slideHeight = width * self.parent.renderManager.screen_ratio
slideHeight = width * self.parent.renderer.screen_ratio
row += 1
text.append(unicode(row))
self.previewListWidget.setItem(framenumber, 0, item)

View File

@ -656,7 +656,7 @@ class ThemeManager(QtGui.QWidget):
def generateImage(self, themeData, forcePage=False):
"""
Call the RenderManager to build a Sample Image
Call the renderer to build a Sample Image
``themeData``
The theme to generated a preview for.
@ -665,7 +665,7 @@ class ThemeManager(QtGui.QWidget):
Flag to tell message lines per page need to be generated.
"""
log.debug(u'generateImage \n%s ', themeData)
return self.mainwindow.renderManager.generate_preview(
return self.mainwindow.renderer.generate_preview(
themeData, forcePage)
def getPreviewImage(self, theme):

View File

@ -147,7 +147,7 @@ class ThemesTab(SettingsTab):
settings.setValue(u'global theme',
QtCore.QVariant(self.global_theme))
settings.endGroup()
self.parent.renderManager.set_global_theme(
self.parent.renderer.set_global_theme(
self.global_theme, self.theme_level)
Receiver.send_message(u'theme_update_global', self.global_theme)
@ -165,7 +165,7 @@ class ThemesTab(SettingsTab):
def onDefaultComboBoxChanged(self, value):
self.global_theme = unicode(self.DefaultComboBox.currentText())
self.parent.renderManager.set_global_theme(
self.parent.renderer.set_global_theme(
self.global_theme, self.theme_level)
self.__previewGlobalTheme()

View File

@ -244,7 +244,7 @@ class ImpressDocument(PresentationDocument):
return False
self.presentation = self.document.getPresentation()
self.presentation.Display = \
self.controller.plugin.renderManager.screens.current_display + 1
self.controller.plugin.renderer.screens.current_display + 1
self.control = None
self.create_thumbnails()
return True

View File

@ -253,8 +253,8 @@ class PowerpointDocument(PresentationDocument):
dpi = 96
self.presentation.SlideShowSettings.Run()
self.presentation.SlideShowWindow.View.GotoSlide(1)
rendermanager = self.controller.plugin.renderManager
rect = rendermanager.screens.current[u'size']
renderer = self.controller.plugin.renderer
rect = renderer.screens.current[u'size']
self.presentation.SlideShowWindow.Top = rect.y() * 72 / dpi
self.presentation.SlideShowWindow.Height = rect.height() * 72 / dpi
self.presentation.SlideShowWindow.Left = rect.x() * 72 / dpi

View File

@ -121,8 +121,8 @@ class PptviewDocument(PresentationDocument):
The file name of the presentations to run.
"""
log.debug(u'LoadPresentation')
rendermanager = self.controller.plugin.renderManager
rect = rendermanager.screens.current[u'size']
renderer = self.controller.plugin.renderer
rect = renderer.screens.current[u'size']
rect = RECT(rect.x(), rect.y(), rect.right(), rect.bottom())
filepath = str(self.filepath.replace(u'/', u'\\'))
if not os.path.isdir(self.get_temp_folder()):

View File

@ -89,7 +89,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.onVerseListViewPressed)
QtCore.QObject.connect(self.themeAddButton,
QtCore.SIGNAL(u'clicked()'),
self.parent.parent.renderManager.theme_manager.onAddTheme)
self.parent.parent.renderer.theme_manager.onAddTheme)
QtCore.QObject.connect(self.maintenanceButton,
QtCore.SIGNAL(u'clicked()'), self.onMaintenanceButtonClicked)
QtCore.QObject.connect(Receiver.get_receiver(),