From 3d184f89a40a630a5403278a4aedbac9e6b9ebbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armin=20K=C3=B6hler?= Date: Sun, 3 Apr 2011 20:44:08 +0200 Subject: [PATCH] moved languageDialog() into BIBLEDB.get_language() --- openlp/plugins/bibles/forms/bibleimportform.py | 7 +------ openlp/plugins/bibles/lib/csvbible.py | 2 ++ openlp/plugins/bibles/lib/db.py | 11 +++++++++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index ea7156193..c406c4db3 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -40,7 +40,7 @@ from openlp.core.ui.wizard import OpenLPWizard, WizardStrings from openlp.core.utils import AppLocation, string_is_unicode from openlp.plugins.bibles.lib.manager import BibleFormat from openlp.plugins.bibles.lib.db import BiblesResourcesDB -from openlp.plugins.bibles.forms import BookNameForm, LanguageForm +from openlp.plugins.bibles.forms import BookNameForm log = logging.getLogger(__name__) @@ -764,8 +764,3 @@ class BibleImportForm(OpenLPWizard): self.book_name = BookNameForm(self) if self.book_name.exec_(name): return unicode(self.book_name.requestComboBox.currentText()) - - def languageDialog(self): - self.language = LanguageForm(self) - if self.language.exec_(): - return unicode(self.language.requestComboBox.currentText()) diff --git a/openlp/plugins/bibles/lib/csvbible.py b/openlp/plugins/bibles/lib/csvbible.py index 389ee1aac..407c90d2f 100644 --- a/openlp/plugins/bibles/lib/csvbible.py +++ b/openlp/plugins/bibles/lib/csvbible.py @@ -78,6 +78,8 @@ class CSVBible(BibleDB): """ This class provides a specialisation for importing of CSV Bibles. """ + log.info(u'CSVBible loaded') + def __init__(self, parent, **kwargs): """ Loads a Bible from a set of CVS files. diff --git a/openlp/plugins/bibles/lib/db.py b/openlp/plugins/bibles/lib/db.py index 1960e155b..3f50bed47 100644 --- a/openlp/plugins/bibles/lib/db.py +++ b/openlp/plugins/bibles/lib/db.py @@ -168,6 +168,7 @@ class BibleDB(QtCore.QObject, Manager): methods, but benefit from the database methods in here via inheritance, rather than depending on yet another object. """ + log.info(u'BibleDB loaded') def __init__(self, parent, **kwargs): """ @@ -491,13 +492,19 @@ class BibleDB(QtCore.QObject, Manager): def get_language(self): """ - Return the language of a bible. + If no language is given it calls a dialog window where the user could + choose the bible language. + Return the language id of a bible. ``book`` The language the bible is. """ log.debug(u'BibleDB.get_language()') - language = self.bible_plugin.manager.import_wizard.languageDialog() + from openlp.plugins.bibles.forms import LanguageForm + language = None + lang = LanguageForm(self.wizard) + if lang.exec_(): + language = unicode(lang.requestComboBox.currentText()) if not language: return False language = BiblesResourcesDB.get_language(language)