forked from openlp/openlp
Moved some more stuff around, tried to get the Bible plugin working... now none of the plugins are working... eish!
bzr-revno: 152
This commit is contained in:
parent
ea2d58d61d
commit
7c067bc3b0
@ -23,7 +23,5 @@ from settingstab import SettingsTab
|
|||||||
from mediamanageritem import MediaManagerItem
|
from mediamanageritem import MediaManagerItem
|
||||||
from event import Event
|
from event import Event
|
||||||
from xmlrootclass import XmlRootClass
|
from xmlrootclass import XmlRootClass
|
||||||
from winregistry import WinRegistry
|
|
||||||
|
|
||||||
__all__ = ['Plugin', 'SettingsTab', 'MediaManagerItem', 'Event', 'XmlRootClass',
|
__all__ = ['Plugin', 'SettingsTab', 'MediaManagerItem', 'Event', 'XmlRootClass']
|
||||||
'WinRegistry']
|
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
# -*- 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
|
|
||||||
|
|
||||||
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
|
|
||||||
"""
|
|
||||||
|
|
||||||
import _winreg
|
|
||||||
|
|
||||||
class WinRegistry(object):
|
|
||||||
"""
|
|
||||||
The WinRegistry class is a high-level wrapper class for the Windows registry
|
|
||||||
functions in Python.
|
|
||||||
"""
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
@ -21,7 +21,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
import os, sys
|
import os, sys
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from openlp.core.lib import Plugin, Event
|
from openlp.core.lib import Plugin
|
||||||
|
|
||||||
# Not sure what this is for. I prefer keeping as much code in the class as possible.
|
# Not sure what this is for. I prefer keeping as much code in the class as possible.
|
||||||
mypath=os.path.split(os.path.abspath(__file__))[0]
|
mypath=os.path.split(os.path.abspath(__file__))[0]
|
||||||
|
@ -17,13 +17,14 @@ 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
|
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||||
Place, Suite 330, Boston, MA 02111-1307 USA
|
Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
"""
|
"""
|
||||||
import os, os.path
|
import os
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from PyQt4 import QtCore, QtGui
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.resources import *
|
from openlp.core.resources import *
|
||||||
|
from openlp.core import PluginManager
|
||||||
from openlp.core.ui import AboutForm, AlertForm, SettingsDialog
|
from openlp.core.ui import AboutForm, AlertForm, SettingsDialog
|
||||||
from openlp.core import Plugin, PluginManager, MediaManagerItem, SettingsTab
|
from openlp.core.lib import Plugin, MediaManagerItem, SettingsTab
|
||||||
|
|
||||||
class MainWindow(object):
|
class MainWindow(object):
|
||||||
|
|
||||||
|
@ -16,4 +16,9 @@ this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
|||||||
Place, Suite 330, Boston, MA 02111-1307 USA
|
Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from registry import Registry
|
||||||
|
from linregistry import LinRegistry
|
||||||
|
from winregistry import WinRegistry
|
||||||
|
from confighelper import ConfigHelper
|
||||||
|
|
||||||
|
__all__ = ['Registry', 'LinRegistry', 'WinRegistry', 'ConfigHelper']
|
||||||
|
@ -1 +1,54 @@
|
|||||||
# -*- 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
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
"""
import os
class ConfigHelper(object):
"""
Utility Helper to allow classes to find directories in a standard manner.
"""
def get_registry_value(reg, key, value_name):
k = _winreg.OpenKey(reg, key)
value = _winreg.QueryValueEx(k, value_name)[0]
_winreg.CloseKey(k)
return value
def getConfigPath():
if os.name == 'nt':
import _winreg
reg = _winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE)
key = r"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
path = get_registry_value(reg, key, "Common AppData")
elif os.name == 'posix':
path = os.path.join(os.getenv('HOME'), ".openlp.org")
if os.path.exists(path) == False :
raise Exception ('Configuration Directory does not Exist ')
return path
def getSongsFile():
path = getConfigPath()
songfile = os.path.join(path, ".openlp.org", "Data", "songs.olp")
if os.path.exists(songfile):
filename.set_filename(songfile)
print songfile
def getBiblePath():
return os.path.join(getConfigPath(), "Data","Bibles")
|
# -*- 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
|
||||||
|
|
||||||
|
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
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
class ConfigHelper(object):
|
||||||
|
"""
|
||||||
|
Utility Helper to allow classes to find directories in a standard manner.
|
||||||
|
"""
|
||||||
|
def get_registry_value(reg, key, value_name):
|
||||||
|
k = _winreg.OpenKey(reg, key)
|
||||||
|
value = _winreg.QueryValueEx(k, value_name)[0]
|
||||||
|
_winreg.CloseKey(k)
|
||||||
|
return value
|
||||||
|
|
||||||
|
def getConfigPath():
|
||||||
|
if os.name == 'nt':
|
||||||
|
import _winreg
|
||||||
|
reg = _winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE)
|
||||||
|
key = r"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
|
||||||
|
path = get_registry_value(reg, key, "Common AppData")
|
||||||
|
elif os.name == 'posix':
|
||||||
|
path = os.path.join(os.getenv('HOME'), ".openlp.org")
|
||||||
|
if os.path.exists(path) == False :
|
||||||
|
raise Exception ('Configuration Directory does not Exist ')
|
||||||
|
return path
|
||||||
|
|
||||||
|
def getSongsFile():
|
||||||
|
path = getConfigPath()
|
||||||
|
songfile = os.path.join(path, ".openlp.org", "Data", "songs.olp")
|
||||||
|
if os.path.exists(songfile):
|
||||||
|
filename.set_filename(songfile)
|
||||||
|
print songfile
|
||||||
|
|
||||||
|
def getBiblePath():
|
||||||
|
return os.path.join(getConfigPath(), "Data","Bibles")
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
|
|
||||||
import _winreg
|
import _winreg
|
||||||
|
|
||||||
class WinRegistry(object):
|
class WinRegistry(Registry):
|
||||||
"""
|
"""
|
||||||
The WinRegistry class is a high-level wrapper class for the Windows registry
|
The WinRegistry class is a high-level wrapper class for the Windows registry
|
||||||
functions in Python.
|
functions in Python.
|
||||||
|
@ -24,10 +24,10 @@ mypath=os.path.split(os.path.abspath(__file__))[0]
|
|||||||
sys.path.insert(0,(os.path.join(mypath, '..', '..', '..')))
|
sys.path.insert(0,(os.path.join(mypath, '..', '..', '..')))
|
||||||
|
|
||||||
from openlp.core.utils import ConfigHelper
|
from openlp.core.utils import ConfigHelper
|
||||||
from openlp.plugins.biblemanager.bibleOSISImpl import BibleOSISImpl
|
from bibleOSISImpl import BibleOSISImpl
|
||||||
from openlp.plugins.biblemanager.bibleCSVImpl import BibleCSVImpl
|
from bibleCSVImpl import BibleCSVImpl
|
||||||
from openlp.plugins.biblemanager.bibleDBImpl import BibleDBImpl
|
from bibleDBImpl import BibleDBImpl
|
||||||
from openlp.plugins.biblemanager.bibleHTTPImpl import BibleHTTPImpl
|
from bibleHTTPImpl import BibleHTTPImpl
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
logging.basicConfig(level=logging.DEBUG,
|
logging.basicConfig(level=logging.DEBUG,
|
||||||
|
@ -45,7 +45,7 @@ class BiblePlugin(Plugin):
|
|||||||
self.MediaManagerItem.addToolbarButton('New Bible', 'Register a new Bible',
|
self.MediaManagerItem.addToolbarButton('New Bible', 'Register a new Bible',
|
||||||
':/Bibles/Bible_new.png', self.onBibleNewClick, 'BibleNewItem')
|
':/Bibles/Bible_new.png', self.onBibleNewClick, 'BibleNewItem')
|
||||||
## Separator Line ##
|
## Separator Line ##
|
||||||
self.MediaManagerItem.addToolbarLine()
|
self.MediaManagerItem.addToolbarSeparator()
|
||||||
## Preview Bible Button ##
|
## Preview Bible Button ##
|
||||||
self.MediaManagerItem.addToolbarButton('Preview Bible', 'Preview the selected Bible Verse',
|
self.MediaManagerItem.addToolbarButton('Preview Bible', 'Preview the selected Bible Verse',
|
||||||
':/system/system_preview.png', self.onBiblePreviewClick, 'BiblePreviewItem')
|
':/system/system_preview.png', self.onBiblePreviewClick, 'BiblePreviewItem')
|
||||||
@ -56,10 +56,6 @@ class BiblePlugin(Plugin):
|
|||||||
self.MediaManagerItem.addToolbarButton('Add Bible Verse(s) To Service',
|
self.MediaManagerItem.addToolbarButton('Add Bible Verse(s) To Service',
|
||||||
'Add the selected Bible(s) to the service', ':/system/system_add.png',
|
'Add the selected Bible(s) to the service', ':/system/system_add.png',
|
||||||
self.onBibleAddClick, 'BibleAddItem')
|
self.onBibleAddClick, 'BibleAddItem')
|
||||||
## Spacer ##
|
|
||||||
self.BibleSpacerItem = QtGui.QSpacerItem(40, 20,
|
|
||||||
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
|
||||||
self.MediaManagerItem.addToolbarItem(self.BibleSpacerItem)
|
|
||||||
# Add the Biblelist widget
|
# Add the Biblelist widget
|
||||||
self.BibleList = QtGui.QTableWidget(self.MediaManagerItem)
|
self.BibleList = QtGui.QTableWidget(self.MediaManagerItem)
|
||||||
self.BibleList.setObjectName("BibleList")
|
self.BibleList.setObjectName("BibleList")
|
||||||
@ -67,6 +63,9 @@ class BiblePlugin(Plugin):
|
|||||||
self.BibleList.setRowCount(0)
|
self.BibleList.setRowCount(0)
|
||||||
self.MediaManagerItem.PageLayout.addWidget(self.BibleList)
|
self.MediaManagerItem.PageLayout.addWidget(self.BibleList)
|
||||||
|
|
||||||
|
def getMediaManagerItem(self):
|
||||||
|
return self.MediaManagerItem
|
||||||
|
|
||||||
def onBibleNewClick(self):
|
def onBibleNewClick(self):
|
||||||
self.bibleimportform(self.biblemanager)
|
self.bibleimportform(self.biblemanager)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user