← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~orangeshirt/openlp/bibles into lp:openlp

 

Armin Köhler has proposed merging lp:~orangeshirt/openlp/bibles into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #609356 in OpenLP: "Web bibles don't download all their books on import"
  https://bugs.launchpad.net/openlp/+bug/609356
  Bug #706207 in OpenLP: "New Web Bible download call relies on ASCII addresses"
  https://bugs.launchpad.net/openlp/+bug/706207
  Bug #722458 in OpenLP: "Verse search in two different languages returns error."
  https://bugs.launchpad.net/openlp/+bug/722458

For more details, see:
https://code.launchpad.net/~orangeshirt/openlp/bibles/+merge/62798

change content of booklist combobox in advanced search and autocomplete suggestionlist in quick search if a second bible is choosen the lists refresh and contain only books which are in both bibles.
-- 
https://code.launchpad.net/~orangeshirt/openlp/bibles/+merge/62798
Your team OpenLP Core is requested to review the proposed merge of lp:~orangeshirt/openlp/bibles into lp:openlp.
=== modified file 'openlp/plugins/bibles/lib/manager.py'
--- openlp/plugins/bibles/lib/manager.py	2011-05-27 09:23:46 +0000
+++ openlp/plugins/bibles/lib/manager.py	2011-05-29 17:21:30 +0000
@@ -220,8 +220,8 @@
         return [
             {
             u'name': book.name,
-            u'chapters': self.db_cache[bible].get_chapter_count(
-                book)
+            u'book_reference_id': book.book_reference_id, 
+            u'chapters': self.db_cache[bible].get_chapter_count(book)
             }
             for book in self.db_cache[bible].get_books()
         ]

=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py	2011-05-27 20:38:06 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py	2011-05-29 17:21:30 +0000
@@ -239,8 +239,14 @@
         self.advancedLayout.addWidget(self.advancedToVerse, 4, 2)
         self.addSearchFields(u'advanced', UiStrings().Advanced)
         # Combo Boxes
+        QtCore.QObject.connect(self.quickVersionComboBox,
+            QtCore.SIGNAL(u'activated(int)'), self.onQuickVersionComboBox)
+        QtCore.QObject.connect(self.quickSecondComboBox,
+            QtCore.SIGNAL(u'activated(int)'), self.onQuickSecondComboBox)
         QtCore.QObject.connect(self.advancedVersionComboBox,
             QtCore.SIGNAL(u'activated(int)'), self.onAdvancedVersionComboBox)
+        QtCore.QObject.connect(self.advancedSecondComboBox,
+            QtCore.SIGNAL(u'activated(int)'), self.onAdvancedSecondComboBox)
         QtCore.QObject.connect(self.advancedBookComboBox,
             QtCore.SIGNAL(u'activated(int)'), self.onAdvancedBookComboBox)
         QtCore.QObject.connect(self.advancedFromChapter,
@@ -401,6 +407,16 @@
         """
         log.debug(u'initialiseAdvancedBible %s', bible)
         book_data = self.parent.manager.get_books(bible)
+        secondbible = unicode(self.advancedSecondComboBox.currentText())
+        if secondbible != u'':
+            secondbook_data = self.parent.manager.get_books(secondbible)
+            book_data_temp = []
+            for book in book_data:
+                for secondbook in secondbook_data:
+                    if book['book_reference_id'] == \
+                        secondbook['book_reference_id']:
+                        book_data_temp.append(book)
+            book_data = book_data_temp
         self.advancedBookComboBox.clear()
         first = True
         for book in book_data:
@@ -449,10 +465,26 @@
             bible = unicode(self.quickVersionComboBox.currentText())
             if bible:
                 book_data = bibles[bible].get_books()
+                secondbible = unicode(self.quickSecondComboBox.currentText())
+                if secondbible != u'':
+                    secondbook_data = bibles[secondbible].get_books()
+                    book_data_temp = []
+                    for book in book_data:
+                        for secondbook in secondbook_data:
+                            if book.book_reference_id == \
+                                secondbook.book_reference_id:
+                                book_data_temp.append(book)
+                    book_data = book_data_temp
                 books = [book.name + u' ' for book in book_data]
                 books.sort(cmp=locale.strcoll)
         add_widget_completer(books, self.quickSearchEdit)
 
+    def onQuickVersionComboBox(self):
+        self.updateAutoCompleter()
+
+    def onQuickSecondComboBox(self):
+        self.updateAutoCompleter()
+
     def onImportClick(self):
         if not hasattr(self, u'import_wizard'):
             self.import_wizard = BibleImportForm(self, self.parent.manager,
@@ -501,6 +533,12 @@
         self.initialiseAdvancedBible(
             unicode(self.advancedVersionComboBox.currentText()))
 
+    def onAdvancedSecondComboBox(self):
+        QtCore.QSettings().setValue(self.settingsSection + u'/advanced bible',
+            QtCore.QVariant(self.advancedVersionComboBox.currentText()))
+        self.initialiseAdvancedBible(
+            unicode(self.advancedVersionComboBox.currentText()))
+
     def onAdvancedBookComboBox(self):
         item = int(self.advancedBookComboBox.currentIndex())
         self.initialiseChapterVerse(


Follow ups