forked from openlp/openlp
Rewrote Plugin methods to match Python standards, fixed a few other things here and there.
bzr-revno: 219
This commit is contained in:
parent
40e52dd4ff
commit
508a542d6f
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE UserProject SYSTEM "UserProject-4.0.dtd">
|
||||
<!-- eric4 user project file for project openlp.org 2.0 -->
|
||||
<!-- Saved: 2008-12-07, 01:02:37 -->
|
||||
<!-- Saved: 2008-12-14, 17:46:43 -->
|
||||
<!-- Copyright (C) 2008 Raoul Snyman, raoulsnyman@openlp.org -->
|
||||
<UserProject version="4.0">
|
||||
</UserProject>
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Tasks SYSTEM "Tasks-4.2.dtd">
|
||||
<!-- eric4 tasks file for project openlp.org 2.0 -->
|
||||
<!-- Saved: 2008-12-07, 01:02:37 -->
|
||||
<!-- Saved: 2008-12-14, 17:46:43 -->
|
||||
<Tasks version="4.2">
|
||||
<Task priority="1" completed="False" bugfix="False">
|
||||
<Summary>TODO: what is the tags for bridge, pre-chorus?</Summary>
|
||||
@ -21,4 +21,94 @@
|
||||
<Linenumber>523</Linenumber>
|
||||
</Resource>
|
||||
</Task>
|
||||
<Task priority="1" completed="False" bugfix="False">
|
||||
<Summary>TODO: Song: Logging - not all, but enough</Summary>
|
||||
<Description></Description>
|
||||
<Created>2008-12-07, 10:06:59</Created>
|
||||
<Resource>
|
||||
<Filename>openlp/plugins/songs/songxml.py</Filename>
|
||||
<Linenumber>39</Linenumber>
|
||||
</Resource>
|
||||
</Task>
|
||||
<Task priority="1" completed="False" bugfix="False">
|
||||
<Summary>TODO: Song: Handle OpenLP2 format</Summary>
|
||||
<Description></Description>
|
||||
<Created>2008-12-07, 10:06:59</Created>
|
||||
<Resource>
|
||||
<Filename>openlp/plugins/songs/songxml.py</Filename>
|
||||
<Linenumber>40</Linenumber>
|
||||
</Resource>
|
||||
</Task>
|
||||
<Task priority="1" completed="False" bugfix="False">
|
||||
<Summary>TODO: Song: Import OpenLP1</Summary>
|
||||
<Description></Description>
|
||||
<Created>2008-12-07, 10:06:59</Created>
|
||||
<Resource>
|
||||
<Filename>openlp/plugins/songs/songxml.py</Filename>
|
||||
<Linenumber>41</Linenumber>
|
||||
</Resource>
|
||||
</Task>
|
||||
<Task priority="1" completed="False" bugfix="False">
|
||||
<Summary>TODO: Song: Export OpenLP1</Summary>
|
||||
<Description></Description>
|
||||
<Created>2008-12-07, 10:07:00</Created>
|
||||
<Resource>
|
||||
<Filename>openlp/plugins/songs/songxml.py</Filename>
|
||||
<Linenumber>42</Linenumber>
|
||||
</Resource>
|
||||
</Task>
|
||||
<Task priority="1" completed="False" bugfix="False">
|
||||
<Summary>TODO: Song: Export Song to CCLI</Summary>
|
||||
<Description></Description>
|
||||
<Created>2008-12-07, 10:07:00</Created>
|
||||
<Resource>
|
||||
<Filename>openlp/plugins/songs/songxml.py</Filename>
|
||||
<Linenumber>43</Linenumber>
|
||||
</Resource>
|
||||
</Task>
|
||||
<Task priority="1" completed="False" bugfix="False">
|
||||
<Summary>TODO: Song: Export Song to OpenSong</Summary>
|
||||
<Description></Description>
|
||||
<Created>2008-12-07, 10:07:00</Created>
|
||||
<Resource>
|
||||
<Filename>openlp/plugins/songs/songxml.py</Filename>
|
||||
<Linenumber>44</Linenumber>
|
||||
</Resource>
|
||||
</Task>
|
||||
<Task priority="1" completed="False" bugfix="False">
|
||||
<Summary>TODO: Song: Import ChangingSong</Summary>
|
||||
<Description></Description>
|
||||
<Created>2008-12-07, 10:07:00</Created>
|
||||
<Resource>
|
||||
<Filename>openlp/plugins/songs/songxml.py</Filename>
|
||||
<Linenumber>45</Linenumber>
|
||||
</Resource>
|
||||
</Task>
|
||||
<Task priority="1" completed="False" bugfix="False">
|
||||
<Summary>TODO: Song: Export ChangingSong</Summary>
|
||||
<Description></Description>
|
||||
<Created>2008-12-07, 10:07:00</Created>
|
||||
<Resource>
|
||||
<Filename>openlp/plugins/songs/songxml.py</Filename>
|
||||
<Linenumber>46</Linenumber>
|
||||
</Resource>
|
||||
</Task>
|
||||
<Task priority="1" completed="False" bugfix="False">
|
||||
<Summary>TODO: what is the tags for bridge, pre-chorus?</Summary>
|
||||
<Description></Description>
|
||||
<Created>2008-12-07, 10:07:00</Created>
|
||||
<Resource>
|
||||
<Filename>openlp/plugins/songs/songxml.py</Filename>
|
||||
<Linenumber>149</Linenumber>
|
||||
</Resource>
|
||||
</Task>
|
||||
<Task priority="1" completed="False" bugfix="False">
|
||||
<Summary>TODO: check font formatting</Summary>
|
||||
<Description></Description>
|
||||
<Created>2008-12-07, 10:07:00</Created>
|
||||
<Resource>
|
||||
<Filename>openlp/plugins/songs/songxml.py</Filename>
|
||||
<Linenumber>534</Linenumber>
|
||||
</Resource>
|
||||
</Task>
|
||||
</Tasks>
|
@ -62,7 +62,7 @@ The "songs" table has the following columns:
|
||||
* comments
|
||||
* ccli_number
|
||||
* song_number
|
||||
* theme
|
||||
* theme_name
|
||||
* search_title
|
||||
* search_lyrics
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE Project SYSTEM "Project-4.4.dtd">
|
||||
<!-- eric4 project file for project openlp.org 2.0 -->
|
||||
<!-- Saved: 2008-12-07, 01:02:26 -->
|
||||
<!-- Saved: 2008-12-13, 19:19:42 -->
|
||||
<!-- Copyright (C) 2008 Raoul Snyman, raoulsnyman@openlp.org -->
|
||||
<Project version="4.4">
|
||||
<ProgLanguage mixed="0">Python</ProgLanguage>
|
||||
@ -21,14 +21,7 @@
|
||||
<Source>openlp/__init__.py</Source>
|
||||
<Source>demo.py</Source>
|
||||
<Source>openlp/core/settingsmanager.py</Source>
|
||||
<Source>openlp/plugins/biblemanager/test/__init__.py</Source>
|
||||
<Source>openlp/plugins/biblemanager/test/test_bibleManager.py</Source>
|
||||
<Source>openlp/plugins/__init__.py</Source>
|
||||
<Source>openlp/libraries/pptviewlib/ppttest.py</Source>
|
||||
<Source>openlp/plugins/biblemanager/test/test_bibleManagerAPI.py</Source>
|
||||
<Source>openlp/plugins/biblemanager/test/test_bibleManagerCSV.py</Source>
|
||||
<Source>openlp/plugins/mediamanageritem.py</Source>
|
||||
<Source>openlp/plugins/biblemanager/test/test_bibleManagerOSIS.py</Source>
|
||||
<Source>openlp/core/pluginmanager.py</Source>
|
||||
<Source>openlp/core/ui/__init__.py</Source>
|
||||
<Source>openlp/core/ui/mainwindow.py</Source>
|
||||
@ -39,7 +32,6 @@
|
||||
<Source>openlp/plugins/songs/songsplugin.py</Source>
|
||||
<Source>openlp/plugins/songs/__init__.py</Source>
|
||||
<Source>openlp/plugins/songs/forms/__init__.py</Source>
|
||||
<Source>openlp/plugins/songs/songxml.py</Source>
|
||||
<Source>openlp/plugins/songs/forms/openlpimportform.py</Source>
|
||||
<Source>openlp/plugins/songs/forms/editsongform.py</Source>
|
||||
<Source>openlp/plugins/songs/forms/opensongexportform.py</Source>
|
||||
@ -85,6 +77,20 @@
|
||||
<Source>openlp/plugins/bibles/lib/__init__.py</Source>
|
||||
<Source>openlp/plugins/bibles/forms/__init__.py</Source>
|
||||
<Source>openlp/plugins/bibles/lib/biblecommon.py</Source>
|
||||
<Source>openlp/plugins/songs/lib/__init__.py</Source>
|
||||
<Source>openlp/plugins/songs/lib/songxml.py</Source>
|
||||
<Source>openlp/plugins/songs/lib/models.py</Source>
|
||||
<Source>openlp/plugins/bibles/test/__init__.py</Source>
|
||||
<Source>openlp/plugins/bibles/test/test_bibleManagerAPI.py</Source>
|
||||
<Source>openlp/plugins/bibles/test/test_bibleManager.py</Source>
|
||||
<Source>openlp/plugins/bibles/test/test_bibleManagerOSIS.py</Source>
|
||||
<Source>openlp/plugins/bibles/test/test_bibleManagerCSV.py</Source>
|
||||
<Source>openlp/plugins/presentations/lib/pptview.py</Source>
|
||||
<Source>openlp/plugins/presentations/lib/impresscom.py</Source>
|
||||
<Source>openlp/plugins/presentations/lib/powerpoint.py</Source>
|
||||
<Source>openlp/plugins/presentations/lib/pptviewlib/ppttest.py</Source>
|
||||
<Source>openlp/plugins/presentations/__init__.py</Source>
|
||||
<Source>openlp/plugins/presentations/presentationplugin.py</Source>
|
||||
</Sources>
|
||||
<Forms>
|
||||
<Form>resources/forms/bibleimport.ui</Form>
|
||||
|
@ -20,9 +20,10 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
"""
|
||||
|
||||
import sys
|
||||
import logging
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
import logging
|
||||
logging.basicConfig(level=logging.DEBUG,
|
||||
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
|
||||
datefmt='%m-%d %H:%M',
|
||||
|
@ -32,14 +32,14 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
"""
|
||||
QtGui.QWidget.__init__(self)
|
||||
if type(icon) is QtGui.QIcon:
|
||||
self.Icon = icon
|
||||
self.icon = icon
|
||||
elif type(icon) is types.StringType:
|
||||
self.Icon.addPixmap(QtGui.QPixmap.fromImage(QtGui.QImage(icon)),
|
||||
self.icon.addPixmap(QtGui.QPixmap.fromImage(QtGui.QImage(icon)),
|
||||
QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
else:
|
||||
self.Icon = None
|
||||
self.icon = None
|
||||
if title is not None:
|
||||
self.Title = title
|
||||
self.title = title
|
||||
self.Toolbar = None
|
||||
#self.ToolbarButtons = []
|
||||
|
||||
|
@ -17,30 +17,43 @@ 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
|
||||
"""
|
||||
|
||||
from openlp.core.lib import PluginConfig
|
||||
__version__ = "$Revision: $"
|
||||
# $Source$
|
||||
|
||||
import logging
|
||||
|
||||
from openlp.core.lib import PluginConfig
|
||||
|
||||
class Plugin(object):
|
||||
"""
|
||||
Base class for openlp plugins to inherit from.
|
||||
|
||||
Basic attributes are:
|
||||
* Name
|
||||
* name
|
||||
The name that should appear in the plugins list.
|
||||
* Version
|
||||
* version
|
||||
The version number of this iteration of the plugin.
|
||||
* MediaManagerItem
|
||||
An instance of the MediaManagerItem class, used in the Media Manager.
|
||||
* SettingsTab
|
||||
An instance of the SettingsTab class, used in the Settings dialog.
|
||||
* ImportMenuItem
|
||||
A menu item to be placed in the Import menu.
|
||||
* ExportMenuItem
|
||||
A menu item to be placed in the Export menu.
|
||||
* icon
|
||||
An instance of QIcon, which holds an icon for this plugin.
|
||||
* config
|
||||
An instance of PluginConfig, which allows plugins to read and write to
|
||||
openlp.org's configuration. This is pre-instantiated.
|
||||
* log
|
||||
A log object used to log debugging messages. This is pre-instantiated.
|
||||
|
||||
Hook functions:
|
||||
* get_media_manager_item()
|
||||
Returns an instance of MediaManagerItem to be used in the Media Manager.
|
||||
* get_import_menu_item()
|
||||
Returns an item for the Import menu.
|
||||
* get_export_menu_item()
|
||||
Returns an item for the Export menu.
|
||||
* get_settings_tab()
|
||||
Returns an instance of SettingsTab to be used in the Settings dialog.
|
||||
* add_to_menu(menubar)
|
||||
A method to add a menu item to anywhere in the menu, given the menu bar.
|
||||
* handle_event(event)
|
||||
A method use to handle events, given an Event object.
|
||||
* about()
|
||||
Used in the plugin manager, when a person clicks on the 'About' button.
|
||||
* save(data)
|
||||
@ -52,12 +65,8 @@ class Plugin(object):
|
||||
* render(theme, screen_number)
|
||||
A method used to render something to the screen, given the current theme
|
||||
and screen number.
|
||||
* addToMenu(menubar)
|
||||
A method to add a menu item to anywhere in the menu, given the menu bar.
|
||||
* handleEvent(event)
|
||||
A method use to handle events, given an Event object.
|
||||
"""
|
||||
global log
|
||||
|
||||
def __init__(self, name=None, version=None):
|
||||
"""
|
||||
This is the constructor for the plugin object. This provides an easy
|
||||
@ -69,17 +78,53 @@ class Plugin(object):
|
||||
...
|
||||
"""
|
||||
if name is not None:
|
||||
self.Name = name
|
||||
self.name = name
|
||||
else:
|
||||
self.Name = 'Plugin'
|
||||
self.name = 'Plugin'
|
||||
if version is not None:
|
||||
self.Version = version
|
||||
self.config = PluginConfig(self.Name)
|
||||
#self.MediaManagerItem = None
|
||||
self.SettingsTab = None
|
||||
self.ImportMenuItem = None
|
||||
self.ExportMenuItem = None
|
||||
self.Weight = 0
|
||||
self.version = version
|
||||
self.icon = None
|
||||
self.config = PluginConfig(self.name)
|
||||
self.weight = 0
|
||||
# Set up logging
|
||||
self.log = logging.getLogger(self.name)
|
||||
|
||||
def get_media_manager_item(self):
|
||||
"""
|
||||
Construct a MediaManagerItem object with all the buttons and things you
|
||||
need, and return it for integration into openlp.org.
|
||||
"""
|
||||
pass
|
||||
|
||||
def get_import_menu_item(self):
|
||||
"""
|
||||
Create a menu item and add it to the "Import" menu.
|
||||
"""
|
||||
pass
|
||||
|
||||
def get_export_menu_item(self):
|
||||
"""
|
||||
Create a menu item and add it to the "Export" menu.
|
||||
"""
|
||||
pass
|
||||
|
||||
def get_settings_tab(self):
|
||||
"""
|
||||
Create a menu item and add it to the "Import" menu.
|
||||
"""
|
||||
pass
|
||||
|
||||
def add_to_menu(self, menubar):
|
||||
"""
|
||||
Add menu items to the menu, given the menubar.
|
||||
"""
|
||||
pass
|
||||
|
||||
def handle_event(self, event):
|
||||
"""
|
||||
Handle the event contained in the event object.
|
||||
"""
|
||||
pass
|
||||
|
||||
def about(self):
|
||||
"""
|
||||
@ -108,30 +153,8 @@ class Plugin(object):
|
||||
"""
|
||||
pass
|
||||
|
||||
def getMediaManagerItem(self):
|
||||
def initalise(self):
|
||||
"""
|
||||
Construct a MediaManagerItem object with all the buttons and things you
|
||||
need, and return it for integration into openlp.org.
|
||||
"""
|
||||
pass
|
||||
|
||||
def addToMenu(self, menubar):
|
||||
"""
|
||||
Add menu items to the menu, given the menubar.
|
||||
"""
|
||||
pass
|
||||
|
||||
def handleEvent(self, event):
|
||||
"""
|
||||
Handle the event contained in the event object.
|
||||
"""
|
||||
pass
|
||||
|
||||
def getName(self):
|
||||
return self.Name
|
||||
|
||||
def initalise_ui(self):
|
||||
"""
|
||||
Called by the plugin Manager to setup any UI features on creation after the UI has been created,
|
||||
Called by the plugin Manager to initialise anything it needs.
|
||||
"""
|
||||
pass
|
||||
|
@ -73,22 +73,22 @@ class PluginManager(object):
|
||||
for p in self.plugin_classes:
|
||||
plugin = p()
|
||||
plugin_objects.append(plugin)
|
||||
self.plugins = sorted(plugin_objects, self.orderByWeight)
|
||||
self.plugins = sorted(plugin_objects, self.order_by_weight)
|
||||
|
||||
def orderByWeight(self, x, y):
|
||||
return cmp(x.Weight, y.Weight)
|
||||
def order_by_weight(self, x, y):
|
||||
return cmp(x.weight, y.weight)
|
||||
|
||||
def hookMediaManager(self, mediatoolbox):
|
||||
def hook_media_manager(self, mediatoolbox):
|
||||
"""
|
||||
Loop through all the plugins. If a plugin has a valid media manager item,
|
||||
add it to the media manager.
|
||||
"""
|
||||
for plugin in self.plugins:
|
||||
media_manager_item = plugin.getMediaManagerItem()
|
||||
media_manager_item = plugin.get_media_manager_item()
|
||||
if media_manager_item is not None:
|
||||
log.debug('Inserting media manager item from %s' % plugin.Name)
|
||||
mediatoolbox.addItem(media_manager_item, plugin.Icon, media_manager_item.Title)
|
||||
plugin.initalise_ui()
|
||||
log.debug('Inserting media manager item from %s' % plugin.name)
|
||||
mediatoolbox.addItem(media_manager_item, plugin.icon, media_manager_item.title)
|
||||
plugin.initalise()
|
||||
|
||||
def hookHandleEvent(self, event):
|
||||
def hook_handle_event(self, event):
|
||||
pass
|
||||
|
@ -161,7 +161,7 @@ class MainWindow(object):
|
||||
self.MediaToolBox.setObjectName("MediaToolBox")
|
||||
# This is where we will eventually get the Plugin Manager to pull in
|
||||
# the media manager items.
|
||||
self.plugin_manager.hookMediaManager(self.MediaToolBox)
|
||||
self.plugin_manager.hook_media_manager(self.MediaToolBox)
|
||||
# End adding media manager items.
|
||||
self.MediaManagerLayout.addWidget(self.MediaToolBox)
|
||||
self.MediaManagerDock.setWidget(self.MediaManagerContents)
|
||||
|
@ -18,14 +18,14 @@ 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.resources import *
|
||||
from openlp.core.lib import Plugin, MediaManagerItem
|
||||
|
||||
from openlp.plugins.bibles.lib.biblemanager import BibleManager
|
||||
from openlp.plugins.bibles.forms.bibleimportform import BibleImportForm
|
||||
|
||||
import logging
|
||||
from openlp.plugins.bibles.lib import BibleManager
|
||||
from openlp.plugins.bibles.forms import BibleImportForm
|
||||
|
||||
class BiblePlugin(Plugin):
|
||||
global log
|
||||
@ -34,24 +34,24 @@ class BiblePlugin(Plugin):
|
||||
def __init__(self):
|
||||
# Call the parent constructor
|
||||
Plugin.__init__(self, 'Bible', '1.9.0')
|
||||
self.Weight = -9
|
||||
self.weight = -9
|
||||
# Create the plugin icon
|
||||
self.icon = QtGui.QIcon()
|
||||
self.icon.addPixmap(QtGui.QPixmap(':/media/media_verse.png'),
|
||||
QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
#Register the bible Manager
|
||||
self.biblemanager = BibleManager(self.config)
|
||||
self.searchresults = {} # place to store the search results
|
||||
|
||||
def getMediaManagerItem(self):
|
||||
# Create the plugin icon
|
||||
self.Icon = QtGui.QIcon()
|
||||
self.Icon.addPixmap(QtGui.QPixmap(':/media/media_verse.png'),
|
||||
QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
def get_media_manager_item(self):
|
||||
# Create the MediaManagerItem object
|
||||
self.MediaManagerItem = MediaManagerItem(self.Icon, 'Bible Verses')
|
||||
self.MediaManagerItem = MediaManagerItem(self.icon, 'Bible Verses')
|
||||
# Add a toolbar
|
||||
self.MediaManagerItem.addToolbar()
|
||||
# Create buttons for the toolbar
|
||||
## New Bible Button ##
|
||||
self.MediaManagerItem.addToolbarButton('New Bible', 'Register a new Bible',
|
||||
':/bibles/bible_new.png', self.onBibleNewClick, 'BibleNewItem')
|
||||
':/themes/theme_import.png', self.onBibleNewClick, 'BibleNewItem')
|
||||
## Separator Line ##
|
||||
self.MediaManagerItem.addToolbarSeparator()
|
||||
## Preview Bible Button ##
|
||||
@ -182,12 +182,14 @@ class BiblePlugin(Plugin):
|
||||
QtCore.QObject.connect(self.AdvancedFromChapter, QtCore.SIGNAL("activated(int)"), self.onAdvancedFromChapter)
|
||||
QtCore.QObject.connect(self.AdvancedFromVerse, QtCore.SIGNAL("activated(int)"), self.onAdvancedFromVerse)
|
||||
QtCore.QObject.connect(self.AdvancedToChapter, QtCore.SIGNAL("activated(int)"), self.onAdvancedToChapter)
|
||||
|
||||
self._initialiseForm()
|
||||
QtCore.QObject.connect(self.AdvancedSearchButton, QtCore.SIGNAL("pressed()"), self.onAdvancedSearchButton)
|
||||
QtCore.QObject.connect(self.QuickSearchButton, QtCore.SIGNAL("pressed()"), self.onQuickSearchButton)
|
||||
|
||||
return self.MediaManagerItem
|
||||
|
||||
def initalise_ui(self):
|
||||
def initalise(self):
|
||||
self._initialiseForm()
|
||||
|
||||
def onAdvancedVersionComboBox(self):
|
||||
@ -230,7 +232,6 @@ class BiblePlugin(Plugin):
|
||||
first = False
|
||||
self._initialiseBible(b) # use the fist bible as the trigger
|
||||
|
||||
|
||||
def _initialiseBible(self, bible):
|
||||
log.debug("_initialiseBible %s ", bible)
|
||||
self._initialiseBibleQuick(bible)
|
||||
|
@ -17,3 +17,7 @@ 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
|
||||
"""
|
||||
|
||||
from bibleimportform import BibleImportForm
|
||||
|
||||
__all__ = ['BibleImportForm']
|
||||
|
@ -17,3 +17,8 @@ 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
|
||||
"""
|
||||
|
||||
from biblecommon import BibleCommon
|
||||
from biblemanager import BibleManager
|
||||
|
||||
__all__ = ['BibleCommon', 'BibleManager']
|
||||
|
@ -16,7 +16,8 @@ this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
"""
|
||||
|
||||
import os, os.path
|
||||
import os
|
||||
import os.path
|
||||
import sys
|
||||
import urllib2
|
||||
|
||||
|
@ -19,24 +19,24 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
"""
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.resources import *
|
||||
from openlp.core.lib import Plugin, MediaManagerItem
|
||||
#from forms import EditSongForm
|
||||
|
||||
class PresentationPlugin(Plugin):
|
||||
def __init__(self):
|
||||
# Call the parent constructor
|
||||
Plugin.__init__(self, 'Presentations', '1.9.0')
|
||||
self.Weight = -8
|
||||
|
||||
|
||||
def getMediaManagerItem(self):
|
||||
self.weight = -8
|
||||
# Create the plugin icon
|
||||
self.Icon = QtGui.QIcon()
|
||||
self.Icon.addPixmap(QtGui.QPixmap(':/media/media_song.png'),
|
||||
self.icon = QtGui.QIcon()
|
||||
self.icon.addPixmap(QtGui.QPixmap(':/media/media_song.png'),
|
||||
QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
|
||||
|
||||
def get_media_manager_item(self):
|
||||
# Create the MediaManagerItem object
|
||||
self.MediaManagerItem = MediaManagerItem(self.Icon, 'Presentations')
|
||||
self.MediaManagerItem = MediaManagerItem(self.icon, 'Presentations')
|
||||
# Add a toolbar
|
||||
self.MediaManagerItem.addToolbar()
|
||||
# Create buttons for the toolbar
|
||||
@ -70,7 +70,7 @@ class PresentationPlugin(Plugin):
|
||||
|
||||
return self.MediaManagerItem
|
||||
|
||||
def initalise_ui(self):
|
||||
def initalise(self):
|
||||
self.onPresentationNewClick()
|
||||
|
||||
def onPresentationNewClick(self):
|
||||
|
@ -19,4 +19,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
"""
|
||||
|
||||
from editsongform import EditSongForm
|
||||
|
||||
from openlpexportform import OpenLPExportForm
|
||||
from openlpimportform import OpenLPImportForm
|
||||
from opensongexportform import OpenSongExportForm
|
||||
from opensongimportform import OpenSongImportForm
|
||||
|
@ -1,15 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||
"""
|
||||
OpenLP - Open Source Lyrics Projection
|
||||
Copyright (c) 2008 Raoul Snyman
|
||||
Portions copyright (c) 2008 Martin Thompson, Tim Bentley,
|
||||
|
||||
# Form implementation generated from reading ui file 'C:\Project Folders\Personal Projects\openlp-2\trunk\openlp\resources\forms\openlpexportform.ui'
|
||||
#
|
||||
# Created: Wed Nov 05 20:55:51 2008
|
||||
# by: PyQt4 UI code generator 4.4.4-snapshot-20080918
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
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
|
||||
"""
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.resources import *
|
||||
from openlp.core.resources import *
|
||||
|
||||
class OpenLPExportForm(object):
|
||||
|
||||
|
@ -1,15 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||
"""
|
||||
OpenLP - Open Source Lyrics Projection
|
||||
Copyright (c) 2008 Raoul Snyman
|
||||
Portions copyright (c) 2008 Martin Thompson, Tim Bentley,
|
||||
|
||||
# Form implementation generated from reading ui file 'C:\Project Folders\Personal Projects\openlp-2\trunk\openlp\resources\forms\openlpimportform.ui'
|
||||
#
|
||||
# Created: Wed Nov 05 20:56:08 2008
|
||||
# by: PyQt4 UI code generator 4.4.4-snapshot-20080918
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
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
|
||||
"""
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.resources import *
|
||||
from openlp.core.resources import *
|
||||
|
||||
class OpenLPImportForm(object):
|
||||
|
||||
|
@ -1,15 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||
"""
|
||||
OpenLP - Open Source Lyrics Projection
|
||||
Copyright (c) 2008 Raoul Snyman
|
||||
Portions copyright (c) 2008 Martin Thompson, Tim Bentley,
|
||||
|
||||
# Form implementation generated from reading ui file 'C:\Project Folders\Personal Projects\openlp-2\trunk\openlp\resources\forms\opensongexportform.ui'
|
||||
#
|
||||
# Created: Wed Nov 05 20:56:41 2008
|
||||
# by: PyQt4 UI code generator 4.4.4-snapshot-20080918
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
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
|
||||
"""
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.resources import *
|
||||
from openlp.core.resources import *
|
||||
|
||||
class OpenSongExportForm(object):
|
||||
|
||||
|
@ -1,15 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||
"""
|
||||
OpenLP - Open Source Lyrics Projection
|
||||
Copyright (c) 2008 Raoul Snyman
|
||||
Portions copyright (c) 2008 Martin Thompson, Tim Bentley,
|
||||
|
||||
# Form implementation generated from reading ui file 'C:\Project Folders\Personal Projects\openlp-2\trunk\openlp\resources\forms\opensongimportform.ui'
|
||||
#
|
||||
# Created: Wed Nov 05 20:56:54 2008
|
||||
# by: PyQt4 UI code generator 4.4.4-snapshot-20080918
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
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
|
||||
"""
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.resources import *
|
||||
from openlp.core.resources import *
|
||||
|
||||
class OpenSongImportForm(object):
|
||||
|
||||
|
@ -19,6 +19,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
"""
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.resources import *
|
||||
from openlp.core.lib import Plugin, MediaManagerItem
|
||||
from forms import EditSongForm
|
||||
@ -27,16 +28,16 @@ class SongsPlugin(Plugin):
|
||||
def __init__(self):
|
||||
# Call the parent constructor
|
||||
Plugin.__init__(self, 'Songs', '1.9.0')
|
||||
self.Weight = -10
|
||||
self.weight = -10
|
||||
self.edit_song_form = EditSongForm()
|
||||
|
||||
def getMediaManagerItem(self):
|
||||
# Create the plugin icon
|
||||
self.Icon = QtGui.QIcon()
|
||||
self.Icon.addPixmap(QtGui.QPixmap(':/media/media_song.png'),
|
||||
self.icon = QtGui.QIcon()
|
||||
self.icon.addPixmap(QtGui.QPixmap(':/media/media_song.png'),
|
||||
QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
|
||||
def get_media_manager_item(self):
|
||||
# Create the MediaManagerItem object
|
||||
self.MediaManagerItem = MediaManagerItem(self.Icon, 'Songs')
|
||||
self.MediaManagerItem = MediaManagerItem(self.icon, 'Songs')
|
||||
# Add a toolbar
|
||||
self.MediaManagerItem.addToolbar()
|
||||
# Create buttons for the toolbar
|
||||
@ -64,41 +65,38 @@ class SongsPlugin(Plugin):
|
||||
## Add the songlist widget ##
|
||||
|
||||
# Create the tab widget
|
||||
self.SongGroupBox = QtGui.QGroupBox(self.MediaManagerItem)
|
||||
self.SongWidget = QtGui.QWidget(self.MediaManagerItem)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.SongGroupBox.sizePolicy().hasHeightForWidth())
|
||||
self.SongGroupBox.setSizePolicy(sizePolicy)
|
||||
self.SongGroupBox.setObjectName('SearchTabWidget')
|
||||
sizePolicy.setHeightForWidth(self.SongWidget.sizePolicy().hasHeightForWidth())
|
||||
self.SongWidget.setSizePolicy(sizePolicy)
|
||||
self.SongWidget.setObjectName('SongWidget')
|
||||
|
||||
self.QuickLayout = QtGui.QGridLayout(self.SongGroupBox)
|
||||
self.QuickLayout.setObjectName('QuickLayout')
|
||||
self.SearchTypeComboBox = QtGui.QComboBox(self.SongGroupBox)
|
||||
self.SearchTypeComboBox.setObjectName('VersionComboBox')
|
||||
self.QuickLayout.addWidget(self.SearchTypeComboBox, 0, 1, 1, 2)
|
||||
self.SearchTypeLabel = QtGui.QLabel(self.SongGroupBox)
|
||||
self.SearchLayout = QtGui.QGridLayout(self.SongWidget)
|
||||
self.SearchLayout.setObjectName('SearchLayout')
|
||||
self.SearchTypeComboBox = QtGui.QComboBox(self.SongWidget)
|
||||
self.SearchTypeComboBox.setObjectName('SearchTypeComboBox')
|
||||
self.SearchLayout.addWidget(self.SearchTypeComboBox, 0, 1, 1, 2)
|
||||
self.SearchTypeLabel = QtGui.QLabel(self.SongWidget)
|
||||
self.SearchTypeLabel.setObjectName('SearchTypeLabel')
|
||||
self.SearchTypeLabel.setText('Search Type:')
|
||||
self.QuickLayout.addWidget(self.SearchTypeLabel, 0, 0, 1, 1)
|
||||
self.SearchLayout.addWidget(self.SearchTypeLabel, 0, 0, 1, 1)
|
||||
|
||||
|
||||
self.SearchTextLabel = QtGui.QLabel(self.SongGroupBox)
|
||||
self.SearchTextLabel = QtGui.QLabel(self.SongWidget)
|
||||
self.SearchTextLabel.setObjectName('SearchTextLabel')
|
||||
self.SearchTextLabel.setText('Search Text:')
|
||||
self.QuickLayout.addWidget(self.SearchTextLabel, 2, 0, 1, 1)
|
||||
self.SearchTextEdit = QtGui.QLineEdit(self.SongGroupBox)
|
||||
self.SearchLayout.addWidget(self.SearchTextLabel, 2, 0, 1, 1)
|
||||
self.SearchTextEdit = QtGui.QLineEdit(self.SongWidget)
|
||||
self.SearchTextEdit.setObjectName('SearchTextEdit')
|
||||
self.QuickLayout.addWidget(self.SearchTextEdit, 2, 1, 1, 2)
|
||||
self.SearchTextButton = QtGui.QPushButton(self.SongGroupBox)
|
||||
self.SearchLayout.addWidget(self.SearchTextEdit, 2, 1, 1, 2)
|
||||
self.SearchTextButton = QtGui.QPushButton(self.SongWidget)
|
||||
self.SearchTextButton.setObjectName('SearchTextButton')
|
||||
self.SearchTextButton.setText('Search')
|
||||
self.QuickLayout.addWidget(self.SearchTextButton, 3, 2, 1, 1)
|
||||
QuickSpacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
|
||||
self.QuickLayout.addItem(QuickSpacerItem, 4, 2, 1, 1)
|
||||
self.SearchLayout.addWidget(self.SearchTextButton, 3, 2, 1, 1)
|
||||
|
||||
# Add the search tab widget to the page layout
|
||||
self.MediaManagerItem.PageLayout.addWidget(self.SongGroupBox)
|
||||
# Add the song widget to the page layout
|
||||
self.MediaManagerItem.PageLayout.addWidget(self.SongWidget)
|
||||
|
||||
self.listView = QtGui.QListWidget()
|
||||
self.listView.setGeometry(QtCore.QRect(10, 100, 256, 591))
|
||||
@ -107,7 +105,7 @@ class SongsPlugin(Plugin):
|
||||
|
||||
return self.MediaManagerItem
|
||||
|
||||
def initalise_ui(self):
|
||||
def initalise(self):
|
||||
self.SearchTypeComboBox.addItem("Lyrics")
|
||||
self.SearchTypeComboBox.addItem("Titles")
|
||||
self.SearchTypeComboBox.addItem("Authors")
|
||||
|
@ -1,7 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||
"""
|
||||
OpenLP - Open Source Lyrics Projection
|
||||
Copyright (c) 2008 Raoul Snyman
|
||||
Portions copyright (c) 2008 Carsten Tinggaard
|
||||
Portions copyright (c) 2008 Martin Thompson, Tim Bentley,
|
||||
|
||||
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
|
||||
@ -15,6 +17,7 @@ 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 py.test
|
||||
import os
|
||||
import sys
|
||||
|
@ -3,7 +3,7 @@ suffix name = bible3
|
||||
|
||||
[main]
|
||||
themes path = themes
|
||||
data path = /home/timali/.openlp/data
|
||||
data path = /home/raoul/.openlp/data
|
||||
|
||||
[songs]
|
||||
file name = songs.sqlite
|
||||
|
Loading…
Reference in New Issue
Block a user