hopefully Line ending corrected and resolve merge conflict, part2

This commit is contained in:
rimach 2010-09-10 21:21:14 +02:00
parent 2b700c481f
commit 6d7e7d7ad2
11 changed files with 2408 additions and 2408 deletions

View File

@ -1,84 +1,84 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2010 Raoul Snyman #
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
import logging
log = logging.getLogger(__name__)
class MediaDockManager(object):
"""
Provide a repository for MediaManagerItems
"""
def __init__(self, media_dock):
"""
Initialise the media dock
"""
self.media_dock = media_dock
def add_dock(self, media_item, icon, weight):
"""
Add a MediaManagerItem to the dock
``media_item``
The item to add to the dock
``icon``
An icon for this dock item
"""
log.info(u'Adding %s dock' % media_item.title)
self.media_dock.addItem(media_item, icon, media_item.title)
def insert_dock(self, media_item, icon, weight):
"""
This should insert a dock item at a given location
This does not work as it gives a Segmentation error.
For now add at end of stack if not present
"""
log.debug(u'Inserting %s dock' % media_item.title)
match = False
for dock_index in range(0, self.media_dock.count()):
if self.media_dock.widget(dock_index).settingsSection == \
media_item.parent.name_lower:
match = True
break
if not match:
self.media_dock.addItem(media_item, icon, media_item.title)
def remove_dock(self, name):
"""
Removes a MediaManagerItem from the dock
``name``
The item to remove
"""
log.debug(u'remove %s dock' % name)
for dock_index in range(0, self.media_dock.count()):
if self.media_dock.widget(dock_index):
log.debug(u'%s %s' % (name, self.media_dock.widget(dock_index).settingsSection))
if self.media_dock.widget(dock_index).settingsSection == \
name:
self.media_dock.widget(dock_index).hide()
self.media_dock.removeItem(dock_index)
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2010 Raoul Snyman #
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
import logging
log = logging.getLogger(__name__)
class MediaDockManager(object):
"""
Provide a repository for MediaManagerItems
"""
def __init__(self, media_dock):
"""
Initialise the media dock
"""
self.media_dock = media_dock
def add_dock(self, media_item, icon, weight):
"""
Add a MediaManagerItem to the dock
``media_item``
The item to add to the dock
``icon``
An icon for this dock item
"""
log.info(u'Adding %s dock' % media_item.title)
self.media_dock.addItem(media_item, icon, media_item.title)
def insert_dock(self, media_item, icon, weight):
"""
This should insert a dock item at a given location
This does not work as it gives a Segmentation error.
For now add at end of stack if not present
"""
log.debug(u'Inserting %s dock' % media_item.title)
match = False
for dock_index in range(0, self.media_dock.count()):
if self.media_dock.widget(dock_index).settingsSection == \
media_item.parent.name_lower:
match = True
break
if not match:
self.media_dock.addItem(media_item, icon, media_item.title)
def remove_dock(self, name):
"""
Removes a MediaManagerItem from the dock
``name``
The item to remove
"""
log.debug(u'remove %s dock' % name)
for dock_index in range(0, self.media_dock.count()):
if self.media_dock.widget(dock_index):
log.debug(u'%s %s' % (name, self.media_dock.widget(dock_index).settingsSection))
if self.media_dock.widget(dock_index).settingsSection == \
name:
self.media_dock.widget(dock_index).hide()
self.media_dock.removeItem(dock_index)

File diff suppressed because it is too large Load Diff

View File

@ -1,117 +1,117 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2010 Raoul Snyman #
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
import logging
from PyQt4 import QtCore, QtGui
from openlp.core.lib import Plugin, StringType, build_icon, translate
from openlp.core.lib.db import Manager
from openlp.plugins.alerts.lib import AlertsManager, AlertsTab
from openlp.plugins.alerts.lib.db import init_schema
from openlp.plugins.alerts.forms import AlertForm
log = logging.getLogger(__name__)
class AlertsPlugin(Plugin):
log.info(u'Alerts Plugin loaded')
def __init__(self, plugin_helpers):
self.set_plugin_strings()
Plugin.__init__(self, u'Alerts', u'1.9.2', plugin_helpers)
self.weight = -3
self.icon = build_icon(u':/plugins/plugin_alerts.png')
self.alertsmanager = AlertsManager(self)
self.manager = Manager(u'alerts', init_schema)
self.alertForm = AlertForm(self)
def getSettingsTab(self):
"""
Return the settings tab for the Alerts plugin
"""
self.alertsTab = AlertsTab(self)
return self.alertsTab
def addToolsMenuItem(self, tools_menu):
"""
Give the alerts plugin the opportunity to add items to the
**Tools** menu.
``tools_menu``
The actual **Tools** menu item, so that your actions can
use it as their parent.
"""
log.info(u'add tools menu')
self.toolsAlertItem = QtGui.QAction(tools_menu)
self.toolsAlertItem.setIcon(build_icon(u':/plugins/plugin_alerts.png'))
self.toolsAlertItem.setObjectName(u'toolsAlertItem')
self.toolsAlertItem.setText(translate('AlertsPlugin', '&Alert'))
self.toolsAlertItem.setStatusTip(
translate('AlertsPlugin', 'Show an alert message.'))
self.toolsAlertItem.setShortcut(u'F7')
self.serviceManager.parent.ToolsMenu.addAction(self.toolsAlertItem)
QtCore.QObject.connect(self.toolsAlertItem,
QtCore.SIGNAL(u'triggered()'), self.onAlertsTrigger)
self.toolsAlertItem.setVisible(False)
def initialise(self):
log.info(u'Alerts Initialising')
Plugin.initialise(self)
self.toolsAlertItem.setVisible(True)
self.liveController.alertTab = self.alertsTab
def finalise(self):
log.info(u'Alerts Finalising')
Plugin.finalise(self)
self.toolsAlertItem.setVisible(False)
def toggleAlertsState(self):
self.alertsActive = not self.alertsActive
QtCore.QSettings().setValue(self.settingsSection + u'/active',
QtCore.QVariant(self.alertsActive))
def onAlertsTrigger(self):
self.alertForm.loadList()
self.alertForm.exec_()
def about(self):
about_text = translate('AlertsPlugin', '<strong>Alerts Plugin</strong>'
'<br />The alert plugin controls the displaying of nursery alerts '
'on the display screen')
return about_text
def set_plugin_strings(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'Alerts'
self.name_lower = u'alerts'
self.strings = {}
# for names in mediamanagerdock and pluginlist
self.strings[StringType.Name] = {
u'singular': translate('AlertsPlugin', 'Alert'),
u'plural': translate('AlertsPlugin', 'Alerts')
}
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2010 Raoul Snyman #
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
import logging
from PyQt4 import QtCore, QtGui
from openlp.core.lib import Plugin, StringType, build_icon, translate
from openlp.core.lib.db import Manager
from openlp.plugins.alerts.lib import AlertsManager, AlertsTab
from openlp.plugins.alerts.lib.db import init_schema
from openlp.plugins.alerts.forms import AlertForm
log = logging.getLogger(__name__)
class AlertsPlugin(Plugin):
log.info(u'Alerts Plugin loaded')
def __init__(self, plugin_helpers):
self.set_plugin_strings()
Plugin.__init__(self, u'Alerts', u'1.9.2', plugin_helpers)
self.weight = -3
self.icon = build_icon(u':/plugins/plugin_alerts.png')
self.alertsmanager = AlertsManager(self)
self.manager = Manager(u'alerts', init_schema)
self.alertForm = AlertForm(self)
def getSettingsTab(self):
"""
Return the settings tab for the Alerts plugin
"""
self.alertsTab = AlertsTab(self)
return self.alertsTab
def addToolsMenuItem(self, tools_menu):
"""
Give the alerts plugin the opportunity to add items to the
**Tools** menu.
``tools_menu``
The actual **Tools** menu item, so that your actions can
use it as their parent.
"""
log.info(u'add tools menu')
self.toolsAlertItem = QtGui.QAction(tools_menu)
self.toolsAlertItem.setIcon(build_icon(u':/plugins/plugin_alerts.png'))
self.toolsAlertItem.setObjectName(u'toolsAlertItem')
self.toolsAlertItem.setText(translate('AlertsPlugin', '&Alert'))
self.toolsAlertItem.setStatusTip(
translate('AlertsPlugin', 'Show an alert message.'))
self.toolsAlertItem.setShortcut(u'F7')
self.serviceManager.parent.ToolsMenu.addAction(self.toolsAlertItem)
QtCore.QObject.connect(self.toolsAlertItem,
QtCore.SIGNAL(u'triggered()'), self.onAlertsTrigger)
self.toolsAlertItem.setVisible(False)
def initialise(self):
log.info(u'Alerts Initialising')
Plugin.initialise(self)
self.toolsAlertItem.setVisible(True)
self.liveController.alertTab = self.alertsTab
def finalise(self):
log.info(u'Alerts Finalising')
Plugin.finalise(self)
self.toolsAlertItem.setVisible(False)
def toggleAlertsState(self):
self.alertsActive = not self.alertsActive
QtCore.QSettings().setValue(self.settingsSection + u'/active',
QtCore.QVariant(self.alertsActive))
def onAlertsTrigger(self):
self.alertForm.loadList()
self.alertForm.exec_()
def about(self):
about_text = translate('AlertsPlugin', '<strong>Alerts Plugin</strong>'
'<br />The alert plugin controls the displaying of nursery alerts '
'on the display screen')
return about_text
def set_plugin_strings(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'Alerts'
self.name_lower = u'alerts'
self.strings = {}
# for names in mediamanagerdock and pluginlist
self.strings[StringType.Name] = {
u'singular': translate('AlertsPlugin', 'Alert'),
u'plural': translate('AlertsPlugin', 'Alerts')
}

View File

@ -1,170 +1,170 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2010 Raoul Snyman #
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
import logging
from PyQt4 import QtCore, QtGui
from openlp.core.lib import Plugin, StringType, build_icon, translate
from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem
log = logging.getLogger(__name__)
class BiblePlugin(Plugin):
log.info(u'Bible Plugin loaded')
def __init__(self, plugin_helpers):
self.set_plugin_strings()
Plugin.__init__(self, u'Bibles', u'1.9.2', plugin_helpers)
self.weight = -9
self.icon_path = u':/plugins/plugin_bibles.png'
self.icon = build_icon(self.icon_path)
self.manager = None
def initialise(self):
log.info(u'bibles Initialising')
if self.manager is None:
self.manager = BibleManager(self)
Plugin.initialise(self)
self.importBibleItem.setVisible(True)
self.exportBibleItem.setVisible(True)
def finalise(self):
log.info(u'Plugin Finalise')
Plugin.finalise(self)
self.importBibleItem.setVisible(False)
self.exportBibleItem.setVisible(False)
def getSettingsTab(self):
return BiblesTab(self.name)
def getMediaManagerItem(self):
# Create the BibleManagerItem object.
return BibleMediaItem(self, self.icon, self.name)
def addImportMenuItem(self, import_menu):
self.importBibleItem = QtGui.QAction(import_menu)
self.importBibleItem.setObjectName(u'importBibleItem')
import_menu.addAction(self.importBibleItem)
self.importBibleItem.setText(
translate('BiblesPlugin', '&Bible'))
# signals and slots
QtCore.QObject.connect(self.importBibleItem,
QtCore.SIGNAL(u'triggered()'), self.onBibleImportClick)
self.importBibleItem.setVisible(False)
def addExportMenuItem(self, export_menu):
self.exportBibleItem = QtGui.QAction(export_menu)
self.exportBibleItem.setObjectName(u'exportBibleItem')
export_menu.addAction(self.exportBibleItem)
self.exportBibleItem.setText(translate(
'BiblesPlugin', '&Bible'))
self.exportBibleItem.setVisible(False)
def onBibleImportClick(self):
if self.mediaItem:
self.mediaItem.onImportClick()
def about(self):
about_text = translate('BiblesPlugin', '<strong>Bible Plugin</strong>'
'<br />The Bible plugin provides the ability to display bible '
'verses from different sources during the service.')
return about_text
def usesTheme(self, theme):
"""
Called to find out if the bible plugin is currently using a theme.
Returns True if the theme is being used, otherwise returns False.
"""
if self.settings_tab.bible_theme == theme:
return True
return False
def renameTheme(self, oldTheme, newTheme):
"""
Rename the theme the bible plugin is using making the plugin use the
new name.
``oldTheme``
The name of the theme the plugin should stop using. Unused for
this particular plugin.
``newTheme``
The new name the plugin should now use.
"""
self.settings_tab.bible_theme = newTheme
def set_plugin_strings(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'Bibles'
self.name_lower = u'Bibles'
self.strings = {}
# for names in mediamanagerdock and pluginlist
self.strings[StringType.Name] = {
u'singular': translate('BiblesPlugin', 'Bible'),
u'plural': translate('BiblesPlugin', 'Bibles')
}
# Middle Header Bar
## Import Button ##
self.strings[StringType.Import] = {
u'title': translate('BiblesPlugin', 'Import'),
u'tooltip': translate('BiblesPlugin', 'Import a Bible')
}
## New Button ##
self.strings[StringType.New] = {
u'title': translate('BiblesPlugin', 'Add'),
u'tooltip': translate('BiblesPlugin', 'Add a new Bible')
}
## Edit Button ##
self.strings[StringType.Edit] = {
u'title': translate('BiblesPlugin', 'Edit'),
u'tooltip': translate('BiblesPlugin', 'Edit the selected Bible')
}
## Delete Button ##
self.strings[StringType.Delete] = {
u'title': translate('BiblesPlugin', 'Delete'),
u'tooltip': translate('BiblesPlugin', 'Delete the selected Bible')
}
## Preview ##
self.strings[StringType.Preview] = {
u'title': translate('BiblesPlugin', 'Preview'),
u'tooltip': translate('BiblesPlugin', 'Preview the selected Bible')
}
## Live Button ##
self.strings[StringType.Live] = {
u'title': translate('BiblesPlugin', 'Live'),
u'tooltip': translate('BiblesPlugin', 'Send the selected Bible live')
}
## Add to service Button ##
self.strings[StringType.Service] = {
u'title': translate('BiblesPlugin', 'Service'),
u'tooltip': translate('BiblesPlugin', 'Add the selected Bible to the service')
}
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2010 Raoul Snyman #
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
import logging
from PyQt4 import QtCore, QtGui
from openlp.core.lib import Plugin, StringType, build_icon, translate
from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem
log = logging.getLogger(__name__)
class BiblePlugin(Plugin):
log.info(u'Bible Plugin loaded')
def __init__(self, plugin_helpers):
self.set_plugin_strings()
Plugin.__init__(self, u'Bibles', u'1.9.2', plugin_helpers)
self.weight = -9
self.icon_path = u':/plugins/plugin_bibles.png'
self.icon = build_icon(self.icon_path)
self.manager = None
def initialise(self):
log.info(u'bibles Initialising')
if self.manager is None:
self.manager = BibleManager(self)
Plugin.initialise(self)
self.importBibleItem.setVisible(True)
self.exportBibleItem.setVisible(True)
def finalise(self):
log.info(u'Plugin Finalise')
Plugin.finalise(self)
self.importBibleItem.setVisible(False)
self.exportBibleItem.setVisible(False)
def getSettingsTab(self):
return BiblesTab(self.name)
def getMediaManagerItem(self):
# Create the BibleManagerItem object.
return BibleMediaItem(self, self.icon, self.name)
def addImportMenuItem(self, import_menu):
self.importBibleItem = QtGui.QAction(import_menu)
self.importBibleItem.setObjectName(u'importBibleItem')
import_menu.addAction(self.importBibleItem)
self.importBibleItem.setText(
translate('BiblesPlugin', '&Bible'))
# signals and slots
QtCore.QObject.connect(self.importBibleItem,
QtCore.SIGNAL(u'triggered()'), self.onBibleImportClick)
self.importBibleItem.setVisible(False)
def addExportMenuItem(self, export_menu):
self.exportBibleItem = QtGui.QAction(export_menu)
self.exportBibleItem.setObjectName(u'exportBibleItem')
export_menu.addAction(self.exportBibleItem)
self.exportBibleItem.setText(translate(
'BiblesPlugin', '&Bible'))
self.exportBibleItem.setVisible(False)
def onBibleImportClick(self):
if self.mediaItem:
self.mediaItem.onImportClick()
def about(self):
about_text = translate('BiblesPlugin', '<strong>Bible Plugin</strong>'
'<br />The Bible plugin provides the ability to display bible '
'verses from different sources during the service.')
return about_text
def usesTheme(self, theme):
"""
Called to find out if the bible plugin is currently using a theme.
Returns True if the theme is being used, otherwise returns False.
"""
if self.settings_tab.bible_theme == theme:
return True
return False
def renameTheme(self, oldTheme, newTheme):
"""
Rename the theme the bible plugin is using making the plugin use the
new name.
``oldTheme``
The name of the theme the plugin should stop using. Unused for
this particular plugin.
``newTheme``
The new name the plugin should now use.
"""
self.settings_tab.bible_theme = newTheme
def set_plugin_strings(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'Bibles'
self.name_lower = u'Bibles'
self.strings = {}
# for names in mediamanagerdock and pluginlist
self.strings[StringType.Name] = {
u'singular': translate('BiblesPlugin', 'Bible'),
u'plural': translate('BiblesPlugin', 'Bibles')
}
# Middle Header Bar
## Import Button ##
self.strings[StringType.Import] = {
u'title': translate('BiblesPlugin', 'Import'),
u'tooltip': translate('BiblesPlugin', 'Import a Bible')
}
## New Button ##
self.strings[StringType.New] = {
u'title': translate('BiblesPlugin', 'Add'),
u'tooltip': translate('BiblesPlugin', 'Add a new Bible')
}
## Edit Button ##
self.strings[StringType.Edit] = {
u'title': translate('BiblesPlugin', 'Edit'),
u'tooltip': translate('BiblesPlugin', 'Edit the selected Bible')
}
## Delete Button ##
self.strings[StringType.Delete] = {
u'title': translate('BiblesPlugin', 'Delete'),
u'tooltip': translate('BiblesPlugin', 'Delete the selected Bible')
}
## Preview ##
self.strings[StringType.Preview] = {
u'title': translate('BiblesPlugin', 'Preview'),
u'tooltip': translate('BiblesPlugin', 'Preview the selected Bible')
}
## Live Button ##
self.strings[StringType.Live] = {
u'title': translate('BiblesPlugin', 'Live'),
u'tooltip': translate('BiblesPlugin', 'Send the selected Bible live')
}
## Add to service Button ##
self.strings[StringType.Service] = {
u'title': translate('BiblesPlugin', 'Service'),
u'tooltip': translate('BiblesPlugin', 'Add the selected Bible to the service')
}

View File

@ -1,154 +1,154 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2010 Raoul Snyman #
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
import logging
from forms import EditCustomForm
from openlp.core.lib import Plugin, StringType, build_icon, translate
from openlp.core.lib.db import Manager
from openlp.plugins.custom.lib import CustomMediaItem, CustomTab
from openlp.plugins.custom.lib.db import CustomSlide, init_schema
log = logging.getLogger(__name__)
class CustomPlugin(Plugin):
"""
This plugin enables the user to create, edit and display
custom slide shows. Custom shows are divided into slides.
Each show is able to have it's own theme.
Custom shows are designed to replace the use of Customs where
the Customs plugin has become restrictive. Examples could be
Welcome slides, Bible Reading information, Orders of service.
"""
log.info(u'Custom Plugin loaded')
def __init__(self, plugin_helpers):
self.set_plugin_strings()
Plugin.__init__(self, u'Custom', u'1.9.2', plugin_helpers)
self.weight = -5
self.custommanager = Manager(u'custom', init_schema)
self.edit_custom_form = EditCustomForm(self.custommanager)
self.icon_path = u':/plugins/plugin_custom.png'
self.icon = build_icon(self.icon_path)
def getSettingsTab(self):
return CustomTab(self.name)
def getMediaManagerItem(self):
# Create the CustomManagerItem object
return CustomMediaItem(self, self.icon, self.name)
def about(self):
about_text = translate('CustomPlugin', '<strong>Custom Plugin</strong>'
'<br />The custom plugin provides the ability to set up custom '
'text slides that can be displayed on the screen the same way '
'Customs are. This plugin provides greater freedom over the Customs '
'plugin.')
return about_text
def usesTheme(self, theme):
"""
Called to find out if the custom plugin is currently using a theme.
Returns True if the theme is being used, otherwise returns False.
"""
if self.custommanager.get_all_objects(CustomSlide,
CustomSlide.theme_name == theme):
return True
return False
def renameTheme(self, oldTheme, newTheme):
"""
Renames a theme the custom plugin is using making the plugin use the
new name.
``oldTheme``
The name of the theme the plugin should stop using.
``newTheme``
The new name the plugin should now use.
"""
customsUsingTheme = self.custommanager.get_all_objects(CustomSlide,
CustomSlide.theme_name == oldTheme)
for custom in customsUsingTheme:
custom.theme_name = newTheme
self.custommanager.save_object(custom)
def set_plugin_strings(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'Custom'
self.name_lower = u'custom'
self.strings = {}
# for names in mediamanagerdock and pluginlist
self.strings[StringType.Name] = {
u'singular': translate('CustomsPlugin', 'Custom'),
u'plural': translate('CustomsPlugin', 'Customs')
}
# Middle Header Bar
## Import Button ##
self.strings[StringType.Import] = {
u'title': translate('CustomsPlugin', 'Import'),
u'tooltip': translate('CustomsPlugin', 'Import a Custom')
}
## Load Button ##
self.strings[StringType.Load] = {
u'title': translate('CustomsPlugin', 'Load'),
u'tooltip': translate('CustomsPlugin', 'Load a new Custom')
}
## New Button ##
self.strings[StringType.New] = {
u'title': translate('CustomsPlugin', 'Add'),
u'tooltip': translate('CustomsPlugin', 'Add a new Custom')
}
## Edit Button ##
self.strings[StringType.Edit] = {
u'title': translate('CustomsPlugin', 'Edit'),
u'tooltip': translate('CustomsPlugin', 'Edit the selected Custom')
}
## Delete Button ##
self.strings[StringType.Delete] = {
u'title': translate('CustomsPlugin', 'Delete'),
u'tooltip': translate('CustomsPlugin', 'Delete the selected Custom')
}
## Preview ##
self.strings[StringType.Preview] = {
u'title': translate('CustomsPlugin', 'Preview'),
u'tooltip': translate('CustomsPlugin', 'Preview the selected Custom')
}
## Live Button ##
self.strings[StringType.Live] = {
u'title': translate('CustomsPlugin', 'Live'),
u'tooltip': translate('CustomsPlugin', 'Send the selected Custom live')
}
## Add to service Button ##
self.strings[StringType.Service] = {
u'title': translate('CustomsPlugin', 'Service'),
u'tooltip': translate('CustomsPlugin', 'Add the selected Custom to the service')
}
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2010 Raoul Snyman #
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
import logging
from forms import EditCustomForm
from openlp.core.lib import Plugin, StringType, build_icon, translate
from openlp.core.lib.db import Manager
from openlp.plugins.custom.lib import CustomMediaItem, CustomTab
from openlp.plugins.custom.lib.db import CustomSlide, init_schema
log = logging.getLogger(__name__)
class CustomPlugin(Plugin):
"""
This plugin enables the user to create, edit and display
custom slide shows. Custom shows are divided into slides.
Each show is able to have it's own theme.
Custom shows are designed to replace the use of Customs where
the Customs plugin has become restrictive. Examples could be
Welcome slides, Bible Reading information, Orders of service.
"""
log.info(u'Custom Plugin loaded')
def __init__(self, plugin_helpers):
self.set_plugin_strings()
Plugin.__init__(self, u'Custom', u'1.9.2', plugin_helpers)
self.weight = -5
self.custommanager = Manager(u'custom', init_schema)
self.edit_custom_form = EditCustomForm(self.custommanager)
self.icon_path = u':/plugins/plugin_custom.png'
self.icon = build_icon(self.icon_path)
def getSettingsTab(self):
return CustomTab(self.name)
def getMediaManagerItem(self):
# Create the CustomManagerItem object
return CustomMediaItem(self, self.icon, self.name)
def about(self):
about_text = translate('CustomPlugin', '<strong>Custom Plugin</strong>'
'<br />The custom plugin provides the ability to set up custom '
'text slides that can be displayed on the screen the same way '
'Customs are. This plugin provides greater freedom over the Customs '
'plugin.')
return about_text
def usesTheme(self, theme):
"""
Called to find out if the custom plugin is currently using a theme.
Returns True if the theme is being used, otherwise returns False.
"""
if self.custommanager.get_all_objects(CustomSlide,
CustomSlide.theme_name == theme):
return True
return False
def renameTheme(self, oldTheme, newTheme):
"""
Renames a theme the custom plugin is using making the plugin use the
new name.
``oldTheme``
The name of the theme the plugin should stop using.
``newTheme``
The new name the plugin should now use.
"""
customsUsingTheme = self.custommanager.get_all_objects(CustomSlide,
CustomSlide.theme_name == oldTheme)
for custom in customsUsingTheme:
custom.theme_name = newTheme
self.custommanager.save_object(custom)
def set_plugin_strings(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'Custom'
self.name_lower = u'custom'
self.strings = {}
# for names in mediamanagerdock and pluginlist
self.strings[StringType.Name] = {
u'singular': translate('CustomsPlugin', 'Custom'),
u'plural': translate('CustomsPlugin', 'Customs')
}
# Middle Header Bar
## Import Button ##
self.strings[StringType.Import] = {
u'title': translate('CustomsPlugin', 'Import'),
u'tooltip': translate('CustomsPlugin', 'Import a Custom')
}
## Load Button ##
self.strings[StringType.Load] = {
u'title': translate('CustomsPlugin', 'Load'),
u'tooltip': translate('CustomsPlugin', 'Load a new Custom')
}
## New Button ##
self.strings[StringType.New] = {
u'title': translate('CustomsPlugin', 'Add'),
u'tooltip': translate('CustomsPlugin', 'Add a new Custom')
}
## Edit Button ##
self.strings[StringType.Edit] = {
u'title': translate('CustomsPlugin', 'Edit'),
u'tooltip': translate('CustomsPlugin', 'Edit the selected Custom')
}
## Delete Button ##
self.strings[StringType.Delete] = {
u'title': translate('CustomsPlugin', 'Delete'),
u'tooltip': translate('CustomsPlugin', 'Delete the selected Custom')
}
## Preview ##
self.strings[StringType.Preview] = {
u'title': translate('CustomsPlugin', 'Preview'),
u'tooltip': translate('CustomsPlugin', 'Preview the selected Custom')
}
## Live Button ##
self.strings[StringType.Live] = {
u'title': translate('CustomsPlugin', 'Live'),
u'tooltip': translate('CustomsPlugin', 'Send the selected Custom live')
}
## Add to service Button ##
self.strings[StringType.Service] = {
u'title': translate('CustomsPlugin', 'Service'),
u'tooltip': translate('CustomsPlugin', 'Add the selected Custom to the service')
}

View File

@ -1,111 +1,111 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2010 Raoul Snyman #
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
import logging
from openlp.core.lib import Plugin, StringType, build_icon, translate
from openlp.plugins.images.lib import ImageMediaItem
log = logging.getLogger(__name__)
class ImagePlugin(Plugin):
log.info(u'Image Plugin loaded')
def __init__(self, plugin_helpers):
self.set_plugin_strings()
Plugin.__init__(self, u'Images', u'1.9.2', plugin_helpers)
self.weight = -7
self.icon_path = u':/plugins/plugin_images.png'
self.icon = build_icon(self.icon_path)
def getMediaManagerItem(self):
# Create the MediaManagerItem object
return ImageMediaItem(self, self.icon, self.name)
def about(self):
about_text = translate('ImagePlugin', '<strong>Image Plugin</strong>'
'<br />The image plugin provides displaying of images.<br />One '
'of the distinguishing features of this plugin is the ability to '
'group a number of images together in the service manager, making '
'the displaying of multiple images easier. This plugin can also '
'make use of OpenLP\'s "timed looping" feature to create a slide '
'show that runs automatically. In addition to this, images from '
'the plugin can be used to override the current theme\'s '
'background, which renders text-based items like Images with the '
'selected image as a background instead of the background '
'provided by the theme.')
return about_text
# rimach
def set_plugin_strings(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'Images'
self.name_lower = u'images'
self.strings = {}
# for names in mediamanagerdock and pluginlist
self.strings[StringType.Name] = {
u'singular': translate('ImagePlugin', 'Image'),
u'plural': translate('ImagePlugin', 'Images')
}
# Middle Header Bar
## Load Button ##
self.strings[StringType.Load] = {
u'title': translate('ImagePlugin', 'Load'),
u'tooltip': translate('ImagePlugin', 'Load a new Image')
}
## New Button ##
self.strings[StringType.New] = {
u'title': translate('ImagePlugin', 'Add'),
u'tooltip': translate('ImagePlugin', 'Add a new Image')
}
## Edit Button ##
self.strings[StringType.Edit] = {
u'title': translate('ImagePlugin', 'Edit'),
u'tooltip': translate('ImagePlugin', 'Edit the selected Image')
}
## Delete Button ##
self.strings[StringType.Delete] = {
u'title': translate('ImagePlugin', 'Delete'),
u'tooltip': translate('ImagePlugin', 'Delete the selected Image')
}
## Preview ##
self.strings[StringType.Preview] = {
u'title': translate('ImagePlugin', 'Preview'),
u'tooltip': translate('ImagePlugin', 'Preview the selected Image')
}
## Live Button ##
self.strings[StringType.Live] = {
u'title': translate('ImagePlugin', 'Live'),
u'tooltip': translate('ImagePlugin', 'Send the selected Image live')
}
## Add to service Button ##
self.strings[StringType.Service] = {
u'title': translate('ImagePlugin', 'Service'),
u'tooltip': translate('ImagePlugin', 'Add the selected Image to the service')
}
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2010 Raoul Snyman #
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
import logging
from openlp.core.lib import Plugin, StringType, build_icon, translate
from openlp.plugins.images.lib import ImageMediaItem
log = logging.getLogger(__name__)
class ImagePlugin(Plugin):
log.info(u'Image Plugin loaded')
def __init__(self, plugin_helpers):
self.set_plugin_strings()
Plugin.__init__(self, u'Images', u'1.9.2', plugin_helpers)
self.weight = -7
self.icon_path = u':/plugins/plugin_images.png'
self.icon = build_icon(self.icon_path)
def getMediaManagerItem(self):
# Create the MediaManagerItem object
return ImageMediaItem(self, self.icon, self.name)
def about(self):
about_text = translate('ImagePlugin', '<strong>Image Plugin</strong>'
'<br />The image plugin provides displaying of images.<br />One '
'of the distinguishing features of this plugin is the ability to '
'group a number of images together in the service manager, making '
'the displaying of multiple images easier. This plugin can also '
'make use of OpenLP\'s "timed looping" feature to create a slide '
'show that runs automatically. In addition to this, images from '
'the plugin can be used to override the current theme\'s '
'background, which renders text-based items like Images with the '
'selected image as a background instead of the background '
'provided by the theme.')
return about_text
# rimach
def set_plugin_strings(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'Images'
self.name_lower = u'images'
self.strings = {}
# for names in mediamanagerdock and pluginlist
self.strings[StringType.Name] = {
u'singular': translate('ImagePlugin', 'Image'),
u'plural': translate('ImagePlugin', 'Images')
}
# Middle Header Bar
## Load Button ##
self.strings[StringType.Load] = {
u'title': translate('ImagePlugin', 'Load'),
u'tooltip': translate('ImagePlugin', 'Load a new Image')
}
## New Button ##
self.strings[StringType.New] = {
u'title': translate('ImagePlugin', 'Add'),
u'tooltip': translate('ImagePlugin', 'Add a new Image')
}
## Edit Button ##
self.strings[StringType.Edit] = {
u'title': translate('ImagePlugin', 'Edit'),
u'tooltip': translate('ImagePlugin', 'Edit the selected Image')
}
## Delete Button ##
self.strings[StringType.Delete] = {
u'title': translate('ImagePlugin', 'Delete'),
u'tooltip': translate('ImagePlugin', 'Delete the selected Image')
}
## Preview ##
self.strings[StringType.Preview] = {
u'title': translate('ImagePlugin', 'Preview'),
u'tooltip': translate('ImagePlugin', 'Preview the selected Image')
}
## Live Button ##
self.strings[StringType.Live] = {
u'title': translate('ImagePlugin', 'Live'),
u'tooltip': translate('ImagePlugin', 'Send the selected Image live')
}
## Add to service Button ##
self.strings[StringType.Service] = {
u'title': translate('ImagePlugin', 'Service'),
u'tooltip': translate('ImagePlugin', 'Add the selected Image to the service')
}

View File

@ -1,129 +1,129 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2010 Raoul Snyman #
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
import logging
from PyQt4.phonon import Phonon
from openlp.core.lib import Plugin, StringType, build_icon, translate
from openlp.plugins.media.lib import MediaMediaItem
log = logging.getLogger(__name__)
class MediaPlugin(Plugin):
log.info(u'%s MediaPlugin loaded', __name__)
def __init__(self, plugin_helpers):
self.set_plugin_strings()
Plugin.__init__(self, u'Media', u'1.9.2', plugin_helpers)
self.weight = -6
self.icon_path = u':/plugins/plugin_media.png'
self.icon = build_icon(self.icon_path)
# passed with drag and drop messages
self.dnd_id = u'Media'
self.audio_list = u''
self.video_list = u''
for mimetype in Phonon.BackendCapabilities.availableMimeTypes():
mimetype = unicode(mimetype)
type = mimetype.split(u'audio/x-')
self.audio_list, mimetype = self._addToList(self.audio_list,
type, mimetype)
type = mimetype.split(u'audio/')
self.audio_list, mimetype = self._addToList(self.audio_list,
type, mimetype)
type = mimetype.split(u'video/x-')
self.video_list, mimetype = self._addToList(self.video_list,
type, mimetype)
type = mimetype.split(u'video/')
self.video_list, mimetype = self._addToList(self.video_list,
type, mimetype)
def _addToList(self, list, value, type):
if len(value) == 2:
if list.find(value[1]) == -1:
list += u'*.%s ' % value[1]
self.serviceManager.supportedSuffixes(value[1])
type = u''
return list, type
def getMediaManagerItem(self):
# Create the MediaManagerItem object
return MediaMediaItem(self, self.icon, self.name)
def about(self):
about_text = translate('MediaPlugin', '<strong>Media Plugin</strong>'
'<br />The media plugin provides playback of audio and video.')
return about_text
def set_plugin_strings(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'Media'
self.name_lower = u'media'
self.strings = {}
# for names in mediamanagerdock and pluginlist
self.strings[StringType.Name] = {
u'singular': translate('MediaPlugin', 'Media'),
u'plural': translate('MediaPlugin', 'Medias')
}
# Middle Header Bar
## Load Button ##
self.strings[StringType.Load] = {
u'title': translate('MediaPlugin', 'Load'),
u'tooltip': translate('MediaPlugin', 'Load a new Media')
}
## New Button ##
self.strings[StringType.New] = {
u'title': translate('MediaPlugin', 'Add'),
u'tooltip': translate('MediaPlugin', 'Add a new Media')
}
## Edit Button ##
self.strings[StringType.Edit] = {
u'title': translate('MediaPlugin', 'Edit'),
u'tooltip': translate('MediaPlugin', 'Edit the selected Media')
}
## Delete Button ##
self.strings[StringType.Delete] = {
u'title': translate('MediaPlugin', 'Delete'),
u'tooltip': translate('MediaPlugin', 'Delete the selected Media')
}
## Preview ##
self.strings[StringType.Preview] = {
u'title': translate('MediaPlugin', 'Preview'),
u'tooltip': translate('MediaPlugin', 'Preview the selected Media')
}
## Live Button ##
self.strings[StringType.Live] = {
u'title': translate('MediaPlugin', 'Live'),
u'tooltip': translate('MediaPlugin', 'Send the selected Media live')
}
## Add to service Button ##
self.strings[StringType.Service] = {
u'title': translate('MediaPlugin', 'Service'),
u'tooltip': translate('MediaPlugin', 'Add the selected Media to the service')
}
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2010 Raoul Snyman #
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
import logging
from PyQt4.phonon import Phonon
from openlp.core.lib import Plugin, StringType, build_icon, translate
from openlp.plugins.media.lib import MediaMediaItem
log = logging.getLogger(__name__)
class MediaPlugin(Plugin):
log.info(u'%s MediaPlugin loaded', __name__)
def __init__(self, plugin_helpers):
self.set_plugin_strings()
Plugin.__init__(self, u'Media', u'1.9.2', plugin_helpers)
self.weight = -6
self.icon_path = u':/plugins/plugin_media.png'
self.icon = build_icon(self.icon_path)
# passed with drag and drop messages
self.dnd_id = u'Media'
self.audio_list = u''
self.video_list = u''
for mimetype in Phonon.BackendCapabilities.availableMimeTypes():
mimetype = unicode(mimetype)
type = mimetype.split(u'audio/x-')
self.audio_list, mimetype = self._addToList(self.audio_list,
type, mimetype)
type = mimetype.split(u'audio/')
self.audio_list, mimetype = self._addToList(self.audio_list,
type, mimetype)
type = mimetype.split(u'video/x-')
self.video_list, mimetype = self._addToList(self.video_list,
type, mimetype)
type = mimetype.split(u'video/')
self.video_list, mimetype = self._addToList(self.video_list,
type, mimetype)
def _addToList(self, list, value, type):
if len(value) == 2:
if list.find(value[1]) == -1:
list += u'*.%s ' % value[1]
self.serviceManager.supportedSuffixes(value[1])
type = u''
return list, type
def getMediaManagerItem(self):
# Create the MediaManagerItem object
return MediaMediaItem(self, self.icon, self.name)
def about(self):
about_text = translate('MediaPlugin', '<strong>Media Plugin</strong>'
'<br />The media plugin provides playback of audio and video.')
return about_text
def set_plugin_strings(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'Media'
self.name_lower = u'media'
self.strings = {}
# for names in mediamanagerdock and pluginlist
self.strings[StringType.Name] = {
u'singular': translate('MediaPlugin', 'Media'),
u'plural': translate('MediaPlugin', 'Medias')
}
# Middle Header Bar
## Load Button ##
self.strings[StringType.Load] = {
u'title': translate('MediaPlugin', 'Load'),
u'tooltip': translate('MediaPlugin', 'Load a new Media')
}
## New Button ##
self.strings[StringType.New] = {
u'title': translate('MediaPlugin', 'Add'),
u'tooltip': translate('MediaPlugin', 'Add a new Media')
}
## Edit Button ##
self.strings[StringType.Edit] = {
u'title': translate('MediaPlugin', 'Edit'),
u'tooltip': translate('MediaPlugin', 'Edit the selected Media')
}
## Delete Button ##
self.strings[StringType.Delete] = {
u'title': translate('MediaPlugin', 'Delete'),
u'tooltip': translate('MediaPlugin', 'Delete the selected Media')
}
## Preview ##
self.strings[StringType.Preview] = {
u'title': translate('MediaPlugin', 'Preview'),
u'tooltip': translate('MediaPlugin', 'Preview the selected Media')
}
## Live Button ##
self.strings[StringType.Live] = {
u'title': translate('MediaPlugin', 'Live'),
u'tooltip': translate('MediaPlugin', 'Send the selected Media live')
}
## Add to service Button ##
self.strings[StringType.Service] = {
u'title': translate('MediaPlugin', 'Service'),
u'tooltip': translate('MediaPlugin', 'Add the selected Media to the service')
}

View File

@ -1,187 +1,187 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2010 Raoul Snyman #
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
"""
The :mod:`presentationplugin` module provides the ability for OpenLP to display
presentations from a variety of document formats.
"""
import os
import logging
from openlp.core.lib import Plugin, StringType, build_icon, translate
from openlp.core.utils import AppLocation
from openlp.plugins.presentations.lib import PresentationController, \
PresentationMediaItem, PresentationTab
log = logging.getLogger(__name__)
class PresentationPlugin(Plugin):
"""
This plugin allowed a Presentation to be opened, controlled and displayed
on the output display. The plugin controls third party applications such
as OpenOffice.org Impress, Microsoft PowerPoint and the PowerPoint viewer
"""
log = logging.getLogger(u'PresentationPlugin')
def __init__(self, plugin_helpers):
"""
PluginPresentation constructor.
"""
log.debug(u'Initialised')
self.controllers = {}
self.set_plugin_strings()
Plugin.__init__(self, u'Presentations', u'1.9.2', plugin_helpers)
self.weight = -8
self.icon_path = u':/plugins/plugin_presentations.png'
self.icon = build_icon(self.icon_path)
def getSettingsTab(self):
"""
Create the settings Tab
"""
return PresentationTab(self.name, self.controllers)
def initialise(self):
"""
Initialise the plugin. Determine which controllers are enabled
are start their processes.
"""
log.info(u'Presentations Initialising')
Plugin.initialise(self)
self.insertToolboxItem()
for controller in self.controllers:
if self.controllers[controller].enabled():
self.controllers[controller].start_process()
self.mediaItem.buildFileMaskString()
def finalise(self):
"""
Finalise the plugin. Ask all the enabled presentation applications
to close down their applications and release resources.
"""
log.info(u'Plugin Finalise')
#Ask each controller to tidy up
for key in self.controllers:
controller = self.controllers[key]
if controller.enabled():
controller.kill()
Plugin.finalise(self)
def getMediaManagerItem(self):
"""
Create the Media Manager List
"""
return PresentationMediaItem(
self, self.icon, self.name, self.controllers)
def registerControllers(self, controller):
"""
Register each presentation controller (Impress, PPT etc) and
store for later use
"""
self.controllers[controller.name] = controller
def checkPreConditions(self):
"""
Check to see if we have any presentation software available
If Not do not install the plugin.
"""
log.debug(u'checkPreConditions')
controller_dir = os.path.join(
AppLocation.get_directory(AppLocation.PluginsDir),
u'presentations', u'lib')
for filename in os.listdir(controller_dir):
if filename.endswith(u'controller.py') and \
not filename == 'presentationcontroller.py':
path = os.path.join(controller_dir, filename)
if os.path.isfile(path):
modulename = u'openlp.plugins.presentations.lib.' + \
os.path.splitext(filename)[0]
log.debug(u'Importing controller %s', modulename)
try:
__import__(modulename, globals(), locals(), [])
except ImportError:
log.exception(u'Failed to import %s on path %s',
modulename, path)
controller_classes = PresentationController.__subclasses__()
for controller_class in controller_classes:
controller = controller_class(self)
self.registerControllers(controller)
if self.controllers:
return True
else:
return False
def about(self):
"""
Return information about this plugin
"""
about_text = translate('PresentationPlugin', '<strong>Presentation '
'Plugin</strong><br />The presentation plugin provides the '
'ability to show presentations using a number of different '
'programs. The choice of available presentation programs is '
'available to the user in a drop down box.')
return about_text
def set_plugin_strings(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'Presentations'
self.name_lower = u'presentations'
self.strings = {}
# for names in mediamanagerdock and pluginlist
self.strings[StringType.Name] = {
u'singular': translate('PresentationPlugin', 'Presentation'),
u'plural': translate('PresentationPlugin', 'Presentations')
}
# Middle Header Bar
## Load Button ##
self.strings[StringType.Load] = {
u'title': translate('PresentationPlugin', 'Load'),
u'tooltip': translate('PresentationPlugin', 'Load a new Presentation')
}
## Delete Button ##
self.strings[StringType.Delete] = {
u'title': translate('PresentationPlugin', 'Delete'),
u'tooltip': translate('PresentationPlugin', 'Delete the selected Presentation')
}
## Preview ##
self.strings[StringType.Preview] = {
u'title': translate('PresentationPlugin', 'Preview'),
u'tooltip': translate('PresentationPlugin', 'Preview the selected Presentation')
}
## Live Button ##
self.strings[StringType.Live] = {
u'title': translate('PresentationPlugin', 'Live'),
u'tooltip': translate('PresentationPlugin', 'Send the selected Presentation live')
}
## Add to service Button ##
self.strings[StringType.Service] = {
u'title': translate('PresentationPlugin', 'Service'),
u'tooltip': translate('PresentationPlugin', 'Add the selected Presentation to the service')
}
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2010 Raoul Snyman #
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
"""
The :mod:`presentationplugin` module provides the ability for OpenLP to display
presentations from a variety of document formats.
"""
import os
import logging
from openlp.core.lib import Plugin, StringType, build_icon, translate
from openlp.core.utils import AppLocation
from openlp.plugins.presentations.lib import PresentationController, \
PresentationMediaItem, PresentationTab
log = logging.getLogger(__name__)
class PresentationPlugin(Plugin):
"""
This plugin allowed a Presentation to be opened, controlled and displayed
on the output display. The plugin controls third party applications such
as OpenOffice.org Impress, Microsoft PowerPoint and the PowerPoint viewer
"""
log = logging.getLogger(u'PresentationPlugin')
def __init__(self, plugin_helpers):
"""
PluginPresentation constructor.
"""
log.debug(u'Initialised')
self.controllers = {}
self.set_plugin_strings()
Plugin.__init__(self, u'Presentations', u'1.9.2', plugin_helpers)
self.weight = -8
self.icon_path = u':/plugins/plugin_presentations.png'
self.icon = build_icon(self.icon_path)
def getSettingsTab(self):
"""
Create the settings Tab
"""
return PresentationTab(self.name, self.controllers)
def initialise(self):
"""
Initialise the plugin. Determine which controllers are enabled
are start their processes.
"""
log.info(u'Presentations Initialising')
Plugin.initialise(self)
self.insertToolboxItem()
for controller in self.controllers:
if self.controllers[controller].enabled():
self.controllers[controller].start_process()
self.mediaItem.buildFileMaskString()
def finalise(self):
"""
Finalise the plugin. Ask all the enabled presentation applications
to close down their applications and release resources.
"""
log.info(u'Plugin Finalise')
#Ask each controller to tidy up
for key in self.controllers:
controller = self.controllers[key]
if controller.enabled():
controller.kill()
Plugin.finalise(self)
def getMediaManagerItem(self):
"""
Create the Media Manager List
"""
return PresentationMediaItem(
self, self.icon, self.name, self.controllers)
def registerControllers(self, controller):
"""
Register each presentation controller (Impress, PPT etc) and
store for later use
"""
self.controllers[controller.name] = controller
def checkPreConditions(self):
"""
Check to see if we have any presentation software available
If Not do not install the plugin.
"""
log.debug(u'checkPreConditions')
controller_dir = os.path.join(
AppLocation.get_directory(AppLocation.PluginsDir),
u'presentations', u'lib')
for filename in os.listdir(controller_dir):
if filename.endswith(u'controller.py') and \
not filename == 'presentationcontroller.py':
path = os.path.join(controller_dir, filename)
if os.path.isfile(path):
modulename = u'openlp.plugins.presentations.lib.' + \
os.path.splitext(filename)[0]
log.debug(u'Importing controller %s', modulename)
try:
__import__(modulename, globals(), locals(), [])
except ImportError:
log.exception(u'Failed to import %s on path %s',
modulename, path)
controller_classes = PresentationController.__subclasses__()
for controller_class in controller_classes:
controller = controller_class(self)
self.registerControllers(controller)
if self.controllers:
return True
else:
return False
def about(self):
"""
Return information about this plugin
"""
about_text = translate('PresentationPlugin', '<strong>Presentation '
'Plugin</strong><br />The presentation plugin provides the '
'ability to show presentations using a number of different '
'programs. The choice of available presentation programs is '
'available to the user in a drop down box.')
return about_text
def set_plugin_strings(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'Presentations'
self.name_lower = u'presentations'
self.strings = {}
# for names in mediamanagerdock and pluginlist
self.strings[StringType.Name] = {
u'singular': translate('PresentationPlugin', 'Presentation'),
u'plural': translate('PresentationPlugin', 'Presentations')
}
# Middle Header Bar
## Load Button ##
self.strings[StringType.Load] = {
u'title': translate('PresentationPlugin', 'Load'),
u'tooltip': translate('PresentationPlugin', 'Load a new Presentation')
}
## Delete Button ##
self.strings[StringType.Delete] = {
u'title': translate('PresentationPlugin', 'Delete'),
u'tooltip': translate('PresentationPlugin', 'Delete the selected Presentation')
}
## Preview ##
self.strings[StringType.Preview] = {
u'title': translate('PresentationPlugin', 'Preview'),
u'tooltip': translate('PresentationPlugin', 'Preview the selected Presentation')
}
## Live Button ##
self.strings[StringType.Live] = {
u'title': translate('PresentationPlugin', 'Live'),
u'tooltip': translate('PresentationPlugin', 'Send the selected Presentation live')
}
## Add to service Button ##
self.strings[StringType.Service] = {
u'title': translate('PresentationPlugin', 'Service'),
u'tooltip': translate('PresentationPlugin', 'Add the selected Presentation to the service')
}

View File

@ -1,93 +1,93 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2010 Raoul Snyman #
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
import logging
from openlp.core.lib import Plugin, StringType, translate, build_icon
from openlp.plugins.remotes.lib import RemoteTab, HttpServer
log = logging.getLogger(__name__)
class RemotesPlugin(Plugin):
log.info(u'Remote Plugin loaded')
def __init__(self, plugin_helpers):
"""
remotes constructor
"""
self.set_plugin_strings()
Plugin.__init__(self, u'Remotes', u'1.9.2', plugin_helpers)
self.icon = build_icon(u':/plugins/plugin_remote.png')
self.weight = -1
self.server = None
def initialise(self):
"""
Initialise the remotes plugin, and start the http server
"""
log.debug(u'initialise')
Plugin.initialise(self)
self.insertToolboxItem()
self.server = HttpServer(self)
def finalise(self):
"""
Tidy up and close down the http server
"""
log.debug(u'finalise')
Plugin.finalise(self)
if self.server:
self.server.close()
def getSettingsTab(self):
"""
Create the settings Tab
"""
return RemoteTab(self.name)
def about(self):
"""
Information about this plugin
"""
about_text = translate('RemotePlugin', '<strong>Remote Plugin</strong>'
'<br />The remote plugin provides the ability to send messages to '
'a running version of OpenLP on a different computer via a web '
'browser or through the remote API.')
return about_text
def set_plugin_strings(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'Remotes'
self.name_lower = u'remotes'
self.strings = {}
# for names in mediamanagerdock and pluginlist
self.strings[StringType.Name] = {
u'singular': translate('RemotePlugin', 'Remote'),
u'plural': translate('RemotePlugin', 'Remotes')
}
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2010 Raoul Snyman #
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
import logging
from openlp.core.lib import Plugin, StringType, translate, build_icon
from openlp.plugins.remotes.lib import RemoteTab, HttpServer
log = logging.getLogger(__name__)
class RemotesPlugin(Plugin):
log.info(u'Remote Plugin loaded')
def __init__(self, plugin_helpers):
"""
remotes constructor
"""
self.set_plugin_strings()
Plugin.__init__(self, u'Remotes', u'1.9.2', plugin_helpers)
self.icon = build_icon(u':/plugins/plugin_remote.png')
self.weight = -1
self.server = None
def initialise(self):
"""
Initialise the remotes plugin, and start the http server
"""
log.debug(u'initialise')
Plugin.initialise(self)
self.insertToolboxItem()
self.server = HttpServer(self)
def finalise(self):
"""
Tidy up and close down the http server
"""
log.debug(u'finalise')
Plugin.finalise(self)
if self.server:
self.server.close()
def getSettingsTab(self):
"""
Create the settings Tab
"""
return RemoteTab(self.name)
def about(self):
"""
Information about this plugin
"""
about_text = translate('RemotePlugin', '<strong>Remote Plugin</strong>'
'<br />The remote plugin provides the ability to send messages to '
'a running version of OpenLP on a different computer via a web '
'browser or through the remote API.')
return about_text
def set_plugin_strings(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'Remotes'
self.name_lower = u'remotes'
self.strings = {}
# for names in mediamanagerdock and pluginlist
self.strings[StringType.Name] = {
u'singular': translate('RemotePlugin', 'Remote'),
u'plural': translate('RemotePlugin', 'Remotes')
}

View File

@ -1,196 +1,196 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2010 Raoul Snyman #
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
import logging
from PyQt4 import QtCore, QtGui
from openlp.core.lib import Plugin, StringType, build_icon, translate
from openlp.core.lib.db import Manager
from openlp.plugins.songs.lib import SongMediaItem, SongsTab
from openlp.plugins.songs.lib.db import init_schema, Song
from openlp.plugins.songs.lib.importer import SongFormat
log = logging.getLogger(__name__)
class SongsPlugin(Plugin):
"""
This is the number 1 plugin, if importance were placed on any
plugins. This plugin enables the user to create, edit and display
songs. Songs are divided into verses, and the verse order can be
specified. Authors, topics and song books can be assigned to songs
as well.
"""
log.info(u'Song Plugin loaded')
def __init__(self, plugin_helpers):
"""
Create and set up the Songs plugin.
"""
self.set_plugin_strings()
Plugin.__init__(self, u'Songs', u'1.9.2', plugin_helpers)
self.weight = -10
self.manager = Manager(u'songs', init_schema)
self.icon_path = u':/plugins/plugin_songs.png'
self.icon = build_icon(self.icon_path)
def getSettingsTab(self):
return SongsTab(self.name)
def initialise(self):
log.info(u'Songs Initialising')
Plugin.initialise(self)
self.mediaItem.displayResultsSong(
self.manager.get_all_objects(Song, order_by_ref=Song.title))
def getMediaManagerItem(self):
"""
Create the MediaManagerItem object, which is displaed in the
Media Manager.
"""
return SongMediaItem(self, self.icon, self.name)
def addImportMenuItem(self, import_menu):
"""
Give the Songs plugin the opportunity to add items to the
**Import** menu.
``import_menu``
The actual **Import** menu item, so that your actions can
use it as their parent.
"""
# Main song import menu item - will eventually be the only one
self.SongImportItem = QtGui.QAction(import_menu)
self.SongImportItem.setObjectName(u'SongImportItem')
self.SongImportItem.setText(translate(
'SongsPlugin', '&Song'))
self.SongImportItem.setToolTip(translate('SongsPlugin',
'Import songs using the import wizard.'))
import_menu.addAction(self.SongImportItem)
# Signals and slots
QtCore.QObject.connect(self.SongImportItem,
QtCore.SIGNAL(u'triggered()'), self.onSongImportItemClicked)
def addExportMenuItem(self, export_menu):
"""
Give the Songs plugin the opportunity to add items to the
**Export** menu.
``export_menu``
The actual **Export** menu item, so that your actions can
use it as their parent.
"""
# No menu items for now.
pass
def onSongImportItemClicked(self):
if self.mediaItem:
self.mediaItem.onImportClick()
def about(self):
about_text = translate('SongsPlugin', '<strong>Songs Plugin</strong>'
'<br />The songs plugin provides the ability to display and '
'manage songs.')
return about_text
def usesTheme(self, theme):
"""
Called to find out if the song plugin is currently using a theme.
Returns True if the theme is being used, otherwise returns False.
"""
if self.manager.get_all_objects(Song, Song.theme_name == theme):
return True
return False
def renameTheme(self, oldTheme, newTheme):
"""
Renames a theme the song plugin is using making the plugin use the new
name.
``oldTheme``
The name of the theme the plugin should stop using.
``newTheme``
The new name the plugin should now use.
"""
songsUsingTheme = self.manager.get_all_objects(Song,
Song.theme_name == oldTheme)
for song in songsUsingTheme:
song.theme_name = newTheme
self.custommanager.save_object(song)
def importSongs(self, format, **kwargs):
class_ = SongFormat.get_class(format)
importer = class_(self.manager, **kwargs)
importer.register(self.mediaItem.import_wizard)
return importer
def set_plugin_strings(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'Songs'
self.name_lower = u'songs'
self.strings = {}
# for names in mediamanagerdock and pluginlist
self.strings[StringType.Name] = {
u'singular': translate('SongsPlugin', 'Song'),
u'plural': translate('SongsPlugin', 'Songs')
}
# Middle Header Bar
## New Button ##
self.strings[StringType.New] = {
u'title': translate('SongsPlugin', 'Add'),
u'tooltip': translate('SongsPlugin', 'Add a new Song')
}
## Edit Button ##
self.strings[StringType.Edit] = {
u'title': translate('SongsPlugin', 'Edit'),
u'tooltip': translate('SongsPlugin', 'Edit the selected Song')
}
## Delete Button ##
self.strings[StringType.Delete] = {
u'title': translate('SongsPlugin', 'Delete'),
u'tooltip': translate('SongsPlugin', 'Delete the selected Song')
}
## Preview ##
self.strings[StringType.Preview] = {
u'title': translate('SongsPlugin', 'Preview'),
u'tooltip': translate('SongsPlugin', 'Preview the selected Song')
}
## Live Button ##
self.strings[StringType.Live] = {
u'title': translate('SongsPlugin', 'Live'),
u'tooltip': translate('SongsPlugin', 'Send the selected Song live')
}
## Add to service Button ##
self.strings[StringType.Service] = {
u'title': translate('SongsPlugin', 'Service'),
u'tooltip': translate('SongsPlugin', 'Add the selected Song to the service')
}
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2010 Raoul Snyman #
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
import logging
from PyQt4 import QtCore, QtGui
from openlp.core.lib import Plugin, StringType, build_icon, translate
from openlp.core.lib.db import Manager
from openlp.plugins.songs.lib import SongMediaItem, SongsTab
from openlp.plugins.songs.lib.db import init_schema, Song
from openlp.plugins.songs.lib.importer import SongFormat
log = logging.getLogger(__name__)
class SongsPlugin(Plugin):
"""
This is the number 1 plugin, if importance were placed on any
plugins. This plugin enables the user to create, edit and display
songs. Songs are divided into verses, and the verse order can be
specified. Authors, topics and song books can be assigned to songs
as well.
"""
log.info(u'Song Plugin loaded')
def __init__(self, plugin_helpers):
"""
Create and set up the Songs plugin.
"""
self.set_plugin_strings()
Plugin.__init__(self, u'Songs', u'1.9.2', plugin_helpers)
self.weight = -10
self.manager = Manager(u'songs', init_schema)
self.icon_path = u':/plugins/plugin_songs.png'
self.icon = build_icon(self.icon_path)
def getSettingsTab(self):
return SongsTab(self.name)
def initialise(self):
log.info(u'Songs Initialising')
Plugin.initialise(self)
self.mediaItem.displayResultsSong(
self.manager.get_all_objects(Song, order_by_ref=Song.title))
def getMediaManagerItem(self):
"""
Create the MediaManagerItem object, which is displaed in the
Media Manager.
"""
return SongMediaItem(self, self.icon, self.name)
def addImportMenuItem(self, import_menu):
"""
Give the Songs plugin the opportunity to add items to the
**Import** menu.
``import_menu``
The actual **Import** menu item, so that your actions can
use it as their parent.
"""
# Main song import menu item - will eventually be the only one
self.SongImportItem = QtGui.QAction(import_menu)
self.SongImportItem.setObjectName(u'SongImportItem')
self.SongImportItem.setText(translate(
'SongsPlugin', '&Song'))
self.SongImportItem.setToolTip(translate('SongsPlugin',
'Import songs using the import wizard.'))
import_menu.addAction(self.SongImportItem)
# Signals and slots
QtCore.QObject.connect(self.SongImportItem,
QtCore.SIGNAL(u'triggered()'), self.onSongImportItemClicked)
def addExportMenuItem(self, export_menu):
"""
Give the Songs plugin the opportunity to add items to the
**Export** menu.
``export_menu``
The actual **Export** menu item, so that your actions can
use it as their parent.
"""
# No menu items for now.
pass
def onSongImportItemClicked(self):
if self.mediaItem:
self.mediaItem.onImportClick()
def about(self):
about_text = translate('SongsPlugin', '<strong>Songs Plugin</strong>'
'<br />The songs plugin provides the ability to display and '
'manage songs.')
return about_text
def usesTheme(self, theme):
"""
Called to find out if the song plugin is currently using a theme.
Returns True if the theme is being used, otherwise returns False.
"""
if self.manager.get_all_objects(Song, Song.theme_name == theme):
return True
return False
def renameTheme(self, oldTheme, newTheme):
"""
Renames a theme the song plugin is using making the plugin use the new
name.
``oldTheme``
The name of the theme the plugin should stop using.
``newTheme``
The new name the plugin should now use.
"""
songsUsingTheme = self.manager.get_all_objects(Song,
Song.theme_name == oldTheme)
for song in songsUsingTheme:
song.theme_name = newTheme
self.custommanager.save_object(song)
def importSongs(self, format, **kwargs):
class_ = SongFormat.get_class(format)
importer = class_(self.manager, **kwargs)
importer.register(self.mediaItem.import_wizard)
return importer
def set_plugin_strings(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'Songs'
self.name_lower = u'songs'
self.strings = {}
# for names in mediamanagerdock and pluginlist
self.strings[StringType.Name] = {
u'singular': translate('SongsPlugin', 'Song'),
u'plural': translate('SongsPlugin', 'Songs')
}
# Middle Header Bar
## New Button ##
self.strings[StringType.New] = {
u'title': translate('SongsPlugin', 'Add'),
u'tooltip': translate('SongsPlugin', 'Add a new Song')
}
## Edit Button ##
self.strings[StringType.Edit] = {
u'title': translate('SongsPlugin', 'Edit'),
u'tooltip': translate('SongsPlugin', 'Edit the selected Song')
}
## Delete Button ##
self.strings[StringType.Delete] = {
u'title': translate('SongsPlugin', 'Delete'),
u'tooltip': translate('SongsPlugin', 'Delete the selected Song')
}
## Preview ##
self.strings[StringType.Preview] = {
u'title': translate('SongsPlugin', 'Preview'),
u'tooltip': translate('SongsPlugin', 'Preview the selected Song')
}
## Live Button ##
self.strings[StringType.Live] = {
u'title': translate('SongsPlugin', 'Live'),
u'tooltip': translate('SongsPlugin', 'Send the selected Song live')
}
## Add to service Button ##
self.strings[StringType.Service] = {
u'title': translate('SongsPlugin', 'Service'),
u'tooltip': translate('SongsPlugin', 'Add the selected Song to the service')
}

View File

@ -1,179 +1,179 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2010 Raoul Snyman #
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
import logging
from datetime import datetime
from PyQt4 import QtCore, QtGui
from openlp.core.lib import Plugin, StringType, Receiver, build_icon, translate
from openlp.core.lib.db import Manager
from openlp.plugins.songusage.forms import SongUsageDetailForm, \
SongUsageDeleteForm
from openlp.plugins.songusage.lib.db import init_schema, SongUsageItem
log = logging.getLogger(__name__)
class SongUsagePlugin(Plugin):
log.info(u'SongUsage Plugin loaded')
def __init__(self, plugin_helpers):
self.set_plugin_strings()
Plugin.__init__(self, u'SongUsage', u'1.9.2', plugin_helpers)
self.weight = -4
self.icon = build_icon(u':/plugins/plugin_songusage.png')
self.songusagemanager = None
self.songusageActive = False
def addToolsMenuItem(self, tools_menu):
"""
Give the SongUsage plugin the opportunity to add items to the
**Tools** menu.
``tools_menu``
The actual **Tools** menu item, so that your actions can
use it as their parent.
"""
log.info(u'add tools menu')
self.toolsMenu = tools_menu
self.SongUsageMenu = QtGui.QMenu(tools_menu)
self.SongUsageMenu.setObjectName(u'SongUsageMenu')
self.SongUsageMenu.setTitle(translate(
'SongUsagePlugin', '&Song Usage Tracking'))
#SongUsage Delete
self.SongUsageDelete = QtGui.QAction(tools_menu)
self.SongUsageDelete.setText(translate('SongUsagePlugin',
'&Delete Tracking Data'))
self.SongUsageDelete.setStatusTip(translate('SongUsagePlugin',
'Delete song usage data up to a specified date.'))
self.SongUsageDelete.setObjectName(u'SongUsageDelete')
#SongUsage Report
self.SongUsageReport = QtGui.QAction(tools_menu)
self.SongUsageReport.setText(
translate('SongUsagePlugin', '&Extract Tracking Data'))
self.SongUsageReport.setStatusTip(
translate('SongUsagePlugin', 'Generate a report on song usage.'))
self.SongUsageReport.setObjectName(u'SongUsageReport')
#SongUsage activation
self.SongUsageStatus = QtGui.QAction(tools_menu)
self.SongUsageStatus.setCheckable(True)
self.SongUsageStatus.setChecked(False)
self.SongUsageStatus.setText(translate(
'SongUsagePlugin', 'Toggle Tracking'))
self.SongUsageStatus.setStatusTip(translate('SongUsagePlugin',
'Toggle the tracking of song usage.'))
self.SongUsageStatus.setShortcut(u'F4')
self.SongUsageStatus.setObjectName(u'SongUsageStatus')
#Add Menus together
self.toolsMenu.addAction(self.SongUsageMenu.menuAction())
self.SongUsageMenu.addAction(self.SongUsageStatus)
self.SongUsageMenu.addSeparator()
self.SongUsageMenu.addAction(self.SongUsageDelete)
self.SongUsageMenu.addAction(self.SongUsageReport)
# Signals and slots
QtCore.QObject.connect(self.SongUsageStatus,
QtCore.SIGNAL(u'visibilityChanged(bool)'),
self.SongUsageStatus.setChecked)
QtCore.QObject.connect(self.SongUsageStatus,
QtCore.SIGNAL(u'triggered(bool)'),
self.toggleSongUsageState)
QtCore.QObject.connect(self.SongUsageDelete,
QtCore.SIGNAL(u'triggered()'), self.onSongUsageDelete)
QtCore.QObject.connect(self.SongUsageReport,
QtCore.SIGNAL(u'triggered()'), self.onSongUsageReport)
self.SongUsageMenu.menuAction().setVisible(False)
def initialise(self):
log.info(u'SongUsage Initialising')
Plugin.initialise(self)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'slidecontroller_live_started'),
self.onReceiveSongUsage)
self.SongUsageActive = QtCore.QSettings().value(
self.settingsSection + u'/active',
QtCore.QVariant(False)).toBool()
self.SongUsageStatus.setChecked(self.SongUsageActive)
if self.songusagemanager is None:
self.songusagemanager = Manager(u'songusage', init_schema)
self.SongUsagedeleteform = SongUsageDeleteForm(self.songusagemanager,
self.formparent)
self.SongUsagedetailform = SongUsageDetailForm(self, self.formparent)
self.SongUsageMenu.menuAction().setVisible(True)
def finalise(self):
log.info(u'Plugin Finalise')
self.SongUsageMenu.menuAction().setVisible(False)
#stop any events being processed
self.SongUsageActive = False
def toggleSongUsageState(self):
self.SongUsageActive = not self.SongUsageActive
QtCore.QSettings().setValue(self.settingsSection + u'/active',
QtCore.QVariant(self.SongUsageActive))
def onReceiveSongUsage(self, item):
"""
Song Usage for live song from SlideController
"""
audit = item[0].audit
if self.SongUsageActive and audit:
song_usage_item = SongUsageItem()
song_usage_item.usagedate = datetime.today()
song_usage_item.usagetime = datetime.now().time()
song_usage_item.title = audit[0]
song_usage_item.copyright = audit[2]
song_usage_item.ccl_number = audit[3]
song_usage_item.authors = u''
for author in audit[1]:
song_usage_item.authors += author + u' '
self.songusagemanager.save_object(song_usage_item)
def onSongUsageDelete(self):
self.SongUsagedeleteform.exec_()
def onSongUsageReport(self):
self.SongUsagedetailform.initialise()
self.SongUsagedetailform.exec_()
def about(self):
about_text = translate('SongUsagePlugin', '<strong>SongUsage Plugin'
'</strong><br />This plugin tracks the usage of songs in '
'services.')
return about_text
def set_plugin_strings(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'SongUsage'
self.name_lower = u'songusage'
self.strings = {}
# for names in mediamanagerdock and pluginlist
self.strings[StringType.Name] = {
u'singular': translate('SongUsagePlugin', 'SongUsage'),
u'plural': translate('SongUsagePlugin', 'SongUsage')
}
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# --------------------------------------------------------------------------- #
# Copyright (c) 2008-2010 Raoul Snyman #
# Portions copyright (c) 2008-2010 Tim Bentley, Jonathan Corwin, Michael #
# Gorven, Scott Guerrieri, Meinert Jordan, Andreas Preikschat, Christian #
# Richter, Philip Ridout, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
# Carsten Tinggaard, Frode Woldsund #
# --------------------------------------------------------------------------- #
# 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 #
###############################################################################
import logging
from datetime import datetime
from PyQt4 import QtCore, QtGui
from openlp.core.lib import Plugin, StringType, Receiver, build_icon, translate
from openlp.core.lib.db import Manager
from openlp.plugins.songusage.forms import SongUsageDetailForm, \
SongUsageDeleteForm
from openlp.plugins.songusage.lib.db import init_schema, SongUsageItem
log = logging.getLogger(__name__)
class SongUsagePlugin(Plugin):
log.info(u'SongUsage Plugin loaded')
def __init__(self, plugin_helpers):
self.set_plugin_strings()
Plugin.__init__(self, u'SongUsage', u'1.9.2', plugin_helpers)
self.weight = -4
self.icon = build_icon(u':/plugins/plugin_songusage.png')
self.songusagemanager = None
self.songusageActive = False
def addToolsMenuItem(self, tools_menu):
"""
Give the SongUsage plugin the opportunity to add items to the
**Tools** menu.
``tools_menu``
The actual **Tools** menu item, so that your actions can
use it as their parent.
"""
log.info(u'add tools menu')
self.toolsMenu = tools_menu
self.SongUsageMenu = QtGui.QMenu(tools_menu)
self.SongUsageMenu.setObjectName(u'SongUsageMenu')
self.SongUsageMenu.setTitle(translate(
'SongUsagePlugin', '&Song Usage Tracking'))
#SongUsage Delete
self.SongUsageDelete = QtGui.QAction(tools_menu)
self.SongUsageDelete.setText(translate('SongUsagePlugin',
'&Delete Tracking Data'))
self.SongUsageDelete.setStatusTip(translate('SongUsagePlugin',
'Delete song usage data up to a specified date.'))
self.SongUsageDelete.setObjectName(u'SongUsageDelete')
#SongUsage Report
self.SongUsageReport = QtGui.QAction(tools_menu)
self.SongUsageReport.setText(
translate('SongUsagePlugin', '&Extract Tracking Data'))
self.SongUsageReport.setStatusTip(
translate('SongUsagePlugin', 'Generate a report on song usage.'))
self.SongUsageReport.setObjectName(u'SongUsageReport')
#SongUsage activation
self.SongUsageStatus = QtGui.QAction(tools_menu)
self.SongUsageStatus.setCheckable(True)
self.SongUsageStatus.setChecked(False)
self.SongUsageStatus.setText(translate(
'SongUsagePlugin', 'Toggle Tracking'))
self.SongUsageStatus.setStatusTip(translate('SongUsagePlugin',
'Toggle the tracking of song usage.'))
self.SongUsageStatus.setShortcut(u'F4')
self.SongUsageStatus.setObjectName(u'SongUsageStatus')
#Add Menus together
self.toolsMenu.addAction(self.SongUsageMenu.menuAction())
self.SongUsageMenu.addAction(self.SongUsageStatus)
self.SongUsageMenu.addSeparator()
self.SongUsageMenu.addAction(self.SongUsageDelete)
self.SongUsageMenu.addAction(self.SongUsageReport)
# Signals and slots
QtCore.QObject.connect(self.SongUsageStatus,
QtCore.SIGNAL(u'visibilityChanged(bool)'),
self.SongUsageStatus.setChecked)
QtCore.QObject.connect(self.SongUsageStatus,
QtCore.SIGNAL(u'triggered(bool)'),
self.toggleSongUsageState)
QtCore.QObject.connect(self.SongUsageDelete,
QtCore.SIGNAL(u'triggered()'), self.onSongUsageDelete)
QtCore.QObject.connect(self.SongUsageReport,
QtCore.SIGNAL(u'triggered()'), self.onSongUsageReport)
self.SongUsageMenu.menuAction().setVisible(False)
def initialise(self):
log.info(u'SongUsage Initialising')
Plugin.initialise(self)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'slidecontroller_live_started'),
self.onReceiveSongUsage)
self.SongUsageActive = QtCore.QSettings().value(
self.settingsSection + u'/active',
QtCore.QVariant(False)).toBool()
self.SongUsageStatus.setChecked(self.SongUsageActive)
if self.songusagemanager is None:
self.songusagemanager = Manager(u'songusage', init_schema)
self.SongUsagedeleteform = SongUsageDeleteForm(self.songusagemanager,
self.formparent)
self.SongUsagedetailform = SongUsageDetailForm(self, self.formparent)
self.SongUsageMenu.menuAction().setVisible(True)
def finalise(self):
log.info(u'Plugin Finalise')
self.SongUsageMenu.menuAction().setVisible(False)
#stop any events being processed
self.SongUsageActive = False
def toggleSongUsageState(self):
self.SongUsageActive = not self.SongUsageActive
QtCore.QSettings().setValue(self.settingsSection + u'/active',
QtCore.QVariant(self.SongUsageActive))
def onReceiveSongUsage(self, item):
"""
Song Usage for live song from SlideController
"""
audit = item[0].audit
if self.SongUsageActive and audit:
song_usage_item = SongUsageItem()
song_usage_item.usagedate = datetime.today()
song_usage_item.usagetime = datetime.now().time()
song_usage_item.title = audit[0]
song_usage_item.copyright = audit[2]
song_usage_item.ccl_number = audit[3]
song_usage_item.authors = u''
for author in audit[1]:
song_usage_item.authors += author + u' '
self.songusagemanager.save_object(song_usage_item)
def onSongUsageDelete(self):
self.SongUsagedeleteform.exec_()
def onSongUsageReport(self):
self.SongUsagedetailform.initialise()
self.SongUsagedetailform.exec_()
def about(self):
about_text = translate('SongUsagePlugin', '<strong>SongUsage Plugin'
'</strong><br />This plugin tracks the usage of songs in '
'services.')
return about_text
def set_plugin_strings(self):
"""
Called to define all translatable texts of the plugin
"""
self.name = u'SongUsage'
self.name_lower = u'songusage'
self.strings = {}
# for names in mediamanagerdock and pluginlist
self.strings[StringType.Name] = {
u'singular': translate('SongUsagePlugin', 'SongUsage'),
u'plural': translate('SongUsagePlugin', 'SongUsage')
}