diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index 7fc4631a690..9e276ea1cc3 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -176,17 +177,27 @@ static void initTAndCAcceptDialog() dialog.setWindowTitle(Tr::tr("Terms and Conditions")); QDialogButtonBox buttonBox; + QCheckBox *acceptCheckBox; QPushButton *acceptButton = buttonBox.addButton(Tr::tr("Accept"), QDialogButtonBox::ButtonRole::YesRole); QPushButton *decline = buttonBox.addButton(Tr::tr("Decline"), QDialogButtonBox::ButtonRole::NoRole); acceptButton->setAutoDefault(false); acceptButton->setDefault(false); + acceptButton->setEnabled(false); decline->setAutoDefault(true); decline->setDefault(true); QObject::connect(&buttonBox, &QDialogButtonBox::accepted, &dialog, &QDialog::accept); QObject::connect(&buttonBox, &QDialogButtonBox::rejected, &dialog, &QDialog::reject); + const QLatin1String legal = QLatin1String( + "I confirm that I have reviewed and accept the terms and conditions\n" + "of this extension. I confirm that I have the authority and ability to\n" + "accept the terms and conditions of this extension for the customer.\n" + "I acknowledge that if the customer and the Qt Company already have a\n" + "valid agreement in place, that agreement shall apply, but these terms\n" + "shall govern the use of this extension."); + // clang-format off Column { Tr::tr("The plugin %1 requires you to accept the following terms and conditions:").arg(spec->name()), br, @@ -195,11 +206,14 @@ static void initTAndCAcceptDialog() readOnly(true), }, br, Row { - Tr::tr("Do you wish to accept?"), &buttonBox, + acceptCheckBox = new QCheckBox(legal), &buttonBox, } }.attachTo(&dialog); // clang-format on + QObject::connect( + acceptCheckBox, &QCheckBox::toggled, acceptButton, &QPushButton::setEnabled); + return dialog.exec() == QDialog::Accepted; }); }