diff options
author | Aurindam Jana <aurindam.jana@digia.com> | 2013-05-17 14:28:41 +0200 |
---|---|---|
committer | Aurindam Jana <aurindam.jana@digia.com> | 2013-05-17 16:16:30 +0200 |
commit | 7e0dd72252b0696b4bf924c3249d8810f966c174 (patch) | |
tree | 1dbd18f8654a2e9a6f628b9a54e082e2d22bb2be /src/plugins/projectexplorer/customwizard/customwizardpage.cpp | |
parent | fcb419c51037e28074edff8a4e41841c71f145e7 (diff) | |
download | qt-creator-7e0dd72252b0696b4bf924c3249d8810f966c174.tar.gz |
CustomWizardPage: Connect user fields to completeChanged()
Change-Id: I0000c18ffebbcb25bb203dc16fd78b804de19042
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/plugins/projectexplorer/customwizard/customwizardpage.cpp')
-rw-r--r-- | src/plugins/projectexplorer/customwizard/customwizardpage.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/plugins/projectexplorer/customwizard/customwizardpage.cpp b/src/plugins/projectexplorer/customwizard/customwizardpage.cpp index 4e735fab28..f4d1a76236 100644 --- a/src/plugins/projectexplorer/customwizard/customwizardpage.cpp +++ b/src/plugins/projectexplorer/customwizard/customwizardpage.cpp @@ -294,6 +294,8 @@ QWidget *CustomWizardFieldPage::registerComboBox(const QString &fieldName, combo->setCurrentIndex(currentIndex); } while (false); registerField(fieldName, combo, "text", SIGNAL(text4Changed(QString))); + // Connect to completeChanged() for derived classes that reimplement isComplete() + connect(combo, SIGNAL(text4Changed(QString)), SIGNAL(completeChanged())); return combo; } // QComboBox @@ -305,7 +307,9 @@ QWidget *CustomWizardFieldPage::registerTextEdit(const QString &fieldName, // pasting from Bug tracker, etc. const bool acceptRichText = field.controlAttributes.value(QLatin1String("acceptRichText")) == QLatin1String("true"); textEdit->setAcceptRichText(acceptRichText); + // Connect to completeChanged() for derived classes that reimplement isComplete() registerField(fieldName, textEdit, "plainText", SIGNAL(textChanged())); + connect(textEdit, SIGNAL(textChanged()), SIGNAL(completeChanged())); const QString defaultText = field.controlAttributes.value(QLatin1String("defaulttext")); m_textEdits.push_back(TextEditData(textEdit, defaultText)); return textEdit; @@ -330,6 +334,8 @@ QWidget *CustomWizardFieldPage::registerPathChooser(const QString &fieldName, pathChooser->setExpectedKind(Utils::PathChooser::Any); registerField(fieldName, pathChooser, "path", SIGNAL(changed(QString))); + // Connect to completeChanged() for derived classes that reimplement isComplete() + connect(pathChooser, SIGNAL(changed(QString)), SIGNAL(completeChanged())); const QString defaultText = field.controlAttributes.value(QLatin1String("defaulttext")); m_pathChoosers.push_back(PathChooserData(pathChooser, defaultText)); return pathChooser; @@ -351,6 +357,8 @@ QWidget *CustomWizardFieldPage::registerCheckBox(const QString &fieldName, if (falseTextIt != field.controlAttributes.constEnd()) // Also set empty texts checkBox->setFalseText(falseTextIt.value()); registerField(fieldName, checkBox, "text", SIGNAL(textChanged(QString))); + // Connect to completeChanged() for derived classes that reimplement isComplete() + connect(checkBox, SIGNAL(textChanged(QString)), SIGNAL(completeChanged())); return checkBox; } @@ -368,6 +376,8 @@ QWidget *CustomWizardFieldPage::registerLineEdit(const QString &fieldName, qWarning("Invalid custom wizard field validator regular expression %s.", qPrintable(validationRegExp)); } registerField(fieldName, lineEdit, "text", SIGNAL(textEdited(QString))); + // Connect to completeChanged() for derived classes that reimplement isComplete() + connect(lineEdit, SIGNAL(textEdited(QString)), SIGNAL(completeChanged())); const QString defaultText = field.controlAttributes.value(QLatin1String("defaulttext")); m_lineEdits.push_back(LineEditData(lineEdit, defaultText)); @@ -521,7 +531,7 @@ void CustomWizardPage::setPath(const QString &path) bool CustomWizardPage::isComplete() const { - return m_pathChooser->isValid(); + return m_pathChooser->isValid() && CustomWizardFieldPage::isComplete(); } } // namespace Internal |