Moar and moar documents-tations!!

This commit is contained in:
Raoul Snyman 2009-09-05 00:50:19 +02:00
parent 0c7a53bb16
commit dea03e21c8
8 changed files with 147 additions and 34 deletions

View File

@ -3,9 +3,6 @@
:mod:`core` Module
==================
.. automodule:: openlp.core
:members:
.. toctree::
:maxdepth: 2

View File

@ -12,27 +12,99 @@ Module Members
Module Classes
--------------
:mod:`BaseListWithDnD` Class
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:mod:`BaseListWithDnD`
^^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: openlp.core.lib.baselistwithdnd.BaseListWithDnD
:members:
:mod:`EventReceiver` Class
^^^^^^^^^^^^^^^^^^^^^^^^^^
:mod:`EventReceiver`
^^^^^^^^^^^^^^^^^^^^
.. autoclass:: openlp.core.lib.eventreceiver.EventReceiver
:members:
:mod:`ListWithPreviews` Class
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:mod:`ListWithPreviews`
^^^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: openlp.core.lib.listwithpreviews.ListWithPreviews
:members:
:mod:`MediaManagerItem` Class
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:mod:`MediaManagerItem`
^^^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: openlp.core.lib.mediamanageritem.MediaManagerItem
:members:
:mod:`Plugin`
^^^^^^^^^^^^^
.. autoclass:: openlp.core.lib.plugin.Plugin
:members:
:mod:`PluginConfig`
^^^^^^^^^^^^^^^^^^^
.. autoclass:: openlp.core.lib.pluginconfig.PluginConfig
:members:
:mod:`PluginManager`
^^^^^^^^^^^^^^^^^^^^
.. autoclass:: openlp.core.lib.pluginmanager.PluginManager
:members:
:mod:`Renderer`
^^^^^^^^^^^^^^^
.. autoclass:: openlp.core.lib.renderer.Renderer
:members:
:mod:`RenderManager`
^^^^^^^^^^^^^^^^^^^^
.. autoclass:: openlp.core.lib.rendermanager.RenderManager
:members:
:mod:`ServiceItem`
^^^^^^^^^^^^^^^^^^
.. autoclass:: openlp.core.lib.serviceitem.ServiceItem
:members:
:mod:`SettingsTab`
^^^^^^^^^^^^^^^^^^
.. autoclass:: openlp.core.lib.settingstab.SettingsTab
:members:
:mod:`SongXMLBuilder`
^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: openlp.core.lib.songxmlhandler.SongXMLBuilder
:members:
:mod:`SongXMLParser`
^^^^^^^^^^^^^^^^^^^^
.. autoclass:: openlp.core.lib.songxmlhandler.SongXMLParser
:members:
:mod:`ThemeXML`
^^^^^^^^^^^^^^^
.. autoclass:: openlp.core.lib.themexmlhandler.ThemeXML
:members:
:mod:`OpenLPToolbar`
^^^^^^^^^^^^^^^^^^^^
.. autoclass:: openlp.core.lib.toolbar.OpenLPToolbar
:members:
:mod:`XmlRootClass`
^^^^^^^^^^^^^^^^^^^
.. autoclass:: openlp.core.lib.xmlrootclass.XmlRootClass
:members:

View File

@ -57,6 +57,7 @@ def contextMenuSeparator(base):
action.setSeparator(True)
return action
from eventreceiver import Receiver
from settingsmanager import SettingsManager
from pluginconfig import PluginConfig
from plugin import Plugin
@ -65,7 +66,6 @@ from settingstab import SettingsTab
from mediamanageritem import MediaManagerItem
from xmlrootclass import XmlRootClass
from serviceitem import ServiceItem
from eventreceiver import Receiver
from serviceitem import ServiceType
from serviceitem import ServiceItem
from toolbar import OpenLPToolbar

View File

@ -115,12 +115,17 @@ class MediaManagerItem(QtGui.QWidget):
self.initialise()
def retranslateUi(self):
"""
This method is called automatically to provide OpenLP with the
opportunity to translate the ``MediaManagerItem`` to another
language.
"""
pass
def addToolbar(self):
"""
A method to help developers easily add a toolbar to the media manager
item.
A method to help developers easily add a toolbar to the media
manager item.
"""
if self.Toolbar is None:
self.Toolbar = OpenLPToolbar(self)
@ -129,9 +134,29 @@ class MediaManagerItem(QtGui.QWidget):
def addToolbarButton(self, title, tooltip, icon, slot=None, objectname=None):
"""
A method to help developers easily add a button to the toolbar.
``title``
The title of the button.
``tooltip``
The tooltip to be displayed when the mouse hovers over the
button.
``icon``
The icon of the button. This can be an instance of QIcon, or a
string cotaining either the absolute path to the image, or an
internal resource path starting with ':/'.
``slot``
The method to call when the button is clicked.
``objectname``
The name of the button.
"""
# NB different order (when I broke this out, I wanted to not break compatability)
# but it makes sense for the icon to come before the tooltip (as you have to have an icon, but not neccesarily a tooltip)
# NB different order (when I broke this out, I didn't want to
# break compatability), but it makes sense for the icon to
# come before the tooltip (as you have to have an icon, but
# not neccesarily a tooltip)
self.Toolbar.addToolbarButton(title, icon, tooltip, slot, objectname)
def addToolbarSeparator(self):
@ -141,6 +166,11 @@ class MediaManagerItem(QtGui.QWidget):
self.Toolbar.addSeparator()
def setupUi(self):
"""
This method sets up the interface on the button. Plugin
developers use this to add and create toolbars, and the rest
of the interface of the media manager item.
"""
# Add a toolbar
self.addToolbar()
# Create buttons for the toolbar
@ -221,6 +251,11 @@ class MediaManagerItem(QtGui.QWidget):
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.onPreviewClick)
def initialise(self):
"""
Implement this method in your descendent media manager item to
do any UI or other initialisation. This method is called
automatically.
"""
pass
def addHeaderBar(self):

View File

@ -21,17 +21,13 @@ Place, Suite 330, Boston, MA 02111-1307 USA
import logging
from PyQt4 import QtCore
from openlp.core.lib import PluginConfig
# why does this not work???
# from openlp.core.lib import Event, EventType
# so I have to do this???
from eventreceiver import Receiver
from openlp.core.lib import PluginConfig, Receiver
class Plugin(object):
"""
Base class for openlp plugins to inherit from.
Basic attributes are:
**Basic Attributes**
``name``
The name that should appear in the plugins list.
@ -49,7 +45,7 @@ class Plugin(object):
``log``
A log object used to log debugging messages. This is pre-instantiated.
Hook functions:
**Hook Functions**
``check_pre_conditions()``
Provides the Plugin with a handle to check if it can be loaded.
@ -201,7 +197,7 @@ class Plugin(object):
def finalise(self):
"""
Called by the plugin Manager to cleanup things
Called by the plugin Manager to cleanup things.
"""
pass

View File

@ -52,7 +52,8 @@ class PluginManager(object):
def find_plugins(self, dir, plugin_helpers):
"""
Scan the directory dir for objects inheriting from ``openlp.plugin``.
Scan the directory ``dir`` for objects inheriting from the ``Plugin``
class.
``dir``
The directory to scan.

View File

@ -31,6 +31,15 @@ class RenderManager(object):
Class to pull all Renderer interactions into one place. The plugins will
call helper methods to do the rendering but this class will provide
display defense code.
``theme_manager``
The ThemeManager instance, used to get the current theme details.
``screen_list``
The list of screens available.
``screen_number``
Defaults to *0*. The index of the output/display screen.
"""
global log
log=logging.getLogger(u'RenderManager')
@ -39,15 +48,6 @@ class RenderManager(object):
def __init__(self, theme_manager, screen_list, screen_number=0):
"""
Initialise the render manager.
``theme_manager``
The ThemeManager instance, used to get the current theme details.
``screen_list``
The list of screens available.
``screen_number``
Defaults to *0*. The index of the output/display screen.
"""
log.debug(u'Initilisation started')
self.screen_list = screen_list

View File

@ -109,9 +109,21 @@ class OpenLPToolbar(QtGui.QToolBar):
return QtGui.QIcon()
def makeWidgetsInvisible(self, widgets):
"""
Hide a set of widgets.
``widgets``
The list of names of widgets to be hidden.
"""
for widget in widgets:
self.actions[widget].setVisible(False)
def makeWidgetsVisible(self, widgets):
"""
Show a set of widgets.
``widgets``
The list of names of widgets to be shown.
"""
for widget in widgets:
self.actions[widget].setVisible(True)