From 60d4009261468f6f3e4d3dd9e277a08528c813b5 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 4 Jan 2014 20:58:18 +0000 Subject: [PATCH] start off --- openlp/core/lib/renderer.py | 14 +++++++------- openlp/core/ui/maindisplay.py | 8 +++----- openlp/core/ui/thememanager.py | 3 +-- openlp/core/ui/themestab.py | 3 ++- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 4ef3b7a63..6eeccfc2a 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -31,7 +31,7 @@ import logging from PyQt4 import QtGui, QtCore, QtWebKit -from openlp.core.common import Registry, Settings +from openlp.core.common import Registry, OpenLPMixin, RegistryMixin, Settings from openlp.core.lib import FormattingTags, ImageSource, ItemCapabilities, ScreenList, ServiceItem, expand_tags, \ build_lyrics_format_css, build_lyrics_outline_css from openlp.core.common import ThemeLevel @@ -50,12 +50,11 @@ VERSE_FOR_LINE_COUNT = '\n'.join(map(str, range(100))) FOOTER = ['Arky Arky (Unknown)', 'Public Domain', 'CCLI 123456'] -class Renderer(object): +class Renderer(OpenLPMixin, RegistryMixin): """ Class to pull all Renderer interactions into one place. The plugins will call helper methods to do the rendering but this class will provide display defense code. """ - log.info('Renderer Loaded') def __init__(self): """ @@ -63,20 +62,21 @@ class Renderer(object): """ log.debug('Initialisation started') self.screens = ScreenList() - Registry().register('renderer', self) self.theme_level = ThemeLevel.Global self.global_theme_name = '' self.service_theme_name = '' self.item_theme_name = '' self.force_page = False - self.display = MainDisplay(None, False, self) - self.display.setup() self._theme_dimensions = {} self._calculate_default() - Registry().register_function('theme_update_global', self.set_global_theme) self.web = QtWebKit.QWebView() self.web.setVisible(False) self.web_frame = self.web.page().mainFrame() + Registry().register_function('theme_update_global', self.set_global_theme) + + def bootstrap_initialise(self): + self.display = MainDisplay(None, False, self) + self.display.setup() def update_display(self): """ diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 60c0a7f4f..ecaeb0299 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -56,9 +56,8 @@ log = logging.getLogger(__name__) class Display(QtGui.QGraphicsView): """ - This is a general display screen class. Here the general display settings - will done. It will be used as specialized classes by Main Display and - Preview display. + This is a general display screen class. Here the general display settings will done. It will be used as + specialized classes by Main Display and Preview display. """ def __init__(self, parent, live, controller): """ @@ -521,8 +520,7 @@ class MainDisplay(Display): class AudioPlayer(QtCore.QObject): """ - This Class will play audio only allowing components to work with a - soundtrack independent of the user interface. + This Class will play audio only allowing components to work with a soundtrack independent of the user interface. """ log.info('AudioPlayer Loaded') diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index d9d798b67..2f5e3b47a 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -158,7 +158,7 @@ class ThemeManager(OpenLPMixin, RegistryMixin, QtGui.QWidget, Ui_ThemeManager): self.theme_form.path = self.path self.file_rename_form = FileRenameForm() Registry().register_function('theme_update_global', self.change_global_from_tab) - self._push_themes() + self.load_themes() def build_theme_path(self): """ @@ -446,7 +446,6 @@ class ThemeManager(OpenLPMixin, RegistryMixin, QtGui.QWidget, Ui_ThemeManager): self._write_theme(theme, None, None) Settings().setValue(self.settings_section + '/global theme', theme.theme_name) self.application.set_normal_cursor() - self.load_themes() def load_themes(self): """ diff --git a/openlp/core/ui/themestab.py b/openlp/core/ui/themestab.py index da2cb0f87..b5033e452 100644 --- a/openlp/core/ui/themestab.py +++ b/openlp/core/ui/themestab.py @@ -160,7 +160,8 @@ class ThemesTab(SettingsTab): """ After setting things up... """ - Registry().execute('theme_update_global') + #Registry().execute('theme_update_global') + pass def on_song_level_button_clicked(self): """