disable 'next button' if importer is not available

This commit is contained in:
Andreas Preikschat 2011-04-11 16:34:14 +02:00
parent de616b9d1a
commit 073d6c8403
1 changed files with 11 additions and 1 deletions

View File

@ -66,7 +66,17 @@ class SongImportForm(OpenLPWizard):
self.formatStack.setCurrentIndex(0)
QtCore.QObject.connect(self.formatComboBox,
QtCore.SIGNAL(u'currentIndexChanged(int)'),
self.formatStack.setCurrentIndex)
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.formatStack.setCurrentIndex(index)
next_button = self.button(QtGui.QWizard.NextButton)
next_button.setEnabled(SongFormat.get_availability(index))
def customInit(self):
"""