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 :mod:`core` Module
================== ==================
.. automodule:: openlp.core
:members:
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2

View File

@ -12,27 +12,99 @@ Module Members
Module Classes Module Classes
-------------- --------------
:mod:`BaseListWithDnD` Class :mod:`BaseListWithDnD`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: openlp.core.lib.baselistwithdnd.BaseListWithDnD .. autoclass:: openlp.core.lib.baselistwithdnd.BaseListWithDnD
:members: :members:
:mod:`EventReceiver` Class :mod:`EventReceiver`
^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
.. autoclass:: openlp.core.lib.eventreceiver.EventReceiver .. autoclass:: openlp.core.lib.eventreceiver.EventReceiver
:members: :members:
:mod:`ListWithPreviews` Class :mod:`ListWithPreviews`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: openlp.core.lib.listwithpreviews.ListWithPreviews .. autoclass:: openlp.core.lib.listwithpreviews.ListWithPreviews
:members: :members:
:mod:`MediaManagerItem` Class :mod:`MediaManagerItem`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: openlp.core.lib.mediamanageritem.MediaManagerItem .. autoclass:: openlp.core.lib.mediamanageritem.MediaManagerItem
:members: :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) action.setSeparator(True)
return action return action
from eventreceiver import Receiver
from settingsmanager import SettingsManager from settingsmanager import SettingsManager
from pluginconfig import PluginConfig from pluginconfig import PluginConfig
from plugin import Plugin from plugin import Plugin
@ -65,7 +66,6 @@ from settingstab import SettingsTab
from mediamanageritem import MediaManagerItem from mediamanageritem import MediaManagerItem
from xmlrootclass import XmlRootClass from xmlrootclass import XmlRootClass
from serviceitem import ServiceItem from serviceitem import ServiceItem
from eventreceiver import Receiver
from serviceitem import ServiceType from serviceitem import ServiceType
from serviceitem import ServiceItem from serviceitem import ServiceItem
from toolbar import OpenLPToolbar from toolbar import OpenLPToolbar

View File

@ -115,12 +115,17 @@ class MediaManagerItem(QtGui.QWidget):
self.initialise() self.initialise()
def retranslateUi(self): def retranslateUi(self):
"""
This method is called automatically to provide OpenLP with the
opportunity to translate the ``MediaManagerItem`` to another
language.
"""
pass pass
def addToolbar(self): def addToolbar(self):
""" """
A method to help developers easily add a toolbar to the media manager A method to help developers easily add a toolbar to the media
item. manager item.
""" """
if self.Toolbar is None: if self.Toolbar is None:
self.Toolbar = OpenLPToolbar(self) self.Toolbar = OpenLPToolbar(self)
@ -129,9 +134,29 @@ class MediaManagerItem(QtGui.QWidget):
def addToolbarButton(self, title, tooltip, icon, slot=None, objectname=None): def addToolbarButton(self, title, tooltip, icon, slot=None, objectname=None):
""" """
A method to help developers easily add a button to the toolbar. 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) # NB different order (when I broke this out, I didn't want to
# but it makes sense for the icon to come before the tooltip (as you have to have an icon, but not neccesarily a tooltip) # 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) self.Toolbar.addToolbarButton(title, icon, tooltip, slot, objectname)
def addToolbarSeparator(self): def addToolbarSeparator(self):
@ -141,6 +166,11 @@ class MediaManagerItem(QtGui.QWidget):
self.Toolbar.addSeparator() self.Toolbar.addSeparator()
def setupUi(self): 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 # Add a toolbar
self.addToolbar() self.addToolbar()
# Create buttons for the toolbar # Create buttons for the toolbar
@ -221,6 +251,11 @@ class MediaManagerItem(QtGui.QWidget):
QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.onPreviewClick) QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.onPreviewClick)
def initialise(self): 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 pass
def addHeaderBar(self): def addHeaderBar(self):

View File

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

View File

@ -52,7 +52,8 @@ class PluginManager(object):
def find_plugins(self, dir, plugin_helpers): 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`` ``dir``
The directory to scan. 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 Class to pull all Renderer interactions into one place. The plugins will
call helper methods to do the rendering but this class will provide call helper methods to do the rendering but this class will provide
display defense code. 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 global log
log=logging.getLogger(u'RenderManager') log=logging.getLogger(u'RenderManager')
@ -39,15 +48,6 @@ class RenderManager(object):
def __init__(self, theme_manager, screen_list, screen_number=0): def __init__(self, theme_manager, screen_list, screen_number=0):
""" """
Initialise the render manager. 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') log.debug(u'Initilisation started')
self.screen_list = screen_list self.screen_list = screen_list

View File

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