forked from openlp/openlp
Cleanups
This commit is contained in:
parent
0abf1597eb
commit
9a1ed78fd5
@ -343,10 +343,10 @@ def build_lyrics(item):
|
|||||||
shadow = u'display: none;'
|
shadow = u'display: none;'
|
||||||
if theme:
|
if theme:
|
||||||
lyricscommon = u'width: %spx; height: %spx; word-wrap: break-word; ' \
|
lyricscommon = u'width: %spx; height: %spx; word-wrap: break-word; ' \
|
||||||
u'font-family: %s; font-size: %spx; color: %s; line-height: %d%%;' % \
|
u'font-family: %s; font-size: %spx; color: %s; line-height: %d%%;' \
|
||||||
(item.main.width(), item.main.height(),
|
% (item.main.width(), item.main.height(), theme.font_main_name,
|
||||||
theme.font_main_name, theme.font_main_proportion,
|
theme.font_main_proportion, theme.font_main_color,
|
||||||
theme.font_main_color, 100 + int(theme.font_main_line_adjustment))
|
100 + int(theme.font_main_line_adjustment))
|
||||||
lyricstable = u'left: %spx; top: %spx;' % \
|
lyricstable = u'left: %spx; top: %spx;' % \
|
||||||
(item.main.x(), item.main.y())
|
(item.main.x(), item.main.y())
|
||||||
outlinetable = u'left: %spx; top: %spx;' % \
|
outlinetable = u'left: %spx; top: %spx;' % \
|
||||||
@ -375,7 +375,7 @@ def build_lyrics(item):
|
|||||||
theme.display_outline_color)
|
theme.display_outline_color)
|
||||||
if theme.display_shadow:
|
if theme.display_shadow:
|
||||||
shadow = u'-webkit-text-stroke: %sem %s; ' \
|
shadow = u'-webkit-text-stroke: %sem %s; ' \
|
||||||
u'-webkit-text-fill-color: %s; '% \
|
u'-webkit-text-fill-color: %s; ' % \
|
||||||
(float(theme.display_outline_size) / 16,
|
(float(theme.display_outline_size) / 16,
|
||||||
theme.display_shadow_color, theme.display_shadow_color)
|
theme.display_shadow_color, theme.display_shadow_color)
|
||||||
else:
|
else:
|
||||||
|
@ -200,7 +200,7 @@ class RenderManager(object):
|
|||||||
serviceItem.raw_footer = footer
|
serviceItem.raw_footer = footer
|
||||||
serviceItem.render(True)
|
serviceItem.render(True)
|
||||||
self.display.buildHtml(serviceItem)
|
self.display.buildHtml(serviceItem)
|
||||||
frame, raw_html = serviceItem.get_rendered_frame(0)
|
raw_html = serviceItem.get_rendered_frame(0)[1]
|
||||||
preview = self.display.text(raw_html)
|
preview = self.display.text(raw_html)
|
||||||
# Reset the real screen size for subsequent render requests
|
# Reset the real screen size for subsequent render requests
|
||||||
self.calculate_default(self.screens.current[u'size'])
|
self.calculate_default(self.screens.current[u'size'])
|
||||||
|
@ -53,8 +53,9 @@ class SpellTextEdit(QtGui.QPlainTextEdit):
|
|||||||
if event.button() == QtCore.Qt.RightButton:
|
if event.button() == QtCore.Qt.RightButton:
|
||||||
# Rewrite the mouse event to a left button event so the cursor is
|
# Rewrite the mouse event to a left button event so the cursor is
|
||||||
# moved to the location of the pointer.
|
# moved to the location of the pointer.
|
||||||
event = QtGui.QMouseEvent(QtCore.QEvent.MouseButtonPress, event.pos(),
|
event = QtGui.QMouseEvent(QtCore.QEvent.MouseButtonPress,
|
||||||
QtCore.Qt.LeftButton, QtCore.Qt.LeftButton, QtCore.Qt.NoModifier)
|
event.pos(), QtCore.Qt.LeftButton, QtCore.Qt.LeftButton,
|
||||||
|
QtCore.Qt.NoModifier)
|
||||||
QtGui.QPlainTextEdit.mousePressEvent(self, event)
|
QtGui.QPlainTextEdit.mousePressEvent(self, event)
|
||||||
|
|
||||||
def contextMenuEvent(self, event):
|
def contextMenuEvent(self, event):
|
||||||
|
@ -94,8 +94,10 @@ class Ui_MainWindow(object):
|
|||||||
self.ControlSplitter.setObjectName(u'ControlSplitter')
|
self.ControlSplitter.setObjectName(u'ControlSplitter')
|
||||||
self.MainContentLayout.addWidget(self.ControlSplitter)
|
self.MainContentLayout.addWidget(self.ControlSplitter)
|
||||||
# Create slide controllers
|
# Create slide controllers
|
||||||
self.PreviewController = SlideController(self, self.settingsmanager, self.screens)
|
self.PreviewController = SlideController(self, self.settingsmanager,
|
||||||
self.LiveController = SlideController(self, self.settingsmanager, self.screens, True)
|
self.screens)
|
||||||
|
self.LiveController = SlideController(self, self.settingsmanager,
|
||||||
|
self.screens, True)
|
||||||
# Create menu
|
# Create menu
|
||||||
self.MenuBar = QtGui.QMenuBar(MainWindow)
|
self.MenuBar = QtGui.QMenuBar(MainWindow)
|
||||||
self.MenuBar.setGeometry(QtCore.QRect(0, 0, 1087, 27))
|
self.MenuBar.setGeometry(QtCore.QRect(0, 0, 1087, 27))
|
||||||
|
@ -117,7 +117,8 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.split = 1
|
self.split = 1
|
||||||
self.typePrefix = u'live'
|
self.typePrefix = u'live'
|
||||||
else:
|
else:
|
||||||
self.TypeLabel.setText(translate('OpenLP.SlideController', 'Preview'))
|
self.TypeLabel.setText(translate('OpenLP.SlideController',
|
||||||
|
'Preview'))
|
||||||
self.split = 0
|
self.split = 0
|
||||||
self.typePrefix = u'preview'
|
self.typePrefix = u'preview'
|
||||||
self.TypeLabel.setStyleSheet(u'font-weight: bold; font-size: 12pt;')
|
self.TypeLabel.setStyleSheet(u'font-weight: bold; font-size: 12pt;')
|
||||||
@ -199,7 +200,8 @@ class SlideController(QtGui.QWidget):
|
|||||||
QtCore.SIGNAL("triggered(bool)"), self.onThemeDisplay)
|
QtCore.SIGNAL("triggered(bool)"), self.onThemeDisplay)
|
||||||
if self.screens.display_count > 1:
|
if self.screens.display_count > 1:
|
||||||
self.DesktopScreen = QtGui.QAction(QtGui.QIcon(
|
self.DesktopScreen = QtGui.QAction(QtGui.QIcon(
|
||||||
u':/slides/slide_desktop.png'), u'Show Desktop', self.HideMenu)
|
u':/slides/slide_desktop.png'), u'Show Desktop',
|
||||||
|
self.HideMenu)
|
||||||
self.DesktopScreen.setCheckable(True)
|
self.DesktopScreen.setCheckable(True)
|
||||||
QtCore.QObject.connect(self.DesktopScreen,
|
QtCore.QObject.connect(self.DesktopScreen,
|
||||||
QtCore.SIGNAL("triggered(bool)"), self.onHideDisplay)
|
QtCore.SIGNAL("triggered(bool)"), self.onHideDisplay)
|
||||||
@ -212,7 +214,8 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.Toolbar.addToolbarSeparator(u'Close Separator')
|
self.Toolbar.addToolbarSeparator(u'Close Separator')
|
||||||
self.Toolbar.addToolbarButton(
|
self.Toolbar.addToolbarButton(
|
||||||
u'Go Live', u':/general/general_live.png',
|
u'Go Live', u':/general/general_live.png',
|
||||||
translate('OpenLP.SlideController', 'Move to live'), self.onGoLive)
|
translate('OpenLP.SlideController', 'Move to live'),
|
||||||
|
self.onGoLive)
|
||||||
self.Toolbar.addToolbarSeparator(u'Close Separator')
|
self.Toolbar.addToolbarSeparator(u'Close Separator')
|
||||||
self.Toolbar.addToolbarButton(
|
self.Toolbar.addToolbarButton(
|
||||||
u'Edit Song', u':/general/general_edit.png',
|
u'Edit Song', u':/general/general_edit.png',
|
||||||
@ -233,7 +236,8 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.DelaySpinBox.setMaximum(180)
|
self.DelaySpinBox.setMaximum(180)
|
||||||
self.Toolbar.addToolbarWidget(
|
self.Toolbar.addToolbarWidget(
|
||||||
u'Image SpinBox', self.DelaySpinBox)
|
u'Image SpinBox', self.DelaySpinBox)
|
||||||
self.DelaySpinBox.setSuffix(translate('OpenLP.SlideController', 's'))
|
self.DelaySpinBox.setSuffix(translate('OpenLP.SlideController',
|
||||||
|
's'))
|
||||||
self.DelaySpinBox.setToolTip(translate('OpenLP.SlideController',
|
self.DelaySpinBox.setToolTip(translate('OpenLP.SlideController',
|
||||||
'Delay between slides in seconds'))
|
'Delay between slides in seconds'))
|
||||||
self.ControllerLayout.addWidget(self.Toolbar)
|
self.ControllerLayout.addWidget(self.Toolbar)
|
||||||
@ -274,11 +278,13 @@ class SlideController(QtGui.QWidget):
|
|||||||
# Build the Song Toolbar
|
# Build the Song Toolbar
|
||||||
if isLive:
|
if isLive:
|
||||||
self.SongMenu = QtGui.QToolButton(self.Toolbar)
|
self.SongMenu = QtGui.QToolButton(self.Toolbar)
|
||||||
self.SongMenu.setText(translate('OpenLP.SlideController', 'Go to Verse'))
|
self.SongMenu.setText(translate('OpenLP.SlideController',
|
||||||
|
'Go to Verse'))
|
||||||
self.SongMenu.setPopupMode(QtGui.QToolButton.InstantPopup)
|
self.SongMenu.setPopupMode(QtGui.QToolButton.InstantPopup)
|
||||||
self.Toolbar.addToolbarWidget(u'Song Menu', self.SongMenu)
|
self.Toolbar.addToolbarWidget(u'Song Menu', self.SongMenu)
|
||||||
self.SongMenu.setMenu(QtGui.QMenu(
|
self.SongMenu.setMenu(QtGui.QMenu(
|
||||||
translate('OpenLP.SlideController', 'Go to Verse'), self.Toolbar))
|
translate('OpenLP.SlideController', 'Go to Verse'),
|
||||||
|
self.Toolbar))
|
||||||
self.Toolbar.makeWidgetsInvisible([u'Song Menu'])
|
self.Toolbar.makeWidgetsInvisible([u'Song Menu'])
|
||||||
# Screen preview area
|
# Screen preview area
|
||||||
self.PreviewFrame = QtGui.QFrame(self.Splitter)
|
self.PreviewFrame = QtGui.QFrame(self.Splitter)
|
||||||
|
@ -465,9 +465,9 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
self.displayResults(bible, dual_bible)
|
self.displayResults(bible, dual_bible)
|
||||||
|
|
||||||
def generateSlideData(self, service_item, item=None):
|
def generateSlideData(self, service_item, item=None):
|
||||||
'''
|
"""
|
||||||
Generates and formats the slides for the service item.
|
Generates and formats the slides for the service item.
|
||||||
'''
|
"""
|
||||||
log.debug(u'generating slide data')
|
log.debug(u'generating slide data')
|
||||||
items = self.listView.selectedIndexes()
|
items = self.listView.selectedIndexes()
|
||||||
if len(items) == 0:
|
if len(items) == 0:
|
||||||
@ -551,7 +551,8 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
if isinstance(reference, QtCore.QVariant):
|
if isinstance(reference, QtCore.QVariant):
|
||||||
reference = reference.toPyObject()
|
reference = reference.toPyObject()
|
||||||
bible_new = self._decodeQtObject(reference, 'bible')
|
bible_new = self._decodeQtObject(reference, 'bible')
|
||||||
dual_bible_new = self._decodeQtObject(reference, 'dual_bible')
|
dual_bible_new = self._decodeQtObject(reference,
|
||||||
|
'dual_bible')
|
||||||
if dual_bible_new:
|
if dual_bible_new:
|
||||||
raw_slides.append(bible_text)
|
raw_slides.append(bible_text)
|
||||||
bible_text = u''
|
bible_text = u''
|
||||||
@ -639,10 +640,10 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
combo.addItem(unicode(i))
|
combo.addItem(unicode(i))
|
||||||
|
|
||||||
def displayResults(self, bible, dual_bible=None):
|
def displayResults(self, bible, dual_bible=None):
|
||||||
'''
|
"""
|
||||||
Displays the search results in the media manager. All data needed for further
|
Displays the search results in the media manager. All data needed for
|
||||||
action is saved for/in each row.
|
further action is saved for/in each row.
|
||||||
'''
|
"""
|
||||||
version = self.parent.manager.get_meta_data(bible, u'Version')
|
version = self.parent.manager.get_meta_data(bible, u'Version')
|
||||||
copyright = self.parent.manager.get_meta_data(bible, u'Copyright')
|
copyright = self.parent.manager.get_meta_data(bible, u'Copyright')
|
||||||
#permission = self.parent.manager.get_meta_data(bible, u'Permissions')
|
#permission = self.parent.manager.get_meta_data(bible, u'Permissions')
|
||||||
|
Loading…
Reference in New Issue
Block a user