forked from openlp/openlp
Head
This commit is contained in:
commit
12810ad34a
@ -48,5 +48,4 @@ class BaseListWithDnD(QtGui.QListWidget):
|
|||||||
mimeData = QtCore.QMimeData()
|
mimeData = QtCore.QMimeData()
|
||||||
drag.setMimeData(mimeData)
|
drag.setMimeData(mimeData)
|
||||||
mimeData.setText(self.PluginName)
|
mimeData.setText(self.PluginName)
|
||||||
dropAction = drag.start(QtCore.Qt.CopyAction)
|
drag.start(QtCore.Qt.CopyAction)
|
||||||
|
|
||||||
|
@ -70,11 +70,6 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
The user visible name for a plugin which should use a suitable
|
The user visible name for a plugin which should use a suitable
|
||||||
translation function.
|
translation function.
|
||||||
|
|
||||||
``self.SettingsSection``
|
|
||||||
The section in the configuration where the items in the media
|
|
||||||
manager are stored. This could potentially be
|
|
||||||
``self.PluginNameShort.lower()``.
|
|
||||||
|
|
||||||
``self.OnNewPrompt``
|
``self.OnNewPrompt``
|
||||||
Defaults to *'Select Image(s)'*.
|
Defaults to *'Select Image(s)'*.
|
||||||
|
|
||||||
@ -103,6 +98,7 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
QtGui.QWidget.__init__(self)
|
QtGui.QWidget.__init__(self)
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
|
self.settingsSection = title.lower()
|
||||||
if type(icon) is QtGui.QIcon:
|
if type(icon) is QtGui.QIcon:
|
||||||
self.icon = icon
|
self.icon = icon
|
||||||
elif type(icon) is types.StringType:
|
elif type(icon) is types.StringType:
|
||||||
@ -335,20 +331,20 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
def onFileClick(self):
|
def onFileClick(self):
|
||||||
files = QtGui.QFileDialog.getOpenFileNames(
|
files = QtGui.QFileDialog.getOpenFileNames(
|
||||||
self, self.OnNewPrompt,
|
self, self.OnNewPrompt,
|
||||||
SettingsManager.get_last_dir(self.SettingsSection),
|
SettingsManager.get_last_dir(self.settingsSection),
|
||||||
self.OnNewFileMasks)
|
self.OnNewFileMasks)
|
||||||
log.info(u'New files(s) %s', unicode(files))
|
log.info(u'New files(s) %s', unicode(files))
|
||||||
if files:
|
if files:
|
||||||
self.loadList(files)
|
self.loadList(files)
|
||||||
dir, filename = os.path.split(unicode(files[0]))
|
dir = os.path.split(unicode(files[0]))[0]
|
||||||
SettingsManager.set_last_dir(self.SettingsSection, dir)
|
SettingsManager.set_last_dir(self.settingsSection, dir)
|
||||||
SettingsManager.set_list(
|
SettingsManager.set_list(self.settingsSection,
|
||||||
self.SettingsSection, self.SettingsSection, self.getFileList())
|
self.settingsSection, self.getFileList())
|
||||||
|
|
||||||
def getFileList(self):
|
def getFileList(self):
|
||||||
count = 0
|
count = 0
|
||||||
filelist = []
|
filelist = []
|
||||||
while count < self.ListView.count():
|
while count < self.ListView.count():
|
||||||
bitem = self.ListView.item(count)
|
bitem = self.ListView.item(count)
|
||||||
filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString())
|
filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString())
|
||||||
filelist.append(filename)
|
filelist.append(filename)
|
||||||
|
@ -51,7 +51,7 @@ class Plugin(QtCore.QObject):
|
|||||||
``version``
|
``version``
|
||||||
The version number of this iteration of the plugin.
|
The version number of this iteration of the plugin.
|
||||||
|
|
||||||
``settings_section``
|
``settingsSection``
|
||||||
The namespace to store settings for the plugin.
|
The namespace to store settings for the plugin.
|
||||||
|
|
||||||
``icon``
|
``icon``
|
||||||
@ -116,7 +116,7 @@ class Plugin(QtCore.QObject):
|
|||||||
self.name = name
|
self.name = name
|
||||||
if version:
|
if version:
|
||||||
self.version = version
|
self.version = version
|
||||||
self.settings_section = self.name.lower()
|
self.settingsSection = self.name.lower()
|
||||||
self.icon = None
|
self.icon = None
|
||||||
self.weight = 0
|
self.weight = 0
|
||||||
self.status = PluginStatus.Inactive
|
self.status = PluginStatus.Inactive
|
||||||
@ -147,7 +147,7 @@ class Plugin(QtCore.QObject):
|
|||||||
Sets the status of the plugin
|
Sets the status of the plugin
|
||||||
"""
|
"""
|
||||||
self.status = QtCore.QSettings().value(
|
self.status = QtCore.QSettings().value(
|
||||||
self.settings_section + u'/status',
|
self.settingsSection + u'/status',
|
||||||
QtCore.QVariant(PluginStatus.Inactive)).toInt()[0]
|
QtCore.QVariant(PluginStatus.Inactive)).toInt()[0]
|
||||||
|
|
||||||
def toggle_status(self, new_status):
|
def toggle_status(self, new_status):
|
||||||
@ -156,7 +156,7 @@ class Plugin(QtCore.QObject):
|
|||||||
"""
|
"""
|
||||||
self.status = new_status
|
self.status = new_status
|
||||||
QtCore.QSettings().setValue(
|
QtCore.QSettings().setValue(
|
||||||
self.settings_section + u'/status', QtCore.QVariant(self.status))
|
self.settingsSection + u'/status', QtCore.QVariant(self.status))
|
||||||
|
|
||||||
def is_active(self):
|
def is_active(self):
|
||||||
"""
|
"""
|
||||||
|
@ -117,8 +117,7 @@ class Renderer(object):
|
|||||||
QtGui.QImage.Format_ARGB32_Premultiplied)
|
QtGui.QImage.Format_ARGB32_Premultiplied)
|
||||||
if self._bg_image_filename and not self.bg_image:
|
if self._bg_image_filename and not self.bg_image:
|
||||||
self.bg_image = resize_image(self._bg_image_filename,
|
self.bg_image = resize_image(self._bg_image_filename,
|
||||||
self._frame.width(),
|
self._frame.width(), self._frame.height())
|
||||||
self._frame.height())
|
|
||||||
if self.bg_frame is None:
|
if self.bg_frame is None:
|
||||||
self._generate_background_frame()
|
self._generate_background_frame()
|
||||||
|
|
||||||
@ -223,7 +222,7 @@ class Renderer(object):
|
|||||||
``rect_footer``
|
``rect_footer``
|
||||||
The footer text block.
|
The footer text block.
|
||||||
"""
|
"""
|
||||||
log.debug(u'set_text_rectangle %s , %s' %(rect_main, rect_footer) )
|
log.debug(u'set_text_rectangle %s , %s' % (rect_main, rect_footer))
|
||||||
self._rect = rect_main
|
self._rect = rect_main
|
||||||
self._rect_footer = rect_footer
|
self._rect_footer = rect_footer
|
||||||
|
|
||||||
@ -244,7 +243,8 @@ class Renderer(object):
|
|||||||
bbox1 = self._render_lines_unaligned(footer_lines, True)
|
bbox1 = self._render_lines_unaligned(footer_lines, True)
|
||||||
# reset the frame. first time do not worry about what you paint on.
|
# reset the frame. first time do not worry about what you paint on.
|
||||||
self._frame = QtGui.QImage(self.bg_frame)
|
self._frame = QtGui.QImage(self.bg_frame)
|
||||||
self._frameOp = QtGui.QImage(self.bg_frame)
|
if self._theme.display_slideTransition:
|
||||||
|
self._frameOp = QtGui.QImage(self.bg_frame)
|
||||||
x, y = self._correctAlignment(self._rect, bbox)
|
x, y = self._correctAlignment(self._rect, bbox)
|
||||||
bbox = self._render_lines_unaligned(lines, False, (x, y), True)
|
bbox = self._render_lines_unaligned(lines, False, (x, y), True)
|
||||||
if footer_lines:
|
if footer_lines:
|
||||||
@ -267,8 +267,8 @@ class Renderer(object):
|
|||||||
QtGui.QPixmap(self._frame.width(), self._frame.height())
|
QtGui.QPixmap(self._frame.width(), self._frame.height())
|
||||||
self.bg_frame.fill(QtCore.Qt.transparent)
|
self.bg_frame.fill(QtCore.Qt.transparent)
|
||||||
else:
|
else:
|
||||||
self.bg_frame = QtGui.QImage(self._frame.width(), self._frame.height(),
|
self.bg_frame = QtGui.QImage(self._frame.width(),
|
||||||
QtGui.QImage.Format_ARGB32_Premultiplied)
|
self._frame.height(), QtGui.QImage.Format_ARGB32_Premultiplied)
|
||||||
log.debug(u'render background %s start', self._theme.background_type)
|
log.debug(u'render background %s start', self._theme.background_type)
|
||||||
painter = QtGui.QPainter()
|
painter = QtGui.QPainter()
|
||||||
painter.begin(self.bg_frame)
|
painter.begin(self.bg_frame)
|
||||||
@ -463,10 +463,11 @@ class Renderer(object):
|
|||||||
# now draw the text, and any outlines/shadows
|
# now draw the text, and any outlines/shadows
|
||||||
if self._theme.display_shadow:
|
if self._theme.display_shadow:
|
||||||
self._get_extent_and_render(line, footer,
|
self._get_extent_and_render(line, footer,
|
||||||
tlcorner=(x + display_shadow_size, y + display_shadow_size),
|
tlcorner=(x + display_shadow_size,
|
||||||
draw=True, color = self._theme.display_shadow_color)
|
y + display_shadow_size),
|
||||||
self._get_extent_and_render(line, footer, tlcorner=(x, y), draw=True,
|
draw=True, color = self._theme.display_shadow_color)
|
||||||
outline_size=display_outline_size)
|
self._get_extent_and_render(line, footer, tlcorner=(x, y),
|
||||||
|
draw=True, outline_size=display_outline_size)
|
||||||
y += h
|
y += h
|
||||||
if linenum == 0:
|
if linenum == 0:
|
||||||
self._first_line_right_extent = rightextent
|
self._first_line_right_extent = rightextent
|
||||||
@ -532,7 +533,7 @@ class Renderer(object):
|
|||||||
font = self.mainFont
|
font = self.mainFont
|
||||||
metrics = QtGui.QFontMetrics(font)
|
metrics = QtGui.QFontMetrics(font)
|
||||||
w = metrics.width(line)
|
w = metrics.width(line)
|
||||||
h = metrics.height()
|
h = metrics.height() + int(self._theme.font_main_line_adjustment)
|
||||||
if draw:
|
if draw:
|
||||||
self.painter.setFont(font)
|
self.painter.setFont(font)
|
||||||
if color is None:
|
if color is None:
|
||||||
@ -543,27 +544,29 @@ class Renderer(object):
|
|||||||
else:
|
else:
|
||||||
pen = QtGui.QColor(color)
|
pen = QtGui.QColor(color)
|
||||||
x, y = tlcorner
|
x, y = tlcorner
|
||||||
|
rowpos = y + metrics.ascent()
|
||||||
if self._theme.display_outline and outline_size != 0 and not footer:
|
if self._theme.display_outline and outline_size != 0 and not footer:
|
||||||
path = QtGui.QPainterPath()
|
path = QtGui.QPainterPath()
|
||||||
path.addText(QtCore.QPointF(x, y + metrics.ascent()), font, line)
|
path.addText(QtCore.QPointF(x, rowpos), font, line)
|
||||||
self.painter.setBrush(self.painter.pen().brush())
|
self.painter.setBrush(self.painter.pen().brush())
|
||||||
self.painter.setPen(QtGui.QPen(
|
self.painter.setPen(QtGui.QPen(QtGui.QColor(
|
||||||
QtGui.QColor(self._theme.display_outline_color), outline_size))
|
self._theme.display_outline_color), outline_size))
|
||||||
self.painter.drawPath(path)
|
self.painter.drawPath(path)
|
||||||
self.painter.setPen(pen)
|
self.painter.setPen(pen)
|
||||||
self.painter.drawText(x, y + metrics.ascent(), line)
|
self.painter.drawText(x, rowpos, line)
|
||||||
if self._theme.display_slideTransition:
|
if self._theme.display_slideTransition:
|
||||||
# Print 2nd image with 70% weight
|
# Print 2nd image with 70% weight
|
||||||
if self._theme.display_outline and outline_size != 0 and not footer:
|
if self._theme.display_outline and outline_size != 0 and not footer:
|
||||||
path = QtGui.QPainterPath()
|
path = QtGui.QPainterPath()
|
||||||
path.addText(QtCore.QPointF(x, y + metrics.ascent()), font, line)
|
path.addText(QtCore.QPointF(x, rowpos), font, line)
|
||||||
self.painter2.setBrush(self.painter2.pen().brush())
|
self.painter2.setBrush(self.painter2.pen().brush())
|
||||||
self.painter2.setPen(QtGui.QPen(
|
self.painter2.setPen(QtGui.QPen(
|
||||||
QtGui.QColor(self._theme.display_outline_color), outline_size))
|
QtGui.QColor(self._theme.display_outline_color),
|
||||||
|
outline_size))
|
||||||
self.painter2.drawPath(path)
|
self.painter2.drawPath(path)
|
||||||
self.painter2.setFont(font)
|
self.painter2.setFont(font)
|
||||||
self.painter2.setPen(pen)
|
self.painter2.setPen(pen)
|
||||||
self.painter2.drawText(x, y + metrics.ascent(), line)
|
self.painter2.drawText(x, rowpos, line)
|
||||||
return (w, h)
|
return (w, h)
|
||||||
|
|
||||||
def snoop_Image(self, image, image2=None):
|
def snoop_Image(self, image, image2=None):
|
||||||
|
@ -49,7 +49,6 @@ class ItemCapabilities(object):
|
|||||||
RequiresMedia = 4
|
RequiresMedia = 4
|
||||||
AllowsLoop = 5
|
AllowsLoop = 5
|
||||||
|
|
||||||
|
|
||||||
class ServiceItem(object):
|
class ServiceItem(object):
|
||||||
"""
|
"""
|
||||||
The service item is a base class for the plugins to use to interact with
|
The service item is a base class for the plugins to use to interact with
|
||||||
|
@ -53,6 +53,7 @@ blankthemexml=\
|
|||||||
<weight>Normal</weight>
|
<weight>Normal</weight>
|
||||||
<italics>False</italics>
|
<italics>False</italics>
|
||||||
<indentation>0</indentation>
|
<indentation>0</indentation>
|
||||||
|
<line_adjustment>0</line_adjustment>
|
||||||
<location override="False" x="10" y="10" width="1004" height="730"/>
|
<location override="False" x="10" y="10" width="1004" height="730"/>
|
||||||
</font>
|
</font>
|
||||||
<font type="footer">
|
<font type="footer">
|
||||||
@ -62,6 +63,7 @@ blankthemexml=\
|
|||||||
<weight>Normal</weight>
|
<weight>Normal</weight>
|
||||||
<italics>False</italics>
|
<italics>False</italics>
|
||||||
<indentation>0</indentation>
|
<indentation>0</indentation>
|
||||||
|
<line_adjustment>0</line_adjustment>
|
||||||
<location override="False" x="10" y="730" width="1004" height="38"/>
|
<location override="False" x="10" y="730" width="1004" height="38"/>
|
||||||
</font>
|
</font>
|
||||||
<display>
|
<display>
|
||||||
@ -171,8 +173,8 @@ class ThemeXML(object):
|
|||||||
self.child_element(background, u'filename', filename)
|
self.child_element(background, u'filename', filename)
|
||||||
|
|
||||||
def add_font(self, name, color, proportion, override, fonttype=u'main',
|
def add_font(self, name, color, proportion, override, fonttype=u'main',
|
||||||
weight=u'Normal', italics=u'False', indentation=0, xpos=0, ypos=0,
|
weight=u'Normal', italics=u'False', indentation=0, line_adjustment=0,
|
||||||
width=0, height=0):
|
xpos=0, ypos=0, width=0, height=0):
|
||||||
"""
|
"""
|
||||||
Add a Font.
|
Add a Font.
|
||||||
|
|
||||||
@ -227,6 +229,8 @@ class ThemeXML(object):
|
|||||||
self.child_element(background, u'italics', italics)
|
self.child_element(background, u'italics', italics)
|
||||||
#Create indentation name element
|
#Create indentation name element
|
||||||
self.child_element(background, u'indentation', unicode(indentation))
|
self.child_element(background, u'indentation', unicode(indentation))
|
||||||
|
#Create indentation name element
|
||||||
|
self.child_element(background, u'line_adjustment', unicode(line_adjustment))
|
||||||
|
|
||||||
#Create Location element
|
#Create Location element
|
||||||
element = self.theme_xml.createElement(u'location')
|
element = self.theme_xml.createElement(u'location')
|
||||||
|
@ -23,6 +23,16 @@
|
|||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
class HideMode(object):
|
||||||
|
"""
|
||||||
|
This is basically an enumeration class which specifies the mode of a Bible.
|
||||||
|
Mode refers to whether or not a Bible in OpenLP is a full Bible or needs to
|
||||||
|
be downloaded from the Internet on an as-needed basis.
|
||||||
|
"""
|
||||||
|
Blank = 1
|
||||||
|
Theme = 2
|
||||||
|
Screen = 3
|
||||||
|
|
||||||
from slidecontroller import HideMode
|
from slidecontroller import HideMode
|
||||||
from servicenoteform import ServiceNoteForm
|
from servicenoteform import ServiceNoteForm
|
||||||
from serviceitemeditform import ServiceItemEditForm
|
from serviceitemeditform import ServiceItemEditForm
|
||||||
@ -33,6 +43,7 @@ from maindisplay import DisplayManager
|
|||||||
from amendthemeform import AmendThemeForm
|
from amendthemeform import AmendThemeForm
|
||||||
from slidecontroller import SlideController
|
from slidecontroller import SlideController
|
||||||
from splashscreen import SplashScreen
|
from splashscreen import SplashScreen
|
||||||
|
from displaytab import DisplayTab
|
||||||
from generaltab import GeneralTab
|
from generaltab import GeneralTab
|
||||||
from themestab import ThemesTab
|
from themestab import ThemesTab
|
||||||
from aboutform import AboutForm
|
from aboutform import AboutForm
|
||||||
|
@ -178,16 +178,22 @@ class Ui_AmendThemeDialog(object):
|
|||||||
self.FontMainWeightLabel.setObjectName("FontMainWeightLabel")
|
self.FontMainWeightLabel.setObjectName("FontMainWeightLabel")
|
||||||
self.MainFontLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontMainWeightLabel)
|
self.MainFontLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontMainWeightLabel)
|
||||||
self.MainLeftLayout.addWidget(self.FontMainGroupBox)
|
self.MainLeftLayout.addWidget(self.FontMainGroupBox)
|
||||||
|
self.FontMainWrapLineAdjustmentLabel = QtGui.QLabel(self.FontMainGroupBox)
|
||||||
|
self.FontMainWrapLineAdjustmentLabel.setObjectName("FontMainWrapLineAdjustmentLabel")
|
||||||
|
self.MainFontLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.FontMainWrapLineAdjustmentLabel)
|
||||||
|
self.FontMainLineAdjustmentSpinBox = QtGui.QSpinBox(self.FontMainGroupBox)
|
||||||
|
self.FontMainLineAdjustmentSpinBox.setObjectName("FontMainLineAdjustmentSpinBox")
|
||||||
|
self.MainFontLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.FontMainLineAdjustmentSpinBox)
|
||||||
self.FontMainWrapIndentationLabel = QtGui.QLabel(self.FontMainGroupBox)
|
self.FontMainWrapIndentationLabel = QtGui.QLabel(self.FontMainGroupBox)
|
||||||
self.FontMainWrapIndentationLabel.setObjectName("FontMainWrapIndentationLabel")
|
self.FontMainWrapIndentationLabel.setObjectName("FontMainWrapIndentationLabel")
|
||||||
self.MainFontLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.FontMainWrapIndentationLabel)
|
self.MainFontLayout.setWidget(5, QtGui.QFormLayout.LabelRole, self.FontMainWrapIndentationLabel)
|
||||||
self.FontMainLineSpacingSpinBox = QtGui.QSpinBox(self.FontMainGroupBox)
|
self.FontMainLineSpacingSpinBox = QtGui.QSpinBox(self.FontMainGroupBox)
|
||||||
self.FontMainLineSpacingSpinBox.setObjectName("FontMainLineSpacingSpinBox")
|
self.FontMainLineSpacingSpinBox.setObjectName("FontMainLineSpacingSpinBox")
|
||||||
self.FontMainLineSpacingSpinBox.setMaximum(10)
|
self.FontMainLineSpacingSpinBox.setMaximum(10)
|
||||||
self.MainFontLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.FontMainLineSpacingSpinBox)
|
self.MainFontLayout.setWidget(5, QtGui.QFormLayout.FieldRole, self.FontMainLineSpacingSpinBox)
|
||||||
self.FontMainLinesPageLabel = QtGui.QLabel(self.FontMainGroupBox)
|
self.FontMainLinesPageLabel = QtGui.QLabel(self.FontMainGroupBox)
|
||||||
self.FontMainLinesPageLabel.setObjectName("FontMainLinesPageLabel")
|
self.FontMainLinesPageLabel.setObjectName("FontMainLinesPageLabel")
|
||||||
self.MainFontLayout.setWidget(5, QtGui.QFormLayout.LabelRole, self.FontMainLinesPageLabel)
|
self.MainFontLayout.setWidget(6, QtGui.QFormLayout.LabelRole, self.FontMainLinesPageLabel)
|
||||||
spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
|
spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
|
||||||
self.MainLeftLayout.addItem(spacerItem1)
|
self.MainLeftLayout.addItem(spacerItem1)
|
||||||
self.FontMainLayout.addWidget(self.MainLeftWidget)
|
self.FontMainLayout.addWidget(self.MainLeftWidget)
|
||||||
@ -620,6 +626,7 @@ class Ui_AmendThemeDialog(object):
|
|||||||
self.FontMainSize.setText(self.trUtf8('Size:'))
|
self.FontMainSize.setText(self.trUtf8('Size:'))
|
||||||
self.FontMainSizeSpinBox.setSuffix(self.trUtf8('pt'))
|
self.FontMainSizeSpinBox.setSuffix(self.trUtf8('pt'))
|
||||||
self.FontMainWrapIndentationLabel.setText(self.trUtf8('Wrap Indentation'))
|
self.FontMainWrapIndentationLabel.setText(self.trUtf8('Wrap Indentation'))
|
||||||
|
self.FontMainWrapLineAdjustmentLabel.setText(self.trUtf8('Adjust Line Spacing'))
|
||||||
self.FontMainWeightComboBox.setItemText(0, self.trUtf8('Normal'))
|
self.FontMainWeightComboBox.setItemText(0, self.trUtf8('Normal'))
|
||||||
self.FontMainWeightComboBox.setItemText(1, self.trUtf8('Bold'))
|
self.FontMainWeightComboBox.setItemText(1, self.trUtf8('Bold'))
|
||||||
self.FontMainWeightComboBox.setItemText(2, self.trUtf8('Italics'))
|
self.FontMainWeightComboBox.setItemText(2, self.trUtf8('Italics'))
|
||||||
|
@ -101,6 +101,9 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
|||||||
QtCore.QObject.connect(self.FontMainHeightSpinBox,
|
QtCore.QObject.connect(self.FontMainHeightSpinBox,
|
||||||
QtCore.SIGNAL(u'editingFinished()'),
|
QtCore.SIGNAL(u'editingFinished()'),
|
||||||
self.onFontMainHeightSpinBoxChanged)
|
self.onFontMainHeightSpinBoxChanged)
|
||||||
|
QtCore.QObject.connect(self.FontMainLineAdjustmentSpinBox,
|
||||||
|
QtCore.SIGNAL(u'editingFinished()'),
|
||||||
|
self.onFontMainLineAdjustmentSpinBoxChanged)
|
||||||
QtCore.QObject.connect(self.FontMainLineSpacingSpinBox,
|
QtCore.QObject.connect(self.FontMainLineSpacingSpinBox,
|
||||||
QtCore.SIGNAL(u'editingFinished()'),
|
QtCore.SIGNAL(u'editingFinished()'),
|
||||||
self.onFontMainLineSpacingSpinBoxChanged)
|
self.onFontMainLineSpacingSpinBoxChanged)
|
||||||
@ -130,7 +133,8 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
|||||||
QtCore.SIGNAL(u'editingFinished()'),
|
QtCore.SIGNAL(u'editingFinished()'),
|
||||||
self.onOutlineSpinBoxChanged)
|
self.onOutlineSpinBoxChanged)
|
||||||
QtCore.QObject.connect(self.SlideTransitionCheckedBox,
|
QtCore.QObject.connect(self.SlideTransitionCheckedBox,
|
||||||
QtCore.SIGNAL(u'stateChanged(int)'), self.onSlideTransitionCheckedBoxChanged)
|
QtCore.SIGNAL(u'stateChanged(int)'),
|
||||||
|
self.onSlideTransitionCheckedBoxChanged)
|
||||||
|
|
||||||
def accept(self):
|
def accept(self):
|
||||||
new_theme = ThemeXML()
|
new_theme = ThemeXML()
|
||||||
@ -142,10 +146,10 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
|||||||
new_theme.add_background_transparent()
|
new_theme.add_background_transparent()
|
||||||
else:
|
else:
|
||||||
if self.theme.background_type == u'solid':
|
if self.theme.background_type == u'solid':
|
||||||
new_theme.add_background_solid( \
|
new_theme.add_background_solid(
|
||||||
unicode(self.theme.background_color))
|
unicode(self.theme.background_color))
|
||||||
elif self.theme.background_type == u'gradient':
|
elif self.theme.background_type == u'gradient':
|
||||||
new_theme.add_background_gradient( \
|
new_theme.add_background_gradient(
|
||||||
unicode(self.theme.background_startColor),
|
unicode(self.theme.background_startColor),
|
||||||
unicode(self.theme.background_endColor),
|
unicode(self.theme.background_endColor),
|
||||||
self.theme.background_direction)
|
self.theme.background_direction)
|
||||||
@ -155,7 +159,6 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
|||||||
new_theme.add_background_image(filename)
|
new_theme.add_background_image(filename)
|
||||||
save_to = os.path.join(self.path, theme_name, filename)
|
save_to = os.path.join(self.path, theme_name, filename)
|
||||||
save_from = self.theme.background_filename
|
save_from = self.theme.background_filename
|
||||||
|
|
||||||
new_theme.add_font(unicode(self.theme.font_main_name),
|
new_theme.add_font(unicode(self.theme.font_main_name),
|
||||||
unicode(self.theme.font_main_color),
|
unicode(self.theme.font_main_color),
|
||||||
unicode(self.theme.font_main_proportion),
|
unicode(self.theme.font_main_proportion),
|
||||||
@ -163,6 +166,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
|||||||
unicode(self.theme.font_main_weight),
|
unicode(self.theme.font_main_weight),
|
||||||
unicode(self.theme.font_main_italics),
|
unicode(self.theme.font_main_italics),
|
||||||
unicode(self.theme.font_main_indentation),
|
unicode(self.theme.font_main_indentation),
|
||||||
|
unicode(self.theme.font_main_line_adjustment),
|
||||||
unicode(self.theme.font_main_x),
|
unicode(self.theme.font_main_x),
|
||||||
unicode(self.theme.font_main_y),
|
unicode(self.theme.font_main_y),
|
||||||
unicode(self.theme.font_main_width),
|
unicode(self.theme.font_main_width),
|
||||||
@ -173,11 +177,12 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
|||||||
unicode(self.theme.font_footer_override), u'footer',
|
unicode(self.theme.font_footer_override), u'footer',
|
||||||
unicode(self.theme.font_footer_weight),
|
unicode(self.theme.font_footer_weight),
|
||||||
unicode(self.theme.font_footer_italics),
|
unicode(self.theme.font_footer_italics),
|
||||||
0,
|
0, # indentation
|
||||||
|
0, # line adjustment
|
||||||
unicode(self.theme.font_footer_x),
|
unicode(self.theme.font_footer_x),
|
||||||
unicode(self.theme.font_footer_y),
|
unicode(self.theme.font_footer_y),
|
||||||
unicode(self.theme.font_footer_width),
|
unicode(self.theme.font_footer_width),
|
||||||
unicode(self.theme.font_footer_height) )
|
unicode(self.theme.font_footer_height))
|
||||||
new_theme.add_display(unicode(self.theme.display_shadow),
|
new_theme.add_display(unicode(self.theme.display_shadow),
|
||||||
unicode(self.theme.display_shadow_color),
|
unicode(self.theme.display_shadow_color),
|
||||||
unicode(self.theme.display_outline),
|
unicode(self.theme.display_outline),
|
||||||
@ -261,6 +266,8 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
|||||||
self.FontMainYSpinBox.setValue(self.theme.font_main_y)
|
self.FontMainYSpinBox.setValue(self.theme.font_main_y)
|
||||||
self.FontMainWidthSpinBox.setValue(self.theme.font_main_width)
|
self.FontMainWidthSpinBox.setValue(self.theme.font_main_width)
|
||||||
self.FontMainHeightSpinBox.setValue(self.theme.font_main_height)
|
self.FontMainHeightSpinBox.setValue(self.theme.font_main_height)
|
||||||
|
self.FontMainLineAdjustmentSpinBox.setValue(
|
||||||
|
self.theme.font_main_line_adjustment)
|
||||||
self.FontMainLineSpacingSpinBox.setValue(
|
self.FontMainLineSpacingSpinBox.setValue(
|
||||||
self.theme.font_main_indentation)
|
self.theme.font_main_indentation)
|
||||||
self.stateChanging(self.theme)
|
self.stateChanging(self.theme)
|
||||||
@ -281,6 +288,13 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
|||||||
self.theme.font_main_width = self.FontMainWidthSpinBox.value()
|
self.theme.font_main_width = self.FontMainWidthSpinBox.value()
|
||||||
self.previewTheme()
|
self.previewTheme()
|
||||||
|
|
||||||
|
def onFontMainLineAdjustmentSpinBoxChanged(self):
|
||||||
|
if self.theme.font_main_line_adjustment != \
|
||||||
|
self.FontMainLineAdjustmentSpinBox.value():
|
||||||
|
self.theme.font_main_line_adjustment = \
|
||||||
|
self.FontMainLineAdjustmentSpinBox.value()
|
||||||
|
self.previewTheme()
|
||||||
|
|
||||||
def onFontMainLineSpacingSpinBoxChanged(self):
|
def onFontMainLineSpacingSpinBoxChanged(self):
|
||||||
if self.theme.font_main_indentation != \
|
if self.theme.font_main_indentation != \
|
||||||
self.FontMainLineSpacingSpinBox.value():
|
self.FontMainLineSpacingSpinBox.value():
|
||||||
@ -687,7 +701,8 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
|||||||
if self.allowPreview:
|
if self.allowPreview:
|
||||||
#calculate main number of rows
|
#calculate main number of rows
|
||||||
metrics = self._getThemeMetrics()
|
metrics = self._getThemeMetrics()
|
||||||
line_height = metrics.height()
|
line_height = metrics.height() \
|
||||||
|
+ int(self.theme.font_main_line_adjustment)
|
||||||
if self.theme.display_shadow:
|
if self.theme.display_shadow:
|
||||||
line_height += int(self.theme.display_shadow_size)
|
line_height += int(self.theme.display_shadow_size)
|
||||||
if self.theme.display_outline:
|
if self.theme.display_outline:
|
||||||
@ -700,7 +715,6 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
|||||||
page_length))
|
page_length))
|
||||||
page_length_text = unicode(self.trUtf8('Slide Height is %s rows'))
|
page_length_text = unicode(self.trUtf8('Slide Height is %s rows'))
|
||||||
self.FontMainLinesPageLabel.setText(page_length_text % page_length)
|
self.FontMainLinesPageLabel.setText(page_length_text % page_length)
|
||||||
#a=c
|
|
||||||
frame = self.thememanager.generateImage(self.theme)
|
frame = self.thememanager.generateImage(self.theme)
|
||||||
self.ThemePreview.setPixmap(QtGui.QPixmap.fromImage(frame))
|
self.ThemePreview.setPixmap(QtGui.QPixmap.fromImage(frame))
|
||||||
|
|
||||||
|
235
openlp/core/ui/displaytab.py
Normal file
235
openlp/core/ui/displaytab.py
Normal file
@ -0,0 +1,235 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# OpenLP - Open Source Lyrics Projection #
|
||||||
|
# --------------------------------------------------------------------------- #
|
||||||
|
# Copyright (c) 2008-2010 Raoul Snyman #
|
||||||
|
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
|
||||||
|
# Gorven, Scott Guerrieri, Christian Richter, Maikel Stuivenberg, Martin #
|
||||||
|
# Thompson, Jon Tibble, Carsten Tinggaard #
|
||||||
|
# --------------------------------------------------------------------------- #
|
||||||
|
# This program is free software; you can redistribute it and/or modify it #
|
||||||
|
# under the terms of the GNU General Public License as published by the Free #
|
||||||
|
# Software Foundation; version 2 of the License. #
|
||||||
|
# #
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT #
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
|
||||||
|
# more details. #
|
||||||
|
# #
|
||||||
|
# You should have received a copy of the GNU General Public License along #
|
||||||
|
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||||
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
from PyQt4 import QtGui, QtCore
|
||||||
|
|
||||||
|
from openlp.core.lib import SettingsTab, Receiver
|
||||||
|
|
||||||
|
class DisplayTab(SettingsTab):
|
||||||
|
"""
|
||||||
|
Class documentation goes here.
|
||||||
|
"""
|
||||||
|
def __init__(self, screens):
|
||||||
|
"""
|
||||||
|
Constructor
|
||||||
|
"""
|
||||||
|
self.screens = screens
|
||||||
|
SettingsTab.__init__(self, u'Display')
|
||||||
|
|
||||||
|
def setupUi(self):
|
||||||
|
self.tabTitleVisible = self.trUtf8('Displays')
|
||||||
|
self.layoutWidget = QtGui.QWidget(self)
|
||||||
|
self.layoutWidget.setGeometry(QtCore.QRect(0, 40, 241, 79))
|
||||||
|
self.layoutWidget.setObjectName("layoutWidget")
|
||||||
|
self.verticalLayout = QtGui.QVBoxLayout(self.layoutWidget)
|
||||||
|
self.verticalLayout.setObjectName("verticalLayout")
|
||||||
|
self.CurrentGroupBox = QtGui.QGroupBox(self.layoutWidget)
|
||||||
|
self.CurrentGroupBox.setObjectName("CurrentGroupBox")
|
||||||
|
self.horizontalLayout = QtGui.QHBoxLayout(self.CurrentGroupBox)
|
||||||
|
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||||
|
self.verticalLayout_6 = QtGui.QVBoxLayout()
|
||||||
|
self.verticalLayout_6.setObjectName("verticalLayout_6")
|
||||||
|
self.XLabel = QtGui.QLabel(self.CurrentGroupBox)
|
||||||
|
self.XLabel.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
|
self.XLabel.setObjectName("XLabel")
|
||||||
|
self.verticalLayout_6.addWidget(self.XLabel)
|
||||||
|
self.Xpos = QtGui.QLabel(self.CurrentGroupBox)
|
||||||
|
self.Xpos.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
|
self.Xpos.setObjectName("Xpos")
|
||||||
|
self.verticalLayout_6.addWidget(self.Xpos)
|
||||||
|
self.horizontalLayout.addLayout(self.verticalLayout_6)
|
||||||
|
self.verticalLayout_7 = QtGui.QVBoxLayout()
|
||||||
|
self.verticalLayout_7.setObjectName("verticalLayout_7")
|
||||||
|
self.YLabel = QtGui.QLabel(self.CurrentGroupBox)
|
||||||
|
self.YLabel.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
|
self.YLabel.setObjectName("YLabel")
|
||||||
|
self.verticalLayout_7.addWidget(self.YLabel)
|
||||||
|
self.Ypos = QtGui.QLabel(self.CurrentGroupBox)
|
||||||
|
self.Ypos.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
|
self.Ypos.setObjectName("Ypos")
|
||||||
|
self.verticalLayout_7.addWidget(self.Ypos)
|
||||||
|
self.horizontalLayout.addLayout(self.verticalLayout_7)
|
||||||
|
self.verticalLayout_9 = QtGui.QVBoxLayout()
|
||||||
|
self.verticalLayout_9.setObjectName("verticalLayout_9")
|
||||||
|
self.HeightLabel = QtGui.QLabel(self.CurrentGroupBox)
|
||||||
|
self.HeightLabel.setMaximumSize(QtCore.QSize(100, 16777215))
|
||||||
|
self.HeightLabel.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
|
self.HeightLabel.setObjectName("HeightLabel")
|
||||||
|
self.verticalLayout_9.addWidget(self.HeightLabel)
|
||||||
|
self.Height = QtGui.QLabel(self.CurrentGroupBox)
|
||||||
|
self.Height.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
|
self.Height.setObjectName("Height")
|
||||||
|
self.verticalLayout_9.addWidget(self.Height)
|
||||||
|
self.horizontalLayout.addLayout(self.verticalLayout_9)
|
||||||
|
self.verticalLayout_8 = QtGui.QVBoxLayout()
|
||||||
|
self.verticalLayout_8.setObjectName("verticalLayout_8")
|
||||||
|
self.WidthLabel = QtGui.QLabel(self.CurrentGroupBox)
|
||||||
|
self.WidthLabel.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
|
self.WidthLabel.setObjectName("WidthLabel")
|
||||||
|
self.verticalLayout_8.addWidget(self.WidthLabel)
|
||||||
|
self.Width = QtGui.QLabel(self.CurrentGroupBox)
|
||||||
|
self.Width.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
|
self.Width.setObjectName("Width")
|
||||||
|
self.verticalLayout_8.addWidget(self.Width)
|
||||||
|
self.horizontalLayout.addLayout(self.verticalLayout_8)
|
||||||
|
self.verticalLayout.addWidget(self.CurrentGroupBox)
|
||||||
|
self.CurrentGroupBox_2 = QtGui.QGroupBox(self)
|
||||||
|
self.CurrentGroupBox_2.setGeometry(QtCore.QRect(0, 130, 248, 87))
|
||||||
|
self.CurrentGroupBox_2.setMaximumSize(QtCore.QSize(500, 16777215))
|
||||||
|
self.CurrentGroupBox_2.setObjectName("CurrentGroupBox_2")
|
||||||
|
self.horizontalLayout_2 = QtGui.QHBoxLayout(self.CurrentGroupBox_2)
|
||||||
|
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||||
|
self.verticalLayout_2 = QtGui.QVBoxLayout()
|
||||||
|
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||||
|
self.XAmendLabel = QtGui.QLabel(self.CurrentGroupBox_2)
|
||||||
|
self.XAmendLabel.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
|
self.XAmendLabel.setObjectName("XAmendLabel")
|
||||||
|
self.verticalLayout_2.addWidget(self.XAmendLabel)
|
||||||
|
self.XposEdit = QtGui.QLineEdit(self.CurrentGroupBox_2)
|
||||||
|
self.XposEdit.setMaximumSize(QtCore.QSize(50, 16777215))
|
||||||
|
self.XposEdit.setMaxLength(4)
|
||||||
|
self.XposEdit.setObjectName("XposEdit")
|
||||||
|
self.verticalLayout_2.addWidget(self.XposEdit)
|
||||||
|
self.horizontalLayout_2.addLayout(self.verticalLayout_2)
|
||||||
|
self.verticalLayout_3 = QtGui.QVBoxLayout()
|
||||||
|
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||||
|
self.YAmendLabel = QtGui.QLabel(self.CurrentGroupBox_2)
|
||||||
|
self.YAmendLabel.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
|
self.YAmendLabel.setObjectName("YAmendLabel")
|
||||||
|
self.verticalLayout_3.addWidget(self.YAmendLabel)
|
||||||
|
self.YposEdit = QtGui.QLineEdit(self.CurrentGroupBox_2)
|
||||||
|
self.YposEdit.setMaximumSize(QtCore.QSize(50, 16777215))
|
||||||
|
self.YposEdit.setMaxLength(4)
|
||||||
|
self.YposEdit.setObjectName("YposEdit")
|
||||||
|
self.verticalLayout_3.addWidget(self.YposEdit)
|
||||||
|
self.horizontalLayout_2.addLayout(self.verticalLayout_3)
|
||||||
|
self.verticalLayout_4 = QtGui.QVBoxLayout()
|
||||||
|
self.verticalLayout_4.setObjectName("verticalLayout_4")
|
||||||
|
self.HeightAmendLabel = QtGui.QLabel(self.CurrentGroupBox_2)
|
||||||
|
self.HeightAmendLabel.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
|
self.HeightAmendLabel.setObjectName("HeightAmendLabel")
|
||||||
|
self.verticalLayout_4.addWidget(self.HeightAmendLabel)
|
||||||
|
self.HeightEdit = QtGui.QLineEdit(self.CurrentGroupBox_2)
|
||||||
|
self.HeightEdit.setMaximumSize(QtCore.QSize(50, 16777215))
|
||||||
|
self.HeightEdit.setMaxLength(4)
|
||||||
|
self.HeightEdit.setObjectName("HeightEdit")
|
||||||
|
self.verticalLayout_4.addWidget(self.HeightEdit)
|
||||||
|
self.horizontalLayout_2.addLayout(self.verticalLayout_4)
|
||||||
|
self.verticalLayout_5 = QtGui.QVBoxLayout()
|
||||||
|
self.verticalLayout_5.setSizeConstraint(QtGui.QLayout.SetMinimumSize)
|
||||||
|
self.verticalLayout_5.setObjectName("verticalLayout_5")
|
||||||
|
self.WidthAmendLabel = QtGui.QLabel(self.CurrentGroupBox_2)
|
||||||
|
self.WidthAmendLabel.setMaximumSize(QtCore.QSize(100, 16777215))
|
||||||
|
self.WidthAmendLabel.setAlignment(QtCore.Qt.AlignCenter)
|
||||||
|
self.WidthAmendLabel.setObjectName("WidthAmendLabel")
|
||||||
|
self.verticalLayout_5.addWidget(self.WidthAmendLabel)
|
||||||
|
self.WidthEdit = QtGui.QLineEdit(self.CurrentGroupBox_2)
|
||||||
|
self.WidthEdit.setMaximumSize(QtCore.QSize(60, 16777215))
|
||||||
|
self.WidthEdit.setObjectName("WidthEdit")
|
||||||
|
self.verticalLayout_5.addWidget(self.WidthEdit)
|
||||||
|
self.horizontalLayout_2.addLayout(self.verticalLayout_5)
|
||||||
|
self.OverrideCheckBox = QtGui.QCheckBox(self)
|
||||||
|
self.OverrideCheckBox.setGeometry(QtCore.QRect(0, 10, 191, 23))
|
||||||
|
self.OverrideCheckBox.setObjectName("OverrideCheckBox")
|
||||||
|
QtCore.QMetaObject.connectSlotsByName(self)
|
||||||
|
QtCore.QObject.connect(self.OverrideCheckBox,
|
||||||
|
QtCore.SIGNAL(u'stateChanged(int)'),
|
||||||
|
self.onOverrideCheckBoxChanged)
|
||||||
|
|
||||||
|
def retranslateUi(self):
|
||||||
|
self.setWindowTitle(QtGui.QApplication.translate("self", "Amend Display Settings", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
|
self.CurrentGroupBox.setTitle(QtGui.QApplication.translate("self", "Default Settings", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
|
self.XLabel.setText(QtGui.QApplication.translate("self", "X", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
|
self.Xpos.setText(QtGui.QApplication.translate("self", "0", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
|
self.YLabel.setText(QtGui.QApplication.translate("self", "Y", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
|
self.Ypos.setText(QtGui.QApplication.translate("self", "0", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
|
self.HeightLabel.setText(QtGui.QApplication.translate("self", "Height", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
|
self.Height.setText(QtGui.QApplication.translate("self", "0", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
|
self.WidthLabel.setText(QtGui.QApplication.translate("self", "Width", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
|
self.Width.setText(QtGui.QApplication.translate("self", "0", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
|
self.CurrentGroupBox_2.setTitle(QtGui.QApplication.translate("self", "Amend Settings", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
|
self.XAmendLabel.setText(QtGui.QApplication.translate("self", "X", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
|
self.YAmendLabel.setText(QtGui.QApplication.translate("self", "Y", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
|
self.HeightAmendLabel.setText(QtGui.QApplication.translate("self", "Height", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
|
self.WidthAmendLabel.setText(QtGui.QApplication.translate("self", "Width", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
|
self.OverrideCheckBox.setText(QtGui.QApplication.translate("self", "Override Output Display", None, QtGui.QApplication.UnicodeUTF8))
|
||||||
|
|
||||||
|
def load(self):
|
||||||
|
settings = QtCore.QSettings()
|
||||||
|
settings.beginGroup(self.settingsSection)
|
||||||
|
self.Xpos.setText(unicode(self.screens.current[u'size'].x()))
|
||||||
|
self.Ypos.setText(unicode(self.screens.current[u'size'].y()))
|
||||||
|
self.Height.setText(unicode(self.screens.current[u'size'].height()))
|
||||||
|
self.Width.setText(unicode(self.screens.current[u'size'].width()))
|
||||||
|
xpos = settings.value(u'x position',
|
||||||
|
QtCore.QVariant(self.screens.current[u'size'].x())).toString()
|
||||||
|
self.XposEdit.setText(xpos)
|
||||||
|
ypos = settings.value(u'y position',
|
||||||
|
QtCore.QVariant(self.screens.current[u'size'].y())).toString()
|
||||||
|
self.YposEdit.setText(ypos)
|
||||||
|
height = settings.value(u'height',
|
||||||
|
QtCore.QVariant(self.screens.current[u'size'].height())).toString()
|
||||||
|
self.HeightEdit.setText(height)
|
||||||
|
width = settings.value(u'width',
|
||||||
|
QtCore.QVariant(self.screens.current[u'size'].width())).toString()
|
||||||
|
self.WidthEdit.setText(width)
|
||||||
|
self.amend_display = settings.value(u'amend display',
|
||||||
|
QtCore.QVariant(False)).toBool()
|
||||||
|
self.OverrideCheckBox.setChecked(self.amend_display)
|
||||||
|
self.amend_display_start = self.amend_display
|
||||||
|
|
||||||
|
def onOverrideCheckBoxChanged(self, check_state):
|
||||||
|
self.amend_display = False
|
||||||
|
# we have a set value convert to True/False
|
||||||
|
if check_state == QtCore.Qt.Checked:
|
||||||
|
self.amend_display = True
|
||||||
|
|
||||||
|
def save(self):
|
||||||
|
settings = QtCore.QSettings()
|
||||||
|
settings.beginGroup(self.settingsSection)
|
||||||
|
settings.setValue('x position',
|
||||||
|
QtCore.QVariant(self.XposEdit.text()))
|
||||||
|
settings.setValue('y position',
|
||||||
|
QtCore.QVariant(self.YposEdit.text()))
|
||||||
|
settings.setValue('height',
|
||||||
|
QtCore.QVariant(self.HeightEdit.text()))
|
||||||
|
settings.setValue('width',
|
||||||
|
QtCore.QVariant(self.WidthEdit.text()))
|
||||||
|
settings.setValue('amend display',
|
||||||
|
QtCore.QVariant(self.amend_display))
|
||||||
|
self.postSetUp()
|
||||||
|
|
||||||
|
def postSetUp(self):
|
||||||
|
self.screens.override[u'size'] = QtCore.QRect(int(self.XposEdit.text()),\
|
||||||
|
int(self.YposEdit.text()), int(self.WidthEdit.text()),\
|
||||||
|
int(self.HeightEdit.text()))
|
||||||
|
if self.amend_display:
|
||||||
|
self.screens.set_override_display()
|
||||||
|
else:
|
||||||
|
self.screens.reset_current_display()
|
||||||
|
#only trigger event if data has changed in this edit session
|
||||||
|
if self.amend_display_start != self.amend_display:
|
||||||
|
self.amend_display_start = self.amend_display
|
||||||
|
Receiver.send_message(u'config_screen_changed')
|
@ -181,7 +181,7 @@ class GeneralTab(SettingsTab):
|
|||||||
self.MonitorLabel.setText(
|
self.MonitorLabel.setText(
|
||||||
self.trUtf8('Select monitor for output display:'))
|
self.trUtf8('Select monitor for output display:'))
|
||||||
self.DisplayOnMonitorCheck.setText(
|
self.DisplayOnMonitorCheck.setText(
|
||||||
self.trUtf8('Display if in single screen'))
|
self.trUtf8('Display if a single screen'))
|
||||||
self.StartupGroupBox.setTitle(self.trUtf8('Application Startup'))
|
self.StartupGroupBox.setTitle(self.trUtf8('Application Startup'))
|
||||||
self.WarningCheckBox.setText(self.trUtf8('Show blank screen warning'))
|
self.WarningCheckBox.setText(self.trUtf8('Show blank screen warning'))
|
||||||
self.AutoOpenCheckBox.setText(
|
self.AutoOpenCheckBox.setText(
|
||||||
|
@ -34,12 +34,12 @@ from openlp.core.ui import HideMode
|
|||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class DisplayManager(QtGui.QWidget):
|
class DisplayManager(QtGui.QWidget):
|
||||||
"""
|
"""
|
||||||
Wrapper class to hold the display widgets.
|
Wrapper class to hold the display widgets.
|
||||||
I will provide API's in future to access the screens allow for
|
I will provide API's in future to access the screens allow for
|
||||||
extra displays to be added.
|
extra displays to be added.
|
||||||
|
RenderManager is poked in by MainWindow
|
||||||
"""
|
"""
|
||||||
def __init__(self, screens):
|
def __init__(self, screens):
|
||||||
QtGui.QWidget.__init__(self)
|
QtGui.QWidget.__init__(self)
|
||||||
@ -130,31 +130,30 @@ class MainDisplay(DisplayWidget):
|
|||||||
self.displayBlank = False
|
self.displayBlank = False
|
||||||
self.blankFrame = None
|
self.blankFrame = None
|
||||||
self.frame = None
|
self.frame = None
|
||||||
self.firstTime = True
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
self.hasTransition = False
|
QtCore.SIGNAL(u'videodisplay_start'), self.hideDisplayForVideo)
|
||||||
self.mediaBackground = False
|
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'maindisplay_hide'), self.hideDisplay)
|
QtCore.SIGNAL(u'maindisplay_hide'), self.hideDisplay)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'maindisplay_show'), self.showDisplay)
|
QtCore.SIGNAL(u'maindisplay_show'), self.showDisplay)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'videodisplay_start'), self.hideDisplay)
|
QtCore.SIGNAL(u'videodisplay_background'), self.hideDisplayForVideo)
|
||||||
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
"""
|
"""
|
||||||
Sets up the screen on a particular screen.
|
Sets up the screen on a particular screen.
|
||||||
"""
|
"""
|
||||||
log.debug(u'Setup %s for %s ' %(self.screens,
|
log.debug(u'Setup %s for %s ' % (
|
||||||
self.screens.monitor_number))
|
self.screens, self.screens.monitor_number))
|
||||||
self.setVisible(False)
|
self.setVisible(False)
|
||||||
self.screen = self.screens.current
|
self.screen = self.screens.current
|
||||||
#Sort out screen locations and sizes
|
#Sort out screen locations and sizes
|
||||||
self.setGeometry(self.screen[u'size'])
|
|
||||||
self.display_alert.setGeometry(self.screen[u'size'])
|
self.display_alert.setGeometry(self.screen[u'size'])
|
||||||
self.display_image.resize(self.screen[u'size'].width(),
|
self.display_image.resize(
|
||||||
self.screen[u'size'].height())
|
self.screen[u'size'].width(), self.screen[u'size'].height())
|
||||||
self.display_text.resize(self.screen[u'size'].width(),
|
self.display_text.resize(
|
||||||
self.screen[u'size'].height())
|
self.screen[u'size'].width(), self.screen[u'size'].height())
|
||||||
|
self.setGeometry(self.screen[u'size'])
|
||||||
#Build a custom splash screen
|
#Build a custom splash screen
|
||||||
self.InitialFrame = QtGui.QImage(
|
self.InitialFrame = QtGui.QImage(
|
||||||
self.screen[u'size'].width(),
|
self.screen[u'size'].width(),
|
||||||
@ -179,8 +178,8 @@ class MainDisplay(DisplayWidget):
|
|||||||
painter.begin(self.blankFrame)
|
painter.begin(self.blankFrame)
|
||||||
painter.fillRect(self.blankFrame.rect(), QtCore.Qt.black)
|
painter.fillRect(self.blankFrame.rect(), QtCore.Qt.black)
|
||||||
#build a blank transparent image
|
#build a blank transparent image
|
||||||
self.transparent = QtGui.QPixmap(self.screen[u'size'].width(),
|
self.transparent = QtGui.QPixmap(
|
||||||
self.screen[u'size'].height())
|
self.screen[u'size'].width(), self.screen[u'size'].height())
|
||||||
self.transparent.fill(QtCore.Qt.transparent)
|
self.transparent.fill(QtCore.Qt.transparent)
|
||||||
self.display_alert.setPixmap(self.transparent)
|
self.display_alert.setPixmap(self.transparent)
|
||||||
self.display_text.setPixmap(self.transparent)
|
self.display_text.setPixmap(self.transparent)
|
||||||
@ -201,31 +200,63 @@ class MainDisplay(DisplayWidget):
|
|||||||
else:
|
else:
|
||||||
self.showFullScreen()
|
self.showFullScreen()
|
||||||
|
|
||||||
def hideDisplay(self):
|
def hideDisplayForVideo(self):
|
||||||
log.debug(u'hideDisplay')
|
"""
|
||||||
self.display_image.setPixmap(self.transparent)
|
Hides the main display if for the video to be played
|
||||||
|
"""
|
||||||
|
self.hideDisplay(HideMode.Screen)
|
||||||
|
|
||||||
|
def hideDisplay(self, mode=HideMode.Screen):
|
||||||
|
"""
|
||||||
|
Hide the display by making all layers transparent
|
||||||
|
Store the images so they can be replaced when required
|
||||||
|
"""
|
||||||
|
log.debug(u'hideDisplay mode = %d', mode)
|
||||||
|
self.storeImage = QtGui.QPixmap(self.display_image.pixmap())
|
||||||
|
self.storeText = QtGui.QPixmap(self.display_text.pixmap())
|
||||||
self.display_alert.setPixmap(self.transparent)
|
self.display_alert.setPixmap(self.transparent)
|
||||||
self.display_text.setPixmap(self.transparent)
|
self.display_text.setPixmap(self.transparent)
|
||||||
|
if mode == HideMode.Screen:
|
||||||
|
self.display_image.setPixmap(self.transparent)
|
||||||
|
elif mode == HideMode.Blank:
|
||||||
|
self.display_image.setPixmap(
|
||||||
|
QtGui.QPixmap.fromImage(self.blankFrame))
|
||||||
|
else:
|
||||||
|
if self.parent.renderManager.renderer.bg_frame:
|
||||||
|
self.display_image.setPixmap(QtGui.QPixmap.fromImage(
|
||||||
|
self.parent.renderManager.renderer.bg_frame))
|
||||||
|
else:
|
||||||
|
self.display_image.setPixmap(
|
||||||
|
QtGui.QPixmap.fromImage(self.blankFrame))
|
||||||
self.moveToTop()
|
self.moveToTop()
|
||||||
|
|
||||||
def moveToTop(self):
|
def moveToTop(self):
|
||||||
log.debug(u'moveToTop')
|
log.debug(u'moveToTop')
|
||||||
self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint \
|
self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint |
|
||||||
| QtCore.Qt.FramelessWindowHint | QtCore.Qt.Dialog)
|
QtCore.Qt.FramelessWindowHint | QtCore.Qt.Dialog)
|
||||||
self.show()
|
self.show()
|
||||||
|
|
||||||
def showDisplay(self):
|
def showDisplay(self):
|
||||||
|
"""
|
||||||
|
Show the stored layers so the screen reappears as it was
|
||||||
|
originally.
|
||||||
|
Make the stored images None to release memory.
|
||||||
|
"""
|
||||||
log.debug(u'showDisplay')
|
log.debug(u'showDisplay')
|
||||||
if not self.primary:
|
if self.storeImage:
|
||||||
self.setVisible(True)
|
self.display_image.setPixmap(self.storeImage)
|
||||||
self.showFullScreen()
|
self.display_alert.setPixmap(self.transparent)
|
||||||
|
if self.storeText:
|
||||||
|
self.display_text.setPixmap(self.storeText)
|
||||||
|
self.storeImage = None
|
||||||
|
self.store = None
|
||||||
|
self.moveToTop()
|
||||||
Receiver.send_message(u'maindisplay_active')
|
Receiver.send_message(u'maindisplay_active')
|
||||||
|
|
||||||
def addImageWithText(self, frame):
|
def addImageWithText(self, frame):
|
||||||
log.debug(u'addImageWithText')
|
log.debug(u'addImageWithText')
|
||||||
frame = resize_image(frame,
|
frame = resize_image(
|
||||||
self.screen[u'size'].width(),
|
frame, self.screen[u'size'].width(), self.screen[u'size'].height())
|
||||||
self.screen[u'size'].height() )
|
|
||||||
self.display_image.setPixmap(QtGui.QPixmap.fromImage(frame))
|
self.display_image.setPixmap(QtGui.QPixmap.fromImage(frame))
|
||||||
self.moveToTop()
|
self.moveToTop()
|
||||||
|
|
||||||
@ -280,27 +311,6 @@ class MainDisplay(DisplayWidget):
|
|||||||
self.waitingFrame = frame
|
self.waitingFrame = frame
|
||||||
self.waitingFrameTrans = transition
|
self.waitingFrameTrans = transition
|
||||||
|
|
||||||
def blankDisplay(self, blankType=HideMode.Blank, blanked=True):
|
|
||||||
log.debug(u'Blank main Display %d' % blanked)
|
|
||||||
if blanked:
|
|
||||||
self.displayBlank = True
|
|
||||||
if blankType == HideMode.Blank:
|
|
||||||
self.display_text.setPixmap(
|
|
||||||
QtGui.QPixmap.fromImage(self.blankFrame))
|
|
||||||
elif blankType == HideMode.Theme:
|
|
||||||
theme = self.parent.RenderManager.renderer.bg_frame
|
|
||||||
if not theme:
|
|
||||||
theme = self.blankFrame
|
|
||||||
self.display_text.setPixmap(QtGui.QPixmap.fromImage(theme))
|
|
||||||
self.waitingFrame = None
|
|
||||||
self.waitingFrameTrans = False
|
|
||||||
else:
|
|
||||||
self.displayBlank = False
|
|
||||||
if self.waitingFrame:
|
|
||||||
self.frameView(self.waitingFrame, self.waitingFrameTrans)
|
|
||||||
elif self.display_frame:
|
|
||||||
self.frameView(self.display_frame)
|
|
||||||
|
|
||||||
class VideoDisplay(Phonon.VideoWidget):
|
class VideoDisplay(Phonon.VideoWidget):
|
||||||
"""
|
"""
|
||||||
This is the form that is used to display videos on the projector.
|
This is the form that is used to display videos on the projector.
|
||||||
@ -323,11 +333,19 @@ class VideoDisplay(Phonon.VideoWidget):
|
|||||||
self.setWindowTitle(u'OpenLP Video Display')
|
self.setWindowTitle(u'OpenLP Video Display')
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.screens = screens
|
self.screens = screens
|
||||||
|
self.hidden = False
|
||||||
|
self.background = False
|
||||||
self.mediaObject = Phonon.MediaObject()
|
self.mediaObject = Phonon.MediaObject()
|
||||||
self.setAspectRatio(aspect)
|
self.setAspectRatio(aspect)
|
||||||
self.audioObject = Phonon.AudioOutput(Phonon.VideoCategory)
|
self.audioObject = Phonon.AudioOutput(Phonon.VideoCategory)
|
||||||
Phonon.createPath(self.mediaObject, self)
|
Phonon.createPath(self.mediaObject, self)
|
||||||
Phonon.createPath(self.mediaObject, self.audioObject)
|
Phonon.createPath(self.mediaObject, self.audioObject)
|
||||||
|
self.setWindowFlags(QtCore.Qt.WindowStaysOnBottomHint |
|
||||||
|
QtCore.Qt.FramelessWindowHint | QtCore.Qt.Dialog)
|
||||||
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
|
QtCore.SIGNAL(u'maindisplay_hide'), self.mediaHide)
|
||||||
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
|
QtCore.SIGNAL(u'maindisplay_show'), self.mediaShow)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'videodisplay_start'), self.onMediaQueue)
|
QtCore.SIGNAL(u'videodisplay_start'), self.onMediaQueue)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
@ -336,8 +354,13 @@ class VideoDisplay(Phonon.VideoWidget):
|
|||||||
QtCore.SIGNAL(u'videodisplay_pause'), self.onMediaPause)
|
QtCore.SIGNAL(u'videodisplay_pause'), self.onMediaPause)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'videodisplay_stop'), self.onMediaStop)
|
QtCore.SIGNAL(u'videodisplay_stop'), self.onMediaStop)
|
||||||
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
|
QtCore.SIGNAL(u'videodisplay_background'), self.onMediaBackground)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'config_updated'), self.setup)
|
QtCore.SIGNAL(u'config_updated'), self.setup)
|
||||||
|
QtCore.QObject.connect(self.mediaObject,
|
||||||
|
QtCore.SIGNAL(u'finished()'), self.onMediaBackground)
|
||||||
|
self.setVisible(False)
|
||||||
|
|
||||||
def keyPressEvent(self, event):
|
def keyPressEvent(self, event):
|
||||||
if type(event) == QtGui.QKeyEvent:
|
if type(event) == QtGui.QKeyEvent:
|
||||||
@ -353,29 +376,42 @@ class VideoDisplay(Phonon.VideoWidget):
|
|||||||
"""
|
"""
|
||||||
Sets up the screen on a particular screen.
|
Sets up the screen on a particular screen.
|
||||||
"""
|
"""
|
||||||
log.debug(u'VideoDisplay Setup %s for %s ' %(self.screens,
|
log.debug(u'VideoDisplay Setup %s for %s ' % (self.screens,
|
||||||
self.screens.monitor_number))
|
self.screens.monitor_number))
|
||||||
self.setVisible(False)
|
|
||||||
self.screen = self.screens.current
|
self.screen = self.screens.current
|
||||||
#Sort out screen locations and sizes
|
#Sort out screen locations and sizes
|
||||||
self.setGeometry(self.screen[u'size'])
|
self.setGeometry(self.screen[u'size'])
|
||||||
# To display or not to display?
|
# To display or not to display?
|
||||||
if not self.screen[u'primary']:
|
if not self.screen[u'primary'] and self.isVisible():
|
||||||
self.showFullScreen()
|
self.showFullScreen()
|
||||||
self.primary = False
|
self.primary = False
|
||||||
else:
|
else:
|
||||||
self.setVisible(False)
|
self.setVisible(False)
|
||||||
self.primary = True
|
self.primary = True
|
||||||
|
|
||||||
|
def onMediaBackground(self, message):
|
||||||
|
if not message:
|
||||||
|
message = self.message
|
||||||
|
log.debug(u'VideoDisplay Queue new media message %s' % message)
|
||||||
|
self.mediaObject.setCurrentSource(Phonon.MediaSource(message))
|
||||||
|
self.message = message
|
||||||
|
self.background = True
|
||||||
|
self._play()
|
||||||
|
|
||||||
def onMediaQueue(self, message):
|
def onMediaQueue(self, message):
|
||||||
log.debug(u'VideoDisplay Queue new media message %s' % message)
|
log.debug(u'VideoDisplay Queue new media message %s' % message)
|
||||||
file = os.path.join(message[0].get_frame_path(),
|
file = os.path.join(message[0].get_frame_path(),
|
||||||
message[0].get_frame_title())
|
message[0].get_frame_title())
|
||||||
source = self.mediaObject.setCurrentSource(Phonon.MediaSource(file))
|
self.mediaObject.setCurrentSource(Phonon.MediaSource(file))
|
||||||
self.onMediaPlay()
|
self._play()
|
||||||
|
|
||||||
def onMediaPlay(self):
|
def onMediaPlay(self):
|
||||||
log.debug(u'VideoDisplay Play the new media, Live ')
|
if not self.hidden:
|
||||||
|
log.debug(u'VideoDisplay Play the new media, Live ')
|
||||||
|
self._play()
|
||||||
|
|
||||||
|
def _play(self):
|
||||||
|
log.debug(u'VideoDisplay _play called')
|
||||||
self.mediaObject.play()
|
self.mediaObject.play()
|
||||||
self.setVisible(True)
|
self.setVisible(True)
|
||||||
self.showFullScreen()
|
self.showFullScreen()
|
||||||
@ -387,6 +423,8 @@ class VideoDisplay(Phonon.VideoWidget):
|
|||||||
|
|
||||||
def onMediaStop(self):
|
def onMediaStop(self):
|
||||||
log.debug(u'VideoDisplay Media stopped by user')
|
log.debug(u'VideoDisplay Media stopped by user')
|
||||||
|
self.background = False
|
||||||
|
self.message = None
|
||||||
self.mediaObject.stop()
|
self.mediaObject.stop()
|
||||||
self.onMediaFinish()
|
self.onMediaFinish()
|
||||||
|
|
||||||
@ -394,3 +432,13 @@ class VideoDisplay(Phonon.VideoWidget):
|
|||||||
log.debug(u'VideoDisplay Reached end of media playlist')
|
log.debug(u'VideoDisplay Reached end of media playlist')
|
||||||
self.mediaObject.clearQueue()
|
self.mediaObject.clearQueue()
|
||||||
self.setVisible(False)
|
self.setVisible(False)
|
||||||
|
|
||||||
|
def mediaHide(self):
|
||||||
|
self.mediaObject.pause()
|
||||||
|
self.hidden = True
|
||||||
|
self.setVisible(False)
|
||||||
|
|
||||||
|
def mediaShow(self):
|
||||||
|
if self.hidden:
|
||||||
|
self.hidden = False
|
||||||
|
self._play()
|
||||||
|
@ -424,8 +424,12 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
QtGui.QMainWindow.__init__(self)
|
QtGui.QMainWindow.__init__(self)
|
||||||
self.screens = screens
|
self.screens = screens
|
||||||
self.applicationVersion = applicationVersion
|
self.applicationVersion = applicationVersion
|
||||||
self.generalSettingsSection = u'general'
|
# Set up settings sections for the main application
|
||||||
|
# (not for use by plugins)
|
||||||
self.uiSettingsSection = u'user interface'
|
self.uiSettingsSection = u'user interface'
|
||||||
|
self.generalSettingsSection = u'general'
|
||||||
|
self.serviceSettingsSection = u'servicemanager'
|
||||||
|
self.songsSettingsSection = u'songs'
|
||||||
self.serviceNotSaved = False
|
self.serviceNotSaved = False
|
||||||
self.settingsmanager = SettingsManager(screens)
|
self.settingsmanager = SettingsManager(screens)
|
||||||
self.displayManager = DisplayManager(screens)
|
self.displayManager = DisplayManager(screens)
|
||||||
@ -509,6 +513,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
#ThemeManager needs to call RenderManager
|
#ThemeManager needs to call RenderManager
|
||||||
self.RenderManager = RenderManager(
|
self.RenderManager = RenderManager(
|
||||||
self.ThemeManagerContents, self.screens)
|
self.ThemeManagerContents, self.screens)
|
||||||
|
self.displayManager.renderManager = self.RenderManager
|
||||||
#Define the media Dock Manager
|
#Define the media Dock Manager
|
||||||
self.mediaDockManager = MediaDockManager(self.MediaToolBox)
|
self.mediaDockManager = MediaDockManager(self.MediaToolBox)
|
||||||
log.info(u'Load Plugins')
|
log.info(u'Load Plugins')
|
||||||
@ -570,7 +575,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
if self.displayManager.mainDisplay.isVisible():
|
if self.displayManager.mainDisplay.isVisible():
|
||||||
self.displayManager.mainDisplay.setFocus()
|
self.displayManager.mainDisplay.setFocus()
|
||||||
self.activateWindow()
|
self.activateWindow()
|
||||||
if QtCore.QSettings().value(self.generalSettingsSection + u'/auto open',
|
if QtCore.QSettings().value(
|
||||||
|
self.generalSettingsSection + u'/auto open',
|
||||||
QtCore.QVariant(False)).toBool():
|
QtCore.QVariant(False)).toBool():
|
||||||
self.ServiceManagerContents.onLoadService(True)
|
self.ServiceManagerContents.onLoadService(True)
|
||||||
|
|
||||||
@ -725,8 +731,9 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
def loadSettings(self):
|
def loadSettings(self):
|
||||||
log.debug(u'Loading QSettings')
|
log.debug(u'Loading QSettings')
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
self.recentFiles = settings.value(
|
settings.beginGroup(self.generalSettingsSection)
|
||||||
self.generalSettingsSection + u'/recent files').toStringList()
|
self.recentFiles = settings.value(u'recent files').toStringList()
|
||||||
|
settings.endGroup()
|
||||||
settings.beginGroup(self.uiSettingsSection)
|
settings.beginGroup(self.uiSettingsSection)
|
||||||
self.move(settings.value(u'main window position',
|
self.move(settings.value(u'main window position',
|
||||||
QtCore.QVariant(QtCore.QPoint(0, 0))).toPoint())
|
QtCore.QVariant(QtCore.QPoint(0, 0))).toPoint())
|
||||||
@ -738,10 +745,11 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
|||||||
def saveSettings(self):
|
def saveSettings(self):
|
||||||
log.debug(u'Saving QSettings')
|
log.debug(u'Saving QSettings')
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
|
settings.beginGroup(self.generalSettingsSection)
|
||||||
recentFiles = QtCore.QVariant(self.recentFiles) \
|
recentFiles = QtCore.QVariant(self.recentFiles) \
|
||||||
if self.recentFiles else QtCore.QVariant()
|
if self.recentFiles else QtCore.QVariant()
|
||||||
settings.setValue(
|
settings.setValue(u'recent files', recentFiles)
|
||||||
self.generalSettingsSection + u'/recent files', recentFiles)
|
settings.endGroup()
|
||||||
settings.beginGroup(self.uiSettingsSection)
|
settings.beginGroup(self.uiSettingsSection)
|
||||||
settings.setValue(u'main window position',
|
settings.setValue(u'main window position',
|
||||||
QtCore.QVariant(self.pos()))
|
QtCore.QVariant(self.pos()))
|
||||||
|
@ -45,18 +45,17 @@ class MediaDockManager(object):
|
|||||||
log.debug(u'Inserting %s dock' % media_item.title)
|
log.debug(u'Inserting %s dock' % media_item.title)
|
||||||
match = False
|
match = False
|
||||||
for dock_index in range(0, self.media_dock.count()):
|
for dock_index in range(0, self.media_dock.count()):
|
||||||
if self.media_dock.widget(dock_index).SettingsSection == \
|
if self.media_dock.widget(dock_index).settingsSection == \
|
||||||
media_item.title.lower():
|
media_item.title.lower():
|
||||||
match = True
|
match = True
|
||||||
break
|
break
|
||||||
if not match:
|
if not match:
|
||||||
self.media_dock.addItem(media_item, icon, media_item.title)
|
self.media_dock.addItem(media_item, icon, media_item.title)
|
||||||
|
|
||||||
|
|
||||||
def remove_dock(self, name):
|
def remove_dock(self, name):
|
||||||
log.debug(u'remove %s dock' % name)
|
log.debug(u'remove %s dock' % name)
|
||||||
for dock_index in range(0, self.media_dock.count()):
|
for dock_index in range(0, self.media_dock.count()):
|
||||||
if self.media_dock.widget(dock_index):
|
if self.media_dock.widget(dock_index):
|
||||||
if self.media_dock.widget(dock_index).SettingsSection == name:
|
if self.media_dock.widget(dock_index).settingsSection == name:
|
||||||
self.media_dock.widget(dock_index).hide()
|
self.media_dock.widget(dock_index).hide()
|
||||||
self.media_dock.removeItem(dock_index)
|
self.media_dock.removeItem(dock_index)
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
import copy
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -36,6 +37,7 @@ class ScreenList(object):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.preview = None
|
self.preview = None
|
||||||
self.current = None
|
self.current = None
|
||||||
|
self.override = None
|
||||||
self.screen_list = []
|
self.screen_list = []
|
||||||
self.display_count = 0
|
self.display_count = 0
|
||||||
#actual display number
|
#actual display number
|
||||||
@ -59,12 +61,31 @@ class ScreenList(object):
|
|||||||
"""
|
"""
|
||||||
Set up the current screen dimensions
|
Set up the current screen dimensions
|
||||||
"""
|
"""
|
||||||
|
log.debug(u'set_override_display %s', number, )
|
||||||
if number + 1 > self.display_count:
|
if number + 1 > self.display_count:
|
||||||
self.current = self.screen_list[0]
|
self.current = self.screen_list[0]
|
||||||
self.current_display = 0
|
self.current_display = 0
|
||||||
else:
|
else:
|
||||||
self.current = self.screen_list[number]
|
self.current = self.screen_list[number]
|
||||||
self.preview = self.current
|
self.override = copy.deepcopy(self.current)
|
||||||
|
self.preview = copy.deepcopy(self.current)
|
||||||
self.current_display = number
|
self.current_display = number
|
||||||
if self.display_count == 1:
|
if self.display_count == 1:
|
||||||
self.preview = self.screen_list[0]
|
self.preview = self.screen_list[0]
|
||||||
|
|
||||||
|
def set_override_display(self):
|
||||||
|
"""
|
||||||
|
replace the current size with the override values
|
||||||
|
user wants to have their own screen attributes
|
||||||
|
"""
|
||||||
|
log.debug(u'set_override_display')
|
||||||
|
self.current = copy.deepcopy(self.override)
|
||||||
|
self.preview = copy.deepcopy(self.current)
|
||||||
|
|
||||||
|
def reset_current_display(self):
|
||||||
|
"""
|
||||||
|
replace the current values with the correct values
|
||||||
|
user wants to use the correct screen attributes
|
||||||
|
"""
|
||||||
|
log.debug(u'reset_current_display')
|
||||||
|
self.set_current_display(self.current_display)
|
||||||
|
@ -84,7 +84,7 @@ class ServiceManagerList(QtGui.QTreeWidget):
|
|||||||
mimeData = QtCore.QMimeData()
|
mimeData = QtCore.QMimeData()
|
||||||
drag.setMimeData(mimeData)
|
drag.setMimeData(mimeData)
|
||||||
mimeData.setText(u'ServiceManager')
|
mimeData.setText(u'ServiceManager')
|
||||||
dropAction = drag.start(QtCore.Qt.CopyAction)
|
drag.start(QtCore.Qt.CopyAction)
|
||||||
|
|
||||||
class ServiceManager(QtGui.QWidget):
|
class ServiceManager(QtGui.QWidget):
|
||||||
"""
|
"""
|
||||||
@ -99,8 +99,6 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
QtGui.QWidget.__init__(self)
|
QtGui.QWidget.__init__(self)
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.settingsSection = u'servicemanager'
|
|
||||||
self.generalSettingsSection = self.parent.generalSettingsSection
|
|
||||||
self.serviceItems = []
|
self.serviceItems = []
|
||||||
self.serviceName = u''
|
self.serviceName = u''
|
||||||
self.droppos = 0
|
self.droppos = 0
|
||||||
@ -199,7 +197,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
QtCore.SIGNAL(u'config_updated'), self.regenerateServiceItems)
|
QtCore.SIGNAL(u'config_updated'), self.regenerateServiceItems)
|
||||||
# Last little bits of setting up
|
# Last little bits of setting up
|
||||||
self.service_theme = unicode(QtCore.QSettings().value(
|
self.service_theme = unicode(QtCore.QSettings().value(
|
||||||
self.settingsSection + u'/service theme',
|
self.parent.serviceSettingsSection + u'/service theme',
|
||||||
QtCore.QVariant(u'')).toString())
|
QtCore.QVariant(u'')).toString())
|
||||||
self.servicePath = AppLocation.get_section_data_path(u'servicemanager')
|
self.servicePath = AppLocation.get_section_data_path(u'servicemanager')
|
||||||
#build the context menu
|
#build the context menu
|
||||||
@ -447,7 +445,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
Clear the list to create a new service
|
Clear the list to create a new service
|
||||||
"""
|
"""
|
||||||
if self.parent.serviceNotSaved and QtCore.QSettings().value(
|
if self.parent.serviceNotSaved and QtCore.QSettings().value(
|
||||||
self.generalSettingsSection + u'/save prompt',
|
self.parent.generalSettingsSection + u'/save prompt',
|
||||||
QtCore.QVariant(False)).toBool():
|
QtCore.QVariant(False)).toBool():
|
||||||
ret = QtGui.QMessageBox.question(self,
|
ret = QtGui.QMessageBox.question(self,
|
||||||
self.trUtf8('Save Changes to Service?'),
|
self.trUtf8('Save Changes to Service?'),
|
||||||
@ -532,17 +530,20 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
if not quick or self.isNew:
|
if not quick or self.isNew:
|
||||||
filename = QtGui.QFileDialog.getSaveFileName(self,
|
filename = QtGui.QFileDialog.getSaveFileName(self,
|
||||||
self.trUtf8(u'Save Service'),
|
self.trUtf8(u'Save Service'),
|
||||||
SettingsManager.get_last_dir(self.settingsSection),
|
SettingsManager.get_last_dir(self.parent.serviceSettingsSection),
|
||||||
self.trUtf8(u'OpenLP Service Files (*.osz)'))
|
self.trUtf8(u'OpenLP Service Files (*.osz)'))
|
||||||
else:
|
else:
|
||||||
filename = SettingsManager.get_last_dir(self.settingsSection)
|
filename = SettingsManager.get_last_dir(
|
||||||
|
self.parent.serviceSettingsSection)
|
||||||
if filename:
|
if filename:
|
||||||
splittedFile = filename.split(u'.')
|
splittedFile = filename.split(u'.')
|
||||||
if splittedFile[-1] != u'osz':
|
if splittedFile[-1] != u'osz':
|
||||||
filename = filename + u'.osz'
|
filename = filename + u'.osz'
|
||||||
filename = unicode(filename)
|
filename = unicode(filename)
|
||||||
self.isNew = False
|
self.isNew = False
|
||||||
SettingsManager.set_last_dir(self.settingsSection, filename)
|
SettingsManager.set_last_dir(
|
||||||
|
self.parent.serviceSettingsSection,
|
||||||
|
os.path.split(filename)[0])
|
||||||
service = []
|
service = []
|
||||||
servicefile = filename + u'.osd'
|
servicefile = filename + u'.osd'
|
||||||
zip = None
|
zip = None
|
||||||
@ -583,12 +584,13 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
|
|
||||||
def onLoadService(self, lastService=False):
|
def onLoadService(self, lastService=False):
|
||||||
if lastService:
|
if lastService:
|
||||||
filename = SettingsManager.get_last_dir(self.settingsSection)
|
filename = SettingsManager.get_last_dir(
|
||||||
|
self.parent.serviceSettingsSection)
|
||||||
else:
|
else:
|
||||||
filename = QtGui.QFileDialog.getOpenFileName(
|
filename = QtGui.QFileDialog.getOpenFileName(
|
||||||
self, self.trUtf8('Open Service'),
|
self, self.trUtf8('Open Service'),
|
||||||
SettingsManager.get_last_dir(self.settingsSection),
|
SettingsManager.get_last_dir(
|
||||||
u'Services (*.osz)')
|
self.parent.serviceSettingsSection), u'Services (*.osz)')
|
||||||
self.loadService(filename)
|
self.loadService(filename)
|
||||||
|
|
||||||
def loadService(self, filename=None):
|
def loadService(self, filename=None):
|
||||||
@ -617,7 +619,9 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
filename = unicode(filename)
|
filename = unicode(filename)
|
||||||
name = filename.split(os.path.sep)
|
name = filename.split(os.path.sep)
|
||||||
if filename:
|
if filename:
|
||||||
SettingsManager.set_last_dir(self.settingsSection, filename)
|
SettingsManager.set_last_dir(
|
||||||
|
self.parent.serviceSettingsSection,
|
||||||
|
os.path.split(filename)[0])
|
||||||
zip = None
|
zip = None
|
||||||
f = None
|
f = None
|
||||||
try:
|
try:
|
||||||
@ -686,7 +690,8 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
self.service_theme = unicode(self.ThemeComboBox.currentText())
|
self.service_theme = unicode(self.ThemeComboBox.currentText())
|
||||||
self.parent.RenderManager.set_service_theme(self.service_theme)
|
self.parent.RenderManager.set_service_theme(self.service_theme)
|
||||||
QtCore.QSettings().setValue(self.settingsSection + u'/service theme',
|
QtCore.QSettings().setValue(
|
||||||
|
self.parent.serviceSettingsSection + u'/service theme',
|
||||||
QtCore.QVariant(self.service_theme))
|
QtCore.QVariant(self.service_theme))
|
||||||
self.regenerateServiceItems()
|
self.regenerateServiceItems()
|
||||||
|
|
||||||
@ -770,7 +775,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
self.parent.LiveController.addServiceManagerItem(
|
self.parent.LiveController.addServiceManagerItem(
|
||||||
self.serviceItems[item][u'service_item'], count)
|
self.serviceItems[item][u'service_item'], count)
|
||||||
if QtCore.QSettings().value(
|
if QtCore.QSettings().value(
|
||||||
self.generalSettingsSection + u'/auto preview',
|
self.parent.generalSettingsSection + u'/auto preview',
|
||||||
QtCore.QVariant(False)).toBool():
|
QtCore.QVariant(False)).toBool():
|
||||||
item += 1
|
item += 1
|
||||||
if self.serviceItems and item < len(self.serviceItems) and \
|
if self.serviceItems and item < len(self.serviceItems) and \
|
||||||
@ -832,7 +837,7 @@ class ServiceManager(QtGui.QWidget):
|
|||||||
plugin = event.mimeData().text()
|
plugin = event.mimeData().text()
|
||||||
item = self.ServiceManagerList.itemAt(event.pos())
|
item = self.ServiceManagerList.itemAt(event.pos())
|
||||||
if plugin == u'ServiceManager':
|
if plugin == u'ServiceManager':
|
||||||
startpos, startCount = self.findServiceItem()
|
startpos, startCount = self.findServiceItem()
|
||||||
if item is None:
|
if item is None:
|
||||||
endpos = len(self.serviceItems)
|
endpos = len(self.serviceItems)
|
||||||
else:
|
else:
|
||||||
|
@ -27,7 +27,7 @@ import logging
|
|||||||
|
|
||||||
from PyQt4 import QtGui
|
from PyQt4 import QtGui
|
||||||
|
|
||||||
from openlp.core.ui import GeneralTab, ThemesTab
|
from openlp.core.ui import GeneralTab, ThemesTab, DisplayTab
|
||||||
from settingsdialog import Ui_SettingsDialog
|
from settingsdialog import Ui_SettingsDialog
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@ -43,6 +43,9 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
|
|||||||
# Themes tab
|
# Themes tab
|
||||||
self.ThemesTab = ThemesTab(mainWindow)
|
self.ThemesTab = ThemesTab(mainWindow)
|
||||||
self.addTab(u'Themes', self.ThemesTab)
|
self.addTab(u'Themes', self.ThemesTab)
|
||||||
|
# Display tab
|
||||||
|
self.DisplayTab = DisplayTab(screens)
|
||||||
|
self.addTab(u'Display', self.DisplayTab)
|
||||||
|
|
||||||
def addTab(self, name, tab):
|
def addTab(self, name, tab):
|
||||||
log.info(u'Adding %s tab' % tab.tabTitle)
|
log.info(u'Adding %s tab' % tab.tabTitle)
|
||||||
|
@ -30,18 +30,9 @@ 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.lib import ItemCapabilities
|
from openlp.core.ui import HideMode
|
||||||
|
from openlp.core.lib import OpenLPToolbar, Receiver, resize_image, \
|
||||||
class HideMode(object):
|
ItemCapabilities
|
||||||
"""
|
|
||||||
This is basically an enumeration class which specifies the mode of a Bible.
|
|
||||||
Mode refers to whether or not a Bible in OpenLP is a full Bible or needs to
|
|
||||||
be downloaded from the Internet on an as-needed basis.
|
|
||||||
"""
|
|
||||||
Blank = 1
|
|
||||||
Theme = 2
|
|
||||||
|
|
||||||
from openlp.core.lib import OpenLPToolbar, Receiver, resize_image
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -93,8 +84,6 @@ class SlideController(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
QtGui.QWidget.__init__(self, parent)
|
QtGui.QWidget.__init__(self, parent)
|
||||||
self.settingsmanager = settingsmanager
|
self.settingsmanager = settingsmanager
|
||||||
self.generalSettingsSection = u'general'
|
|
||||||
self.songsSettingsSection = u'songs'
|
|
||||||
self.isLive = isLive
|
self.isLive = isLive
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.mainDisplay = self.parent.displayManager.mainDisplay
|
self.mainDisplay = self.parent.displayManager.mainDisplay
|
||||||
@ -199,8 +188,6 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.hideButton = self.Toolbar.addToolbarButton(
|
self.hideButton = self.Toolbar.addToolbarButton(
|
||||||
u'Hide screen', u':/slides/slide_desktop.png',
|
u'Hide screen', u':/slides/slide_desktop.png',
|
||||||
self.trUtf8('Hide Screen'), self.onHideDisplay, True)
|
self.trUtf8('Hide Screen'), self.onHideDisplay, True)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
|
||||||
QtCore.SIGNAL(u'maindisplay_blank'), self.blankScreen)
|
|
||||||
if not self.isLive:
|
if not self.isLive:
|
||||||
self.Toolbar.addToolbarSeparator(u'Close Separator')
|
self.Toolbar.addToolbarSeparator(u'Close Separator')
|
||||||
self.Toolbar.addToolbarButton(
|
self.Toolbar.addToolbarButton(
|
||||||
@ -213,7 +200,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
if isLive:
|
if isLive:
|
||||||
self.Toolbar.addToolbarSeparator(u'Loop Separator')
|
self.Toolbar.addToolbarSeparator(u'Loop Separator')
|
||||||
self.Toolbar.addToolbarButton(
|
self.Toolbar.addToolbarButton(
|
||||||
u'Start Loop', u':/media/media_time.png',
|
u'Start Loop', u':/media/media_time.png',
|
||||||
self.trUtf8('Start continuous loop'), self.onStartLoop)
|
self.trUtf8('Start continuous loop'), self.onStartLoop)
|
||||||
self.Toolbar.addToolbarButton(
|
self.Toolbar.addToolbarButton(
|
||||||
u'Stop Loop', u':/media/media_stop.png',
|
u'Stop Loop', u':/media/media_stop.png',
|
||||||
@ -230,14 +217,24 @@ class SlideController(QtGui.QWidget):
|
|||||||
#Build a Media ToolBar
|
#Build a Media ToolBar
|
||||||
self.Mediabar = OpenLPToolbar(self)
|
self.Mediabar = OpenLPToolbar(self)
|
||||||
self.Mediabar.addToolbarButton(
|
self.Mediabar.addToolbarButton(
|
||||||
u'Media Start', u':/slides/media_playback_start.png',
|
u'Media Start', u':/slides/media_playback_start.png',
|
||||||
self.trUtf8('Start playing media'), self.onMediaPlay)
|
self.trUtf8('Start playing media'), self.onMediaPlay)
|
||||||
self.Mediabar.addToolbarButton(
|
self.Mediabar.addToolbarButton(
|
||||||
u'Media Pause', u':/slides/media_playback_pause.png',
|
u'Media Pause', u':/slides/media_playback_pause.png',
|
||||||
self.trUtf8('Start playing media'), self.onMediaPause)
|
self.trUtf8('Start playing media'), self.onMediaPause)
|
||||||
self.Mediabar.addToolbarButton(
|
self.Mediabar.addToolbarButton(
|
||||||
u'Media Stop', u':/slides/media_playback_stop.png',
|
u'Media Stop', u':/slides/media_playback_stop.png',
|
||||||
self.trUtf8('Start playing media'), self.onMediaStop)
|
self.trUtf8('Start playing media'), self.onMediaStop)
|
||||||
|
if self.isLive:
|
||||||
|
self.blankButton = self.Mediabar.addToolbarButton(
|
||||||
|
u'Blank Screen', u':/slides/slide_blank.png',
|
||||||
|
self.trUtf8('Blank Screen'), self.onBlankDisplay, True)
|
||||||
|
self.themeButton = self.Mediabar.addToolbarButton(
|
||||||
|
u'Display Theme', u':/slides/slide_theme.png',
|
||||||
|
self.trUtf8('Theme Screen'), self.onThemeDisplay, True)
|
||||||
|
self.hideButton = self.Mediabar.addToolbarButton(
|
||||||
|
u'Hide screen', u':/slides/slide_desktop.png',
|
||||||
|
self.trUtf8('Hide Screen'), self.onHideDisplay, True)
|
||||||
if not self.isLive:
|
if not self.isLive:
|
||||||
self.seekSlider = Phonon.SeekSlider()
|
self.seekSlider = Phonon.SeekSlider()
|
||||||
self.seekSlider.setGeometry(QtCore.QRect(90, 260, 221, 24))
|
self.seekSlider.setGeometry(QtCore.QRect(90, 260, 221, 24))
|
||||||
@ -405,7 +402,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
if item.is_text():
|
if item.is_text():
|
||||||
self.Toolbar.makeWidgetsInvisible(self.loop_list)
|
self.Toolbar.makeWidgetsInvisible(self.loop_list)
|
||||||
if QtCore.QSettings().value(
|
if QtCore.QSettings().value(
|
||||||
self.songsSettingsSection + u'/show songbar',
|
self.parent.songsSettingsSection + u'/show songbar',
|
||||||
QtCore.QVariant(True)).toBool() and len(self.slideList) > 0:
|
QtCore.QVariant(True)).toBool() and len(self.slideList) > 0:
|
||||||
self.Toolbar.makeWidgetsVisible([u'Song Menu'])
|
self.Toolbar.makeWidgetsVisible([u'Song Menu'])
|
||||||
if item.is_capable(ItemCapabilities.AllowsLoop) and \
|
if item.is_capable(ItemCapabilities.AllowsLoop) and \
|
||||||
@ -619,55 +616,64 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.PreviewListWidget.selectRow(index)
|
self.PreviewListWidget.selectRow(index)
|
||||||
self.onSlideSelected()
|
self.onSlideSelected()
|
||||||
|
|
||||||
def onBlankDisplay(self, force=False):
|
def onBlankDisplay(self, checked):
|
||||||
"""
|
"""
|
||||||
Handle the blank screen button
|
Handle the blank screen button
|
||||||
"""
|
"""
|
||||||
log.debug(u'onBlankDisplay %d' % force)
|
log.debug(u'onBlankDisplay %d' % checked)
|
||||||
if force:
|
self.hideButton.setChecked(False)
|
||||||
self.blankButton.setChecked(True)
|
self.themeButton.setChecked(False)
|
||||||
self.blankScreen(HideMode.Blank, self.blankButton.isChecked())
|
|
||||||
QtCore.QSettings().setValue(
|
QtCore.QSettings().setValue(
|
||||||
self.generalSettingsSection + u'/screen blank',
|
self.parent.generalSettingsSection + u'/screen blank',
|
||||||
QtCore.QVariant(self.blankButton.isChecked()))
|
QtCore.QVariant(checked))
|
||||||
|
if checked:
|
||||||
|
Receiver.send_message(u'maindisplay_hide', HideMode.Blank)
|
||||||
|
self.blankPlugin(True)
|
||||||
|
else:
|
||||||
|
Receiver.send_message(u'maindisplay_show')
|
||||||
|
self.blankPlugin(False)
|
||||||
|
|
||||||
def onThemeDisplay(self, force=False):
|
def onThemeDisplay(self, checked):
|
||||||
"""
|
"""
|
||||||
Handle the Theme screen button
|
Handle the Theme screen button
|
||||||
"""
|
"""
|
||||||
log.debug(u'onThemeDisplay %d' % force)
|
log.debug(u'onThemeDisplay %d' % checked)
|
||||||
if force:
|
self.blankButton.setChecked(False)
|
||||||
self.themeButton.setChecked(True)
|
self.hideButton.setChecked(False)
|
||||||
self.blankScreen(HideMode.Theme, self.themeButton.isChecked())
|
if checked:
|
||||||
|
Receiver.send_message(u'maindisplay_hide', HideMode.Theme)
|
||||||
|
self.blankPlugin(True)
|
||||||
|
else:
|
||||||
|
Receiver.send_message(u'maindisplay_show')
|
||||||
|
self.blankPlugin(False)
|
||||||
|
|
||||||
def onHideDisplay(self, force=False):
|
def onHideDisplay(self, checked):
|
||||||
"""
|
"""
|
||||||
Handle the Hide screen button
|
Handle the Hide screen button
|
||||||
"""
|
"""
|
||||||
log.debug(u'onHideDisplay %d' % force)
|
log.debug(u'onHideDisplay %d' % checked)
|
||||||
if force:
|
self.blankButton.setChecked(False)
|
||||||
self.hideButton.setChecked(True)
|
self.themeButton.setChecked(False)
|
||||||
if self.hideButton.isChecked():
|
if checked:
|
||||||
self.mainDisplay.hideDisplay()
|
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
|
||||||
|
self.blankPlugin(True)
|
||||||
else:
|
else:
|
||||||
self.mainDisplay.showDisplay()
|
Receiver.send_message(u'maindisplay_show')
|
||||||
|
self.blankPlugin(False)
|
||||||
|
|
||||||
def blankScreen(self, blankType, blanked=False):
|
def blankPlugin(self, blank):
|
||||||
"""
|
"""
|
||||||
Blank the display screen.
|
Blank the display screen.
|
||||||
"""
|
"""
|
||||||
if self.serviceItem is not None:
|
if self.serviceItem is not None:
|
||||||
if blanked:
|
if blank:
|
||||||
Receiver.send_message(
|
Receiver.send_message(u'%s_blank'
|
||||||
u'%s_blank' % self.serviceItem.name.lower(),
|
% self.serviceItem.name.lower(),
|
||||||
[self.serviceItem, self.isLive])
|
[self.serviceItem, self.isLive])
|
||||||
else:
|
else:
|
||||||
Receiver.send_message(u'%s_unblank'
|
Receiver.send_message(u'%s_unblank'
|
||||||
% self.serviceItem.name.lower(),
|
% self.serviceItem.name.lower(),
|
||||||
[self.serviceItem, self.isLive])
|
[self.serviceItem, self.isLive])
|
||||||
self.mainDisplay.blankDisplay(blankType, blanked)
|
|
||||||
else:
|
|
||||||
self.mainDisplay.blankDisplay(blankType, blanked)
|
|
||||||
|
|
||||||
def onSlideSelected(self):
|
def onSlideSelected(self):
|
||||||
"""
|
"""
|
||||||
@ -763,7 +769,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
if not self.serviceItem:
|
if not self.serviceItem:
|
||||||
return
|
return
|
||||||
Receiver.send_message(u'%s_previous' % self.serviceItem.name.lower(),
|
Receiver.send_message(u'%s_previous' % self.serviceItem.name.lower(),
|
||||||
[self.serviceItem, self.isLive])
|
[self.serviceItem, self.isLive])
|
||||||
if self.serviceItem.is_command():
|
if self.serviceItem.is_command():
|
||||||
self.updatePreview()
|
self.updatePreview()
|
||||||
else:
|
else:
|
||||||
@ -813,6 +819,9 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.onSlideSelectedNext()
|
self.onSlideSelectedNext()
|
||||||
|
|
||||||
def onEditSong(self):
|
def onEditSong(self):
|
||||||
|
"""
|
||||||
|
From the preview display requires the service Item to be editied
|
||||||
|
"""
|
||||||
self.songEdit = True
|
self.songEdit = True
|
||||||
Receiver.send_message(u'%s_edit' % self.serviceItem.name.lower(),
|
Receiver.send_message(u'%s_edit' % self.serviceItem.name.lower(),
|
||||||
u'P:%s' % self.serviceItem.editId)
|
u'P:%s' % self.serviceItem.editId)
|
||||||
@ -827,6 +836,10 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.serviceItem, row)
|
self.serviceItem, row)
|
||||||
|
|
||||||
def onMediaStart(self, item):
|
def onMediaStart(self, item):
|
||||||
|
"""
|
||||||
|
Respond to the arrival of a media service item
|
||||||
|
"""
|
||||||
|
log.debug(u'SlideController onMediaStart')
|
||||||
if self.isLive:
|
if self.isLive:
|
||||||
Receiver.send_message(u'videodisplay_start',
|
Receiver.send_message(u'videodisplay_start',
|
||||||
[item, self.blankButton.isChecked()])
|
[item, self.blankButton.isChecked()])
|
||||||
@ -840,12 +853,20 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.onMediaPlay()
|
self.onMediaPlay()
|
||||||
|
|
||||||
def onMediaPause(self):
|
def onMediaPause(self):
|
||||||
|
"""
|
||||||
|
Respond to the Pause from the media Toolbar
|
||||||
|
"""
|
||||||
|
log.debug(u'SlideController onMediaPause')
|
||||||
if self.isLive:
|
if self.isLive:
|
||||||
Receiver.send_message(u'videodisplay_pause')
|
Receiver.send_message(u'videodisplay_pause')
|
||||||
else:
|
else:
|
||||||
self.mediaObject.pause()
|
self.mediaObject.pause()
|
||||||
|
|
||||||
def onMediaPlay(self):
|
def onMediaPlay(self):
|
||||||
|
"""
|
||||||
|
Respond to the Play from the media Toolbar
|
||||||
|
"""
|
||||||
|
log.debug(u'SlideController onMediaPlay')
|
||||||
if self.isLive:
|
if self.isLive:
|
||||||
Receiver.send_message(u'videodisplay_play')
|
Receiver.send_message(u'videodisplay_play')
|
||||||
else:
|
else:
|
||||||
@ -854,6 +875,10 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.mediaObject.play()
|
self.mediaObject.play()
|
||||||
|
|
||||||
def onMediaStop(self):
|
def onMediaStop(self):
|
||||||
|
"""
|
||||||
|
Respond to the Stop from the media Toolbar
|
||||||
|
"""
|
||||||
|
log.debug(u'SlideController onMediaStop')
|
||||||
if self.isLive:
|
if self.isLive:
|
||||||
Receiver.send_message(u'videodisplay_stop')
|
Receiver.send_message(u'videodisplay_stop')
|
||||||
else:
|
else:
|
||||||
|
@ -108,7 +108,7 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
self.themelist = []
|
self.themelist = []
|
||||||
self.path = AppLocation.get_section_data_path(self.settingsSection)
|
self.path = AppLocation.get_section_data_path(self.settingsSection)
|
||||||
self.checkThemesExists(self.path)
|
self.checkThemesExists(self.path)
|
||||||
self.thumbPath = os.path.join(self.path, u'.thumbnails')
|
self.thumbPath = os.path.join(self.path, u'thumbnails')
|
||||||
self.checkThemesExists(self.thumbPath)
|
self.checkThemesExists(self.thumbPath)
|
||||||
self.amendThemeForm.path = self.path
|
self.amendThemeForm.path = self.path
|
||||||
# Last little bits of setting up
|
# Last little bits of setting up
|
||||||
@ -295,7 +295,7 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
self.pushThemes()
|
self.pushThemes()
|
||||||
|
|
||||||
def pushThemes(self):
|
def pushThemes(self):
|
||||||
Receiver.send_message(u'theme_update_list', self.getThemes() )
|
Receiver.send_message(u'theme_update_list', self.getThemes())
|
||||||
|
|
||||||
def getThemes(self):
|
def getThemes(self):
|
||||||
return self.themelist
|
return self.themelist
|
||||||
|
@ -47,7 +47,7 @@ def init_models(url):
|
|||||||
mapper(TAuthor, temp_authors_table)
|
mapper(TAuthor, temp_authors_table)
|
||||||
mapper(Book, song_books_table)
|
mapper(Book, song_books_table)
|
||||||
mapper(Song, songs_table,
|
mapper(Song, songs_table,
|
||||||
properties={'authors': relation(Author, backref='songs',
|
properties={'authors': relation(Author, backref='songs',
|
||||||
secondary=authors_songs_table),
|
secondary=authors_songs_table),
|
||||||
'book': relation(Book, backref='songs'),
|
'book': relation(Book, backref='songs'),
|
||||||
'topics': relation(Topic, backref='songs',
|
'topics': relation(Topic, backref='songs',
|
||||||
@ -156,13 +156,13 @@ class MigrateSongs():
|
|||||||
print songs_temp.songtitle
|
print songs_temp.songtitle
|
||||||
aa = self.session.execute(
|
aa = self.session.execute(
|
||||||
u'select * from songauthors_temp where songid =' + \
|
u'select * from songauthors_temp where songid =' + \
|
||||||
unicode(songs_temp.songid) )
|
unicode(songs_temp.songid))
|
||||||
for row in aa:
|
for row in aa:
|
||||||
a = row['authorid']
|
a = row['authorid']
|
||||||
authors_temp = self.session.query(TAuthor).get(a)
|
authors_temp = self.session.query(TAuthor).get(a)
|
||||||
bb = self.session.execute(
|
bb = self.session.execute(
|
||||||
u'select * from authors where display_name = \"%s\"' % \
|
u'select * from authors where display_name = \"%s\"' % \
|
||||||
unicode(authors_temp.authorname) ).fetchone()
|
unicode(authors_temp.authorname)).fetchone()
|
||||||
if bb is None:
|
if bb is None:
|
||||||
author = Author()
|
author = Author()
|
||||||
author.display_name = authors_temp.authorname
|
author.display_name = authors_temp.authorname
|
||||||
|
@ -28,8 +28,8 @@ import logging
|
|||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import Plugin, build_icon, PluginStatus
|
from openlp.core.lib import Plugin, build_icon, PluginStatus
|
||||||
from openlp.plugins.alerts.lib import AlertsManager, DBManager
|
from openlp.plugins.alerts.lib import AlertsManager, AlertsTab, DBManager
|
||||||
from openlp.plugins.alerts.forms import AlertsTab, AlertForm
|
from openlp.plugins.alerts.forms import AlertForm
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ class alertsPlugin(Plugin):
|
|||||||
def togglealertsState(self):
|
def togglealertsState(self):
|
||||||
self.alertsActive = not self.alertsActive
|
self.alertsActive = not self.alertsActive
|
||||||
QtCore.QSettings().setValue(
|
QtCore.QSettings().setValue(
|
||||||
self.settings_section + u'/active',
|
self.settingsSection + u'/active',
|
||||||
QtCore.QVariant(self.alertsActive))
|
QtCore.QVariant(self.alertsActive))
|
||||||
|
|
||||||
def onAlertsTrigger(self):
|
def onAlertsTrigger(self):
|
||||||
|
@ -23,5 +23,4 @@
|
|||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
from alertstab import AlertsTab
|
|
||||||
from alertform import AlertForm
|
from alertform import AlertForm
|
||||||
|
@ -24,4 +24,5 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
from alertsmanager import AlertsManager
|
from alertsmanager import AlertsManager
|
||||||
|
from alertstab import AlertsTab
|
||||||
from manager import DBManager
|
from manager import DBManager
|
||||||
|
@ -274,7 +274,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
|
|
||||||
def setDefaults(self):
|
def setDefaults(self):
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
settings.beginGroup(self.bibleplugin.settings_section)
|
settings.beginGroup(self.bibleplugin.settingsSection)
|
||||||
self.setField(u'source_format', QtCore.QVariant(0))
|
self.setField(u'source_format', QtCore.QVariant(0))
|
||||||
self.setField(u'osis_location', QtCore.QVariant(''))
|
self.setField(u'osis_location', QtCore.QVariant(''))
|
||||||
self.setField(u'csv_booksfile', QtCore.QVariant(''))
|
self.setField(u'csv_booksfile', QtCore.QVariant(''))
|
||||||
@ -345,11 +345,11 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard):
|
|||||||
|
|
||||||
def getFileName(self, title, editbox):
|
def getFileName(self, title, editbox):
|
||||||
filename = QtGui.QFileDialog.getOpenFileName(self, title,
|
filename = QtGui.QFileDialog.getOpenFileName(self, title,
|
||||||
SettingsManager.get_last_dir(self.bibleplugin.settings_section, 1))
|
SettingsManager.get_last_dir(self.bibleplugin.settingsSection, 1))
|
||||||
if filename:
|
if filename:
|
||||||
editbox.setText(filename)
|
editbox.setText(filename)
|
||||||
SettingsManager.set_last_dir(
|
SettingsManager.set_last_dir(
|
||||||
self.bibleplugin.settings_section, filename, 1)
|
self.bibleplugin.settingsSection, filename, 1)
|
||||||
|
|
||||||
def incrementProgressBar(self, status_text):
|
def incrementProgressBar(self, status_text):
|
||||||
log.debug(u'IncrementBar %s', status_text)
|
log.debug(u'IncrementBar %s', status_text)
|
||||||
|
@ -111,7 +111,7 @@ class BibleDB(QtCore.QObject):
|
|||||||
``old_filename``
|
``old_filename``
|
||||||
The "dirty" file name or version name.
|
The "dirty" file name or version name.
|
||||||
"""
|
"""
|
||||||
if not isinstance(old_filename, unicode):
|
if not isinstance(old_filename, unicode):
|
||||||
old_filename = unicode(old_filename, u'utf-8')
|
old_filename = unicode(old_filename, u'utf-8')
|
||||||
old_filename = re.sub(r'[^\w]+', u'_', old_filename).strip(u'_')
|
old_filename = re.sub(r'[^\w]+', u'_', old_filename).strip(u'_')
|
||||||
return old_filename + u'.sqlite'
|
return old_filename + u'.sqlite'
|
||||||
|
@ -109,12 +109,12 @@ class BibleManager(object):
|
|||||||
"""
|
"""
|
||||||
log.debug(u'Bible Initialising')
|
log.debug(u'Bible Initialising')
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.settings_section = u'bibles'
|
self.settingsSection = u'bibles'
|
||||||
self.web = u'Web'
|
self.web = u'Web'
|
||||||
self.db_cache = None
|
self.db_cache = None
|
||||||
self.path = AppLocation.get_section_data_path(self.settings_section)
|
self.path = AppLocation.get_section_data_path(self.settingsSection)
|
||||||
self.proxy_name = unicode(
|
self.proxy_name = unicode(
|
||||||
QtCore.QSettings().value(self.settings_section + u'/proxy name',
|
QtCore.QSettings().value(self.settingsSection + u'/proxy name',
|
||||||
QtCore.QVariant(u'')).toString())
|
QtCore.QVariant(u'')).toString())
|
||||||
self.suffix = u'.sqlite'
|
self.suffix = u'.sqlite'
|
||||||
self.import_wizard = None
|
self.import_wizard = None
|
||||||
@ -128,7 +128,7 @@ class BibleManager(object):
|
|||||||
BibleDB class.
|
BibleDB class.
|
||||||
"""
|
"""
|
||||||
log.debug(u'Reload bibles')
|
log.debug(u'Reload bibles')
|
||||||
files = SettingsManager.get_files(self.settings_section, self.suffix)
|
files = SettingsManager.get_files(self.settingsSection, self.suffix)
|
||||||
log.debug(u'Bible Files %s', files)
|
log.debug(u'Bible Files %s', files)
|
||||||
self.db_cache = {}
|
self.db_cache = {}
|
||||||
for filename in files:
|
for filename in files:
|
||||||
|
@ -54,7 +54,6 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
|
|
||||||
def __init__(self, parent, icon, title):
|
def __init__(self, parent, icon, title):
|
||||||
self.PluginNameShort = u'Bible'
|
self.PluginNameShort = u'Bible'
|
||||||
self.SettingsSection = title.lower()
|
|
||||||
self.IconPath = u'songs/song'
|
self.IconPath = u'songs/song'
|
||||||
self.ListViewWithDnD_class = BibleListView
|
self.ListViewWithDnD_class = BibleListView
|
||||||
self.lastReference = []
|
self.lastReference = []
|
||||||
@ -276,7 +275,7 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
self.SearchProgress.setObjectName(u'SearchProgress')
|
self.SearchProgress.setObjectName(u'SearchProgress')
|
||||||
|
|
||||||
def configUpdated(self):
|
def configUpdated(self):
|
||||||
if QtCore.QSettings().value(self.SettingsSection + u'/dual bibles',
|
if QtCore.QSettings().value(self.settingsSection + u'/dual bibles',
|
||||||
QtCore.QVariant(False)).toBool():
|
QtCore.QVariant(False)).toBool():
|
||||||
self.AdvancedSecondBibleLabel.setVisible(True)
|
self.AdvancedSecondBibleLabel.setVisible(True)
|
||||||
self.AdvancedSecondBibleComboBox.setVisible(True)
|
self.AdvancedSecondBibleComboBox.setVisible(True)
|
||||||
|
@ -165,7 +165,7 @@ class OSISBible(BibleDB):
|
|||||||
verse_text = verse_text.replace(u'</lb>', u'')\
|
verse_text = verse_text.replace(u'</lb>', u'')\
|
||||||
.replace(u'</l>', u'').replace(u'<lg>', u'')\
|
.replace(u'</l>', u'').replace(u'<lg>', u'')\
|
||||||
.replace(u'</lg>', u'').replace(u'</q>', u'')\
|
.replace(u'</lg>', u'').replace(u'</q>', u'')\
|
||||||
.replace(u'</div>', u'').replace(u'</w>', u'')
|
.replace(u'</div>', u'').replace(u'</w>', u'')
|
||||||
verse_text = self.spaces_regex.sub(u' ', verse_text)
|
verse_text = self.spaces_regex.sub(u' ', verse_text)
|
||||||
self.create_verse(db_book.id, chapter, verse, verse_text)
|
self.create_verse(db_book.id, chapter, verse, verse_text)
|
||||||
Receiver.send_message(u'openlp_process_events')
|
Receiver.send_message(u'openlp_process_events')
|
||||||
|
@ -271,4 +271,4 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
|
|||||||
if self.VerseTextEdit.toPlainText():
|
if self.VerseTextEdit.toPlainText():
|
||||||
self.VerseTextEdit.setFocus()
|
self.VerseTextEdit.setFocus()
|
||||||
return False, self.trUtf8('You have unsaved data, please save or clear')
|
return False, self.trUtf8('You have unsaved data, please save or clear')
|
||||||
return True, u''
|
return True, u''
|
||||||
|
@ -45,7 +45,6 @@ class CustomMediaItem(MediaManagerItem):
|
|||||||
|
|
||||||
def __init__(self, parent, icon, title):
|
def __init__(self, parent, icon, title):
|
||||||
self.PluginNameShort = u'Custom'
|
self.PluginNameShort = u'Custom'
|
||||||
self.SettingsSection = title.lower()
|
|
||||||
self.IconPath = u'custom/custom'
|
self.IconPath = u'custom/custom'
|
||||||
# this next is a class, not an instance of a class - it will
|
# this next is a class, not an instance of a class - it will
|
||||||
# be instanced by the base MediaManagerItem
|
# be instanced by the base MediaManagerItem
|
||||||
@ -164,7 +163,7 @@ class CustomMediaItem(MediaManagerItem):
|
|||||||
service_item.title = title
|
service_item.title = title
|
||||||
for slide in raw_slides:
|
for slide in raw_slides:
|
||||||
service_item.add_from_text(slide[:30], slide)
|
service_item.add_from_text(slide[:30], slide)
|
||||||
if QtCore.QSettings().value(self.SettingsSection + u'/display footer',
|
if QtCore.QSettings().value(self.settingsSection + u'/display footer',
|
||||||
QtCore.QVariant(True)).toBool() or credit:
|
QtCore.QVariant(True)).toBool() or credit:
|
||||||
raw_footer.append(title + u' ' + credit)
|
raw_footer.append(title + u' ' + credit)
|
||||||
else:
|
else:
|
||||||
|
@ -49,7 +49,6 @@ class ImageMediaItem(MediaManagerItem):
|
|||||||
|
|
||||||
def __init__(self, parent, icon, title):
|
def __init__(self, parent, icon, title):
|
||||||
self.PluginNameShort = u'Image'
|
self.PluginNameShort = u'Image'
|
||||||
self.SettingsSection = title.lower()
|
|
||||||
self.IconPath = u'images/image'
|
self.IconPath = u'images/image'
|
||||||
# this next is a class, not an instance of a class - it will
|
# this next is a class, not an instance of a class - it will
|
||||||
# be instanced by the base MediaManagerItem
|
# be instanced by the base MediaManagerItem
|
||||||
@ -78,12 +77,12 @@ class ImageMediaItem(MediaManagerItem):
|
|||||||
QtGui.QAbstractItemView.ExtendedSelection)
|
QtGui.QAbstractItemView.ExtendedSelection)
|
||||||
self.ListView.setIconSize(QtCore.QSize(88,50))
|
self.ListView.setIconSize(QtCore.QSize(88,50))
|
||||||
self.servicePath = os.path.join(
|
self.servicePath = os.path.join(
|
||||||
AppLocation.get_section_data_path(self.SettingsSection),
|
AppLocation.get_section_data_path(self.settingsSection),
|
||||||
u'.thumbnails')
|
u'thumbnails')
|
||||||
if not os.path.exists(self.servicePath):
|
if not os.path.exists(self.servicePath):
|
||||||
os.mkdir(self.servicePath)
|
os.mkdir(self.servicePath)
|
||||||
self.loadList(SettingsManager.load_list(
|
self.loadList(SettingsManager.load_list(
|
||||||
self.SettingsSection, self.SettingsSection))
|
self.settingsSection, self.settingsSection))
|
||||||
|
|
||||||
def addListViewToToolBar(self):
|
def addListViewToToolBar(self):
|
||||||
MediaManagerItem.addListViewToToolBar(self)
|
MediaManagerItem.addListViewToToolBar(self)
|
||||||
@ -122,8 +121,8 @@ class ImageMediaItem(MediaManagerItem):
|
|||||||
#if not present do not worry
|
#if not present do not worry
|
||||||
pass
|
pass
|
||||||
self.ListView.takeItem(item.row())
|
self.ListView.takeItem(item.row())
|
||||||
SettingsManager.set_list(
|
SettingsManager.set_list(self.settingsSection,
|
||||||
self.SettingsSection, self.getFileList())
|
self.settingsSection, self.getFileList())
|
||||||
|
|
||||||
def loadList(self, list):
|
def loadList(self, list):
|
||||||
for file in list:
|
for file in list:
|
||||||
|
@ -29,7 +29,7 @@ import os
|
|||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \
|
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \
|
||||||
ItemCapabilities, SettingsManager
|
ItemCapabilities, SettingsManager, contextMenuAction, Receiver
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ class MediaMediaItem(MediaManagerItem):
|
|||||||
def __init__(self, parent, icon, title):
|
def __init__(self, parent, icon, title):
|
||||||
self.PluginNameShort = u'Media'
|
self.PluginNameShort = u'Media'
|
||||||
self.IconPath = u'images/image'
|
self.IconPath = u'images/image'
|
||||||
self.SettingsSection = title.lower()
|
self.background = False
|
||||||
# this next is a class, not an instance of a class - it will
|
# this next is a class, not an instance of a class - it will
|
||||||
# be instanced by the base MediaManagerItem
|
# be instanced by the base MediaManagerItem
|
||||||
self.ListViewWithDnD_class = MediaListView
|
self.ListViewWithDnD_class = MediaListView
|
||||||
@ -72,6 +72,47 @@ class MediaMediaItem(MediaManagerItem):
|
|||||||
self.hasNewIcon = False
|
self.hasNewIcon = False
|
||||||
self.hasEditIcon = False
|
self.hasEditIcon = False
|
||||||
|
|
||||||
|
def addListViewToToolBar(self):
|
||||||
|
MediaManagerItem.addListViewToToolBar(self)
|
||||||
|
self.ListView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
|
||||||
|
self.ListView.addAction(
|
||||||
|
contextMenuAction(
|
||||||
|
self.ListView, u':/slides/slide_blank.png',
|
||||||
|
self.trUtf8('Replace Live Background'),
|
||||||
|
self.onReplaceClick))
|
||||||
|
|
||||||
|
def addEndHeaderBar(self):
|
||||||
|
self.ImageWidget = QtGui.QWidget(self)
|
||||||
|
sizePolicy = QtGui.QSizePolicy(
|
||||||
|
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
||||||
|
sizePolicy.setHorizontalStretch(0)
|
||||||
|
sizePolicy.setVerticalStretch(0)
|
||||||
|
sizePolicy.setHeightForWidth(
|
||||||
|
self.ImageWidget.sizePolicy().hasHeightForWidth())
|
||||||
|
self.ImageWidget.setSizePolicy(sizePolicy)
|
||||||
|
self.ImageWidget.setObjectName(u'ImageWidget')
|
||||||
|
self.blankButton = self.Toolbar.addToolbarButton(
|
||||||
|
u'Replace Background', u':/slides/slide_blank.png',
|
||||||
|
self.trUtf8('Replace Live Background'), self.onReplaceClick, False)
|
||||||
|
# Add the song widget to the page layout
|
||||||
|
self.PageLayout.addWidget(self.ImageWidget)
|
||||||
|
|
||||||
|
def onReplaceClick(self):
|
||||||
|
if self.background:
|
||||||
|
self.background = False
|
||||||
|
Receiver.send_message(u'videodisplay_stop')
|
||||||
|
else:
|
||||||
|
self.background = True
|
||||||
|
if not self.ListView.selectedIndexes():
|
||||||
|
QtGui.QMessageBox.information(self,
|
||||||
|
self.trUtf8('No item selected'),
|
||||||
|
self.trUtf8('You must select one item'))
|
||||||
|
items = self.ListView.selectedIndexes()
|
||||||
|
for item in items:
|
||||||
|
bitem = self.ListView.item(item.row())
|
||||||
|
filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString())
|
||||||
|
Receiver.send_message(u'videodisplay_background', filename)
|
||||||
|
|
||||||
def generateSlideData(self, service_item, item=None):
|
def generateSlideData(self, service_item, item=None):
|
||||||
if item is None:
|
if item is None:
|
||||||
item = self.ListView.currentItem()
|
item = self.ListView.currentItem()
|
||||||
@ -90,14 +131,15 @@ class MediaMediaItem(MediaManagerItem):
|
|||||||
QtGui.QAbstractItemView.ExtendedSelection)
|
QtGui.QAbstractItemView.ExtendedSelection)
|
||||||
self.ListView.setIconSize(QtCore.QSize(88,50))
|
self.ListView.setIconSize(QtCore.QSize(88,50))
|
||||||
self.loadList(SettingsManager.load_list(
|
self.loadList(SettingsManager.load_list(
|
||||||
self.SettingsSection, self.SettingsSection))
|
self.settingsSection, self.settingsSection))
|
||||||
|
|
||||||
def onDeleteClick(self):
|
def onDeleteClick(self):
|
||||||
item = self.ListView.currentItem()
|
item = self.ListView.currentItem()
|
||||||
if item:
|
if item:
|
||||||
row = self.ListView.row(item)
|
row = self.ListView.row(item)
|
||||||
self.ListView.takeItem(row)
|
self.ListView.takeItem(row)
|
||||||
SettingsManager.set_list(self.SettingsSection, self.getFileList())
|
SettingsManager.set_list(self.settingsSection,
|
||||||
|
self.settingsSection, self.getFileList())
|
||||||
|
|
||||||
def loadList(self, list):
|
def loadList(self, list):
|
||||||
for file in list:
|
for file in list:
|
||||||
|
@ -47,7 +47,7 @@ else:
|
|||||||
|
|
||||||
from PyQt4 import QtCore
|
from PyQt4 import QtCore
|
||||||
|
|
||||||
from presentationcontroller import PresentationController, PresentationDocument
|
from presentationcontroller import PresentationController, PresentationDocument
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -171,13 +171,13 @@ class ImpressController(PresentationController):
|
|||||||
|
|
||||||
def add_doc(self, name):
|
def add_doc(self, name):
|
||||||
log.debug(u'Add Doc OpenOffice')
|
log.debug(u'Add Doc OpenOffice')
|
||||||
doc = ImpressDocument(self, name)
|
doc = ImpressDocument(self, name)
|
||||||
self.docs.append(doc)
|
self.docs.append(doc)
|
||||||
return doc
|
return doc
|
||||||
|
|
||||||
class ImpressDocument(PresentationDocument):
|
class ImpressDocument(PresentationDocument):
|
||||||
|
|
||||||
def __init__(self, controller, presentation):
|
def __init__(self, controller, presentation):
|
||||||
log.debug(u'Init Presentation OpenOffice')
|
log.debug(u'Init Presentation OpenOffice')
|
||||||
self.controller = controller
|
self.controller = controller
|
||||||
self.document = None
|
self.document = None
|
||||||
|
@ -52,7 +52,6 @@ class PresentationMediaItem(MediaManagerItem):
|
|||||||
def __init__(self, parent, icon, title, controllers):
|
def __init__(self, parent, icon, title, controllers):
|
||||||
self.controllers = controllers
|
self.controllers = controllers
|
||||||
self.PluginNameShort = u'Presentation'
|
self.PluginNameShort = u'Presentation'
|
||||||
self.SettingsSection = title.lower()
|
|
||||||
self.IconPath = u'presentations/presentation'
|
self.IconPath = u'presentations/presentation'
|
||||||
self.Automatic = u''
|
self.Automatic = u''
|
||||||
# this next is a class, not an instance of a class - it will
|
# this next is a class, not an instance of a class - it will
|
||||||
@ -107,11 +106,13 @@ class PresentationMediaItem(MediaManagerItem):
|
|||||||
|
|
||||||
def initialise(self):
|
def initialise(self):
|
||||||
self.servicePath = os.path.join(
|
self.servicePath = os.path.join(
|
||||||
AppLocation.get_section_data_path(self.SettingsSection),
|
AppLocation.get_section_data_path(self.settingsSection),
|
||||||
u'thumbnails')
|
u'thumbnails')
|
||||||
|
self.ListView.setIconSize(QtCore.QSize(88,50))
|
||||||
if not os.path.exists(self.servicePath):
|
if not os.path.exists(self.servicePath):
|
||||||
os.mkdir(self.servicePath)
|
os.mkdir(self.servicePath)
|
||||||
list = SettingsManager.load_list(self.SettingsSection, u'presentations')
|
list = SettingsManager.load_list(
|
||||||
|
self.settingsSection, u'presentations')
|
||||||
self.loadList(list)
|
self.loadList(list)
|
||||||
for item in self.controllers:
|
for item in self.controllers:
|
||||||
#load the drop down selection
|
#load the drop down selection
|
||||||
@ -139,11 +140,13 @@ class PresentationMediaItem(MediaManagerItem):
|
|||||||
icon = None
|
icon = None
|
||||||
for controller in self.controllers:
|
for controller in self.controllers:
|
||||||
thumbPath = os.path.join(
|
thumbPath = os.path.join(
|
||||||
AppLocation.get_section_data_path(self.SettingsSection),
|
AppLocation.get_section_data_path(
|
||||||
|
self.settingsSection),
|
||||||
u'thumbnails', controller, filename)
|
u'thumbnails', controller, filename)
|
||||||
thumb = os.path.join(thumbPath, u'slide1.png')
|
thumb = os.path.join(thumbPath, u'slide1.png')
|
||||||
preview = os.path.join(
|
preview = os.path.join(
|
||||||
AppLocation.get_section_data_path(self.SettingsSection),
|
AppLocation.get_section_data_path(
|
||||||
|
self.settingsSection),
|
||||||
controller, u'thumbnails', filename, u'slide1.png')
|
controller, u'thumbnails', filename, u'slide1.png')
|
||||||
if os.path.exists(preview):
|
if os.path.exists(preview):
|
||||||
if os.path.exists(thumb):
|
if os.path.exists(thumb):
|
||||||
@ -167,7 +170,8 @@ class PresentationMediaItem(MediaManagerItem):
|
|||||||
if item:
|
if item:
|
||||||
row = self.ListView.row(item)
|
row = self.ListView.row(item)
|
||||||
self.ListView.takeItem(row)
|
self.ListView.takeItem(row)
|
||||||
SettingsManager.set_list(self.SettingsSection, self.getFileList())
|
SettingsManager.set_list(self.settingsSection,
|
||||||
|
self.settingsSection, self.getFileList())
|
||||||
filepath = unicode((item.data(QtCore.Qt.UserRole)).toString())
|
filepath = unicode((item.data(QtCore.Qt.UserRole)).toString())
|
||||||
#not sure of this has errors
|
#not sure of this has errors
|
||||||
#John please can you look at .
|
#John please can you look at .
|
||||||
|
@ -44,7 +44,7 @@ class Controller(object):
|
|||||||
self.doc = None
|
self.doc = None
|
||||||
log.info(u'%s controller loaded' % live)
|
log.info(u'%s controller loaded' % live)
|
||||||
|
|
||||||
def addHandler(self, controller, file, isBlank):
|
def addHandler(self, controller, file, isBlank):
|
||||||
log.debug(u'Live = %s, addHandler %s' % (self.isLive, file))
|
log.debug(u'Live = %s, addHandler %s' % (self.isLive, file))
|
||||||
self.controller = controller
|
self.controller = controller
|
||||||
if self.doc is not None:
|
if self.doc is not None:
|
||||||
@ -231,15 +231,17 @@ class MessageListener(object):
|
|||||||
controller.addHandler(self.controllers[self.handler], file, isBlank)
|
controller.addHandler(self.controllers[self.handler], file, isBlank)
|
||||||
|
|
||||||
def decode_message(self, message):
|
def decode_message(self, message):
|
||||||
return message[1], message[0]
|
if len(message) == 3:
|
||||||
|
return message[1], message[0], message[2]
|
||||||
|
else:
|
||||||
|
return message[1], message[0]
|
||||||
|
|
||||||
def slide(self, message):
|
def slide(self, message):
|
||||||
isLive, item = self.decode_message(message)
|
isLive, item, slide = self.decode_message(message)
|
||||||
slide = message[2]
|
|
||||||
if isLive:
|
if isLive:
|
||||||
self.liveHandler.slide(slide, live)
|
self.liveHandler.slide(slide, isLive)
|
||||||
else:
|
else:
|
||||||
self.previewHandler.slide(slide, live)
|
self.previewHandler.slide(slide, isLive)
|
||||||
|
|
||||||
def first(self, message):
|
def first(self, message):
|
||||||
isLive, item = self.decode_message(message)
|
isLive, item = self.decode_message(message)
|
||||||
|
@ -31,7 +31,7 @@ if os.name == u'nt':
|
|||||||
import _winreg
|
import _winreg
|
||||||
import win32ui
|
import win32ui
|
||||||
|
|
||||||
from presentationcontroller import PresentationController, PresentationDocument
|
from presentationcontroller import PresentationController, PresentationDocument
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -62,7 +62,8 @@ class PowerpointController(PresentationController):
|
|||||||
log.debug(u'check_available')
|
log.debug(u'check_available')
|
||||||
if os.name == u'nt':
|
if os.name == u'nt':
|
||||||
try:
|
try:
|
||||||
_winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, u'PowerPoint.Application').Close()
|
_winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT,
|
||||||
|
u'PowerPoint.Application').Close()
|
||||||
return True
|
return True
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
@ -96,13 +97,13 @@ class PowerpointController(PresentationController):
|
|||||||
|
|
||||||
def add_doc(self, name):
|
def add_doc(self, name):
|
||||||
log.debug(u'Add Doc PowerPoint')
|
log.debug(u'Add Doc PowerPoint')
|
||||||
doc = PowerpointDocument(self, name)
|
doc = PowerpointDocument(self, name)
|
||||||
self.docs.append(doc)
|
self.docs.append(doc)
|
||||||
return doc
|
return doc
|
||||||
|
|
||||||
class PowerpointDocument(PresentationDocument):
|
class PowerpointDocument(PresentationDocument):
|
||||||
|
|
||||||
def __init__(self, controller, presentation):
|
def __init__(self, controller, presentation):
|
||||||
log.debug(u'Init Presentation Powerpoint')
|
log.debug(u'Init Presentation Powerpoint')
|
||||||
self.presentation = None
|
self.presentation = None
|
||||||
self.controller = controller
|
self.controller = controller
|
||||||
|
@ -82,7 +82,8 @@ class PptviewController(PresentationController):
|
|||||||
if self.process:
|
if self.process:
|
||||||
return
|
return
|
||||||
log.debug(u'start PPTView')
|
log.debug(u'start PPTView')
|
||||||
self.process = cdll.LoadLibrary(r'openlp\plugins\presentations\lib\pptviewlib\pptviewlib.dll')
|
self.process = cdll.LoadLibrary(
|
||||||
|
r'openlp\plugins\presentations\lib\pptviewlib\pptviewlib.dll')
|
||||||
|
|
||||||
def kill(self):
|
def kill(self):
|
||||||
"""
|
"""
|
||||||
@ -94,13 +95,12 @@ class PptviewController(PresentationController):
|
|||||||
|
|
||||||
def add_doc(self, name):
|
def add_doc(self, name):
|
||||||
log.debug(u'Add Doc PPTView')
|
log.debug(u'Add Doc PPTView')
|
||||||
doc = PptviewDocument(self, name)
|
doc = PptviewDocument(self, name)
|
||||||
self.docs.append(doc)
|
self.docs.append(doc)
|
||||||
return doc
|
return doc
|
||||||
|
|
||||||
class PptviewDocument(PresentationDocument):
|
class PptviewDocument(PresentationDocument):
|
||||||
|
def __init__(self, controller, presentation):
|
||||||
def __init__(self, controller, presentation):
|
|
||||||
log.debug(u'Init Presentation PowerPoint')
|
log.debug(u'Init Presentation PowerPoint')
|
||||||
self.presentation = None
|
self.presentation = None
|
||||||
self.pptid = None
|
self.pptid = None
|
||||||
|
@ -100,16 +100,16 @@ class PresentationController(object):
|
|||||||
self.docs = []
|
self.docs = []
|
||||||
self.plugin = plugin
|
self.plugin = plugin
|
||||||
self.name = name
|
self.name = name
|
||||||
self.settings_section = self.plugin.settings_section
|
self.settingsSection = self.plugin.settingsSection
|
||||||
self.available = self.check_available()
|
self.available = self.check_available()
|
||||||
if self.available:
|
if self.available:
|
||||||
self.enabled = QtCore.QSettings().value(
|
self.enabled = QtCore.QSettings().value(
|
||||||
self.settings_section + u'/' + name,
|
self.settingsSection + u'/' + name,
|
||||||
QtCore.Qt.Unchecked).toInt()[0] == QtCore.Qt.Checked
|
QtCore.Qt.Unchecked).toInt()[0] == QtCore.Qt.Checked
|
||||||
else:
|
else:
|
||||||
self.enabled = False
|
self.enabled = False
|
||||||
self.thumbnailroot = os.path.join(
|
self.thumbnailroot = os.path.join(
|
||||||
AppLocation.get_section_data_path(self.settings_section),
|
AppLocation.get_section_data_path(self.settingsSection),
|
||||||
name, u'thumbnails')
|
name, u'thumbnails')
|
||||||
self.thumbnailprefix = u'slide'
|
self.thumbnailprefix = u'slide'
|
||||||
if not os.path.isdir(self.thumbnailroot):
|
if not os.path.isdir(self.thumbnailroot):
|
||||||
@ -210,7 +210,7 @@ class PresentationDocument(object):
|
|||||||
Returns a path to an image containing a preview for the requested slide
|
Returns a path to an image containing a preview for the requested slide
|
||||||
|
|
||||||
"""
|
"""
|
||||||
def __init__(self, controller, name):
|
def __init__(self, controller, name):
|
||||||
self.slidenumber = 0
|
self.slidenumber = 0
|
||||||
self.controller = controller
|
self.controller = controller
|
||||||
self.store_filename(name)
|
self.store_filename(name)
|
||||||
@ -243,10 +243,10 @@ class PresentationDocument(object):
|
|||||||
if not os.path.isdir(self.thumbnailpath):
|
if not os.path.isdir(self.thumbnailpath):
|
||||||
os.mkdir(self.thumbnailpath)
|
os.mkdir(self.thumbnailpath)
|
||||||
|
|
||||||
def get_file_name(self, presentation):
|
def get_file_name(self, presentation):
|
||||||
return os.path.split(presentation)[1]
|
return os.path.split(presentation)[1]
|
||||||
|
|
||||||
def get_thumbnail_path(self, presentation):
|
def get_thumbnail_path(self, presentation):
|
||||||
return os.path.join(
|
return os.path.join(
|
||||||
self.controller.thumbnailroot, self.get_file_name(presentation))
|
self.controller.thumbnailroot, self.get_file_name(presentation))
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ class HttpServer(object):
|
|||||||
def start_tcp(self):
|
def start_tcp(self):
|
||||||
log.debug(u'Start TCP server')
|
log.debug(u'Start TCP server')
|
||||||
port = QtCore.QSettings().value(
|
port = QtCore.QSettings().value(
|
||||||
self.parent.settings_section + u'/remote port',
|
self.parent.settingsSection + u'/remote port',
|
||||||
QtCore.QVariant(4316)).toInt()[0]
|
QtCore.QVariant(4316)).toInt()[0]
|
||||||
self.server = QtNetwork.QTcpServer()
|
self.server = QtNetwork.QTcpServer()
|
||||||
self.server.listen(QtNetwork.QHostAddress(QtNetwork.QHostAddress.Any),
|
self.server.listen(QtNetwork.QHostAddress(QtNetwork.QHostAddress.Any),
|
||||||
|
@ -150,8 +150,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
def loadBooks(self):
|
def loadBooks(self):
|
||||||
books = self.songmanager.get_books()
|
books = self.songmanager.get_books()
|
||||||
booksCompleter = QtGui.QCompleter(
|
booksCompleter = QtGui.QCompleter(
|
||||||
[book.name for book in books],
|
[book.name for book in books], self.SongbookCombo)
|
||||||
self.SongbookCombo)
|
|
||||||
booksCompleter.setCaseSensitivity(QtCore.Qt.CaseInsensitive);
|
booksCompleter.setCaseSensitivity(QtCore.Qt.CaseInsensitive);
|
||||||
self.SongbookCombo.setCompleter(booksCompleter);
|
self.SongbookCombo.setCompleter(booksCompleter);
|
||||||
self.SongbookCombo.clear()
|
self.SongbookCombo.clear()
|
||||||
@ -340,7 +339,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
self.verse_form.setVerse(u'', self.VerseListWidget.count() + 1, True)
|
self.verse_form.setVerse(u'', self.VerseListWidget.count() + 1, True)
|
||||||
if self.verse_form.exec_():
|
if self.verse_form.exec_():
|
||||||
afterText, verse, subVerse = self.verse_form.getVerse()
|
afterText, verse, subVerse = self.verse_form.getVerse()
|
||||||
data = u'%s:%s' %(verse, subVerse)
|
data = u'%s:%s' % (verse, subVerse)
|
||||||
item = QtGui.QListWidgetItem(afterText)
|
item = QtGui.QListWidgetItem(afterText)
|
||||||
item.setData(QtCore.Qt.UserRole, QtCore.QVariant(data))
|
item.setData(QtCore.Qt.UserRole, QtCore.QVariant(data))
|
||||||
item.setText(afterText)
|
item.setText(afterText)
|
||||||
@ -351,11 +350,11 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
if item:
|
if item:
|
||||||
tempText = item.text()
|
tempText = item.text()
|
||||||
verseId = unicode((item.data(QtCore.Qt.UserRole)).toString())
|
verseId = unicode((item.data(QtCore.Qt.UserRole)).toString())
|
||||||
self.verse_form.setVerse(tempText, \
|
self.verse_form.setVerse(
|
||||||
self.VerseListWidget.count(), True, verseId)
|
tempText, self.VerseListWidget.count(), True, verseId)
|
||||||
if self.verse_form.exec_():
|
if self.verse_form.exec_():
|
||||||
afterText, verse, subVerse = self.verse_form.getVerse()
|
afterText, verse, subVerse = self.verse_form.getVerse()
|
||||||
data = u'%s:%s' %(verse, subVerse)
|
data = u'%s:%s' % (verse, subVerse)
|
||||||
item.setData(QtCore.Qt.UserRole, QtCore.QVariant(data))
|
item.setData(QtCore.Qt.UserRole, QtCore.QVariant(data))
|
||||||
item.setText(afterText)
|
item.setText(afterText)
|
||||||
#number of lines has change so repaint the list moving the data
|
#number of lines has change so repaint the list moving the data
|
||||||
|
@ -46,7 +46,6 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
|
|
||||||
def __init__(self, parent, icon, title):
|
def __init__(self, parent, icon, title):
|
||||||
self.PluginNameShort = u'Song'
|
self.PluginNameShort = u'Song'
|
||||||
self.SettingsSection = title.lower()
|
|
||||||
self.IconPath = u'songs/song'
|
self.IconPath = u'songs/song'
|
||||||
self.ListViewWithDnD_class = SongListView
|
self.ListViewWithDnD_class = SongListView
|
||||||
MediaManagerItem.__init__(self, parent, icon, title)
|
MediaManagerItem.__init__(self, parent, icon, title)
|
||||||
@ -134,7 +133,7 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
|
|
||||||
def configUpdated(self):
|
def configUpdated(self):
|
||||||
self.searchAsYouType = QtCore.QSettings().value(
|
self.searchAsYouType = QtCore.QSettings().value(
|
||||||
self.SettingsSection + u'/search as type',
|
self.settingsSection + u'/search as type',
|
||||||
QtCore.QVariant(u'False')).toBool()
|
QtCore.QVariant(u'False')).toBool()
|
||||||
|
|
||||||
def retranslateUi(self):
|
def retranslateUi(self):
|
||||||
|
@ -137,7 +137,7 @@ class _OpenSong(XmlRootClass):
|
|||||||
newtag = "Pre-chorus"
|
newtag = "Pre-chorus"
|
||||||
else:
|
else:
|
||||||
newtag = t
|
newtag = t
|
||||||
s = (u'# %s %s'%(newtag, c)).rstrip()
|
s = (u'# %s %s' % (newtag, c)).rstrip()
|
||||||
res.append(s)
|
res.append(s)
|
||||||
res.append(l[1:])
|
res.append(l[1:])
|
||||||
if (len(l) == 0) and (not tagPending):
|
if (len(l) == 0) and (not tagPending):
|
||||||
|
@ -45,7 +45,6 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog):
|
|||||||
"""
|
"""
|
||||||
QtGui.QDialog.__init__(self, None)
|
QtGui.QDialog.__init__(self, None)
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.settingsSection = u'songusage'
|
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
|
||||||
def initialise(self):
|
def initialise(self):
|
||||||
@ -57,15 +56,15 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog):
|
|||||||
self.FromDate.setSelectedDate(fromDate)
|
self.FromDate.setSelectedDate(fromDate)
|
||||||
self.ToDate.setSelectedDate(toDate)
|
self.ToDate.setSelectedDate(toDate)
|
||||||
self.FileLineEdit.setText(
|
self.FileLineEdit.setText(
|
||||||
SettingsManager.get_last_dir(self.settingsSection, 1))
|
SettingsManager.get_last_dir(self.parent.settingsSection, 1))
|
||||||
|
|
||||||
def defineOutputLocation(self):
|
def defineOutputLocation(self):
|
||||||
path = QtGui.QFileDialog.getExistingDirectory(self,
|
path = QtGui.QFileDialog.getExistingDirectory(self,
|
||||||
self.trUtf8('Output File Location'),
|
self.trUtf8('Output File Location'),
|
||||||
SettingsManager.get_last_dir(self.settingsSection, 1))
|
SettingsManager.get_last_dir(self.parent.settingsSection, 1))
|
||||||
path = unicode(path)
|
path = unicode(path)
|
||||||
if path != u'':
|
if path != u'':
|
||||||
SettingsManager.set_last_dir(self.settingsSection, path, 1)
|
SettingsManager.set_last_dir(self.parent.settingsSection, path, 1)
|
||||||
self.FileLineEdit.setText(path)
|
self.FileLineEdit.setText(path)
|
||||||
|
|
||||||
def accept(self):
|
def accept(self):
|
||||||
|
@ -111,7 +111,7 @@ class SongUsagePlugin(Plugin):
|
|||||||
QtCore.SIGNAL(u'songs_live_started'),
|
QtCore.SIGNAL(u'songs_live_started'),
|
||||||
self.onReceiveSongUsage)
|
self.onReceiveSongUsage)
|
||||||
self.SongUsageActive = QtCore.QSettings().value(
|
self.SongUsageActive = QtCore.QSettings().value(
|
||||||
self.settings_section + u'/active',
|
self.settingsSection + u'/active',
|
||||||
QtCore.QVariant(False)).toBool()
|
QtCore.QVariant(False)).toBool()
|
||||||
self.SongUsageStatus.setChecked(self.SongUsageActive)
|
self.SongUsageStatus.setChecked(self.SongUsageActive)
|
||||||
if self.songusagemanager is None:
|
if self.songusagemanager is None:
|
||||||
@ -128,7 +128,7 @@ class SongUsagePlugin(Plugin):
|
|||||||
|
|
||||||
def toggleSongUsageState(self):
|
def toggleSongUsageState(self):
|
||||||
self.SongUsageActive = not self.SongUsageActive
|
self.SongUsageActive = not self.SongUsageActive
|
||||||
QtCore.QSettings().setValue(self.settings_section + u'/active',
|
QtCore.QSettings().setValue(self.settingsSection + u'/active',
|
||||||
QtCore.QVariant(self.SongUsageActive))
|
QtCore.QVariant(self.SongUsageActive))
|
||||||
|
|
||||||
def onReceiveSongUsage(self, items):
|
def onReceiveSongUsage(self, items):
|
||||||
|
295
resources/forms/displaytab.ui
Normal file
295
resources/forms/displaytab.ui
Normal file
@ -0,0 +1,295 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>DisplaysDialog</class>
|
||||||
|
<widget class="QWidget" name="DisplaysDialog">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>620</width>
|
||||||
|
<height>716</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Amend Display Settings</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="layoutWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>40</y>
|
||||||
|
<width>241</width>
|
||||||
|
<height>79</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="CurrentGroupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>Default Settings</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="XLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>X</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="Xpos">
|
||||||
|
<property name="text">
|
||||||
|
<string>0</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="YLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Y</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="Ypos">
|
||||||
|
<property name="text">
|
||||||
|
<string>0</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_9">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="HeightLabel">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>100</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Height</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="Height">
|
||||||
|
<property name="text">
|
||||||
|
<string>0</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="WidthLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Width</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="Width">
|
||||||
|
<property name="text">
|
||||||
|
<string>0</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QGroupBox" name="CurrentGroupBox_2">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>130</y>
|
||||||
|
<width>248</width>
|
||||||
|
<height>87</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>500</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Amend Settings</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="XAmendLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>X</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="XposEdit">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>50</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maxLength">
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="YAmendLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Y</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="YposEdit">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>50</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maxLength">
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="HeightAmendLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Height</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="HeightEdit">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>50</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maxLength">
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||||
|
<property name="sizeConstraint">
|
||||||
|
<enum>QLayout::SetMinimumSize</enum>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="WidthAmendLabel">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>100</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Width</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="WidthEdit">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>60</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
<zorder>layoutWidget</zorder>
|
||||||
|
<zorder>YAmendLabel</zorder>
|
||||||
|
<zorder>HeightAmendLabel</zorder>
|
||||||
|
<zorder>WidthAmendLabel</zorder>
|
||||||
|
<zorder>YAmendLabel</zorder>
|
||||||
|
</widget>
|
||||||
|
<widget class="QCheckBox" name="OverrideCheckBox">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>10</y>
|
||||||
|
<width>191</width>
|
||||||
|
<height>23</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Override Output Display</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
Loading…
Reference in New Issue
Block a user