From e0f28ce49398fc12049b2daacab71dc3a934462d Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Thu, 1 Oct 2009 17:56:42 +0100 Subject: [PATCH 1/2] Plugin abouts --- openlp/core/lib/plugin.py | 8 ++++++++ openlp/core/ui/plugindialoglistform.py | 18 +++++++++++++++++- openlp/core/ui/servicemanager.py | 4 ++-- openlp/plugins/audit/auditplugin.py | 3 +++ openlp/plugins/bibles/bibleplugin.py | 2 ++ openlp/plugins/custom/customplugin.py | 3 +++ openlp/plugins/images/imageplugin.py | 3 +++ openlp/plugins/media/mediaplugin.py | 3 +++ .../presentations/presentationplugin.py | 3 +++ openlp/plugins/remotes/remoteplugin.py | 11 ++++++++++- openlp/plugins/songs/songsplugin.py | 3 +++ 11 files changed, 57 insertions(+), 4 deletions(-) diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index 9c4169a81..79f58a788 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -149,6 +149,14 @@ class Plugin(object): """ return True + def can_be_disabled(self): + """ + Indicates whether the plugin can be disabled by the plugin list. + + Returns True or False. + """ + return False + def get_media_manager_item(self): """ Construct a MediaManagerItem object with all the buttons and things diff --git a/openlp/core/ui/plugindialoglistform.py b/openlp/core/ui/plugindialoglistform.py index afcc776ca..bd33c70f8 100644 --- a/openlp/core/ui/plugindialoglistform.py +++ b/openlp/core/ui/plugindialoglistform.py @@ -48,6 +48,8 @@ class PluginForm(QtGui.QDialog): QtCore.QObject.connect(self.ButtonBox, QtCore.SIGNAL(u'accepted()'), PluginForm.close) QtCore.QMetaObject.connectSlotsByName(PluginForm) + QtCore.QObject.connect(self.PluginViewList, + QtCore.SIGNAL(u'itemDoubleClicked(QTableWidgetItem*)'), self.displayAbout) def retranslateUi(self, PluginForm): PluginForm.setWindowTitle(translate(u'PluginForm', u'Plugin list')) @@ -62,15 +64,16 @@ class PluginForm(QtGui.QDialog): """ Load the plugin details into the screen """ - #self.PluginViewList.clear() self.PluginViewList.setRowCount(0) for plugin in self.parent.plugin_manager.plugins: row = self.PluginViewList.rowCount() self.PluginViewList.setRowCount(row + 1) item1 = QtGui.QTableWidgetItem(plugin.name) + item1.setFlags(QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled) item1.setTextAlignment(QtCore.Qt.AlignVCenter) item2 = QtGui.QTableWidgetItem(plugin.version) item2.setTextAlignment(QtCore.Qt.AlignVCenter) + item2.setFlags(QtCore.Qt.ItemIsSelectable) if plugin.status == PluginStatus.Active: item3 = QtGui.QTableWidgetItem( translate(u'PluginForm', u'Active')) @@ -78,8 +81,21 @@ class PluginForm(QtGui.QDialog): item3 = QtGui.QTableWidgetItem( translate(u'PluginForm', u'Inactive')) item3.setTextAlignment(QtCore.Qt.AlignVCenter) + item3.setFlags(QtCore.Qt.ItemIsSelectable) self.PluginViewList.setItem(row, 0, item1) self.PluginViewList.setItem(row, 1, item2) self.PluginViewList.setItem(row, 2, item3) self.PluginViewList.setRowHeight(row, 15) + def displayAbout(self, item): + if item is None: + return False + row = self.PluginViewList.row(item) + text = self.parent.plugin_manager.plugins[row].about() + if text is not None: + ret = QtGui.QMessageBox.information(self, + translate(u'PluginList', u'Plugin Information'), + translate(u'PluginList', text), + QtGui.QMessageBox.StandardButtons( + QtGui.QMessageBox.Ok), + QtGui.QMessageBox.Ok) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 46a54b13d..3c8e03b30 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -35,7 +35,7 @@ from openlp.core.lib import PluginConfig, OpenLPToolbar, ServiceItem, \ class ServiceManagerList(QtGui.QTreeWidget): def __init__(self,parent=None,name=None): - QtGui.QListView.__init__(self,parent) + QtGui.QTreeWidget.__init__(self,parent) self.parent = parent def keyPressEvent(self, event): @@ -402,7 +402,7 @@ class ServiceManager(QtGui.QWidget): name = filename.split(os.path.sep) self.serviceName = name[-1] self.parent.serviceChanged(True, self.serviceName) - + def onQuickSaveService(self): self.onSaveService(True) diff --git a/openlp/plugins/audit/auditplugin.py b/openlp/plugins/audit/auditplugin.py index 03e0a96f3..223426a63 100644 --- a/openlp/plugins/audit/auditplugin.py +++ b/openlp/plugins/audit/auditplugin.py @@ -185,3 +185,6 @@ class AuditPlugin(Plugin): def onAuditReport(self): self.auditdetailform.exec_() + + def about(self): + return u'Audit Plugin
This plugin records the use of songs and when they have been used during a live service' diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index 1458397c2..3e0a0c72b 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -70,3 +70,5 @@ class BiblePlugin(Plugin): def onBibleNewClick(self): self.media_item.onBibleNewClick() + def about(self): + return u'Bible Plugin
This plugin allows bible verse from different sources to be displayed on the screen during the service.

This is a core plugin and cannot be made inactive' diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index 2b011397e..b9523a7b6 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -56,3 +56,6 @@ class CustomPlugin(Plugin): # Create the CustomManagerItem object self.media_item = CustomMediaItem(self, self.icon, u'Custom Slides') return self.media_item + + def about(self): + return u'Custom Plugin
This plugin allows slides to be displayed on the screen in the same way songs are. The difference between this plugin and songs is this plugin provides greater freedom.

This is a core plugin and cannot be made inactive' diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index 9db620d0a..24d07f6be 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -47,3 +47,6 @@ class ImagePlugin(Plugin): # Create the MediaManagerItem object self.media_item = ImageMediaItem(self, self.icon, u'Images') return self.media_item + + def about(self): + return u'Image Plugin
Allows images of all types to be displayed. If a number of images are selected together and presented on the live controller it is possible to turn them into a timed loop.
From the plugin if the Override background is chosen and an image is selected any somgs which are rendered will use the selected image from the background instead of the one provied by the theme.
' diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 3ca4c4141..400cbe269 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -44,3 +44,6 @@ class MediaPlugin(Plugin): # Create the MediaManagerItem object self.media_item = MediaMediaItem(self, self.icon, u'Media') return self.media_item + + def about(self): + return u'Media Plugin
One day this may provide access to video and audio clips' diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index f44617e7d..b5bbc204d 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -96,3 +96,6 @@ class PresentationPlugin(Plugin): #Ask each controller to tidy up for controller in self.controllers: self.controllers[controller].kill() + + def about(self): + return u'Presentation Plugin
Delivers the ability to show presentations using a number of different programs. The choice of available presentaion programs is available in a drop down.' diff --git a/openlp/plugins/remotes/remoteplugin.py b/openlp/plugins/remotes/remoteplugin.py index f11174b66..2365057a4 100644 --- a/openlp/plugins/remotes/remoteplugin.py +++ b/openlp/plugins/remotes/remoteplugin.py @@ -21,7 +21,7 @@ import logging from PyQt4 import QtNetwork, QtCore -from openlp.core.lib import Plugin, Receiver +from openlp.core.lib import Plugin, Receiver, translate from openlp.plugins.remotes.lib import RemoteTab class RemotesPlugin(Plugin): @@ -35,6 +35,9 @@ class RemotesPlugin(Plugin): Plugin.__init__(self, u'Remotes', u'1.9.0', plugin_helpers) self.weight = -1 + def can_be_disabled(self): + return True + def check_pre_conditions(self): """ Check to see if remotes is required @@ -52,6 +55,12 @@ class RemotesPlugin(Plugin): QtCore.QObject.connect(self.server, QtCore.SIGNAL(u'readyRead()'), self.readData) + def finalise(self): + pass + + def about(self): + return u'Remote Plugin
This plugin provides the ability to send messages to a running version of openlp on a different computer.
The Primary use for this would be to send alerts from a creche' + def get_settings_tab(self): """ Create the settings Tab diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 630b4202e..83b1ff82b 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -159,3 +159,6 @@ class SongsPlugin(Plugin): def onExportOpenSongItemClicked(self): self.opensong_export_form.show() + + def about(self): + return u'Song Plugin
This plugin allows Songs to be managed and displayed.

This is a core plugin and cannot be made inactive' From c64584f8880e62c31b429d4143bc1579f7aec758 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Thu, 1 Oct 2009 18:19:46 +0100 Subject: [PATCH 2/2] Plugin abouts fixed --- openlp/plugins/presentations/presentationplugin.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index 9de7ce771..2d068a8ca 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -97,8 +97,6 @@ class PresentationPlugin(Plugin): def finalise(self): log.debug(u'Finalise') #Ask each controller to tidy up - for controller in self.controllers: - self.controllers[controller].kill() for key in self.controllers: controller = self.controllers[key] if controller.enabled: