diff --git a/src/libs/utils/projectintropage.cpp b/src/libs/utils/projectintropage.cpp index 1a318df0d4c..6e180496375 100644 --- a/src/libs/utils/projectintropage.cpp +++ b/src/libs/utils/projectintropage.cpp @@ -195,6 +195,11 @@ bool ProjectIntroPage::validate() return false; } +void ProjectIntroPage::fieldsUpdated() +{ + slotChanged(); +} + void ProjectIntroPage::slotChanged() { const bool newComplete = validate(); @@ -286,6 +291,8 @@ void ProjectIntroPage::displayStatusMessage(InfoLabel::InfoType t, const QString { d->m_ui.stateLabel->setType(t); d->m_ui.stateLabel->setText(s); + + emit statusMessageChanged(t, s); } void ProjectIntroPage::hideStatusLabel() diff --git a/src/libs/utils/projectintropage.h b/src/libs/utils/projectintropage.h index 5de165efe11..0bccd91f2b1 100644 --- a/src/libs/utils/projectintropage.h +++ b/src/libs/utils/projectintropage.h @@ -66,8 +66,14 @@ public: bool validateProjectName(const QString &name, QString *errorMessage); + // Calls slotChanged() - i.e. tell the page that some of its fields have been updated. + // This function is useful if you programmatically update the fields of the page (i.e. from + // your client code). + void fieldsUpdated(); + signals: void activated(); + void statusMessageChanged(InfoLabel::InfoType type, const QString &message); public slots: void setFilePath(const FilePath &path); diff --git a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp index d7584ede0bb..d6080f4e90f 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp @@ -956,6 +956,15 @@ void CheckBoxField::setup(JsonFieldPage *page, const QString &name) }); } +void CheckBoxField::setChecked(bool value) +{ + auto w = qobject_cast(widget()); + QTC_ASSERT(w, return); + + w->setChecked(value); + w->clicked(value); +} + bool CheckBoxField::validate(MacroExpander *expander, QString *message) { if (!JsonFieldPage::Field::validate(expander, message)) diff --git a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage_p.h b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage_p.h index 251315a510b..ed89746d0b2 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonfieldpage_p.h +++ b/src/plugins/projectexplorer/jsonwizard/jsonfieldpage_p.h @@ -230,11 +230,13 @@ private: Utils::PathChooser::Kind m_kind = Utils::PathChooser::ExistingDirectory; }; -class CheckBoxField : public JsonFieldPage::Field +class PROJECTEXPLORER_EXPORT CheckBoxField : public JsonFieldPage::Field { public: bool suppressName() const override { return true; } + void setChecked(bool); + private: bool parseData(const QVariant &data, QString *errorMessage) override; diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp index 579722a63d6..9aa16ff0513 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp @@ -257,12 +257,14 @@ QList JsonWizardFactory::createWizardFactories() .arg(currentFile.fileName()) .arg(line).arg(column) .arg(error.errorString())); + qWarning() << "Failed to parse wizard: " << currentFile.fileName(); continue; } if (!json.isObject()) { verboseLog.append(tr("* Did not find a JSON object in \"%1\".\n") .arg(currentFile.fileName())); + qWarning() << "Failed to parse wizard: " << currentFile.fileName(); continue; } @@ -280,6 +282,7 @@ QList JsonWizardFactory::createWizardFactories() JsonWizardFactory *factory = createWizardFactory(data, currentDir, &errorMessage); if (!factory) { verboseLog.append(tr("* Failed to create: %1\n").arg(errorMessage)); + qWarning() << "Failed to create wizard: " << currentFile.fileName(); continue; }