clean ups

This commit is contained in:
Andreas Preikschat 2012-04-01 13:16:08 +02:00
parent 152bd850eb
commit dbe9fc51aa
1 changed files with 8 additions and 16 deletions

View File

@ -242,9 +242,9 @@ class BibleMediaItem(MediaManagerItem):
self.addSearchFields(u'advanced', UiStrings().Advanced) self.addSearchFields(u'advanced', UiStrings().Advanced)
# Combo Boxes # Combo Boxes
QtCore.QObject.connect(self.quickVersionComboBox, QtCore.QObject.connect(self.quickVersionComboBox,
QtCore.SIGNAL(u'activated(int)'), self.onQuickVersionComboBox) QtCore.SIGNAL(u'activated(int)'), self.updateAutoCompleter)
QtCore.QObject.connect(self.quickSecondComboBox, QtCore.QObject.connect(self.quickSecondComboBox,
QtCore.SIGNAL(u'activated(int)'), self.onQuickSecondComboBox) QtCore.SIGNAL(u'activated(int)'), self.updateAutoCompleter)
QtCore.QObject.connect(self.advancedVersionComboBox, QtCore.QObject.connect(self.advancedVersionComboBox,
QtCore.SIGNAL(u'activated(int)'), self.onAdvancedVersionComboBox) QtCore.SIGNAL(u'activated(int)'), self.onAdvancedVersionComboBox)
QtCore.QObject.connect(self.advancedSecondComboBox, QtCore.QObject.connect(self.advancedSecondComboBox,
@ -379,12 +379,11 @@ class BibleMediaItem(MediaManagerItem):
bibles = self.plugin.manager.get_bibles().keys() bibles = self.plugin.manager.get_bibles().keys()
bibles.sort(cmp=locale.strcoll) bibles.sort(cmp=locale.strcoll)
# Load the bibles into the combo boxes. # Load the bibles into the combo boxes.
for bible in bibles: tmp_bibles = [bible for bible in bibles if bible]
if bible: self.quickVersionComboBox.addItems(tmp_bibles)
self.quickVersionComboBox.addItem(bible) self.quickSecondComboBox.addItems(tmp_bibles)
self.quickSecondComboBox.addItem(bible) self.advancedVersionComboBox.addItems(tmp_bibles)
self.advancedVersionComboBox.addItem(bible) self.advancedSecondComboBox.addItems(tmp_bibles)
self.advancedSecondComboBox.addItem(bible)
# set the default value # set the default value
bible = QtCore.QSettings().value( bible = QtCore.QSettings().value(
self.settingsSection + u'/advanced bible', self.settingsSection + u'/advanced bible',
@ -522,12 +521,6 @@ class BibleMediaItem(MediaManagerItem):
books.sort(cmp=locale.strcoll) books.sort(cmp=locale.strcoll)
add_widget_completer(books, self.quickSearchEdit) add_widget_completer(books, self.quickSearchEdit)
def onQuickVersionComboBox(self):
self.updateAutoCompleter()
def onQuickSecondComboBox(self):
self.updateAutoCompleter()
def onImportClick(self): def onImportClick(self):
if not hasattr(self, u'import_wizard'): if not hasattr(self, u'import_wizard'):
self.import_wizard = BibleImportForm(self, self.plugin.manager, self.import_wizard = BibleImportForm(self, self.plugin.manager,
@ -996,8 +989,7 @@ class BibleMediaItem(MediaManagerItem):
# last verse of the chapter or the current verse is not the # last verse of the chapter or the current verse is not the
# first one of the chapter. # first one of the chapter.
return True return True
else: return False
return False
def formatVerse(self, old_chapter, chapter, verse): def formatVerse(self, old_chapter, chapter, verse):
""" """