make sure, that the bible list in the importer is sorted

This commit is contained in:
Andreas Preikschat 2010-11-12 22:34:06 +01:00
parent b34bb86b7c
commit 46321741ad
1 changed files with 11 additions and 8 deletions

View File

@ -207,9 +207,11 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard):
The index of the combo box. The index of the combo box.
""" """
self.BibleComboBox.clear() self.BibleComboBox.clear()
for bible in self.web_bible_list[index].keys(): bibles = [unicode(translate('BiblesPlugin.ImportWizardForm', bible)) for
self.BibleComboBox.addItem(unicode( bible in self.web_bible_list[index].keys()]
translate('BiblesPlugin.ImportWizardForm', bible))) bibles.sort()
for bible in bibles:
self.BibleComboBox.addItem(bible)
def onOsisFileButtonClicked(self): def onOsisFileButtonClicked(self):
""" """
@ -386,7 +388,8 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard):
self.ImportProgressBar.setValue(0) self.ImportProgressBar.setValue(0)
if bible_type == BibleFormat.WebDownload: if bible_type == BibleFormat.WebDownload:
self.ImportProgressLabel.setText(translate( self.ImportProgressLabel.setText(translate(
'BiblesPlugin.ImportWizardForm', 'Starting Registering bible...')) 'BiblesPlugin.ImportWizardForm',
'Starting Registering bible...'))
else: else:
self.ImportProgressLabel.setText(translate( self.ImportProgressLabel.setText(translate(
'BiblesPlugin.ImportWizardForm', 'Starting import...')) 'BiblesPlugin.ImportWizardForm', 'Starting import...'))
@ -400,26 +403,26 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard):
unicode(self.field(u'license_permissions').toString()) unicode(self.field(u'license_permissions').toString())
importer = None importer = None
if bible_type == BibleFormat.OSIS: if bible_type == BibleFormat.OSIS:
# Import an OSIS bible # Import an OSIS bible.
importer = self.manager.import_bible(BibleFormat.OSIS, importer = self.manager.import_bible(BibleFormat.OSIS,
name=license_version, name=license_version,
filename=unicode(self.field(u'osis_location').toString()) filename=unicode(self.field(u'osis_location').toString())
) )
elif bible_type == BibleFormat.CSV: elif bible_type == BibleFormat.CSV:
# Import a CSV bible # Import a CSV bible.
importer = self.manager.import_bible(BibleFormat.CSV, importer = self.manager.import_bible(BibleFormat.CSV,
name=license_version, name=license_version,
booksfile=unicode(self.field(u'csv_booksfile').toString()), booksfile=unicode(self.field(u'csv_booksfile').toString()),
versefile=unicode(self.field(u'csv_versefile').toString()) versefile=unicode(self.field(u'csv_versefile').toString())
) )
elif bible_type == BibleFormat.OpenSong: elif bible_type == BibleFormat.OpenSong:
# Import an OpenSong bible # Import an OpenSong bible.
importer = self.manager.import_bible(BibleFormat.OpenSong, importer = self.manager.import_bible(BibleFormat.OpenSong,
name=license_version, name=license_version,
filename=unicode(self.field(u'opensong_file').toString()) filename=unicode(self.field(u'opensong_file').toString())
) )
elif bible_type == BibleFormat.WebDownload: elif bible_type == BibleFormat.WebDownload:
# Import a bible from the web # Import a bible from the web.
self.ImportProgressBar.setMaximum(1) self.ImportProgressBar.setMaximum(1)
download_location = self.field(u'web_location').toInt()[0] download_location = self.field(u'web_location').toInt()[0]
bible_version = unicode(self.BibleComboBox.currentText()) bible_version = unicode(self.BibleComboBox.currentText())