forked from openlp/openlp
Kernel start
This commit is contained in:
parent
59bb9efdf3
commit
502a7c2c2e
@ -43,7 +43,7 @@ from traceback import format_exception
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import Receiver, Settings, check_directory_exists
|
||||
from openlp.core.lib import Receiver, Settings, check_directory_exists, Kernel
|
||||
from openlp.core.lib.ui import UiStrings
|
||||
from openlp.core.resources import qInitResources
|
||||
from openlp.core.ui.mainwindow import MainWindow
|
||||
@ -288,6 +288,7 @@ def main(args=None):
|
||||
portable_settings.sync()
|
||||
else:
|
||||
app.setApplicationName(u'OpenLP')
|
||||
kernel = Kernel.create()
|
||||
app.setApplicationVersion(get_application_version()[u'version'])
|
||||
# Instance check
|
||||
if not options.testing:
|
||||
|
@ -112,8 +112,7 @@ class Settings(QtCore.QSettings):
|
||||
Settings.__filePath__ = iniFile
|
||||
|
||||
def __init__(self, *args):
|
||||
if not args and Settings.__filePath__ and \
|
||||
Settings.defaultFormat() == Settings.IniFormat:
|
||||
if not args and Settings.__filePath__ and Settings.defaultFormat() == Settings.IniFormat:
|
||||
QtCore.QSettings.__init__(self, Settings.__filePath__, Settings.IniFormat)
|
||||
else:
|
||||
QtCore.QSettings.__init__(self, *args)
|
||||
@ -459,6 +458,7 @@ def create_separated_list(stringlist):
|
||||
u'Locale list separator: start') % (stringlist[0], merged)
|
||||
|
||||
|
||||
from kernel import Kernel
|
||||
from eventreceiver import Receiver
|
||||
from listwidgetwithdnd import ListWidgetWithDnD
|
||||
from formattingtags import FormattingTags
|
||||
|
@ -32,7 +32,7 @@ import logging
|
||||
from PyQt4 import QtGui, QtCore, QtWebKit
|
||||
|
||||
from openlp.core.lib import ServiceItem, expand_tags, build_lyrics_format_css, build_lyrics_outline_css, Receiver, \
|
||||
ItemCapabilities, FormattingTags, ImageSource
|
||||
ItemCapabilities, FormattingTags, ImageSource, Kernel
|
||||
from openlp.core.lib.theme import ThemeLevel
|
||||
from openlp.core.ui import MainDisplay, ScreenList
|
||||
|
||||
@ -71,6 +71,7 @@ class Renderer(object):
|
||||
self.theme_manager = theme_manager
|
||||
self.image_manager = image_manager
|
||||
self.screens = ScreenList()
|
||||
Kernel().register(u'renderer', self)
|
||||
self.theme_level = ThemeLevel.Global
|
||||
self.global_theme_name = u''
|
||||
self.service_theme_name = u''
|
||||
|
@ -39,7 +39,7 @@ import uuid
|
||||
|
||||
from PyQt4 import QtGui
|
||||
|
||||
from openlp.core.lib import build_icon, clean_tags, expand_tags, translate, ImageSource, Settings
|
||||
from openlp.core.lib import build_icon, clean_tags, expand_tags, translate, ImageSource, Settings, Kernel
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@ -240,11 +240,13 @@ class ServiceItem(object):
|
||||
for the theme manager.
|
||||
"""
|
||||
log.debug(u'Render called')
|
||||
renderer = Kernel().get(u'renderer')
|
||||
print renderer
|
||||
self._display_frames = []
|
||||
self.bg_image_bytes = None
|
||||
if not provides_own_theme_data:
|
||||
self.renderer.set_item_theme(self.theme)
|
||||
self.themedata, self.main, self.footer = self.renderer.pre_render()
|
||||
renderer.set_item_theme(self.theme)
|
||||
self.themedata, self.main, self.footer = renderer.pre_render()
|
||||
if self.service_item_type == ServiceItemType.Text:
|
||||
log.debug(u'Formatting slides: %s' % self.title)
|
||||
# Save rendered pages to this dict. In the case that a slide is used
|
||||
@ -256,7 +258,7 @@ class ServiceItem(object):
|
||||
if verse_tag in previous_pages and previous_pages[verse_tag][0] == slide[u'raw_slide']:
|
||||
pages = previous_pages[verse_tag][1]
|
||||
else:
|
||||
pages = self.renderer.format_slide(slide[u'raw_slide'], self)
|
||||
pages = renderer.format_slide(slide[u'raw_slide'], self)
|
||||
previous_pages[verse_tag] = (slide[u'raw_slide'], pages)
|
||||
for page in pages:
|
||||
page = page.replace(u'<br>', u'{br}')
|
||||
|
Loading…
Reference in New Issue
Block a user