From 2ba0d410fc33f8d739b06645fb1ed5d23b1e99e6 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Mon, 28 Mar 2011 19:56:39 +0100 Subject: [PATCH] More Cleanups --- openlp/core/lib/plugin.py | 2 +- openlp/core/lib/renderer.py | 2 +- openlp/core/lib/serviceitem.py | 4 ++-- openlp/core/ui/mainwindow.py | 4 ++-- openlp/core/ui/servicemanager.py | 4 ++-- openlp/core/ui/slidecontroller.py | 12 ++++++------ openlp/core/ui/thememanager.py | 6 +++--- openlp/core/ui/themestab.py | 6 +++--- .../plugins/presentations/lib/impresscontroller.py | 4 ++-- .../presentations/lib/powerpointcontroller.py | 6 +++--- .../plugins/presentations/lib/pptviewcontroller.py | 6 +++--- openlp/plugins/songs/forms/editsongform.py | 4 ++-- 12 files changed, 30 insertions(+), 30 deletions(-) diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index eda8ecfa1..375331719 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -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'] diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 9256eb096..c1a866668 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -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): """ diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index f996c3f97..c3e6b17aa 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -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) \ No newline at end of file diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index e94273122..e305e06cf 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -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 diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 61dc4e3da..eaa80afac 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -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)) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index ee617287a..da14f3b0a 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -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') \ No newline at end of file diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index d033daeb3..1356a30b2 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -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() \ No newline at end of file diff --git a/openlp/core/ui/themestab.py b/openlp/core/ui/themestab.py index 1e6ddb4a8..27018af07 100644 --- a/openlp/core/ui/themestab.py +++ b/openlp/core/ui/themestab.py @@ -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) \ No newline at end of file diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index 8166a2258..c84f0ff1e 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -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 \ No newline at end of file diff --git a/openlp/plugins/presentations/lib/powerpointcontroller.py b/openlp/plugins/presentations/lib/powerpointcontroller.py index 793b0b75d..3045eed13 100644 --- a/openlp/plugins/presentations/lib/powerpointcontroller.py +++ b/openlp/plugins/presentations/lib/powerpointcontroller.py @@ -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 \ No newline at end of file diff --git a/openlp/plugins/presentations/lib/pptviewcontroller.py b/openlp/plugins/presentations/lib/pptviewcontroller.py index 94fd05f31..354c33361 100644 --- a/openlp/plugins/presentations/lib/pptviewcontroller.py +++ b/openlp/plugins/presentations/lib/pptviewcontroller.py @@ -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) \ No newline at end of file diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 7f7b7fd90..9bb58bd82 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -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()) \ No newline at end of file