Moar documentation!

This commit is contained in:
Raoul Snyman 2009-09-03 23:41:34 +02:00
parent a077fe40eb
commit 0c7a53bb16
8 changed files with 129 additions and 60 deletions

View File

@ -47,7 +47,7 @@ copyright = u'2009, Raoul Snyman'
# The short X.Y version.
version = '2.0'
# The full version, including alpha/beta/rc tags.
release = '1.9.0'
release = '2.0.pre'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

View File

@ -6,39 +6,8 @@
.. automodule:: openlp.core
:members:
:mod:`lib` Module
-----------------
.. automodule:: openlp.core.lib
:members:
:mod:`baselistwithdnd` Submodule
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. automodule:: openlp.core.lib.baselistwithdnd
:members:
:mod:`event` Submodule
^^^^^^^^^^^^^^^^^^^^^^
.. automodule:: openlp.core.lib.event
:members:
:mod:`eventmanager` Submodule
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. automodule:: openlp.core.lib.eventmanager
:members:
:mod:`eventreceiver` Submodule
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. automodule:: openlp.core.lib.eventreceiver
:members:
:mod:`theme` Submodule
----------------------
.. automodule:: openlp.core.theme
:members:
.. toctree::
:maxdepth: 2
lib
theme

View File

@ -0,0 +1,38 @@
.. _core-lib:
:mod:`lib` Module
=================
Module Members
--------------
.. automodule:: openlp.core.lib
:members:
Module Classes
--------------
:mod:`BaseListWithDnD` Class
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: openlp.core.lib.baselistwithdnd.BaseListWithDnD
:members:
:mod:`EventReceiver` Class
^^^^^^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: openlp.core.lib.eventreceiver.EventReceiver
:members:
:mod:`ListWithPreviews` Class
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: openlp.core.lib.listwithpreviews.ListWithPreviews
:members:
:mod:`MediaManagerItem` Class
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: openlp.core.lib.mediamanageritem.MediaManagerItem
:members:

View File

@ -0,0 +1,8 @@
.. _core-theme:
:mod:`theme` Module
===================
.. automodule:: openlp.core.theme
:members:

View File

@ -3,8 +3,12 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to OpenLP's documentation!
==================================
Welcome
=======
Welcome to the OpenLP 2.0 API Documentation! In here you will find all
information relating to OpenLP's core classes, core plugins, and anything else
deemed necessary or interesting by the developers.
Contents:

View File

@ -18,11 +18,29 @@
.. automodule:: openlp.plugins.songs.forms
:members:
:mod:`AuthorsForm` Class
^^^^^^^^^^^^^^^^^^^^^^^^
:mod:`AuthorsForm`
^^^^^^^^^^^^^^^^^^
.. autoclass:: openlp.plugins.songs.forms.authorsdialog.Ui_AuthorsDialog
:members:
.. autoclass:: openlp.plugins.songs.forms.authorsform.AuthorsForm
:members:
:mod:`EditSongForm`
^^^^^^^^^^^^^^^^^^^
.. autoclass:: openlp.plugins.songs.forms.editsongdialog.Ui_EditSongDialog
:members:
.. autoclass:: openlp.plugins.songs.forms.editsongform.EditSongForm
:members:
:mod:`EditVerseForm`
^^^^^^^^^^^^^^^^^^^^
.. autoclass:: openlp.plugins.songs.forms.editversedialog.Ui_EditVerseDialog
:members:
.. autoclass:: openlp.plugins.songs.forms.editverseform.EditVerseForm
:members:

View File

@ -31,28 +31,60 @@ class MediaManagerItem(QtGui.QWidget):
MediaManagerItem is a helper widget for plugins.
None of the following *need* to be used, feel free to override
them cmopletely in your plugin's implementation. Alternatively, call them from your
plugin before or after you've done etra things that you need to.
them cmopletely in your plugin's implementation. Alternatively,
call them from your plugin before or after you've done extra
things that you need to.
The plugin will be assigned an icon called u':/media/media_' + 'self.ShortPluginName + u'image.png'
which needs to be available in the main resources in order for them to work, you need to have setup
**Constructor Parameters**
self.TranslationContext
self.PluginTextShort # eg 'Image' for the image plugin
self.ConfigSection - where the items in the media manager are stored
this could potentially be self.PluginTextShort.lower()
``parent``
The parent widget. Usually this will be the *Media Manager*
itself. This needs to be a class descended from ``QWidget``.
self.OnNewPrompt=u'Select Image(s)'
self.OnNewFileMasks=u'Images (*.jpg *jpeg *.gif *.png *.bmp)'
assumes that the new action is to load a file. If not, override onnew
``icon``
Either a ``QIcon``, a resource path, or a file name. This is
the icon which is displayed in the *Media Manager*.
self.ListViewWithDnD_class - there is a base list class with DnD assigned to it (openlp.core.lib.BaseListWithDnD())
each plugin needs to inherit a class from this and pass that *class* (not an instance) to here
via the ListViewWithDnD_class member
``title``
The title visible on the item in the *Media Manager*.
self.PreviewFunction - a function which returns a QImage to represent the item (a preview usually)
- no scaling required - that's done later
If this fn is not defined, a default will be used (treat the filename as an image)
**Member Variables**
When creating a descendant class from this class for your plugin,
the following member variables should be set.
``self.TranslationContext``
This sets the translation context of all the text in the
Media Manager item.
``self.PluginTextShort``
The shortened name for the plugin, e.g. *'Image'* for the
image plugin.
``self.ConfigSection``
The section in the configuration where the items in the media
manager are stored. This could potentially be
``self.PluginTextShort.lower()``.
``self.OnNewPrompt``
Defaults to *'Select Image(s)'*.
``self.OnNewFileMasks``
Defaults to *'Images (*.jpg *jpeg *.gif *.png *.bmp)'*. This
assumes that the new action is to load a file. If not, you
need to override the ``OnNew`` method.
``self.ListViewWithDnD_class``
This must be a **class**, not an object, descended from
``openlp.core.lib.BaseListWithDnD`` that is not used in any
other part of OpenLP.
``self.PreviewFunction``
This must be a method which returns a QImage to represent the
item (usually a preview). No scaling is required, that is
performed automatically by OpenLP when necessary. If this
method is not defined, a default will be used (treat the
filename as an image).
"""
global log