More UI bits

bzr-revno: 167
This commit is contained in:
Tim Bentley 2008-12-02 20:34:51 +00:00
parent cb6538f1b1
commit 80eb8c9dc1

View File

@ -32,7 +32,7 @@ class BiblePlugin(Plugin):
self.Weight = -9
#Register the bible Manager
#self.biblemanager = BibleManager()
self.textsearch = True
def getMediaManagerItem(self):
# Create the plugin icon
@ -59,31 +59,78 @@ class BiblePlugin(Plugin):
self.MediaManagerItem.addToolbarButton('Add Bible Verse(s) To Service',
'Add the selected Bible(s) to the service', ':/system/system_add.png',
self.onBibleAddClick, 'BibleAddItem')
## Separator Line ##
self.MediaManagerItem.addToolbarSeparator()
## 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
self.groupBox = QtGui.QGroupBox(self.MediaManagerItem)
self.groupBox.setGeometry(QtCore.QRect(5, 5, 271, 391))
self.groupBox.setObjectName("groupBox")
self.lineEdit = QtGui.QLineEdit(self.groupBox)
self.lineEdit.setGeometry(QtCore.QRect(70, 50, 161, 23))
self.lineEdit.setObjectName("lineEdit")
self.label = QtGui.QLabel(self.groupBox)
self.label.setGeometry(QtCore.QRect(20, 20, 54, 17))
self.label.setObjectName("label")
self.comboBox = QtGui.QComboBox(self.groupBox)
self.comboBox.setGeometry(QtCore.QRect(100, 20, 74, 22))
self.comboBox.setObjectName("comboBox")
self.comboBox_2 = QtGui.QComboBox(self.groupBox)
self.comboBox_2.setGeometry(QtCore.QRect(70, 80, 74, 22))
self.comboBox_2.setObjectName("comboBox_2")
self.comboBox_3 = QtGui.QComboBox(self.groupBox)
self.comboBox_3.setGeometry(QtCore.QRect(160, 80, 74, 22))
self.comboBox_3.setObjectName("comboBox_3")
self.comboBox_4 = QtGui.QComboBox(self.groupBox)
self.comboBox_4.setGeometry(QtCore.QRect(70, 110, 74, 22))
self.comboBox_4.setObjectName("comboBox_4")
self.comboBox_5 = QtGui.QComboBox(self.groupBox)
self.comboBox_5.setGeometry(QtCore.QRect(160, 110, 74, 22))
self.comboBox_5.setObjectName("comboBox_5")
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.chapterlabel = QtGui.QLabel(self.groupBox)
self.chapterlabel.setGeometry(QtCore.QRect(10, 80, 50, 25))
self.chapterlabel.setObjectName("chapterlabel")
self.chapterlabel.setText("Chapter:")
self.verselabel = QtGui.QLabel(self.groupBox)
self.verselabel.setGeometry(QtCore.QRect(10, 110, 50, 25))
self.verselabel.setObjectName("verselabel")
self.verselabel.setText("Verse:")
self.fromlabel = QtGui.QLabel(self.groupBox)
self.fromlabel.setGeometry(QtCore.QRect(120, 50, 50, 25))
self.fromlabel.setObjectName("fromlabel")
self.fromlabel.setText("From:")
self.tolabel = QtGui.QLabel(self.groupBox)
self.tolabel.setGeometry(QtCore.QRect(210, 50, 50, 25))
self.tolabel.setObjectName("tolabel")
self.tolabel.setText("To:")
self.fromcomboBox_c = QtGui.QComboBox(self.groupBox)
self.fromcomboBox_c.setGeometry(QtCore.QRect(120, 80, 45, 25))
self.fromcomboBox_c.setObjectName("fromcomboBox_c")
self.fromcomboBox_v = QtGui.QComboBox(self.groupBox)
self.fromcomboBox_v.setGeometry(QtCore.QRect(200, 80, 45, 25))
self.fromcomboBox_v.setObjectName("fromcomboBox_v")
self.tocomboBox_c = QtGui.QComboBox(self.groupBox)
self.tocomboBox_c.setGeometry(QtCore.QRect(120, 110, 45, 22))
self.tocomboBox_c.setObjectName("tocomboBox_c")
self.tocomboBox_v = QtGui.QComboBox(self.groupBox)
self.tocomboBox_v.setGeometry(QtCore.QRect(200, 110, 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):
self.fromcomboBox_v.addItem(str(i))
self.tocomboBox_v.addItem(str(i))
self.searchButton = QtGui.QPushButton(self.groupBox)
self.searchButton.setGeometry(QtCore.QRect(170, 140, 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.groupBox)
self.listView.setGeometry(QtCore.QRect(10, 180, 256, 192))
self.listView.setObjectName("listView")
@ -109,6 +156,7 @@ class BiblePlugin(Plugin):
# self.BibleList.setColumnCount(0)
# self.BibleList.setRowCount(0)
#self.MediaManagerItem.PageLayout.addWidget(self.BibleList)
self.textsearchmode()
return self.MediaManagerItem
def onBibleNewClick(self):
@ -124,3 +172,40 @@ class BiblePlugin(Plugin):
def onBibleAddClick(self):
pass
def onBibleSearchClick(self):
if self.textsearch == True:
print "Text / Verse Search"
else:
print "Combo Search"
def onBibleSearchChangeClick(self):
self.textsearchmode()
def textsearchmode(self):
if self.textsearch == True:
self.searchcomboBox.hide()
self.searchEdit.hide()
self.textsearch = False
self.fromcomboBox_c.show()
self.fromcomboBox_v.show()
self.tocomboBox_c.show()
self.tocomboBox_v.show()
self.chapterlabel.show()
self.verselabel.show()
self.fromlabel.show()
self.tolabel.show()
else:
self.textsearch = True
self.searchcomboBox.show()
self.searchEdit.show()
self.fromcomboBox_c.hide()
self.fromcomboBox_v.hide()
self.tocomboBox_c.hide()
self.tocomboBox_v.hide()
self.chapterlabel.hide()
self.verselabel.hide()
self.fromlabel.hide()
self.tolabel.hide()