This commit is contained in:
Tim Bentley 2009-11-01 15:29:53 +00:00
commit 201fce5bba
46 changed files with 502 additions and 379 deletions

View File

@ -105,6 +105,7 @@ class OpenLP(QtGui.QApplication):
if show_splash: if show_splash:
# now kill the splashscreen # now kill the splashscreen
self.splash.finish(self.mainWindow) self.splash.finish(self.mainWindow)
self.mainWindow.versionCheck()
return self.exec_() return self.exec_()
def main(): def main():

View File

@ -58,18 +58,13 @@ class MediaManagerItem(QtGui.QWidget):
When creating a descendant class from this class for your plugin, When creating a descendant class from this class for your plugin,
the following member variables should be set. the following member variables should be set.
``self.TranslationContext``
This sets the translation context of all the text in the
Media Manager item.
``self.PluginNameShort`` ``self.PluginNameShort``
The shortened (usually singular) name for the plugin e.g. *'Song'* The shortened (usually singular) name for the plugin e.g. *'Song'*
for the Songs plugin. for the Songs plugin.
``self.PluginNameVisible`` ``self.PluginNameVisible``
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. This should normally be translation function.
``self.trUtf8(self.PluginNameShort)``.
``self.ConfigSection`` ``self.ConfigSection``
The section in the configuration where the items in the media The section in the configuration where the items in the media
@ -117,6 +112,7 @@ class MediaManagerItem(QtGui.QWidget):
if title is not None: if title is not None:
self.title = title self.title = title
self.Toolbar = None self.Toolbar = None
self.ServiceItemIconName = None
self.PageLayout = QtGui.QVBoxLayout(self) self.PageLayout = QtGui.QVBoxLayout(self)
self.PageLayout.setSpacing(0) self.PageLayout.setSpacing(0)
self.PageLayout.setContentsMargins(4, 0, 4, 0) self.PageLayout.setContentsMargins(4, 0, 4, 0)
@ -228,7 +224,8 @@ class MediaManagerItem(QtGui.QWidget):
if self.hasEditIcon: if self.hasEditIcon:
self.addToolbarButton( self.addToolbarButton(
u'Edit %s' % self.PluginNameShort, u'Edit %s' % self.PluginNameShort,
u'%s %s' % (self.trUtf8(u'Edit the selected'), self.PluginNameVisible), u'%s %s' % (self.trUtf8(u'Edit the selected'),
self.PluginNameVisible),
u':%s_edit.png' % self.IconPath, self.onEditClick, u':%s_edit.png' % self.IconPath, self.onEditClick,
u'%sEditItem' % self.PluginNameShort) u'%sEditItem' % self.PluginNameShort)
## Delete Button ## ## Delete Button ##
@ -319,7 +316,8 @@ class MediaManagerItem(QtGui.QWidget):
pass pass
def onFileClick(self): def onFileClick(self):
files = QtGui.QFileDialog.getOpenFileNames(self, self.OnNewPrompt, files = QtGui.QFileDialog.getOpenFileNames(
self, self.OnNewPrompt,
self.parent.config.get_last_dir(), self.OnNewFileMasks) self.parent.config.get_last_dir(), self.OnNewFileMasks)
log.info(u'New files(s)%s', unicode(files)) log.info(u'New files(s)%s', unicode(files))
if len(files) > 0: if len(files) > 0:
@ -381,7 +379,7 @@ class MediaManagerItem(QtGui.QWidget):
Common method for generating a service item Common method for generating a service item
""" """
service_item = ServiceItem(self.parent) service_item = ServiceItem(self.parent)
if self.ServiceItemIconName: if self.ServiceItemIconName is not None:
service_item.addIcon(self.ServiceItemIconName) service_item.addIcon(self.ServiceItemIconName)
else: else:
service_item.addIcon( service_item.addIcon(

View File

@ -35,7 +35,7 @@ class PluginStatus(object):
Inactive = 1 Inactive = 1
Disabled = 2 Disabled = 2
class Plugin(object): class Plugin(QtCore.QObject):
""" """
Base class for openlp plugins to inherit from. Base class for openlp plugins to inherit from.
@ -91,7 +91,7 @@ class Plugin(object):
log = logging.getLogger(u'Plugin') log = logging.getLogger(u'Plugin')
log.info(u'loaded') log.info(u'loaded')
def __init__(self, name=None, version=None, plugin_helpers=None): def __init__(self, name, version=None, plugin_helpers=None):
""" """
This is the constructor for the plugin object. This provides an easy This is the constructor for the plugin object. This provides an easy
way for descendent plugins to populate common data. This method *must* way for descendent plugins to populate common data. This method *must*
@ -110,10 +110,8 @@ class Plugin(object):
``plugin_helpers`` ``plugin_helpers``
Defaults to *None*. A list of helper objects. Defaults to *None*. A list of helper objects.
""" """
if name is not None: QtCore.QObject.__init__(self)
self.name = name self.name = name
else:
self.name = u'Plugin'
if version is not None: if version is not None:
self.version = version self.version = version
self.icon = None self.icon = None
@ -129,7 +127,7 @@ class Plugin(object):
self.settings = plugin_helpers[u'settings'] self.settings = plugin_helpers[u'settings']
self.mediadock = plugin_helpers[u'toolbox'] self.mediadock = plugin_helpers[u'toolbox']
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'%s_add_service_item'% self.name), QtCore.SIGNAL(u'%s_add_service_item' % self.name),
self.process_add_service_event) self.process_add_service_event)
def check_pre_conditions(self): def check_pre_conditions(self):

View File

@ -93,7 +93,6 @@ class PluginManager(object):
log.exception(u'Failed to import module %s on path %s for reason %s', log.exception(u'Failed to import module %s on path %s for reason %s',
modulename, path, e.args[0]) modulename, path, e.args[0])
plugin_classes = Plugin.__subclasses__() plugin_classes = Plugin.__subclasses__()
self.plugins = []
plugin_objects = [] plugin_objects = []
for p in plugin_classes: for p in plugin_classes:
try: try:
@ -137,10 +136,6 @@ class PluginManager(object):
for plugin in self.plugins: for plugin in self.plugins:
if plugin.status is not PluginStatus.Disabled: if plugin.status is not PluginStatus.Disabled:
plugin.media_item = plugin.get_media_manager_item() plugin.media_item = plugin.get_media_manager_item()
if plugin.media_item is not None:
log.debug(u'Inserting media manager item from %s' % \
plugin.name)
mediadock.add_dock(plugin.media_item, plugin.icon, plugin.weight)
def hook_settings_tabs(self, settingsform=None): def hook_settings_tabs(self, settingsform=None):
""" """

View File

@ -72,9 +72,11 @@ class Renderer(object):
self._theme = theme self._theme = theme
self.bg_frame = None self.bg_frame = None
self.bg_image = None self.bg_image = None
self._bg_image_filename = None
self.theme_name = theme.theme_name self.theme_name = theme.theme_name
self._set_theme_font() self._set_theme_font()
if theme.background_type == u'image': if theme.background_type == u'image':
print theme.background_filename
if theme.background_filename is not None: if theme.background_filename is not None:
self.set_bg_image(theme.background_filename) self.set_bg_image(theme.background_filename)
@ -110,8 +112,8 @@ class Renderer(object):
painter.begin(self.bg_image) painter.begin(self.bg_image)
self.background_offsetx = (width - realwidth) / 2 self.background_offsetx = (width - realwidth) / 2
self.background_offsety = (height - realheight) / 2 self.background_offsety = (height - realheight) / 2
painter.drawImage(self.background_offsetx, self.background_offsety, painter.drawImage(self.background_offsetx,
preview) self.background_offsety, preview)
painter.end() painter.end()
def set_frame_dest(self, frame_width, frame_height, preview=False): def set_frame_dest(self, frame_width, frame_height, preview=False):

View File

@ -31,7 +31,7 @@ class SettingsTab(QtGui.QWidget):
SettingsTab is a helper widget for plugins to define Tabs for the settings SettingsTab is a helper widget for plugins to define Tabs for the settings
dialog. dialog.
""" """
def __init__(self, title=None, section=None): def __init__(self, title, section=None):
""" """
Constructor to create the Settings tab item. Constructor to create the Settings tab item.

View File

@ -41,6 +41,10 @@ class SongXMLBuilder(object):
</lyrics> </lyrics>
</song> </song>
""" """
global log
log = logging.getLogger(u'SongXMLBuilder')
log.info(u'SongXMLBuilder Loaded')
def __init__(self): def __init__(self):
""" """
Set up the song builder. Set up the song builder.
@ -81,6 +85,7 @@ class SongXMLBuilder(object):
``content`` ``content``
The actual text of the verse to be stored. The actual text of the verse to be stored.
""" """
#log.debug(u'add_verse_to_lyrics %s, %s\n%s' % (type, number, content))
verse = self.song_xml.createElement(u'verse') verse = self.song_xml.createElement(u'verse')
verse.setAttribute(u'type', type) verse.setAttribute(u'type', type)
verse.setAttribute(u'label', number) verse.setAttribute(u'label', number)

View File

@ -31,7 +31,7 @@ class AlertsTab(SettingsTab):
AlertsTab is the alerts settings tab in the settings dialog. AlertsTab is the alerts settings tab in the settings dialog.
""" """
def __init__(self): def __init__(self):
SettingsTab.__init__(self, u'Alerts', u'Alerts') SettingsTab.__init__(self, u'Alerts')
self.font_color = '#ffffff' self.font_color = '#ffffff'
self.bg_color = '#660000' self.bg_color = '#660000'

View File

@ -431,7 +431,6 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
QtGui.QColor(self.theme.background_endColor), self).name() QtGui.QColor(self.theme.background_endColor), self).name()
self.Color2PushButton.setStyleSheet( self.Color2PushButton.setStyleSheet(
u'background-color: %s' % unicode(self.theme.background_endColor)) u'background-color: %s' % unicode(self.theme.background_endColor))
self.previewTheme(self.theme) self.previewTheme(self.theme)
# #
#Other Tab #Other Tab
@ -481,25 +480,28 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
def paintUi(self, theme): def paintUi(self, theme):
self.stateChanging(theme) self.stateChanging(theme)
self.ThemeNameEdit.setText(self.theme.theme_name) self.ThemeNameEdit.setText(self.theme.theme_name)
# Background Tab
if self.theme.background_mode == u'opaque': if self.theme.background_mode == u'opaque':
self.BackgroundComboBox.setCurrentIndex(0) self.BackgroundComboBox.setCurrentIndex(0)
else: else:
self.BackgroundComboBox.setCurrentIndex(1) self.BackgroundComboBox.setCurrentIndex(1)
self.ImageLineEdit.setText(u'')
if theme.background_type == u'solid': if theme.background_type == u'solid':
self.BackgroundTypeComboBox.setCurrentIndex(0) self.BackgroundTypeComboBox.setCurrentIndex(0)
elif theme.background_type == u'gradient': elif theme.background_type == u'gradient':
self.BackgroundTypeComboBox.setCurrentIndex(1) self.BackgroundTypeComboBox.setCurrentIndex(1)
else: else:
self.BackgroundTypeComboBox.setCurrentIndex(2) self.BackgroundTypeComboBox.setCurrentIndex(2)
self.ImageLineEdit.setText(self.theme.background_filename)
if self.theme.background_direction == u'horizontal': if self.theme.background_direction == u'horizontal':
self.GradientComboBox.setCurrentIndex(0) self.GradientComboBox.setCurrentIndex(0)
elif self.theme.background_direction == u'vertical': elif self.theme.background_direction == u'vertical':
self.GradientComboBox.setCurrentIndex(1) self.GradientComboBox.setCurrentIndex(1)
else: else:
self.GradientComboBox.setCurrentIndex(2) self.GradientComboBox.setCurrentIndex(2)
# Font Main Tab
self.FontMainComboBox.setCurrentFont(
QtGui.QFont(self.theme.font_main_name))
self.FontMainSizeSpinBox.setValue(int(self.theme.font_main_proportion)) self.FontMainSizeSpinBox.setValue(int(self.theme.font_main_proportion))
if not self.theme.font_main_italics and \ if not self.theme.font_main_italics and \
self.theme.font_main_weight == u'Normal': self.theme.font_main_weight == u'Normal':
@ -517,6 +519,9 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
self.FontMainYSpinBox.setValue(int(self.theme.font_main_y)) self.FontMainYSpinBox.setValue(int(self.theme.font_main_y))
self.FontMainWidthSpinBox.setValue(int(self.theme.font_main_width)) self.FontMainWidthSpinBox.setValue(int(self.theme.font_main_width))
self.FontMainHeightSpinBox.setValue(int(self.theme.font_main_height)) self.FontMainHeightSpinBox.setValue(int(self.theme.font_main_height))
# Font Footer Tab
self.FontFooterComboBox.setCurrentFont(
QtGui.QFont(self.theme.font_footer_name))
self.FontFooterSizeSpinBox.setValue( self.FontFooterSizeSpinBox.setValue(
int(self.theme.font_footer_proportion)) int(self.theme.font_footer_proportion))
if not self.theme.font_footer_italics and \ if not self.theme.font_footer_italics and \

View File

@ -32,7 +32,7 @@ class GeneralTab(SettingsTab):
""" """
def __init__(self, screen_list): def __init__(self, screen_list):
self.screen_list = screen_list self.screen_list = screen_list
SettingsTab.__init__(self, u'General', u'General') SettingsTab.__init__(self, u'General')
def setupUi(self): def setupUi(self):
self.setObjectName(u'GeneralTab') self.setObjectName(u'GeneralTab')
@ -76,6 +76,16 @@ class GeneralTab(SettingsTab):
self.ShowSplashCheckBox.setObjectName(u'ShowSplashCheckBox') self.ShowSplashCheckBox.setObjectName(u'ShowSplashCheckBox')
self.StartupLayout.addWidget(self.ShowSplashCheckBox) self.StartupLayout.addWidget(self.ShowSplashCheckBox)
self.GeneralLeftLayout.addWidget(self.StartupGroupBox) self.GeneralLeftLayout.addWidget(self.StartupGroupBox)
self.SettingsGroupBox = QtGui.QGroupBox(self.GeneralLeftWidget)
self.SettingsGroupBox.setObjectName(u'SettingsGroupBox')
self.SettingsLayout = QtGui.QVBoxLayout(self.SettingsGroupBox)
self.SettingsLayout.setSpacing(8)
self.SettingsLayout.setMargin(8)
self.SettingsLayout.setObjectName(u'SettingsLayout')
self.SaveCheckServiceCheckBox = QtGui.QCheckBox(self.SettingsGroupBox)
self.SaveCheckServiceCheckBox.setObjectName(u'SaveCheckServiceCheckBox')
self.SettingsLayout.addWidget(self.SaveCheckServiceCheckBox)
self.GeneralLeftLayout.addWidget(self.SettingsGroupBox)
self.GeneralLeftSpacer = QtGui.QSpacerItem(20, 40, self.GeneralLeftSpacer = QtGui.QSpacerItem(20, 40,
QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.GeneralLeftLayout.addItem(self.GeneralLeftSpacer) self.GeneralLeftLayout.addItem(self.GeneralLeftSpacer)
@ -124,6 +134,8 @@ class GeneralTab(SettingsTab):
QtCore.SIGNAL(u'stateChanged(int)'), self.onAutoOpenCheckBoxChanged) QtCore.SIGNAL(u'stateChanged(int)'), self.onAutoOpenCheckBoxChanged)
QtCore.QObject.connect(self.ShowSplashCheckBox, QtCore.QObject.connect(self.ShowSplashCheckBox,
QtCore.SIGNAL(u'stateChanged(int)'), self.onShowSplashCheckBoxChanged) QtCore.SIGNAL(u'stateChanged(int)'), self.onShowSplashCheckBoxChanged)
QtCore.QObject.connect(self.SaveCheckServiceCheckBox,
QtCore.SIGNAL(u'stateChanged(int)'), self.onSaveCheckServiceCheckBox)
QtCore.QObject.connect(self.NumberEdit, QtCore.QObject.connect(self.NumberEdit,
QtCore.SIGNAL(u'editingFinished()'), self.onNumberEditLostFocus) QtCore.SIGNAL(u'editingFinished()'), self.onNumberEditLostFocus)
QtCore.QObject.connect(self.UsernameEdit, QtCore.QObject.connect(self.UsernameEdit,
@ -138,6 +150,8 @@ class GeneralTab(SettingsTab):
self.WarningCheckBox.setText(self.trUtf8(u'Show blank screen warning')) self.WarningCheckBox.setText(self.trUtf8(u'Show blank screen warning'))
self.AutoOpenCheckBox.setText(self.trUtf8(u'Automatically open the last service')) self.AutoOpenCheckBox.setText(self.trUtf8(u'Automatically open the last service'))
self.ShowSplashCheckBox.setText(self.trUtf8(u'Show the splash screen')) self.ShowSplashCheckBox.setText(self.trUtf8(u'Show the splash screen'))
self.SettingsGroupBox.setTitle(self.trUtf8(u'Application Settings'))
self.SaveCheckServiceCheckBox.setText(self.trUtf8(u'Prompt to save Sevice before starting New'))
self.CCLIGroupBox.setTitle(self.trUtf8(u'CCLI Details')) self.CCLIGroupBox.setTitle(self.trUtf8(u'CCLI Details'))
self.NumberLabel.setText(self.trUtf8(u'CCLI Number:')) self.NumberLabel.setText(self.trUtf8(u'CCLI Number:'))
self.UsernameLabel.setText(self.trUtf8(u'SongSelect Username:')) self.UsernameLabel.setText(self.trUtf8(u'SongSelect Username:'))
@ -155,6 +169,9 @@ class GeneralTab(SettingsTab):
def onWarningCheckBoxChanged(self, value): def onWarningCheckBoxChanged(self, value):
self.Warning = (value == QtCore.Qt.Checked) self.Warning = (value == QtCore.Qt.Checked)
def onSaveCheckServiceCheckBox(self, value):
self.PromptSaveService = (value == QtCore.Qt.Checked)
def onNumberEditLostFocus(self): def onNumberEditLostFocus(self):
self.CCLNumber = self.NumberEdit.displayText() self.CCLNumber = self.NumberEdit.displayText()
@ -175,9 +192,11 @@ class GeneralTab(SettingsTab):
self.Warning = str_to_bool(self.config.get_config(u'Blank Warning', u'False')) self.Warning = str_to_bool(self.config.get_config(u'Blank Warning', u'False'))
self.AutoOpen = str_to_bool(self.config.get_config(u'Auto Open', u'False')) self.AutoOpen = str_to_bool(self.config.get_config(u'Auto Open', u'False'))
self.ShowSplash = str_to_bool(self.config.get_config(u'show splash', u'True')) self.ShowSplash = str_to_bool(self.config.get_config(u'show splash', u'True'))
self.PromptSaveService = str_to_bool(self.config.get_config(u'prompt save service', u'False'))
self.CCLNumber = unicode(self.config.get_config(u'CCL Number', u'XXX')) self.CCLNumber = unicode(self.config.get_config(u'CCL Number', u'XXX'))
self.Username = unicode(self.config.get_config(u'User Name', u'')) self.Username = unicode(self.config.get_config(u'User Name', u''))
self.Password = unicode(self.config.get_config(u'Password', u'')) self.Password = unicode(self.config.get_config(u'Password', u''))
self.SaveCheckServiceCheckBox.setChecked(self.PromptSaveService)
# Set a few things up # Set a few things up
self.MonitorComboBox.setCurrentIndex(self.MonitorNumber) self.MonitorComboBox.setCurrentIndex(self.MonitorNumber)
self.WarningCheckBox.setChecked(self.Warning) self.WarningCheckBox.setChecked(self.Warning)
@ -192,6 +211,7 @@ class GeneralTab(SettingsTab):
self.config.set_config(u'Blank Warning', self.Warning) self.config.set_config(u'Blank Warning', self.Warning)
self.config.set_config(u'Auto Open', self.AutoOpen) self.config.set_config(u'Auto Open', self.AutoOpen)
self.config.set_config(u'show splash', self.ShowSplash) self.config.set_config(u'show splash', self.ShowSplash)
self.config.set_config(u'prompt save service', self.PromptSaveService)
self.config.set_config(u'CCL Number', self.CCLNumber) self.config.set_config(u'CCL Number', self.CCLNumber)
self.config.set_config(u'User Name', self.Username) self.config.set_config(u'User Name', self.Username)
self.config.set_config(u'Password', self.Password) self.config.set_config(u'Password', self.Password)

View File

@ -525,7 +525,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
self.settingsForm.postSetUp() self.settingsForm.postSetUp()
def versionCheck(self): def versionCheck(self):
applicationVersion = self.generalConfig.get_config(u'Application version', u'1.9.0-595') applicationVersion = self.generalConfig.get_config(u'Application version', u'1.9.0-640')
version = check_latest_version(self.generalConfig, applicationVersion) version = check_latest_version(self.generalConfig, applicationVersion)
if applicationVersion != version: if applicationVersion != version:
version_text = unicode(self.trUtf8(u'OpenLP version %s has been updated ' version_text = unicode(self.trUtf8(u'OpenLP version %s has been updated '
@ -562,7 +562,6 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
screen_number = self.getMonitorNumber() screen_number = self.getMonitorNumber()
self.mainDisplay.setup(screen_number) self.mainDisplay.setup(screen_number)
self.setFocus() self.setFocus()
self.versionCheck()
if str_to_bool(self.generalConfig.get_config(u'Auto Open', False)): if str_to_bool(self.generalConfig.get_config(u'Auto Open', False)):
self.ServiceManagerContents.onLoadService(True) self.ServiceManagerContents.onLoadService(True)
if str_to_bool(self.generalConfig.get_config(u'Screen Blank', False)) \ if str_to_bool(self.generalConfig.get_config(u'Screen Blank', False)) \

View File

@ -33,8 +33,7 @@ class MediaDockManager(object):
def add_dock(self, media_item, icon, weight): def add_dock(self, media_item, icon, weight):
log.info(u'Adding %s dock' % media_item.title) log.info(u'Adding %s dock' % media_item.title)
id = self.media_dock.addItem( self.media_dock.addItem(media_item, icon, media_item.title)
media_item, icon, media_item.title)
def insert_dock(self, media_item, icon, weight): def insert_dock(self, media_item, icon, weight):
""" """
@ -56,6 +55,6 @@ class MediaDockManager(object):
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) is not None: if self.media_dock.widget(dock_index) is not None:
if self.media_dock.widget(dock_index).ConfigSection == name.lower(): if self.media_dock.widget(dock_index).ConfigSection == 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)

View File

@ -37,6 +37,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
QtGui.QDialog.__init__(self, parent) QtGui.QDialog.__init__(self, parent)
self.parent = parent self.parent = parent
self.activePlugin = None self.activePlugin = None
self.programaticChange = False
self.setupUi(self) self.setupUi(self)
self.load() self.load()
self._clearDetails() self._clearDetails()
@ -84,6 +85,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
self.VersionNumberLabel.setText(self.activePlugin.version) self.VersionNumberLabel.setText(self.activePlugin.version)
self.AboutTextBrowser.setHtml(self.activePlugin.about()) self.AboutTextBrowser.setHtml(self.activePlugin.about())
if self.activePlugin.can_be_disabled(): if self.activePlugin.can_be_disabled():
self.programaticChange = True
self.StatusComboBox.setCurrentIndex(int(self.activePlugin.status)) self.StatusComboBox.setCurrentIndex(int(self.activePlugin.status))
self.StatusComboBox.setEnabled(True) self.StatusComboBox.setEnabled(True)
else: else:
@ -105,6 +107,9 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
self._clearDetails() self._clearDetails()
def onStatusComboBoxChanged(self, status): def onStatusComboBoxChanged(self, status):
if self.programaticChange is True:
self.programaticChange = False
return
self.activePlugin.toggle_status(status) self.activePlugin.toggle_status(status)
if status == PluginStatus.Active: if status == PluginStatus.Active:
self.activePlugin.initialise() self.activePlugin.initialise()
@ -119,4 +124,3 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
status_text = 'Disabled' status_text = 'Disabled'
self.PluginListWidget.currentItem().setText( self.PluginListWidget.currentItem().setText(
u'%s (%s)' % (self.activePlugin.name, status_text)) u'%s (%s)' % (self.activePlugin.name, status_text))

View File

@ -27,11 +27,12 @@ import string
import logging import logging
import cPickle import cPickle
import zipfile import zipfile
import uuid
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import PluginConfig, OpenLPToolbar, ServiceItem, \ from openlp.core.lib import PluginConfig, OpenLPToolbar, ServiceItem, \
ServiceItemType, contextMenuAction, contextMenuSeparator, contextMenu, \ ServiceItemType, contextMenuAction, contextMenuSeparator, contextMenu, \
Receiver Receiver, contextMenu, str_to_bool
class ServiceManagerList(QtGui.QTreeWidget): class ServiceManagerList(QtGui.QTreeWidget):
@ -129,8 +130,12 @@ class ServiceManager(QtGui.QWidget):
self.parent = parent self.parent = parent
self.serviceItems = [] self.serviceItems = []
self.serviceName = u'' self.serviceName = u''
#is a new service and has not been saved
self.isNew = True self.isNew = True
#Indicates if remoteTriggering is active. If it is the next addServiceItem call
#will replace the currently selected one.
self.remoteEditTriggered = False self.remoteEditTriggered = False
#start with the layout
self.Layout = QtGui.QVBoxLayout(self) self.Layout = QtGui.QVBoxLayout(self)
self.Layout.setSpacing(0) self.Layout.setSpacing(0)
self.Layout.setMargin(0) self.Layout.setMargin(0)
@ -355,6 +360,19 @@ 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 \
str_to_bool(PluginConfig(u'General').
get_config(u'prompt save service', u'False')):
ret = QtGui.QMessageBox.question(None,
self.trUtf8(u'Save Changes to Service?'),
self.trUtf8(u'Your service is unsaved, do you want to save those '
u'changes before creating a new one ?'),
QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Cancel |
QtGui.QMessageBox.Save),
QtGui.QMessageBox.Save)
if ret == QtGui.QMessageBox.Save:
self.onSaveService()
self.ServiceManagerList.clear() self.ServiceManagerList.clear()
self.serviceItems = [] self.serviceItems = []
self.serviceName = u'' self.serviceName = u''
@ -539,17 +557,22 @@ class ServiceManager(QtGui.QWidget):
sitem, count = self.findServiceItem() sitem, count = self.findServiceItem()
item.render() item.render()
if self.remoteEditTriggered: if self.remoteEditTriggered:
item.uuid = self.serviceItems[sitem][u'data'].uuid
self.serviceItems[sitem][u'data'] = item self.serviceItems[sitem][u'data'] = item
self.remoteEditTriggered = False self.remoteEditTriggered = False
self.repaintServiceList(sitem + 1, 0) self.repaintServiceList(sitem + 1, 0)
self.parent.LiveController.replaceServiceManagerItem(item)
else: else:
item.uuid = unicode(uuid.uuid1())
if sitem == -1: if sitem == -1:
self.serviceItems.append({u'data': item, self.serviceItems.append({u'data': item,
u'order': len(self.serviceItems) + 1, u'expanded':True}) u'order': len(self.serviceItems) + 1,
u'expanded':True})
self.repaintServiceList(len(self.serviceItems) + 1, 0) self.repaintServiceList(len(self.serviceItems) + 1, 0)
else: else:
self.serviceItems.insert(sitem + 1, {u'data': item, self.serviceItems.insert(sitem + 1, {u'data': item,
u'order': len(self.serviceItems)+1, u'expanded':True}) u'order': len(self.serviceItems)+1,
u'expanded':True})
self.repaintServiceList(sitem + 1, 0) self.repaintServiceList(sitem + 1, 0)
self.parent.serviceChanged(False, self.serviceName) self.parent.serviceChanged(False, self.serviceName)

View File

@ -177,16 +177,16 @@ class SlideController(QtGui.QWidget):
if isLive: if isLive:
self.Songbar = OpenLPToolbar(self) self.Songbar = OpenLPToolbar(self)
self.Songbar.addToolbarButton( self.Songbar.addToolbarButton(
u'Bridge', u':/media/media_time.png', u'Bridge', u':/slides/slide_close.png',
self.trUtf8(u'Bridge'), self.trUtf8(u'Bridge'),
self.onSongBarHandler) self.onSongBarHandler)
self.Songbar.addToolbarButton( self.Songbar.addToolbarButton(
u'Chorus', u':/media/media_time.png', u'Chorus', u':/slides/slide_close.png',
self.trUtf8(u'Chorus'), self.trUtf8(u'Chorus'),
self.onSongBarHandler) self.onSongBarHandler)
for verse in range(1, 9): for verse in range(1, 20):
self.Songbar.addToolbarButton( self.Songbar.addToolbarButton(
unicode(verse), u':/media/media_time.png', unicode(verse), u':/slides/slide_close.png',
unicode(self.trUtf8(u'Verse %s'))%verse, unicode(self.trUtf8(u'Verse %s'))%verse,
self.onSongBarHandler) self.onSongBarHandler)
self.ControllerLayout.addWidget(self.Songbar) self.ControllerLayout.addWidget(self.Songbar)
@ -283,6 +283,15 @@ class SlideController(QtGui.QWidget):
self.Toolbar.makeWidgetsInvisible(self.image_list) self.Toolbar.makeWidgetsInvisible(self.image_list)
if item.name == u'Songs' and \ if item.name == u'Songs' and \
str_to_bool(self.songsconfig.get_config(u'display songbar', True)): str_to_bool(self.songsconfig.get_config(u'display songbar', True)):
for action in self.Songbar.actions:
self.Songbar.actions[action].setVisible(False)
verses = item.verse_order.split(u' ')
for verse in verses:
try:
self.Songbar.actions[verse].setVisible(True)
except:
#More than 20 verses hard luck
pass
self.Songbar.setVisible(True) self.Songbar.setVisible(True)
elif item.service_item_type == ServiceItemType.Image: elif item.service_item_type == ServiceItemType.Image:
#Not sensible to allow loops with 1 frame #Not sensible to allow loops with 1 frame
@ -324,6 +333,13 @@ class SlideController(QtGui.QWidget):
self.songEdit = False self.songEdit = False
self.displayServiceManagerItems(item, slideno) self.displayServiceManagerItems(item, slideno)
def replaceServiceManagerItem(self, item):
"""
Replacement item following a remote edit
"""
if self.commandItem is not None and \
item.uuid == self.commandItem.uuid:
self.addServiceManagerItem(item, self.PreviewListWidget.currentRow())
def addServiceManagerItem(self, item, slideno): def addServiceManagerItem(self, item, slideno):
""" """

View File

@ -32,7 +32,7 @@ class ThemesTab(SettingsTab):
""" """
def __init__(self, parent): def __init__(self, parent):
self.parent = parent self.parent = parent
SettingsTab.__init__(self, u'Themes', u'Themes') SettingsTab.__init__(self, u'Themes')
def setupUi(self): def setupUi(self):
self.setObjectName(u'ThemesTab') self.setObjectName(u'ThemesTab')

View File

@ -35,10 +35,8 @@ class BiblePlugin(Plugin):
log.info(u'Bible Plugin loaded') log.info(u'Bible Plugin loaded')
def __init__(self, plugin_helpers): def __init__(self, plugin_helpers):
# Call the parent constructor
Plugin.__init__(self, u'Bibles', u'1.9.0', plugin_helpers) Plugin.__init__(self, u'Bibles', u'1.9.0', plugin_helpers)
self.weight = -9 self.weight = -9
# Create the plugin icon
self.icon = buildIcon(u':/media/media_bible.png') self.icon = buildIcon(u':/media/media_bible.png')
#Register the bible Manager #Register the bible Manager
self.biblemanager = None self.biblemanager = None
@ -63,11 +61,11 @@ class BiblePlugin(Plugin):
self.ExportBibleItem.setVisible(False) self.ExportBibleItem.setVisible(False)
def get_settings_tab(self): def get_settings_tab(self):
return BiblesTab() return BiblesTab(self.name)
def get_media_manager_item(self): def get_media_manager_item(self):
# Create the BibleManagerItem object # Create the BibleManagerItem object
return BibleMediaItem(self, self.icon, u'Bibles') return BibleMediaItem(self, self.icon, self.name)
def add_import_menu_item(self, import_menu): def add_import_menu_item(self, import_menu):
self.ImportBibleItem = QtGui.QAction(import_menu) self.ImportBibleItem = QtGui.QAction(import_menu)
@ -91,8 +89,7 @@ class BiblePlugin(Plugin):
self.media_item.onNewClick() self.media_item.onNewClick()
def about(self): def about(self):
about_text = u'<strong>Bible Plugin</strong><br />This plugin allows '\ about_text = self.trUtf8(u'<strong>Bible Plugin</strong><br />This '
u'bible verse from different sources to be displayed on the '\ u'plugin allows bible verses from different sources to be '
u'screen during the service.<br /><br /><strong>This is a core '\ u'displayed on the screen during the service.')
u'plugin and cannot be made inactive</strong>'
return about_text return about_text

View File

@ -37,11 +37,11 @@ class BiblesTab(SettingsTab):
log = logging.getLogger(u'BibleTab') log = logging.getLogger(u'BibleTab')
log.info(u'Bible Tab loaded') log.info(u'Bible Tab loaded')
def __init__(self): def __init__(self, title, section=None):
self.paragraph_style = True self.paragraph_style = True
self.show_new_chapters = False self.show_new_chapters = False
self.display_style = 0 self.display_style = 0
SettingsTab.__init__(self, u'Bibles', u'Bibles') SettingsTab.__init__(self, title, section)
def setupUi(self): def setupUi(self):
self.setObjectName(u'BiblesTab') self.setObjectName(u'BiblesTab')

View File

@ -283,7 +283,8 @@ class BibleManager(object):
count = self.bible_db_cache[bible].get_max_bible_book_verses( count = self.bible_db_cache[bible].get_max_bible_book_verses(
book, chapter) book, chapter)
if count == 0: if count == 0:
text = self.get_verse_text(bible, book, chapter, chapter, 1, 1) # Make sure the first chapter has been downloaded
self.get_verse_text(bible, book, chapter, chapter, 1, 1)
count = self.bible_db_cache[bible].get_max_bible_book_verses( count = self.bible_db_cache[bible].get_max_bible_book_verses(
book, chapter) book, chapter)
return count return count

View File

@ -46,12 +46,10 @@ class BibleMediaItem(MediaManagerItem):
log.info(u'Bible Media Item loaded') log.info(u'Bible Media Item loaded')
def __init__(self, parent, icon, title): def __init__(self, parent, icon, title):
self.TranslationContext = u'BiblePlugin'
self.PluginNameShort = u'Bible' self.PluginNameShort = u'Bible'
self.ConfigSection = u'bibles' self.ConfigSection = title
self.IconPath = u'songs/song' self.IconPath = u'songs/song'
self.ListViewWithDnD_class = BibleListView self.ListViewWithDnD_class = BibleListView
self.ServiceItemIconName = u':/media/bible_image.png'
self.servicePath = None self.servicePath = None
MediaManagerItem.__init__(self, parent, icon, title) MediaManagerItem.__init__(self, parent, icon, title)
# place to store the search results # place to store the search results
@ -60,7 +58,7 @@ class BibleMediaItem(MediaManagerItem):
QtCore.SIGNAL(u'openlpreloadbibles'), self.reloadBibles) QtCore.SIGNAL(u'openlpreloadbibles'), self.reloadBibles)
def initPluginNameVisible(self): def initPluginNameVisible(self):
self.PluginNameVisible = self.trUtf8(self.PluginNameShort) self.PluginNameVisible = self.trUtf8(u'Bible')
def requiredIcons(self): def requiredIcons(self):
MediaManagerItem.requiredIcons(self) MediaManagerItem.requiredIcons(self)
@ -89,14 +87,16 @@ class BibleMediaItem(MediaManagerItem):
self.QuickVersionLabel.setObjectName(u'QuickVersionLabel') self.QuickVersionLabel.setObjectName(u'QuickVersionLabel')
self.QuickLayout.addWidget(self.QuickVersionLabel, 0, 0, 1, 1) self.QuickLayout.addWidget(self.QuickVersionLabel, 0, 0, 1, 1)
self.QuickVersionComboBox = QtGui.QComboBox(self.QuickTab) self.QuickVersionComboBox = QtGui.QComboBox(self.QuickTab)
self.QuickVersionComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLength) self.QuickVersionComboBox.setSizeAdjustPolicy(
QtGui.QComboBox.AdjustToMinimumContentsLength)
self.QuickVersionComboBox.setObjectName(u'VersionComboBox') self.QuickVersionComboBox.setObjectName(u'VersionComboBox')
self.QuickLayout.addWidget(self.QuickVersionComboBox, 0, 1, 1, 2) self.QuickLayout.addWidget(self.QuickVersionComboBox, 0, 1, 1, 2)
self.QuickSecondVersionLabel = QtGui.QLabel(self.QuickTab) self.QuickSecondVersionLabel = QtGui.QLabel(self.QuickTab)
self.QuickSecondVersionLabel.setObjectName(u'QuickSecondVersionLabel') self.QuickSecondVersionLabel.setObjectName(u'QuickSecondVersionLabel')
self.QuickLayout.addWidget(self.QuickSecondVersionLabel, 1, 0, 1, 1) self.QuickLayout.addWidget(self.QuickSecondVersionLabel, 1, 0, 1, 1)
self.QuickSecondBibleComboBox = QtGui.QComboBox(self.QuickTab) self.QuickSecondBibleComboBox = QtGui.QComboBox(self.QuickTab)
self.QuickSecondBibleComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLength) self.QuickSecondBibleComboBox.setSizeAdjustPolicy(
QtGui.QComboBox.AdjustToMinimumContentsLength)
self.QuickSecondBibleComboBox.setObjectName(u'SecondBible') self.QuickSecondBibleComboBox.setObjectName(u'SecondBible')
self.QuickLayout.addWidget(self.QuickSecondBibleComboBox, 1, 1, 1, 2) self.QuickLayout.addWidget(self.QuickSecondBibleComboBox, 1, 1, 1, 2)
self.QuickSearchLabel = QtGui.QLabel(self.QuickTab) self.QuickSearchLabel = QtGui.QLabel(self.QuickTab)
@ -147,16 +147,20 @@ class BibleMediaItem(MediaManagerItem):
self.AdvancedVersionLabel.setObjectName(u'AdvancedVersionLabel') self.AdvancedVersionLabel.setObjectName(u'AdvancedVersionLabel')
self.AdvancedLayout.addWidget(self.AdvancedVersionLabel, 0, 0, 1, 1) self.AdvancedLayout.addWidget(self.AdvancedVersionLabel, 0, 0, 1, 1)
self.AdvancedVersionComboBox = QtGui.QComboBox(self.AdvancedTab) self.AdvancedVersionComboBox = QtGui.QComboBox(self.AdvancedTab)
self.AdvancedVersionComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLength) self.AdvancedVersionComboBox.setSizeAdjustPolicy(
QtGui.QComboBox.AdjustToMinimumContentsLength)
self.AdvancedVersionComboBox.setObjectName(u'AdvancedVersionComboBox') self.AdvancedVersionComboBox.setObjectName(u'AdvancedVersionComboBox')
self.AdvancedLayout.addWidget(self.AdvancedVersionComboBox, 0, 1, 1, 2) self.AdvancedLayout.addWidget(self.AdvancedVersionComboBox, 0, 1, 1, 2)
self.AdvancedSecondBibleLabel = QtGui.QLabel(self.AdvancedTab) self.AdvancedSecondBibleLabel = QtGui.QLabel(self.AdvancedTab)
self.AdvancedSecondBibleLabel.setObjectName(u'AdvancedSecondBibleLabel') self.AdvancedSecondBibleLabel.setObjectName(u'AdvancedSecondBibleLabel')
self.AdvancedLayout.addWidget(self.AdvancedSecondBibleLabel, 1, 0, 1, 1) self.AdvancedLayout.addWidget(self.AdvancedSecondBibleLabel, 1, 0, 1, 1)
self.AdvancedSecondBibleComboBox = QtGui.QComboBox(self.AdvancedTab) self.AdvancedSecondBibleComboBox = QtGui.QComboBox(self.AdvancedTab)
self.AdvancedSecondBibleComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToMinimumContentsLength) self.AdvancedSecondBibleComboBox.setSizeAdjustPolicy(
self.AdvancedSecondBibleComboBox.setObjectName(u'AdvancedSecondBibleComboBox') QtGui.QComboBox.AdjustToMinimumContentsLength)
self.AdvancedLayout.addWidget(self.AdvancedSecondBibleComboBox, 1, 1, 1, 2) self.AdvancedSecondBibleComboBox.setObjectName(
u'AdvancedSecondBibleComboBox')
self.AdvancedLayout.addWidget(
self.AdvancedSecondBibleComboBox, 1, 1, 1, 2)
self.AdvancedBookLabel = QtGui.QLabel(self.AdvancedTab) self.AdvancedBookLabel = QtGui.QLabel(self.AdvancedTab)
self.AdvancedBookLabel.setObjectName(u'AdvancedBookLabel') self.AdvancedBookLabel.setObjectName(u'AdvancedBookLabel')
self.AdvancedLayout.addWidget(self.AdvancedBookLabel, 2, 0, 1, 1) self.AdvancedLayout.addWidget(self.AdvancedBookLabel, 2, 0, 1, 1)
@ -198,14 +202,16 @@ class BibleMediaItem(MediaManagerItem):
self.AdvancedSearchButtonLayout = QtGui.QHBoxLayout() self.AdvancedSearchButtonLayout = QtGui.QHBoxLayout()
self.AdvancedSearchButtonLayout.setMargin(0) self.AdvancedSearchButtonLayout.setMargin(0)
self.AdvancedSearchButtonLayout.setSpacing(0) self.AdvancedSearchButtonLayout.setSpacing(0)
self.AdvancedSearchButtonLayout.setObjectName(u'AdvancedSearchButtonLayout') self.AdvancedSearchButtonLayout.setObjectName(
u'AdvancedSearchButtonLayout')
self.AdvancedSearchButtonSpacer = QtGui.QSpacerItem(40, 20, self.AdvancedSearchButtonSpacer = QtGui.QSpacerItem(40, 20,
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.AdvancedSearchButtonLayout.addItem(self.AdvancedSearchButtonSpacer) self.AdvancedSearchButtonLayout.addItem(self.AdvancedSearchButtonSpacer)
self.AdvancedSearchButton = QtGui.QPushButton(self.AdvancedTab) self.AdvancedSearchButton = QtGui.QPushButton(self.AdvancedTab)
self.AdvancedSearchButton.setObjectName(u'AdvancedSearchButton') self.AdvancedSearchButton.setObjectName(u'AdvancedSearchButton')
self.AdvancedSearchButtonLayout.addWidget(self.AdvancedSearchButton) self.AdvancedSearchButtonLayout.addWidget(self.AdvancedSearchButton)
self.AdvancedLayout.addLayout(self.AdvancedSearchButtonLayout, 7, 0, 1, 3) self.AdvancedLayout.addLayout(
self.AdvancedSearchButtonLayout, 7, 0, 1, 3)
self.AdvancedMessage = QtGui.QLabel(self.AdvancedTab) self.AdvancedMessage = QtGui.QLabel(self.AdvancedTab)
self.AdvancedMessage.setObjectName(u'AdvancedMessage') self.AdvancedMessage.setObjectName(u'AdvancedMessage')
self.AdvancedLayout.addWidget(self.AdvancedMessage, 8, 0, 1, 3) self.AdvancedLayout.addWidget(self.AdvancedMessage, 8, 0, 1, 3)
@ -475,10 +481,12 @@ class BibleMediaItem(MediaManagerItem):
for book in book_data: for book in book_data:
row = self.AdvancedBookComboBox.count() row = self.AdvancedBookComboBox.count()
self.AdvancedBookComboBox.addItem(book[u'book']) self.AdvancedBookComboBox.addItem(book[u'book'])
self.AdvancedBookComboBox.setItemData(row, QtCore.QVariant(book[u'total'])) self.AdvancedBookComboBox.setItemData(
row, QtCore.QVariant(book[u'total']))
if first: if first:
first = False first = False
self.initialiseChapterVerse(bible, book[u'book'], book[u'total']) self.initialiseChapterVerse(
bible, book[u'book'], book[u'total'])
def initialiseChapterVerse(self, bible, book, chapters): def initialiseChapterVerse(self, bible, book, chapters):
log.debug(u'initialiseChapterVerse %s, %s', bible, book) log.debug(u'initialiseChapterVerse %s, %s', bible, book)

View File

@ -1,24 +1,26 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman ###############################################################################
# OpenLP - Open Source Lyrics Projection #
Portions copyright (c) 2008 - 2009 Martin Thompson, Tim Bentley # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2009 Raoul Snyman #
This program is free software; you can redistribute it and/or modify it under # Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten #
the terms of the GNU General Public License as published by the Free Software # Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri #
Foundation; version 2 of the License. # --------------------------------------------------------------------------- #
# This program is free software; you can redistribute it and/or modify it #
This program is distributed in the hope that it will be useful, but WITHOUT ANY # under the terms of the GNU General Public License as published by the Free #
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A # Software Foundation; version 2 of the License. #
PARTICULAR PURPOSE. See the GNU General Public License for more details. # #
# This program is distributed in the hope that it will be useful, but WITHOUT #
You should have received a copy of the GNU General Public License along with # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
this program; if not, write to the Free Software Foundation, Inc., 59 Temple # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
Place, Suite 330, Boston, MA 02111-1307 USA # 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 sqlalchemy import Column, Table, MetaData, ForeignKey, types, \ from sqlalchemy import Column, Table, MetaData, ForeignKey, types, \
create_engine create_engine

View File

@ -44,17 +44,15 @@ class CustomPlugin(Plugin):
log.info(u'Custom Plugin loaded') log.info(u'Custom Plugin loaded')
def __init__(self, plugin_helpers): def __init__(self, plugin_helpers):
# Call the parent constructor
Plugin.__init__(self, u'Custom', u'1.9.0', plugin_helpers) Plugin.__init__(self, u'Custom', u'1.9.0', plugin_helpers)
self.weight = -5 self.weight = -5
self.custommanager = CustomManager(self.config) self.custommanager = CustomManager(self.config)
self.edit_custom_form = EditCustomForm(self.custommanager) self.edit_custom_form = EditCustomForm(self.custommanager)
# Create the plugin icon
self.icon = buildIcon(u':/media/media_custom.png') self.icon = buildIcon(u':/media/media_custom.png')
def get_media_manager_item(self): def get_media_manager_item(self):
# Create the CustomManagerItem object # Create the CustomManagerItem object
return CustomMediaItem(self, self.icon, u'Custom') return CustomMediaItem(self, self.icon, self.name)
def can_be_disabled(self): def can_be_disabled(self):
return True return True
@ -69,4 +67,8 @@ class CustomPlugin(Plugin):
self.remove_toolbox_item() self.remove_toolbox_item()
def about(self): def about(self):
return u'<b>Custom Plugin</b> <br>This plugin allows slides to be displayed on the screen in the same way songs are. The difference between this plugin and songs is this plugin provides greater freedom.<br>' about_text = self.trUtf8(u'<b>Custom Plugin</b><br>This plugin '
u'allows slides to be displayed on the screen in the same way '
u'songs are. This plugin provides greater freedom over the '
u'songs plugin.<br>')
return about_text

View File

@ -42,17 +42,14 @@ class CustomMediaItem(MediaManagerItem):
log.info(u'Custom Media Item loaded') log.info(u'Custom Media Item loaded')
def __init__(self, parent, icon, title): def __init__(self, parent, icon, title):
self.TranslationContext = u'CustomPlugin'
self.PluginNameShort = u'Custom' self.PluginNameShort = u'Custom'
self.ConfigSection = u'custom' self.ConfigSection = title
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
self.ListViewWithDnD_class = CustomListView self.ListViewWithDnD_class = CustomListView
self.ServiceItemIconName = u':/custom/custom_image.png'
self.servicePath = None self.servicePath = None
MediaManagerItem.__init__(self, parent, icon, title) MediaManagerItem.__init__(self, parent, icon, title)
self.parent = parent
self.fromServiceManager = -1 self.fromServiceManager = -1
def addEndHeaderBar(self): def addEndHeaderBar(self):
@ -64,7 +61,7 @@ class CustomMediaItem(MediaManagerItem):
QtCore.SIGNAL(u'load_custom_list'), self.initialise) QtCore.SIGNAL(u'load_custom_list'), self.initialise)
def initPluginNameVisible(self): def initPluginNameVisible(self):
self.PluginNameVisible = self.trUtf8(self.PluginNameShort) self.PluginNameVisible = self.trUtf8(u'Custom')
def requiredIcons(self): def requiredIcons(self):
MediaManagerItem.requiredIcons(self) MediaManagerItem.requiredIcons(self)

View File

@ -33,10 +33,8 @@ class ImagePlugin(Plugin):
log.info(u'Image Plugin loaded') log.info(u'Image Plugin loaded')
def __init__(self, plugin_helpers): def __init__(self, plugin_helpers):
# Call the parent constructor
Plugin.__init__(self, u'Images', u'1.9.0', plugin_helpers) Plugin.__init__(self, u'Images', u'1.9.0', plugin_helpers)
self.weight = -7 self.weight = -7
# Create the plugin icon
self.icon = buildIcon(u':/media/media_image.png') self.icon = buildIcon(u':/media/media_image.png')
def can_be_disabled(self): def can_be_disabled(self):
@ -52,11 +50,18 @@ class ImagePlugin(Plugin):
self.remove_toolbox_item() self.remove_toolbox_item()
def get_settings_tab(self): def get_settings_tab(self):
return ImageTab() return ImageTab(self.name)
def get_media_manager_item(self): def get_media_manager_item(self):
# Create the MediaManagerItem object # Create the MediaManagerItem object
return ImageMediaItem(self, self.icon, u'Images') return ImageMediaItem(self, self.icon, self.name)
def about(self): def about(self):
return u'<b>Image Plugin</b><br>Allows images of all types to be displayed. If a number of images are selected together and presented on the live controller it is possible to turn them into a timed loop.<br> From the plugin if the <i>Override background</i> is chosen and an image is selected any somgs which are rendered will use the selected image from the background instead of the one provied by the theme.<br>' about_text = self.trUtf8(u'<b>Image Plugin</b><br>Allows images of '
u'all types to be displayed. If a number of images are selected '
u'together and presented on the live controller it is possible '
u'to turn them into a timed loop.<br>From the plugin if the '
u'<i>Override background</i> is chosen and an image is selected '
u'any somgs which are rendered will use the selected image from '
u'the background instead of the one provied by the theme.<br>')
return about_text

View File

@ -30,8 +30,8 @@ class ImageTab(SettingsTab):
""" """
ImageTab is the Image settings tab in the settings dialog. ImageTab is the Image settings tab in the settings dialog.
""" """
def __init__(self): def __init__(self, title, section=None):
SettingsTab.__init__(self, u'Images', u'Images') SettingsTab.__init__(self, title, section)
def setupUi(self): def setupUi(self):
self.setObjectName(u'ImageTab') self.setObjectName(u'ImageTab')
@ -42,7 +42,7 @@ class ImageTab(SettingsTab):
self.ImageSettingsGroupBox.setObjectName(u'ImageSettingsGroupBox') self.ImageSettingsGroupBox.setObjectName(u'ImageSettingsGroupBox')
self.TimeoutLayout = QtGui.QHBoxLayout(self.ImageSettingsGroupBox) self.TimeoutLayout = QtGui.QHBoxLayout(self.ImageSettingsGroupBox)
self.TimeoutLayout.setSpacing(8) self.TimeoutLayout.setSpacing(8)
self.TimeoutLayout.setMargin(0) self.TimeoutLayout.setMargin(8)
self.TimeoutLayout.setObjectName(u'TimeoutLayout') self.TimeoutLayout.setObjectName(u'TimeoutLayout')
self.TimeoutLabel = QtGui.QLabel(self.ImageSettingsGroupBox) self.TimeoutLabel = QtGui.QLabel(self.ImageSettingsGroupBox)
self.TimeoutLabel.setObjectName(u'TimeoutLabel') self.TimeoutLabel.setObjectName(u'TimeoutLabel')

View File

@ -44,20 +44,18 @@ class ImageMediaItem(MediaManagerItem):
log.info(u'Image Media Item loaded') log.info(u'Image Media Item loaded')
def __init__(self, parent, icon, title): def __init__(self, parent, icon, title):
self.TranslationContext = u'ImagePlugin'
self.PluginNameShort = u'Image' self.PluginNameShort = u'Image'
self.ConfigSection = u'images' self.ConfigSection = title
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
self.ListViewWithDnD_class = ImageListView self.ListViewWithDnD_class = ImageListView
self.ServiceItemIconName = u':/media/media_image.png'
self.servicePath = None self.servicePath = None
MediaManagerItem.__init__(self, parent, icon, title) MediaManagerItem.__init__(self, parent, icon, title)
self.overrideActive = False self.overrideActive = False
def initPluginNameVisible(self): def initPluginNameVisible(self):
self.PluginNameVisible = self.trUtf8(self.PluginNameShort) self.PluginNameVisible = self.trUtf8(u'Image')
def retranslateUi(self): def retranslateUi(self):
self.OnNewPrompt = self.trUtf8(u'Select Image(s)') self.OnNewPrompt = self.trUtf8(u'Select Image(s)')

View File

@ -22,70 +22,70 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Temple Place, Suite 330, Boston, MA 02111-1307 USA #
############################################################################### ###############################################################################
import os #import os
import logging #import logging
from PyQt4.QtCore import * #from PyQt4.QtCore import *
from PyQt4.QtGui import * #from PyQt4.QtGui import *
#
class FileListData(QAbstractListModel): #class FileListData(QAbstractListModel):
""" # """
An abstract list of strings and the preview icon to go with them # An abstract list of strings and the preview icon to go with them
""" # """
global log # global log
log=logging.getLogger(u'FileListData') # log=logging.getLogger(u'FileListData')
log.info(u'started') # log.info(u'started')
#
def __init__(self): # def __init__(self):
QAbstractListModel.__init__(self) # QAbstractListModel.__init__(self)
self.items = [] # will be a list of (full filename shortname) tuples # self.items = [] # will be a list of (full filename shortname) tuples
#
def rowCount(self, parent): # def rowCount(self, parent):
return len(self.items) # return len(self.items)
#
def insertRow(self, row, filename): # def insertRow(self, row, filename):
self.beginInsertRows(QModelIndex(),row,row) # self.beginInsertRows(QModelIndex(),row,row)
log.info(u'insert row %d:%s'%(row,filename)) # log.info(u'insert row %d:%s'%(row,filename))
# get short filename to display next to image # # get short filename to display next to image
(prefix, shortfilename) = os.path.split(unicode(filename)) # (prefix, shortfilename) = os.path.split(unicode(filename))
log.info(u'shortfilename=%s'%(shortfilename)) # log.info(u'shortfilename=%s'%(shortfilename))
# create a preview image # # create a preview image
self.items.insert(row, (filename, shortfilename)) # self.items.insert(row, (filename, shortfilename))
self.endInsertRows() # self.endInsertRows()
#
def removeRow(self, row): # def removeRow(self, row):
self.beginRemoveRows(QModelIndex(), row,row) # self.beginRemoveRows(QModelIndex(), row,row)
self.items.pop(row) # self.items.pop(row)
self.endRemoveRows() # self.endRemoveRows()
#
def addRow(self, filename): # def addRow(self, filename):
self.insertRow(len(self.items), filename) # self.insertRow(len(self.items), filename)
#
def data(self, index, role): # def data(self, index, role):
row = index.row() # row = index.row()
if row > len(self.items): # if the last row is selected and deleted, we then get called with an empty row! # if row > len(self.items): # if the last row is selected and deleted, we then get called with an empty row!
return QVariant() # return QVariant()
if role == Qt.DisplayRole: # if role == Qt.DisplayRole:
retval= self.items[row][1]
# elif role == Qt.DecorationRole:
# retval= self.items[row][1] # retval= self.items[row][1]
elif role == Qt.ToolTipRole: ## elif role == Qt.DecorationRole:
retval= self.items[row][0] ## retval= self.items[row][1]
else: # elif role == Qt.ToolTipRole:
retval= QVariant() # retval= self.items[row][0]
# log.info(u'Returning"+ unicode(retval)) # else:
if type(retval) is not type(QVariant): # retval= QVariant()
return QVariant(retval) ## log.info(u'Returning"+ unicode(retval))
else: # if type(retval) is not type(QVariant):
return retval # return QVariant(retval)
# else:
def getFileList(self): # return retval
filelist = [item[0] for item in self.items]; #
return filelist # def getFileList(self):
# filelist = [item[0] for item in self.items];
def getFilename(self, index): # return filelist
row = index.row() #
return self.items[row][0] # def getFilename(self, index):
# row = index.row()
def getValue(self, index): # return self.items[row][0]
row = index.row() #
return self.items[row][0] # def getValue(self, index):
# row = index.row()
# return self.items[row][0]

View File

@ -43,10 +43,10 @@ class MediaMediaItem(MediaManagerItem):
log.info(u'Media Media Item loaded') log.info(u'Media Media Item loaded')
def __init__(self, parent, icon, title): def __init__(self, parent, icon, title):
self.TranslationContext = u'MediaPlugin'
self.PluginNameShort = u'Media' self.PluginNameShort = u'Media'
self.IconPath = u'images/image' self.IconPath = u'images/image'
self.ConfigSection = u'media' self.ConfigSection = u'media'
self.ConfigSection = title
# 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
@ -56,7 +56,10 @@ class MediaMediaItem(MediaManagerItem):
self.MainDisplay = self.parent.live_controller.parent.mainDisplay self.MainDisplay = self.parent.live_controller.parent.mainDisplay
def initPluginNameVisible(self): def initPluginNameVisible(self):
self.PluginNameVisible = self.trUtf8(self.PluginNameShort) self.PluginNameVisible = self.trUtf8(u'Media')
def retranslateUi(self):
self.OnNewPrompt = self.trUtf8(u'Select Media')
def reTranslateUI(self): def reTranslateUI(self):
self.OnNewPrompt = self.trUtf8(u'Select Media') self.OnNewPrompt = self.trUtf8(u'Select Media')
@ -70,13 +73,10 @@ class MediaMediaItem(MediaManagerItem):
self.hasEditIcon = False self.hasEditIcon = False
def video_get_preview(self): def video_get_preview(self):
#
# For now cross platform is an icon. Phonon does not support # For now cross platform is an icon. Phonon does not support
# individual frame access (yet?) and GStreamer is not available # individual frame access (yet?) and GStreamer is not available
# on Windows # on Windows
# return QtGui.QPixmap(u':/media/media_video.png').toImage()
image = QtGui.QPixmap(u':/media/media_video.png').toImage()
return image
def generateSlideData(self, service_item): def generateSlideData(self, service_item):
items = self.ListView.selectedIndexes() items = self.ListView.selectedIndexes()

View File

@ -30,8 +30,8 @@ class MediaTab(SettingsTab):
""" """
mediaTab is the media settings tab in the settings dialog. mediaTab is the media settings tab in the settings dialog.
""" """
def __init__(self): def __init__(self, title, section=None):
SettingsTab.__init__(self, u'Media', u'Media') SettingsTab.__init__(self, title, section)
def setupUi(self): def setupUi(self):
self.setObjectName(u'MediaTab') self.setObjectName(u'MediaTab')

View File

@ -33,16 +33,14 @@ class MediaPlugin(Plugin):
log.info(u'Media Plugin loaded') log.info(u'Media Plugin loaded')
def __init__(self, plugin_helpers): def __init__(self, plugin_helpers):
# Call the parent constructor
Plugin.__init__(self, u'Media', u'1.9.0', plugin_helpers) Plugin.__init__(self, u'Media', u'1.9.0', plugin_helpers)
self.weight = -6 self.weight = -6
# Create the plugin icon
self.icon = buildIcon(u':/media/media_video.png') self.icon = buildIcon(u':/media/media_video.png')
# passed with drag and drop messages # passed with drag and drop messages
self.dnd_id = u'Media' self.dnd_id = u'Media'
def get_settings_tab(self): def get_settings_tab(self):
return MediaTab() return MediaTab(self.name)
def can_be_disabled(self): def can_be_disabled(self):
return True return True
@ -58,7 +56,9 @@ class MediaPlugin(Plugin):
def get_media_manager_item(self): def get_media_manager_item(self):
# Create the MediaManagerItem object # Create the MediaManagerItem object
return MediaMediaItem(self, self.icon, u'Media') return MediaMediaItem(self, self.icon, self.name)
def about(self): def about(self):
return u'<b>Media Plugin</b> <br> One day this may provide access to video and audio clips' about_text = self.trUtf8(u'<b>Media Plugin</b><br>This plugin '
u'allows the playing of audio and video media')
return about_text

View File

@ -1,22 +1,27 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley
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 # OpenLP - Open Source Lyrics Projection #
Foundation; version 2 of the License. # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2009 Raoul Snyman #
# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten #
# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri #
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
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
"""
# OOo API documentation: # OOo API documentation:
# http://api.openoffice.org/docs/common/ref/com/sun/star/presentation/XSlideShowController.html # http://api.openoffice.org/docs/common/ref/com/sun/star/presentation/XSlideShowController.html
# http://docs.go-oo.org/sd/html/classsd_1_1SlideShow.html # http://docs.go-oo.org/sd/html/classsd_1_1SlideShow.html

View File

@ -48,9 +48,8 @@ class PresentationMediaItem(MediaManagerItem):
def __init__(self, parent, icon, title, controllers): def __init__(self, parent, icon, title, controllers):
self.controllers = controllers self.controllers = controllers
self.TranslationContext = u'PresentationPlugin'
self.PluginNameShort = u'Presentation' self.PluginNameShort = u'Presentation'
self.ConfigSection = u'presentations' self.ConfigSection = title
self.IconPath = u'presentations/presentation' self.IconPath = u'presentations/presentation'
# 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
@ -59,7 +58,10 @@ class PresentationMediaItem(MediaManagerItem):
self.message_listener = MessageListener(controllers) self.message_listener = MessageListener(controllers)
def initPluginNameVisible(self): def initPluginNameVisible(self):
self.PluginNameVisible = self.trUtf8(self.PluginNameShort) self.PluginNameVisible = self.trUtf8(u'Presentation')
def retranslateUi(self):
self.OnNewPrompt = self.trUtf8(u'Select Presentation(s)')
def reTranslateUI(self): def reTranslateUI(self):
self.OnNewPrompt = self.trUtf8(u'Select Presentation(s)') self.OnNewPrompt = self.trUtf8(u'Select Presentation(s)')
@ -112,8 +114,8 @@ class PresentationMediaItem(MediaManagerItem):
(path, filename) = os.path.split(unicode(file)) (path, filename) = os.path.split(unicode(file))
if titles.count(filename) > 0: if titles.count(filename) > 0:
QtGui.QMessageBox.critical( QtGui.QMessageBox.critical(
self, self.trUtf8(u'File exists'), self, self.trUtf8(u'File exists'), self.trUtf8(
self.trUtf8(u'A presentation with that filename already exists.'), u'A presentation with that filename already exists.'),
QtGui.QMessageBox.Ok) QtGui.QMessageBox.Ok)
else: else:
item_name = QtGui.QListWidgetItem(filename) item_name = QtGui.QListWidgetItem(filename)

View File

@ -1,22 +1,27 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley
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 # OpenLP - Open Source Lyrics Projection #
Foundation; version 2 of the License. # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2009 Raoul Snyman #
# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten #
# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri #
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
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
"""
import logging import logging
import os import os

View File

@ -1,22 +1,26 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley
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 # OpenLP - Open Source Lyrics Projection #
Foundation; version 2 of the License. # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2009 Raoul Snyman #
This program is distributed in the hope that it will be useful, but WITHOUT ANY # Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten #
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A # Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri #
PARTICULAR PURPOSE. See the GNU General Public License for more details. # --------------------------------------------------------------------------- #
# This program is free software; you can redistribute it and/or modify it #
You should have received a copy of the GNU General Public License along with # under the terms of the GNU General Public License as published by the Free #
this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Software Foundation; version 2 of the License. #
Place, Suite 330, Boston, MA 02111-1307 USA # #
""" # 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 #
###############################################################################
import logging import logging
import os import os

View File

@ -30,9 +30,9 @@ class PresentationTab(SettingsTab):
""" """
PresentationsTab is the Presentations settings tab in the settings dialog. PresentationsTab is the Presentations settings tab in the settings dialog.
""" """
def __init__(self, controllers): def __init__(self, title, controllers, section=None):
self.controllers = controllers self.controllers = controllers
SettingsTab.__init__(self, u'Presentations', u'Presentations') SettingsTab.__init__(self, title, section)
def setupUi(self): def setupUi(self):
self.setObjectName(u'PresentationTab') self.setObjectName(u'PresentationTab')

View File

@ -25,9 +25,7 @@
import os import os
import logging import logging
from PyQt4 import QtGui from openlp.core.lib import Plugin, buildIcon
from openlp.core.lib import Plugin
from openlp.plugins.presentations.lib import * from openlp.plugins.presentations.lib import *
class PresentationPlugin(Plugin): class PresentationPlugin(Plugin):
@ -36,21 +34,17 @@ class PresentationPlugin(Plugin):
log = logging.getLogger(u'PresentationPlugin') log = logging.getLogger(u'PresentationPlugin')
def __init__(self, plugin_helpers): def __init__(self, plugin_helpers):
# Call the parent constructor
log.debug(u'Initialised') log.debug(u'Initialised')
self.controllers = {} self.controllers = {}
Plugin.__init__(self, u'Presentations', u'1.9.0', plugin_helpers) Plugin.__init__(self, u'Presentations', u'1.9.0', plugin_helpers)
self.weight = -8 self.weight = -8
# Create the plugin icon self.icon = buildIcon(u':/media/media_presentation.png')
self.icon = QtGui.QIcon()
self.icon.addPixmap(QtGui.QPixmap(u':/media/media_presentation.png'),
QtGui.QIcon.Normal, QtGui.QIcon.Off)
def get_settings_tab(self): def get_settings_tab(self):
""" """
Create the settings Tab Create the settings Tab
""" """
return PresentationTab(self.controllers) return PresentationTab(self.name, self.controllers)
def can_be_disabled(self): def can_be_disabled(self):
return True return True
@ -74,7 +68,7 @@ class PresentationPlugin(Plugin):
Create the Media Manager List Create the Media Manager List
""" """
return PresentationMediaItem( return PresentationMediaItem(
self, self.icon, u'Presentations', self.controllers) self, self.icon, self.name, self.controllers)
def registerControllers(self, controller): def registerControllers(self, controller):
self.controllers[controller.name] = controller self.controllers[controller.name] = controller
@ -110,4 +104,8 @@ class PresentationPlugin(Plugin):
return False return False
def about(self): def about(self):
return u'<b>Presentation Plugin</b> <br> Delivers the ability to show presentations using a number of different programs. The choice of available presentaion programs is available in a drop down.' about_text = self.trUtf8(u'<b>Presentation Plugin</b> <br> Delivers '
u'the ability to show presentations using a number of different '
u'programs. The choice of available presentation programs is '
u'available to the user in a drop down box.')
return about_text

View File

@ -1,21 +1,25 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley
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 # OpenLP - Open Source Lyrics Projection #
Foundation; version 2 of the License. # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2009 Raoul Snyman #
This program is distributed in the hope that it will be useful, but WITHOUT ANY # Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten #
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A # Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri #
PARTICULAR PURPOSE. See the GNU General Public License for more details. # --------------------------------------------------------------------------- #
# This program is free software; you can redistribute it and/or modify it #
You should have received a copy of the GNU General Public License along with # under the terms of the GNU General Public License as published by the Free #
this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Software Foundation; version 2 of the License. #
Place, Suite 330, Boston, MA 02111-1307 USA # #
""" # 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 remotetab import RemoteTab from remotetab import RemoteTab

View File

@ -1,22 +1,26 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley,
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 # OpenLP - Open Source Lyrics Projection #
Foundation; version 2 of the License. # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2009 Raoul Snyman #
This program is distributed in the hope that it will be useful, but WITHOUT ANY # Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten #
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A # Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri #
PARTICULAR PURPOSE. See the GNU General Public License for more details. # --------------------------------------------------------------------------- #
# This program is free software; you can redistribute it and/or modify it #
You should have received a copy of the GNU General Public License along with # under the terms of the GNU General Public License as published by the Free #
this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Software Foundation; version 2 of the License. #
Place, Suite 330, Boston, MA 02111-1307 USA # #
""" # 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 from PyQt4 import QtGui
@ -26,8 +30,8 @@ class RemoteTab(SettingsTab):
""" """
RemoteTab is the Remotes settings tab in the settings dialog. RemoteTab is the Remotes settings tab in the settings dialog.
""" """
def __init__(self): def __init__(self, title, section=None):
SettingsTab.__init__(self, u'Remotes', u'Remotes') SettingsTab.__init__(self, title, section)
def setupUi(self): def setupUi(self):
self.setObjectName(u'RemoteTab') self.setObjectName(u'RemoteTab')

View File

@ -1,23 +1,28 @@
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley,
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 # OpenLP - Open Source Lyrics Projection #
Foundation; version 2 of the License. # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2009 Raoul Snyman #
# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten #
# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri #
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
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
"""
import socket import socket
import sys import sys
from optparse import OptionParser from optparse import OptionParser

View File

@ -1,22 +1,27 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley,
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 # OpenLP - Open Source Lyrics Projection #
Foundation; version 2 of the License. # --------------------------------------------------------------------------- #
# Copyright (c) 2008-2009 Raoul Snyman #
# Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten #
# Tinggaard, Jon Tibble, Jonathan Corwin, Maikel Stuivenberg, Scott Guerrieri #
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
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
"""
import logging import logging
from PyQt4 import QtNetwork, QtCore from PyQt4 import QtNetwork, QtCore
@ -31,7 +36,6 @@ class RemotesPlugin(Plugin):
log.info(u'Remote Plugin loaded') log.info(u'Remote Plugin loaded')
def __init__(self, plugin_helpers): def __init__(self, plugin_helpers):
# Call the parent constructor
Plugin.__init__(self, u'Remotes', u'1.9.0', plugin_helpers) Plugin.__init__(self, u'Remotes', u'1.9.0', plugin_helpers)
self.weight = -1 self.weight = -1
self.server = None self.server = None
@ -54,14 +58,11 @@ class RemotesPlugin(Plugin):
if self.server is not None: if self.server is not None:
self.server.close() self.server.close()
def about(self):
return u'<b>Remote Plugin</b> <br>This plugin provides the ability to send messages to a running version of openlp on a different computer.<br> The Primary use for this would be to send alerts from a creche'
def get_settings_tab(self): def get_settings_tab(self):
""" """
Create the settings Tab Create the settings Tab
""" """
return RemoteTab() return RemoteTab(self.name)
def readData(self): def readData(self):
log.info(u'Remoted data has arrived') log.info(u'Remoted data has arrived')
@ -78,3 +79,10 @@ class RemotesPlugin(Plugin):
Receiver().send_message(u'alert_text', unicode(datagram[pos + 1:])) Receiver().send_message(u'alert_text', unicode(datagram[pos + 1:]))
if event == u'next_slide': if event == u'next_slide':
Receiver().send_message(u'live_slide_next') Receiver().send_message(u'live_slide_next')
def about(self):
about_text = self.trUtf8(u'<b>Remote Plugin</b><br>This plugin '
u'provides the ability to send messages to a running version of '
u'openlp on a different computer.<br>The Primary use for this '
u'would be to send alerts from a creche')
return about_text

View File

@ -95,9 +95,10 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
QtCore.SIGNAL(u'lostFocus()'), self.onCommentsEditLostFocus) QtCore.SIGNAL(u'lostFocus()'), self.onCommentsEditLostFocus)
QtCore.QObject.connect(self.VerseOrderEdit, QtCore.QObject.connect(self.VerseOrderEdit,
QtCore.SIGNAL(u'lostFocus()'), self.onVerseOrderEditLostFocus) QtCore.SIGNAL(u'lostFocus()'), self.onVerseOrderEditLostFocus)
previewButton = QtGui.QPushButton() self.previewButton = QtGui.QPushButton()
previewButton.setText(self.trUtf8(u'Save && Preview')) self.previewButton.setText(self.trUtf8(u'Save && Preview'))
self.ButtonBox.addButton(previewButton, QtGui.QDialogButtonBox.ActionRole) self.ButtonBox.addButton(
self.previewButton, QtGui.QDialogButtonBox.ActionRole)
QtCore.QObject.connect(self.ButtonBox, QtCore.QObject.connect(self.ButtonBox,
QtCore.SIGNAL(u'clicked(QAbstractButton*)'), self.onPreview) QtCore.SIGNAL(u'clicked(QAbstractButton*)'), self.onPreview)
# Create other objects and forms # Create other objects and forms
@ -114,7 +115,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.VerseDeleteButton.setEnabled(False) self.VerseDeleteButton.setEnabled(False)
self.AuthorRemoveButton.setEnabled(False) self.AuthorRemoveButton.setEnabled(False)
self.TopicRemoveButton.setEnabled(False) self.TopicRemoveButton.setEnabled(False)
self.title_change = False
def loadAuthors(self): def loadAuthors(self):
authors = self.songmanager.get_authors() authors = self.songmanager.get_authors()
@ -161,13 +161,12 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.VerseListWidget.clear() self.VerseListWidget.clear()
self.AuthorsListView.clear() self.AuthorsListView.clear()
self.TopicsListView.clear() self.TopicsListView.clear()
self.title_change = False
self.TitleEditItem.setFocus(QtCore.Qt.OtherFocusReason) self.TitleEditItem.setFocus(QtCore.Qt.OtherFocusReason)
self.loadAuthors() self.loadAuthors()
self.loadTopics() self.loadTopics()
self.loadBooks() self.loadBooks()
def loadSong(self, id): def loadSong(self, id, preview):
log.debug(u'Load Song') log.debug(u'Load Song')
self.SongTabWidget.setCurrentIndex(0) self.SongTabWidget.setCurrentIndex(0)
self.loadAuthors() self.loadAuthors()
@ -234,8 +233,11 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
topic_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(topic.id)) topic_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(topic.id))
self.TopicsListView.addItem(topic_name) self.TopicsListView.addItem(topic_name)
self._validate_song() self._validate_song()
self.title_change = False
self.TitleEditItem.setFocus(QtCore.Qt.OtherFocusReason) self.TitleEditItem.setFocus(QtCore.Qt.OtherFocusReason)
#if not preview hide the preview button
self.previewButton.setVisible(False)
if preview:
self.previewButton.setVisible(True)
def onAuthorAddButtonClicked(self): def onAuthorAddButtonClicked(self):
item = int(self.AuthorsSelectionComboItem.currentIndex()) item = int(self.AuthorsSelectionComboItem.currentIndex())
@ -373,7 +375,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
def onTitleEditItemLostFocus(self): def onTitleEditItemLostFocus(self):
self.song.title = self.TitleEditItem.text() self.song.title = self.TitleEditItem.text()
self.title_change = True
def onVerseOrderEditLostFocus(self): def onVerseOrderEditLostFocus(self):
self.song.verse_order = self.VerseOrderEdit.text() self.song.verse_order = self.VerseOrderEdit.text()
@ -426,6 +427,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.song.search_title = unicode(self.TitleEditItem.displayText()) + \ self.song.search_title = unicode(self.TitleEditItem.displayText()) + \
u'@'+ unicode(self.AlternativeEdit.displayText()) u'@'+ unicode(self.AlternativeEdit.displayText())
self.song.comments = unicode(self.CommentsEdit.toPlainText()) self.song.comments = unicode(self.CommentsEdit.toPlainText())
self.song.verse_order = unicode(self.VerseOrderEdit.text())
self.song.ccli_number = unicode(self.CCLNumberEdit.displayText()) self.song.ccli_number = unicode(self.CCLNumberEdit.displayText())
self.processLyrics() self.processLyrics()
self.processTitle() self.processTitle()
@ -434,31 +436,34 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
def processLyrics(self): def processLyrics(self):
log.debug(u'processLyrics') log.debug(u'processLyrics')
sxml = SongXMLBuilder() try:
sxml.new_document() sxml = SongXMLBuilder()
sxml.add_lyrics_to_song() sxml.new_document()
count = 1 sxml.add_lyrics_to_song()
text = u' ' count = 1
verse_order = u'' text = u' '
for i in range (0, self.VerseListWidget.count()): verse_order = u''
sxml.add_verse_to_lyrics(u'Verse', unicode(count), for i in range (0, self.VerseListWidget.count()):
unicode(self.VerseListWidget.item(i).text())) sxml.add_verse_to_lyrics(u'Verse', unicode(count),
text = text + unicode(self.VerseListWidget.item(i).text()) + u' ' unicode(self.VerseListWidget.item(i).text()))
verse_order = verse_order + unicode(count) + u' ' text = text + unicode(self.VerseListWidget.item(i).text()) + u' '
count += 1 verse_order = verse_order + unicode(count) + u' '
if self.song.verse_order is None: count += 1
self.song.verse_order = verse_order if self.song.verse_order is None:
text = text.replace(u'\'', u'') self.song.verse_order = verse_order
text = text.replace(u',', u'') text = text.replace(u'\'', u'')
text = text.replace(u';', u'') text = text.replace(u',', u'')
text = text.replace(u':', u'') text = text.replace(u';', u'')
text = text.replace(u'(', u'') text = text.replace(u':', u'')
text = text.replace(u')', u'') text = text.replace(u'(', u'')
text = text.replace(u'{', u'') text = text.replace(u')', u'')
text = text.replace(u'}', u'') text = text.replace(u'{', u'')
text = text.replace(u'?', u'') text = text.replace(u'}', u'')
self.song.search_lyrics = unicode(text) text = text.replace(u'?', u'')
self.song.lyrics = unicode(sxml.extract_xml()) self.song.search_lyrics = unicode(text)
self.song.lyrics = unicode(sxml.extract_xml())
except:
log.exception(u'Problem processing song Lyrics \n%s', sxml.dump_xml())
def processTitle(self): def processTitle(self):
log.debug(u'processTitle') log.debug(u'processTitle')

View File

@ -106,8 +106,8 @@ class SongManager():
self.session.commit() self.session.commit()
return True return True
except: except:
self.session.rollback()
log.exception(u'Could not save song to song database') log.exception(u'Could not save song to song database')
self.session.rollback()
return False return False
def delete_song(self, songid): def delete_song(self, songid):

View File

@ -44,22 +44,24 @@ class SongMediaItem(MediaManagerItem):
log.info(u'Song Media Item loaded') log.info(u'Song Media Item loaded')
def __init__(self, parent, icon, title): def __init__(self, parent, icon, title):
self.TranslationContext = u'SongPlugin'
self.PluginNameShort = u'Song' self.PluginNameShort = u'Song'
self.ConfigSection = u'songs' self.ConfigSection = title
self.IconPath = u'songs/song' self.IconPath = u'songs/song'
self.ListViewWithDnD_class = SongListView self.ListViewWithDnD_class = SongListView
self.ServiceItemIconName = u':/media/song_image.png'
self.servicePath = None self.servicePath = None
MediaManagerItem.__init__(self, parent, icon, title) MediaManagerItem.__init__(self, parent, icon, title)
self.edit_song_form = EditSongForm(self.parent.songmanager, self) self.edit_song_form = EditSongForm(self.parent.songmanager, self)
self.song_maintenance_form = SongMaintenanceForm( self.song_maintenance_form = SongMaintenanceForm(
self.parent.songmanager, self) self.parent.songmanager, self)
#fromPreview holds the id of the item if the song editor needs to trigger a preview
#without closing. It is set to -1 if this function is inactive
self.fromPreview = -1 self.fromPreview = -1
#fromServiceManager holds the id of the item if the song editor needs to trigger posting
#to the servicemanager without closing. It is set to -1 if this function is inactive
self.fromServiceManager = -1 self.fromServiceManager = -1
def initPluginNameVisible(self): def initPluginNameVisible(self):
self.PluginNameVisible = self.trUtf8(self.PluginNameShort) self.PluginNameVisible = self.trUtf8(u'Song')
def requiredIcons(self): def requiredIcons(self):
MediaManagerItem.requiredIcons(self) MediaManagerItem.requiredIcons(self)
@ -244,7 +246,7 @@ class SongMediaItem(MediaManagerItem):
valid = self.parent.songmanager.get_song(songid) valid = self.parent.songmanager.get_song(songid)
if valid is not None: if valid is not None:
self.fromServiceManager = songid self.fromServiceManager = songid
self.edit_song_form.loadSong(songid) self.edit_song_form.loadSong(songid, False)
self.edit_song_form.exec_() self.edit_song_form.exec_()
def onEditClick(self, preview=False): def onEditClick(self, preview=False):
@ -254,7 +256,7 @@ class SongMediaItem(MediaManagerItem):
self.fromPreview = -1 self.fromPreview = -1
if preview: if preview:
self.fromPreview = item_id self.fromPreview = item_id
self.edit_song_form.loadSong(item_id) self.edit_song_form.loadSong(item_id, preview)
self.edit_song_form.exec_() self.edit_song_form.exec_()
def onEventEditSong (self): def onEventEditSong (self):
@ -288,6 +290,7 @@ class SongMediaItem(MediaManagerItem):
service_item.theme = song.theme_name service_item.theme = song.theme_name
service_item.editEnabled = True service_item.editEnabled = True
service_item.editId = item_id service_item.editId = item_id
service_item.verse_order = song.verse_order
if song.lyrics.startswith(u'<?xml version='): if song.lyrics.startswith(u'<?xml version='):
songXML=SongXMLParser(song.lyrics) songXML=SongXMLParser(song.lyrics)
verseList = songXML.get_verses() verseList = songXML.get_verses()
@ -314,5 +317,7 @@ class SongMediaItem(MediaManagerItem):
raw_footer.append(unicode( raw_footer.append(unicode(
self.trUtf8(u'CCL Licence: ') + ccl)) self.trUtf8(u'CCL Licence: ') + ccl))
service_item.raw_footer = raw_footer service_item.raw_footer = raw_footer
service_item.audit = [song.title, author_audit, song.copyright, song.ccli_number] service_item.audit = [
song.title, author_audit, song.copyright, song.ccli_number
]
return True return True

View File

@ -30,8 +30,8 @@ class SongsTab(SettingsTab):
""" """
SongsTab is the Songs settings tab in the settings dialog. SongsTab is the Songs settings tab in the settings dialog.
""" """
def __init__(self): def __init__(self, title, section=None):
SettingsTab.__init__(self, u'Songs', u'Songs') SettingsTab.__init__(self, title, section)
def setupUi(self): def setupUi(self):
self.setObjectName(u'SongsTab') self.setObjectName(u'SongsTab')
@ -61,8 +61,10 @@ class SongsTab(SettingsTab):
def retranslateUi(self): def retranslateUi(self):
self.SongsModeGroupBox.setTitle(self.trUtf8(u'Songs Mode')) self.SongsModeGroupBox.setTitle(self.trUtf8(u'Songs Mode'))
self.SearchAsTypeCheckBox.setText(self.trUtf8(u'Enable search as you type:')) self.SearchAsTypeCheckBox.setText(
self.SongBarActiveCheckBox.setText(self.trUtf8(u'Display Verses on Live Tool bar:')) self.trUtf8(u'Enable search as you type:'))
self.SongBarActiveCheckBox.setText(
self.trUtf8(u'Display Verses on Live Tool bar:'))
def onSearchAsTypeCheckBoxChanged(self, check_state): def onSearchAsTypeCheckBoxChanged(self, check_state):
self.song_search = False self.song_search = False

View File

@ -48,7 +48,6 @@ class SongsPlugin(Plugin):
""" """
Create and set up the Songs plugin. Create and set up the Songs plugin.
""" """
# Call the parent constructor
Plugin.__init__(self, u'Songs', u'1.9.0', plugin_helpers) Plugin.__init__(self, u'Songs', u'1.9.0', plugin_helpers)
self.weight = -10 self.weight = -10
self.songmanager = SongManager(self.config) self.songmanager = SongManager(self.config)
@ -56,14 +55,13 @@ class SongsPlugin(Plugin):
self.opensong_import_form = OpenSongImportForm() self.opensong_import_form = OpenSongImportForm()
self.openlp_export_form = OpenLPExportForm() self.openlp_export_form = OpenLPExportForm()
self.opensong_export_form = OpenSongExportForm() self.opensong_export_form = OpenSongExportForm()
# Create the plugin icon
self.icon = buildIcon(u':/media/media_song.png') self.icon = buildIcon(u':/media/media_song.png')
def can_be_disabled(self): def can_be_disabled(self):
return True return True
def get_settings_tab(self): def get_settings_tab(self):
return SongsTab() return SongsTab(self.name)
def initialise(self): def initialise(self):
log.info(u'Songs Initialising') log.info(u'Songs Initialising')
@ -87,7 +85,7 @@ class SongsPlugin(Plugin):
Create the MediaManagerItem object, which is displaed in the Create the MediaManagerItem object, which is displaed in the
Media Manager. Media Manager.
""" """
return SongMediaItem(self, self.icon, 'Songs') return SongMediaItem(self, self.icon, self.name)
def add_import_menu_item(self, import_menu): def add_import_menu_item(self, import_menu):
""" """
@ -180,4 +178,6 @@ class SongsPlugin(Plugin):
self.opensong_export_form.show() self.opensong_export_form.show()
def about(self): def about(self):
return u'<b>Song Plugin</b> <br>This plugin allows Songs to be managed and displayed.<br>' about_text = self.trUtf8(u'<b>Song Plugin</b> <br>This plugin allows '
u'Songs to be managed and displayed.<br>')
return about_text

View File

@ -38,10 +38,8 @@ class SongUsagePlugin(Plugin):
log.info(u'SongUsage Plugin loaded') log.info(u'SongUsage Plugin loaded')
def __init__(self, plugin_helpers): def __init__(self, plugin_helpers):
# Call the parent constructor
Plugin.__init__(self, u'SongUsage', u'1.9.0', plugin_helpers) Plugin.__init__(self, u'SongUsage', u'1.9.0', plugin_helpers)
self.weight = -4 self.weight = -4
# Create the plugin icon
self.icon = buildIcon(u':/media/media_image.png') self.icon = buildIcon(u':/media/media_image.png')
self.songusagemanager = None self.songusagemanager = None
self.songusageActive = False self.songusageActive = False
@ -63,17 +61,19 @@ class SongUsagePlugin(Plugin):
self.SongUsageMenu = QtGui.QMenu(tools_menu) self.SongUsageMenu = QtGui.QMenu(tools_menu)
self.SongUsageMenu.setObjectName(u'SongUsageMenu') self.SongUsageMenu.setObjectName(u'SongUsageMenu')
self.SongUsageMenu.setTitle(tools_menu.trUtf8(u'&Song Usage')) self.SongUsageMenu.setTitle(tools_menu.trUtf8(u'&Song Usage'))
#SongUsage Delete #SongUsage Delete
self.SongUsageDelete = QtGui.QAction(tools_menu) self.SongUsageDelete = QtGui.QAction(tools_menu)
self.SongUsageDelete.setText(tools_menu.trUtf8(u'&Delete recorded data')) self.SongUsageDelete.setText(
tools_menu.trUtf8(u'&Delete recorded data'))
self.SongUsageDelete.setStatusTip( self.SongUsageDelete.setStatusTip(
tools_menu.trUtf8(u'Delete sing usage to sepecified date')) tools_menu.trUtf8(u'Delete song usage to specified date'))
self.SongUsageDelete.setObjectName(u'SongUsageDelete') self.SongUsageDelete.setObjectName(u'SongUsageDelete')
#SongUsage Report #SongUsage Report
self.SongUsageReport = QtGui.QAction(tools_menu) self.SongUsageReport = QtGui.QAction(tools_menu)
self.SongUsageReport.setText(tools_menu.trUtf8(u'&Extract recoreded data')) self.SongUsageReport.setText(
tools_menu.trUtf8(u'&Extract recorded data'))
self.SongUsageReport.setStatusTip( self.SongUsageReport.setStatusTip(
tools_menu.trUtf8(u'Generate Extracts on Song Usage')) tools_menu.trUtf8(u'Generate report on Song Usage'))
self.SongUsageReport.setObjectName(u'SongUsageReport') self.SongUsageReport.setObjectName(u'SongUsageReport')
#SongUsage activation #SongUsage activation
SongUsageIcon = buildIcon(u':/tools/tools_alert.png') SongUsageIcon = buildIcon(u':/tools/tools_alert.png')
@ -153,6 +153,7 @@ class SongUsagePlugin(Plugin):
self.SongUsagedetailform.exec_() self.SongUsagedetailform.exec_()
def about(self): def about(self):
about_text = u'<b>SongUsage Plugin</b><br />This plugin records the use '\ about_text = self.trUtf8(u'<b>SongUsage Plugin</b><br>This plugin '
u'of songs and when they have been used during a live service' u'records the use of songs and when they have been used during '
u'a live service')
return about_text return about_text