forked from openlp/openlp
moved languageDialog() into BIBLEDB.get_language()
This commit is contained in:
parent
fbce21baaa
commit
3d184f89a4
@ -40,7 +40,7 @@ from openlp.core.ui.wizard import OpenLPWizard, WizardStrings
|
|||||||
from openlp.core.utils import AppLocation, string_is_unicode
|
from openlp.core.utils import AppLocation, string_is_unicode
|
||||||
from openlp.plugins.bibles.lib.manager import BibleFormat
|
from openlp.plugins.bibles.lib.manager import BibleFormat
|
||||||
from openlp.plugins.bibles.lib.db import BiblesResourcesDB
|
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__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -764,8 +764,3 @@ class BibleImportForm(OpenLPWizard):
|
|||||||
self.book_name = BookNameForm(self)
|
self.book_name = BookNameForm(self)
|
||||||
if self.book_name.exec_(name):
|
if self.book_name.exec_(name):
|
||||||
return unicode(self.book_name.requestComboBox.currentText())
|
return unicode(self.book_name.requestComboBox.currentText())
|
||||||
|
|
||||||
def languageDialog(self):
|
|
||||||
self.language = LanguageForm(self)
|
|
||||||
if self.language.exec_():
|
|
||||||
return unicode(self.language.requestComboBox.currentText())
|
|
||||||
|
@ -78,6 +78,8 @@ class CSVBible(BibleDB):
|
|||||||
"""
|
"""
|
||||||
This class provides a specialisation for importing of CSV Bibles.
|
This class provides a specialisation for importing of CSV Bibles.
|
||||||
"""
|
"""
|
||||||
|
log.info(u'CSVBible loaded')
|
||||||
|
|
||||||
def __init__(self, parent, **kwargs):
|
def __init__(self, parent, **kwargs):
|
||||||
"""
|
"""
|
||||||
Loads a Bible from a set of CVS files.
|
Loads a Bible from a set of CVS files.
|
||||||
|
@ -168,6 +168,7 @@ class BibleDB(QtCore.QObject, Manager):
|
|||||||
methods, but benefit from the database methods in here via inheritance,
|
methods, but benefit from the database methods in here via inheritance,
|
||||||
rather than depending on yet another object.
|
rather than depending on yet another object.
|
||||||
"""
|
"""
|
||||||
|
log.info(u'BibleDB loaded')
|
||||||
|
|
||||||
def __init__(self, parent, **kwargs):
|
def __init__(self, parent, **kwargs):
|
||||||
"""
|
"""
|
||||||
@ -491,13 +492,19 @@ class BibleDB(QtCore.QObject, Manager):
|
|||||||
|
|
||||||
def get_language(self):
|
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``
|
``book``
|
||||||
The language the bible is.
|
The language the bible is.
|
||||||
"""
|
"""
|
||||||
log.debug(u'BibleDB.get_language()')
|
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:
|
if not language:
|
||||||
return False
|
return False
|
||||||
language = BiblesResourcesDB.get_language(language)
|
language = BiblesResourcesDB.get_language(language)
|
||||||
|
Loading…
Reference in New Issue
Block a user