From 073d6c8403aa7c21cfe5a8ad0a8733d11c401100 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 11 Apr 2011 16:34:14 +0200 Subject: [PATCH] disable 'next button' if importer is not available --- openlp/plugins/songs/forms/songimportform.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 6d20c8f41..468d2f341 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -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): """