moved languageDialog() into BIBLEDB.get_language()

This commit is contained in:
Armin Köhler 2011-04-03 20:44:08 +02:00
parent fbce21baaa
commit 3d184f89a4
3 changed files with 12 additions and 8 deletions

View File

@ -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())

View File

@ -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.

View File

@ -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)