forked from openlp/openlp
Code Cleanup
This commit is contained in:
parent
4761589d0c
commit
8219a9c222
@ -35,8 +35,9 @@ log = logging.getLogger()
|
|||||||
|
|
||||||
from openlp.core.lib import Receiver
|
from openlp.core.lib import Receiver
|
||||||
from openlp.core.resources import qInitResources
|
from openlp.core.resources import qInitResources
|
||||||
from openlp.core.ui import MainWindow, SplashScreen, ScreenList
|
from openlp.core.ui import SplashScreen, ScreenList
|
||||||
from openlp.core.utils import AppLocation, LanguageManager
|
from openlp.core.utils import AppLocation, LanguageManager
|
||||||
|
from openlp.core.ui.mainwindow import MainWindow
|
||||||
|
|
||||||
application_stylesheet = u"""
|
application_stylesheet = u"""
|
||||||
QMainWindow::separator
|
QMainWindow::separator
|
||||||
|
@ -27,7 +27,8 @@ import logging
|
|||||||
|
|
||||||
from PyQt4 import QtCore
|
from PyQt4 import QtCore
|
||||||
|
|
||||||
from openlp.core.lib import Renderer, ThemeLevel
|
from openlp.core.lib import Renderer, ThemeLevel, ServiceItem
|
||||||
|
from openlp.core.ui import MainDisplay
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -54,6 +55,8 @@ class RenderManager(object):
|
|||||||
"""
|
"""
|
||||||
log.debug(u'Initilisation started')
|
log.debug(u'Initilisation started')
|
||||||
self.screens = screens
|
self.screens = screens
|
||||||
|
self.display = self.display = MainDisplay(self, screens, False)
|
||||||
|
self.display.setup()
|
||||||
self.theme_manager = theme_manager
|
self.theme_manager = theme_manager
|
||||||
self.renderer = Renderer()
|
self.renderer = Renderer()
|
||||||
self.calculate_default(self.screens.current[u'size'])
|
self.calculate_default(self.screens.current[u'size'])
|
||||||
@ -184,9 +187,14 @@ class RenderManager(object):
|
|||||||
footer.append(u'CCLI 123456')
|
footer.append(u'CCLI 123456')
|
||||||
formatted = self.renderer.format_slide(verse, False)
|
formatted = self.renderer.format_slide(verse, False)
|
||||||
#Only Render the first slide page returned
|
#Only Render the first slide page returned
|
||||||
image = self.previewDisplay.preview(self.renderer.bg_frame, verse, self.themedata)
|
serviceItem = ServiceItem()
|
||||||
return image #self.renderer.generate_frame_from_lines(formatted[0],
|
serviceItem.add_from_text(u'', verse, u'')
|
||||||
#footer)[u'main']
|
serviceItem.render_manager = self
|
||||||
|
serviceItem.render()
|
||||||
|
serviceItem.raw_footer = footer
|
||||||
|
self.display.buildHtml(serviceItem)
|
||||||
|
self.display.frame.findFirstElement('div#footer').setInnerXml(serviceItem.foot_text)
|
||||||
|
return #image
|
||||||
|
|
||||||
def format_slide(self, words):
|
def format_slide(self, words):
|
||||||
"""
|
"""
|
||||||
@ -230,4 +238,4 @@ class RenderManager(object):
|
|||||||
log.debug(u'calculate default %d, %d, %f',
|
log.debug(u'calculate default %d, %d, %f',
|
||||||
self.width, self.height, self.screen_ratio )
|
self.width, self.height, self.screen_ratio )
|
||||||
# 90% is start of footer
|
# 90% is start of footer
|
||||||
self.footer_start = int(self.height * 0.90)
|
self.footer_start = int(self.height * 0.90)
|
@ -36,12 +36,11 @@ class HideMode(object):
|
|||||||
Theme = 2
|
Theme = 2
|
||||||
Screen = 3
|
Screen = 3
|
||||||
|
|
||||||
from maindisplay import WebViewer
|
from maindisplay import MainDisplay
|
||||||
from slidecontroller import HideMode
|
from slidecontroller import HideMode
|
||||||
from servicenoteform import ServiceNoteForm
|
from servicenoteform import ServiceNoteForm
|
||||||
from serviceitemeditform import ServiceItemEditForm
|
from serviceitemeditform import ServiceItemEditForm
|
||||||
from screen import ScreenList
|
from screen import ScreenList
|
||||||
from maindisplay import WebViewer
|
|
||||||
from amendthemeform import AmendThemeForm
|
from amendthemeform import AmendThemeForm
|
||||||
from slidecontroller import SlideController
|
from slidecontroller import SlideController
|
||||||
from splashscreen import SplashScreen
|
from splashscreen import SplashScreen
|
||||||
@ -54,8 +53,7 @@ from settingsform import SettingsForm
|
|||||||
from mediadockmanager import MediaDockManager
|
from mediadockmanager import MediaDockManager
|
||||||
from servicemanager import ServiceManager
|
from servicemanager import ServiceManager
|
||||||
from thememanager import ThemeManager
|
from thememanager import ThemeManager
|
||||||
from mainwindow import MainWindow
|
|
||||||
|
|
||||||
__all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'MainWindow',
|
__all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'MainWindow',
|
||||||
'MainDisplay', 'SlideController', 'ServiceManager', 'ThemeManager',
|
'MainDisplay', 'SlideController', 'ServiceManager', 'ThemeManager',
|
||||||
'AmendThemeForm', 'MediaDockManager', 'ServiceItemEditForm']
|
'AmendThemeForm', 'MediaDockManager', 'ServiceItemEditForm']
|
File diff suppressed because it is too large
Load Diff
@ -30,7 +30,7 @@ import os
|
|||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
from PyQt4.phonon import Phonon
|
from PyQt4.phonon import Phonon
|
||||||
|
|
||||||
from openlp.core.ui import HideMode, WebViewer
|
from openlp.core.ui import HideMode, MainDisplay
|
||||||
from openlp.core.lib import OpenLPToolbar, Receiver, resize_image, \
|
from openlp.core.lib import OpenLPToolbar, Receiver, resize_image, \
|
||||||
ItemCapabilities, translate
|
ItemCapabilities, translate
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.isLive = isLive
|
self.isLive = isLive
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.screens = screens
|
self.screens = screens
|
||||||
self.display = WebViewer(self, screens, isLive)
|
self.display = MainDisplay(self, screens, isLive)
|
||||||
#self.displayManager = self.parent.displayManager
|
#self.displayManager = self.parent.displayManager
|
||||||
self.loopList = [
|
self.loopList = [
|
||||||
u'Start Loop',
|
u'Start Loop',
|
||||||
@ -986,4 +986,4 @@ class SlideController(QtGui.QWidget):
|
|||||||
text = text.replace(u'<br>', u'\n').replace(u'<p>', u'')\
|
text = text.replace(u'<br>', u'\n').replace(u'<p>', u'')\
|
||||||
.replace(u'</p>', u'').replace(u'<sup>', u'')\
|
.replace(u'</p>', u'').replace(u'<sup>', u'')\
|
||||||
.replace(u'</sup>', u'')
|
.replace(u'</sup>', u'')
|
||||||
return text
|
return text
|
Loading…
Reference in New Issue
Block a user