From 19e8682bf86deb0b4d3a1ee56f4229cf5949fbc4 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 28 Oct 2009 18:35:06 +0000 Subject: [PATCH] Add BibleGateway List and access it --- openlp/core/ui/settingsform.py | 1 + .../plugins/bibles/forms/bibleimportform.py | 38 ++++++--- .../plugins/bibles/resources/biblegateway.csv | 80 +++++++++++++++++++ 3 files changed, 110 insertions(+), 9 deletions(-) create mode 100644 openlp/plugins/bibles/resources/biblegateway.csv diff --git a/openlp/core/ui/settingsform.py b/openlp/core/ui/settingsform.py index 6d17009af..02f812f9a 100644 --- a/openlp/core/ui/settingsform.py +++ b/openlp/core/ui/settingsform.py @@ -53,6 +53,7 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog): def insertTab(self, tab, location): log.debug(u'Inserting %s tab' % tab.title()) + #13 : There are 3 tables currently and lcations starts at -10 self.SettingsTabWidget.insertTab(location + 13, tab, tab.title()) def removeTab(self, name): diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 9a871ec88..facd055fb 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -53,18 +53,33 @@ class BibleImportForm(QtGui.QDialog, Ui_BibleImportDialog): self.AddressEdit.setText(self.config.get_config(u'proxy_address', u'')) self.UsernameEdit.setText(self.config.get_config(u'proxy_username',u'')) self.PasswordEdit.setText(self.config.get_config(u'proxy_password',u'')) - + #Load and store Crosswalk Bibles filepath = os.path.split(os.path.abspath(__file__))[0] filepath = os.path.abspath(os.path.join(filepath, u'..', u'resources', u'crosswalkbooks.csv')) fbibles=open(filepath, 'r') - self.bible_versions = {} - self.BibleComboBox.clear() - self.BibleComboBox.addItem(u'') + self.cw_bible_versions = {} for line in fbibles: p = line.split(u',') - self.bible_versions[p[0]] = p[1].replace(u'\n', u'') - self.BibleComboBox.addItem(unicode(p[0])) + self.cw_bible_versions[p[0]] = p[1].replace(u'\n', u'') + #Load and store BibleGateway Bibles + filepath = os.path.split(os.path.abspath(__file__))[0] + filepath = os.path.abspath(os.path.join(filepath, u'..', + u'resources', u'biblegateway.csv')) + fbibles=open(filepath, 'r') + self.bg_bible_versions = {} + for line in fbibles: + p = line.split(u',') + self.bg_bible_versions[p[0]] = p[1].replace(u'\n', u'') + self.loadBibleCombo(self.cw_bible_versions) + + def loadBibleCombo(self, biblesList): + self.BibleComboBox.clear() + self.BibleComboBox.addItem(u'') + for bible in biblesList: + row = self.BibleComboBox.count() + self.BibleComboBox.addItem(unicode(self.trUtf8(bible))) + self.BibleComboBox.setItemData(row, QtCore.QVariant(bible)) #Combo Boxes QtCore.QObject.connect(self.LocationComboBox, @@ -150,12 +165,17 @@ class BibleImportForm(QtGui.QDialog, Ui_BibleImportDialog): self.config.set_config( u'proxy_password', unicode(self.PasswordEdit.displayText())) - def onLocationComboBoxSelected(self): + def onLocationComboBoxSelected(self, value): + if value == 0: + self.loadBibleCombo(self.cw_bible_versions) + else: + self.loadBibleCombo(self.bg_bible_versions) self.checkHttp() - def onBibleComboBoxSelected(self): + def onBibleComboBoxSelected(self, value): self.checkHttp() self.BibleNameEdit.setText(unicode(self.BibleComboBox.currentText())) + self.VersionNameEdit.setText(unicode(self.BibleComboBox.currentText())) def onCancelButtonClicked(self): # tell import to stop @@ -210,7 +230,7 @@ class BibleImportForm(QtGui.QDialog, Ui_BibleImportDialog): else: # set a value as it will not be needed self.setMax(1) - bible = self.bible_versions[ + bible = self.cw_bible_versions[ unicode(self.BibleComboBox.currentText())] loaded = self.biblemanager.register_http_bible( unicode(self.BibleComboBox.currentText()), diff --git a/openlp/plugins/bibles/resources/biblegateway.csv b/openlp/plugins/bibles/resources/biblegateway.csv new file mode 100644 index 000000000..deca46d7c --- /dev/null +++ b/openlp/plugins/bibles/resources/biblegateway.csv @@ -0,0 +1,80 @@ +Amuzgo de Guerrero,AMU +Arabic Life Application Bible,ALAB +Bulgarian Bible,BULG +1940 Bulgarian Bible,BG1940 +Chinanteco de Comaltepec,CCO +Cakchiquel Occidental,CKW +Haitian Creole Version,HCV +Slovo na cestu,SNC +Dette er Biblen pÃ¥ dansk,DN1933 +Hoffnung für Alle,HOF +Luther Bibel 1545,LUTH1545 +New International Version,NIV +New American Standard Bible,NASB +The Message,MSG +Amplified Bible,AMP +New Living Translation,NLT +King James Version,KJV +English Standard Version,ESV +Contemporary English Version,CEV +New King James Version,NKJV +New Century Version,NCV +21st Century King James Version,KJ21 +American Standard Version,ASV +Young's Literal Translation,YLT +Darby Translation,DARBY +Holman Christian Standard Bible,HCSB +New International Reader's Version,NIRV +Wycliffe New Testament,WYC +Worldwide English (New Testament),WE +New International Version - UK,NIVUK +Today's New International Version,TNIV +Reina-Valera 1960,RVR1960 +Nueva Versión Internacional,NVI +Reina-Valera 1995,RVR1995 +Castilian,CST +Reina-Valera Antigua,RVA +Biblia en Lenguaje Sencillo,BLS +La Biblia de las Américas,LBLA +Louis Segond,LSG +La Bible du Semeur,BDS +1881 Westcott-Hort New Testament,WHNU +1550 Stephanus New Testament,TR1550 +1894 Scrivener New Testament,TR1894 +The Westminster Leningrad Codex,WLC +Hiligaynon Bible,HLGN +Croatian Bible,CRO +Hungarian Károli,KAR +Icelandic Bible,ICELAND +La Nuova Diodati,LND +La Parola è Vita,LM +Jacalteco, Oriental,JAC +Kekchi,KEK +Korean Bible,KOREAN +Maori Bible,MAORI +Macedonian New Testament,MNT +Mam, Central,MVC +Mam de Todos Santos Chuchumatán,MVJ +Reimer 2001,REIMER +Náhuatl de Guerrero,NGU +Het Boek,HTB +Det Norsk Bibelselskap 1930,DNB1930 +Levande Bibeln,LB +O Livro,OL +João Ferreira de Almeida Atualizada,AA +Quiché, Centro Occidental,QUT +Romanian,RMNN +Romanian,TLCR +Russian Synodal Version,RUSV +Slovo Zhizny,SZ +Nádej pre kazdého,NPK +Albanian Bible,ALB +Levande Bibeln,SVL +Svenska 1917,SV1917 +Swahili New Testament,SNT +Ang Salita ng Diyos,SND +Ukrainian Bible,UKR +Uspanteco,USP +1934 Vietnamese Bible,VIET +Chinese Union Version (Simplified),CUVS +Chinese Union Version (Traditional),CUV \ No newline at end of file