forked from openlp/openlp
move bibles to new homes
tidy up plugin following changes add static text to dropdown. bzr-revno: 188
This commit is contained in:
parent
5e338e8a1f
commit
ce9b58cec6
@ -22,7 +22,7 @@ from PyQt4 import QtCore, QtGui
|
|||||||
from openlp.core.resources import *
|
from openlp.core.resources import *
|
||||||
from openlp.core.lib import Plugin, MediaManagerItem
|
from openlp.core.lib import Plugin, MediaManagerItem
|
||||||
|
|
||||||
from bibleManager import BibleManager
|
from lib.biblemanager import BibleManager
|
||||||
from forms.bibleimportform import BibleImportForm
|
from forms.bibleimportform import BibleImportForm
|
||||||
|
|
||||||
class BiblePlugin(Plugin):
|
class BiblePlugin(Plugin):
|
||||||
@ -62,10 +62,6 @@ class BiblePlugin(Plugin):
|
|||||||
## Separator Line ##
|
## Separator Line ##
|
||||||
#self.MediaManagerItem.addToolbarSeparator()
|
#self.MediaManagerItem.addToolbarSeparator()
|
||||||
## Add Bible Button ##
|
## Add Bible Button ##
|
||||||
#self.MediaManagerItem.addToolbarButton('Change Search Style',
|
|
||||||
# 'Swap between the Bible search styles', ':/system/system_add.png',
|
|
||||||
# self.onBibleSearchChangeClick, 'BibleSearchChange')
|
|
||||||
# Add the Biblelist Tables
|
|
||||||
|
|
||||||
# Create the tab widget
|
# Create the tab widget
|
||||||
self.SearchTabWidget = QtGui.QTabWidget(self.MediaManagerItem)
|
self.SearchTabWidget = QtGui.QTabWidget(self.MediaManagerItem)
|
||||||
@ -136,18 +132,21 @@ class BiblePlugin(Plugin):
|
|||||||
self.AdvancedToLabel.setObjectName('AdvancedToLabel')
|
self.AdvancedToLabel.setObjectName('AdvancedToLabel')
|
||||||
self.AdvancedToLabel.setText('To:')
|
self.AdvancedToLabel.setText('To:')
|
||||||
self.AdvancedLayout.addWidget(self.AdvancedToLabel, 4, 0, 1, 1)
|
self.AdvancedLayout.addWidget(self.AdvancedToLabel, 4, 0, 1, 1)
|
||||||
|
|
||||||
self.AdvancedFromChapter = QtGui.QComboBox(self.AdvancedTab)
|
self.AdvancedFromChapter = QtGui.QComboBox(self.AdvancedTab)
|
||||||
self.AdvancedFromChapter.setObjectName('AdvancedFromChapter')
|
self.AdvancedFromChapter.setObjectName('AdvancedFromChapter')
|
||||||
self.AdvancedLayout.addWidget(self.AdvancedFromChapter, 3, 3, 1, 1)
|
self.AdvancedLayout.addWidget(self.AdvancedFromChapter, 3, 2, 1, 1)
|
||||||
self.AdvancedFromVerse = QtGui.QComboBox(self.AdvancedTab)
|
self.AdvancedFromVerse = QtGui.QComboBox(self.AdvancedTab)
|
||||||
self.AdvancedFromVerse.setObjectName('AdvancedFromVerse')
|
self.AdvancedFromVerse.setObjectName('AdvancedFromVerse')
|
||||||
self.AdvancedLayout.addWidget(self.AdvancedFromVerse, 3, 2, 1, 1)
|
self.AdvancedLayout.addWidget(self.AdvancedFromVerse, 3, 3, 1, 1)
|
||||||
|
|
||||||
self.AdvancedToChapter = QtGui.QComboBox(self.AdvancedTab)
|
self.AdvancedToChapter = QtGui.QComboBox(self.AdvancedTab)
|
||||||
self.AdvancedToChapter.setObjectName('AdvancedToChapter')
|
self.AdvancedToChapter.setObjectName('AdvancedToChapter')
|
||||||
self.AdvancedLayout.addWidget(self.AdvancedToChapter, 4, 2, 1, 1)
|
self.AdvancedLayout.addWidget(self.AdvancedToChapter, 4, 2, 1, 1)
|
||||||
self.AdvancedToVerse = QtGui.QComboBox(self.AdvancedTab)
|
self.AdvancedToVerse = QtGui.QComboBox(self.AdvancedTab)
|
||||||
self.AdvancedToVerse.setObjectName('AdvancedToVerse')
|
self.AdvancedToVerse.setObjectName('AdvancedToVerse')
|
||||||
self.AdvancedLayout.addWidget(self.AdvancedToVerse, 4, 3, 1, 1)
|
self.AdvancedLayout.addWidget(self.AdvancedToVerse, 4, 3, 1, 1)
|
||||||
|
|
||||||
self.AdvancedSearchButton = QtGui.QPushButton(self.AdvancedTab)
|
self.AdvancedSearchButton = QtGui.QPushButton(self.AdvancedTab)
|
||||||
self.AdvancedSearchButton.setObjectName('AdvancedSearchButton')
|
self.AdvancedSearchButton.setObjectName('AdvancedSearchButton')
|
||||||
self.AdvancedSearchButton.setText('Search')
|
self.AdvancedSearchButton.setText('Search')
|
||||||
@ -157,83 +156,23 @@ class BiblePlugin(Plugin):
|
|||||||
# Add the search tab widget to the page layout
|
# Add the search tab widget to the page layout
|
||||||
self.MediaManagerItem.PageLayout.addWidget(self.SearchTabWidget)
|
self.MediaManagerItem.PageLayout.addWidget(self.SearchTabWidget)
|
||||||
|
|
||||||
"""self.groupBox = QtGui.QGroupBox(self.MediaManagerItem)
|
self.QuickVersionComboBox.addItem("NIV")
|
||||||
self.groupBox.setGeometry(QtCore.QRect(0, 0, 271, 391))
|
self.QuickVersionComboBox.addItem("KJC")
|
||||||
self.groupBox.setMinimumSize(QtCore.QSize(0, 271))
|
self.AdvancedVersionComboBox.addItem("NIV")
|
||||||
self.groupBox.setSizePolicy(QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum))
|
self.AdvancedVersionComboBox.addItem("KJC")
|
||||||
self.groupBox.setObjectName("groupBox")
|
self.AdvancedBookComboBox.addItem("Genesis")
|
||||||
self.MediaManagerItem.PageLayout.addWidget(self.groupBox)
|
self.AdvancedBookComboBox.addItem("Matthew")
|
||||||
|
self.AdvancedBookComboBox.addItem("Revelation")
|
||||||
|
|
||||||
self.biblelabel = QtGui.QLabel(self.groupBox)
|
|
||||||
self.biblelabel.setGeometry(QtCore.QRect(10, 20, 80, 25))
|
|
||||||
self.biblelabel.setObjectName("biblelabel")
|
|
||||||
self.biblelabel.setText("Translation:")
|
|
||||||
self.biblecomboBox = QtGui.QComboBox(self.groupBox)
|
|
||||||
self.biblecomboBox.setGeometry(QtCore.QRect(120, 20, 150, 25))
|
|
||||||
self.biblecomboBox.setObjectName("biblecomboBox")
|
|
||||||
self.biblecomboBox.addItem("NIV")
|
|
||||||
self.biblecomboBox.addItem("KJC")
|
|
||||||
|
|
||||||
self.searchcomboBox = QtGui.QComboBox(self.groupBox)
|
|
||||||
self.searchcomboBox.setGeometry(QtCore.QRect(10, 50, 105, 25))
|
|
||||||
self.searchcomboBox.setObjectName("searchcomboBox")
|
|
||||||
self.searchcomboBox.addItem("Verse Search")
|
|
||||||
self.searchcomboBox.addItem("Text Search")
|
|
||||||
self.searchEdit = QtGui.QLineEdit(self.groupBox)
|
|
||||||
self.searchEdit.setGeometry(QtCore.QRect(120, 50, 150, 25))
|
|
||||||
self.searchEdit.setObjectName("searchEdit")
|
|
||||||
|
|
||||||
self.booklabel = QtGui.QLabel(self.groupBox)
|
|
||||||
self.booklabel.setGeometry(QtCore.QRect(10, 50, 80, 25))
|
|
||||||
self.booklabel.setObjectName("booklabel")
|
|
||||||
self.booklabel.setText("Book:")
|
|
||||||
self.bookcomboBox = QtGui.QComboBox(self.groupBox)
|
|
||||||
self.bookcomboBox.setGeometry(QtCore.QRect(120, 50, 105, 25))
|
|
||||||
self.bookcomboBox.setObjectName("bookcomboBox")
|
|
||||||
self.bookcomboBox.addItem("Genesis")
|
|
||||||
self.bookcomboBox.addItem("Matthew")
|
|
||||||
self.bookcomboBox.addItem("Revelation")
|
|
||||||
|
|
||||||
self.chapterlabel = QtGui.QLabel(self.groupBox)
|
|
||||||
self.chapterlabel.setGeometry(QtCore.QRect(10, 110, 50, 25))
|
|
||||||
self.chapterlabel.setObjectName("chapterlabel")
|
|
||||||
self.chapterlabel.setText("Chapter:")
|
|
||||||
self.verselabel = QtGui.QLabel(self.groupBox)
|
|
||||||
self.verselabel.setGeometry(QtCore.QRect(10, 140, 50, 25))
|
|
||||||
self.verselabel.setObjectName("verselabel")
|
|
||||||
self.verselabel.setText("Verse:")
|
|
||||||
self.fromlabel = QtGui.QLabel(self.groupBox)
|
|
||||||
self.fromlabel.setGeometry(QtCore.QRect(120, 80, 50, 25))
|
|
||||||
self.fromlabel.setObjectName("fromlabel")
|
|
||||||
self.fromlabel.setText("From:")
|
|
||||||
self.tolabel = QtGui.QLabel(self.groupBox)
|
|
||||||
self.tolabel.setGeometry(QtCore.QRect(210, 80, 50, 25))
|
|
||||||
self.tolabel.setObjectName("tolabel")
|
|
||||||
self.tolabel.setText("To:")
|
|
||||||
self.fromcomboBox_c = QtGui.QComboBox(self.groupBox)
|
|
||||||
self.fromcomboBox_c.setGeometry(QtCore.QRect(120, 110, 45, 25))
|
|
||||||
self.fromcomboBox_c.setObjectName("fromcomboBox_c")
|
|
||||||
self.fromcomboBox_v = QtGui.QComboBox(self.groupBox)
|
|
||||||
self.fromcomboBox_v.setGeometry(QtCore.QRect(200, 110, 45, 25))
|
|
||||||
self.fromcomboBox_v.setObjectName("fromcomboBox_v")
|
|
||||||
self.tocomboBox_c = QtGui.QComboBox(self.groupBox)
|
|
||||||
self.tocomboBox_c.setGeometry(QtCore.QRect(120, 140, 45, 22))
|
|
||||||
self.tocomboBox_c.setObjectName("tocomboBox_c")
|
|
||||||
self.tocomboBox_v = QtGui.QComboBox(self.groupBox)
|
|
||||||
self.tocomboBox_v.setGeometry(QtCore.QRect(200, 140, 45, 22))
|
|
||||||
self.tocomboBox_v.setObjectName("tocomboBox_v")
|
|
||||||
for i in range(1, 20):
|
|
||||||
self.fromcomboBox_c.addItem(str(i))
|
|
||||||
self.tocomboBox_c.addItem(str(i))
|
|
||||||
for i in range(1, 10):
|
for i in range(1, 10):
|
||||||
self.fromcomboBox_v.addItem(str(i))
|
self.AdvancedFromChapter.addItem(str(i))
|
||||||
self.tocomboBox_v.addItem(str(i))
|
for i in range(1, 20):
|
||||||
|
self.AdvancedToChapter.addItem(str(i))
|
||||||
|
for i in range(1, 30):
|
||||||
|
self.AdvancedFromVerse.addItem(str(i))
|
||||||
|
for i in range(1, 40):
|
||||||
|
self.AdvancedToVerse.addItem(str(i))
|
||||||
|
|
||||||
self.searchButton = QtGui.QPushButton(self.groupBox)
|
|
||||||
self.searchButton.setGeometry(QtCore.QRect(170, 170, 75, 27))
|
|
||||||
self.searchButton.setObjectName("searchButton")
|
|
||||||
self.searchButton.setText("Search")
|
|
||||||
QtCore.QObject.connect(self.searchButton, QtCore.SIGNAL("pressed()"), self.onBibleSearchClick)"""
|
|
||||||
|
|
||||||
self.listView = QtGui.QListView()
|
self.listView = QtGui.QListView()
|
||||||
self.listView.setGeometry(QtCore.QRect(10, 200, 256, 391))
|
self.listView.setGeometry(QtCore.QRect(10, 200, 256, 391))
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Form implementation generated from reading ui file 'bibleimport.ui'
|
# Form implementation generated from reading ui file 'bibleimport.ui'
|
||||||
#
|
#
|
||||||
# Created: Sun Nov 30 14:32:39 2008
|
# Created: Thu Dec 4 20:52:10 2008
|
||||||
# by: PyQt4 UI code generator 4.4.3
|
# by: PyQt4 UI code generator 4.4.3
|
||||||
#
|
#
|
||||||
# WARNING! All changes made in this file will be lost!
|
# WARNING! All changes made in this file will be lost!
|
||||||
@ -22,7 +22,7 @@ class Ui_BibleImportDialog(object):
|
|||||||
self.ImportToolBox.setGeometry(QtCore.QRect(0, 0, 481, 431))
|
self.ImportToolBox.setGeometry(QtCore.QRect(0, 0, 481, 431))
|
||||||
self.ImportToolBox.setObjectName("ImportToolBox")
|
self.ImportToolBox.setObjectName("ImportToolBox")
|
||||||
self.FileImportPage = QtGui.QWidget()
|
self.FileImportPage = QtGui.QWidget()
|
||||||
self.FileImportPage.setGeometry(QtCore.QRect(0, 0, 481, 369))
|
self.FileImportPage.setGeometry(QtCore.QRect(0, 0, 471, 361))
|
||||||
self.FileImportPage.setObjectName("FileImportPage")
|
self.FileImportPage.setObjectName("FileImportPage")
|
||||||
self.OSISGroupBox = QtGui.QGroupBox(self.FileImportPage)
|
self.OSISGroupBox = QtGui.QGroupBox(self.FileImportPage)
|
||||||
self.OSISGroupBox.setGeometry(QtCore.QRect(8, 74, 451, 71))
|
self.OSISGroupBox.setGeometry(QtCore.QRect(8, 74, 451, 71))
|
||||||
@ -70,7 +70,7 @@ class Ui_BibleImportDialog(object):
|
|||||||
self.BibleNameLabel.setObjectName("BibleNameLabel")
|
self.BibleNameLabel.setObjectName("BibleNameLabel")
|
||||||
self.ImportToolBox.addItem(self.FileImportPage, "")
|
self.ImportToolBox.addItem(self.FileImportPage, "")
|
||||||
self.WebBiblePage = QtGui.QWidget()
|
self.WebBiblePage = QtGui.QWidget()
|
||||||
self.WebBiblePage.setGeometry(QtCore.QRect(0, 0, 246, 265))
|
self.WebBiblePage.setGeometry(QtCore.QRect(0, 0, 471, 361))
|
||||||
self.WebBiblePage.setObjectName("WebBiblePage")
|
self.WebBiblePage.setObjectName("WebBiblePage")
|
||||||
self.WebBibleLayout = QtGui.QVBoxLayout(self.WebBiblePage)
|
self.WebBibleLayout = QtGui.QVBoxLayout(self.WebBiblePage)
|
||||||
self.WebBibleLayout.setSpacing(8)
|
self.WebBibleLayout.setSpacing(8)
|
||||||
@ -169,10 +169,6 @@ class Ui_BibleImportDialog(object):
|
|||||||
|
|
||||||
self.retranslateUi(BibleImportDialog)
|
self.retranslateUi(BibleImportDialog)
|
||||||
self.ImportToolBox.setCurrentIndex(0)
|
self.ImportToolBox.setCurrentIndex(0)
|
||||||
QtCore.QObject.connect(self.BibleImportButtonBox, QtCore.SIGNAL("accepted()"), BibleImportDialog.accept)
|
|
||||||
QtCore.QObject.connect(self.BibleImportButtonBox, QtCore.SIGNAL("rejected()"), BibleImportDialog.reject)
|
|
||||||
QtCore.QObject.connect(self.BibleImportButtonBox, QtCore.SIGNAL("rejected()"), BibleImportDialog.close)
|
|
||||||
QtCore.QObject.connect(self.BibleImportButtonBox, QtCore.SIGNAL("accepted()"), BibleImportDialog.close)
|
|
||||||
QtCore.QMetaObject.connectSlotsByName(BibleImportDialog)
|
QtCore.QMetaObject.connectSlotsByName(BibleImportDialog)
|
||||||
|
|
||||||
def retranslateUi(self, BibleImportDialog):
|
def retranslateUi(self, BibleImportDialog):
|
@ -31,8 +31,8 @@ class BibleImportForm(QDialog, Ui_BibleImportDialog):
|
|||||||
QDialog.__init__(self, parent)
|
QDialog.__init__(self, parent)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.biblemanager = biblemanager
|
self.biblemanager = biblemanager
|
||||||
self.savebutton = self.BibleImportButtonBox.button(QtGui.QDialogButtonBox.Save)
|
# self.savebutton = self.BibleImportButtonBox.button(QtGui.QDialogButtonBox.Save)
|
||||||
self.BibleImportButtonBox.removeButton(self.savebutton) # hide the save button tile screen is valid
|
# self.BibleImportButtonBox.removeButton(self.savebutton) # hide the save button tile screen is valid
|
||||||
|
|
||||||
|
|
||||||
@pyqtSignature("")
|
@pyqtSignature("")
|
||||||
@ -66,8 +66,11 @@ class BibleImportForm(QDialog, Ui_BibleImportDialog):
|
|||||||
if button.text() == "Save":
|
if button.text() == "Save":
|
||||||
bipf = BibleImportProgressForm()
|
bipf = BibleImportProgressForm()
|
||||||
bipf.show()
|
bipf.show()
|
||||||
|
if self.biblemanager != None:
|
||||||
self.biblemanager.processDialog(bipf)
|
self.biblemanager.processDialog(bipf)
|
||||||
self.biblemanager.registerOSISFileBible(str(self.BibleNameEdit.displayText()), self.OSISLocationEdit.displayText())
|
self.biblemanager.registerOSISFileBible(str(self.BibleNameEdit.displayText()), self.OSISLocationEdit.displayText())
|
||||||
|
elif button.text() == "Cancel":
|
||||||
|
self.close()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -82,10 +85,10 @@ class BibleImportForm(QDialog, Ui_BibleImportDialog):
|
|||||||
validcount += 1
|
validcount += 1
|
||||||
if len(self.VersionNameEdit.displayText()) > 0 and len(self.CopyrightEdit.displayText()) > 0 and len(self.PermisionEdit.displayText()) > 0:
|
if len(self.VersionNameEdit.displayText()) > 0 and len(self.CopyrightEdit.displayText()) > 0 and len(self.PermisionEdit.displayText()) > 0:
|
||||||
valid = True
|
valid = True
|
||||||
if validcount == 2 and valid:
|
# if validcount == 2 and valid:
|
||||||
self.BibleImportButtonBox.addButton(self.savebutton, QtGui.QDialogButtonBox.AcceptRole) # hide the save button tile screen is valid
|
# self.BibleImportButtonBox.addButton(self.savebutton, QtGui.QDialogButtonBox.AcceptRole) # hide the save button tile screen is valid
|
||||||
else:
|
# else:
|
||||||
self.BibleImportButtonBox.removeButton(self.savebutton) # hide the save button tile screen is valid
|
# self.BibleImportButtonBox.removeButton(self.savebutton) # hide the save button tile screen is valid
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -93,8 +96,8 @@ class runner(QtGui.QApplication):
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
values = ["Genesis","Matthew","Revelation"]
|
values = ["Genesis","Matthew","Revelation"]
|
||||||
self.bm = BibleManager()
|
self.bm = BibleManager("/home/timali/.openlp")
|
||||||
self.bim = BibleImportForm(self.bm)
|
self.bim = BibleImportForm()
|
||||||
self.bim.show()
|
self.bim.show()
|
||||||
self.processEvents()
|
self.processEvents()
|
||||||
sys.exit(app.exec_())
|
sys.exit(app.exec_())
|
@ -23,10 +23,10 @@ import sys
|
|||||||
mypath=os.path.split(os.path.abspath(__file__))[0]
|
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 bibleOSISImpl import BibleOSISImpl
|
from bibleOSISimpl import BibleOSISImpl
|
||||||
from bibleCSVImpl import BibleCSVImpl
|
from bibleCSVimpl import BibleCSVImpl
|
||||||
from bibleDBImpl import BibleDBImpl
|
from bibleDBimpl import BibleDBImpl
|
||||||
from bibleHTTPImpl import BibleHTTPImpl
|
from bibleHTTPimpl import BibleHTTPImpl
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
logging.basicConfig(level=logging.DEBUG,
|
logging.basicConfig(level=logging.DEBUG,
|
||||||
@ -50,7 +50,9 @@ class BibleManager():
|
|||||||
log.debug( "Bible Initialising")
|
log.debug( "Bible Initialising")
|
||||||
self.bibleDBCache = {} # dict of bible database classes
|
self.bibleDBCache = {} # dict of bible database classes
|
||||||
self.bibleHTTPCache = {} # dict of bible http readers
|
self.bibleHTTPCache = {} # dict of bible http readers
|
||||||
|
|
||||||
self.biblePath = path #+"/Data/Bibles" #ConfigHelper.getBiblePath()
|
self.biblePath = path #+"/Data/Bibles" #ConfigHelper.getBiblePath()
|
||||||
|
|
||||||
print self.biblePath
|
print self.biblePath
|
||||||
self.dialogobject = None
|
self.dialogobject = None
|
||||||
#log.debug( self.biblePath )
|
#log.debug( self.biblePath )
|
Loading…
Reference in New Issue
Block a user