enable/disable next button if bible importer is not available

This commit is contained in:
Andreas Preikschat 2011-04-11 17:01:42 +02:00
parent 073d6c8403
commit 53660fe23f
1 changed files with 12 additions and 2 deletions

View File

@ -85,8 +85,18 @@ class BibleImportForm(OpenLPWizard):
""" """
OpenLPWizard.setupUi(self, image) OpenLPWizard.setupUi(self, image)
QtCore.QObject.connect(self.formatComboBox, QtCore.QObject.connect(self.formatComboBox,
QtCore.SIGNAL(u'currentIndexChanged(int)'), self.selectStack, QtCore.SIGNAL(u'currentIndexChanged(int)'),
QtCore.SLOT(u'setCurrentIndex(int)')) self.onCurrentIndexChanged)
def onCurrentIndexChanged(self, index):
"""
Called when the format combo box's index changed. We have to check if
the import is available and accordingly to disable or enable the next
button.
"""
self.selectStack.setCurrentIndex(index)
next_button = self.button(QtGui.QWizard.NextButton)
next_button.setEnabled(BibleFormat.get_availability(index))
def customInit(self): def customInit(self):
""" """