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''
@ -455,4 +455,4 @@ class ServiceItem(object):
elif not start and end:
return end
else:
return u'%s : %s' % (start, end)
return u'%s : %s' % (start, end)

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)
@ -1111,4 +1111,4 @@ class SlideController(QtGui.QWidget):
blank.setChecked(False)
self.hideMenu.setDefaultAction(blank)
QtCore.QSettings().remove(
self.parent.generalSettingsSection + u'/screen blank')
self.parent.generalSettingsSection + u'/screen blank')

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):
@ -802,4 +802,4 @@ class ThemeManager(QtGui.QWidget):
vAlignCorrection = VerticalType.Bottom
newtheme.display_horizontal_align = theme.HorizontalAlign
newtheme.display_vertical_align = vAlignCorrection
return newtheme.extract_xml()
return newtheme.extract_xml()

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()
@ -206,4 +206,4 @@ class ThemesTab(SettingsTab):
if not preview.isNull():
preview = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio,
QtCore.Qt.SmoothTransformation)
self.DefaultListView.setPixmap(preview)
self.DefaultListView.setPixmap(preview)

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
@ -463,4 +463,4 @@ class ImpressDocument(PresentationDocument):
shape = page.getByIndex(idx)
if shape.supportsService("com.sun.star.drawing.Text"):
text += shape.getString() + '\n'
return text
return text

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
@ -326,4 +326,4 @@ def _get_text_from_shapes(shapes):
shape = shapes(idx + 1)
if shape.HasTextFrame:
text += shape.TextFrame.TextRange.Text + '\n'
return text
return text

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()):
@ -244,4 +244,4 @@ class PptviewDocument(PresentationDocument):
"""
Triggers the previous slide on the running presentation
"""
self.controller.process.PrevStep(self.pptid)
self.controller.process.PrevStep(self.pptid)

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(),
@ -788,4 +788,4 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.song.verse_order)
except:
log.exception(u'Problem processing song Lyrics \n%s',
sxml.dump_xml())
sxml.dump_xml())