summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2024-03-05 09:47:42 +0200
committerKatja Marttila <katja.marttila@qt.io>2024-03-05 13:07:11 +0000
commit270603e9db275ad352f84247dbd77389285109cd (patch)
tree3f706004fa5afef58743c8608d48c4f1aa83f60d
parent49c7011844a85bc50004e64ee5e56705202f10a5 (diff)
Add possibility for additional license check
Productkeycheck, or repository, can implement additional license checkings. Added possibility to enable the next button in license agreement page when productkeycheck has also validated that the license check is ok. By default productkeycheck returns true for additional license checks, the developer can override the productkeycheck to add additional checks. Task-number: QTIFW-3319 Change-Id: Ie7e3d84eb800edb6c5c9731afa6bfe464e4ae4d1 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
-rw-r--r--src/libs/installer/packagemanagergui.cpp2
-rw-r--r--src/libs/installer/productkeycheck.cpp5
-rw-r--r--src/libs/installer/productkeycheck.h1
3 files changed, 7 insertions, 1 deletions
diff --git a/src/libs/installer/packagemanagergui.cpp b/src/libs/installer/packagemanagergui.cpp
index 2a843de01..eb80e83b0 100644
--- a/src/libs/installer/packagemanagergui.cpp
+++ b/src/libs/installer/packagemanagergui.cpp
@@ -2104,7 +2104,7 @@ void LicenseAgreementPage::entering()
*/
bool LicenseAgreementPage::isComplete() const
{
- return m_acceptCheckBox->isChecked();
+ return m_acceptCheckBox->isChecked() && ProductKeyCheck::instance()->hasAcceptedAllLicenses();
}
void LicenseAgreementPage::openLicenseUrl(const QUrl &url)
diff --git a/src/libs/installer/productkeycheck.cpp b/src/libs/installer/productkeycheck.cpp
index 4911d226e..fc4d18960 100644
--- a/src/libs/installer/productkeycheck.cpp
+++ b/src/libs/installer/productkeycheck.cpp
@@ -114,3 +114,8 @@ bool ProductKeyCheck::hasValidLicense() const
{
return true;
}
+
+bool ProductKeyCheck::hasAcceptedAllLicenses() const
+{
+ return true;
+}
diff --git a/src/libs/installer/productkeycheck.h b/src/libs/installer/productkeycheck.h
index 2e6a5f2e6..aea8d36ef 100644
--- a/src/libs/installer/productkeycheck.h
+++ b/src/libs/installer/productkeycheck.h
@@ -70,6 +70,7 @@ public:
QList<int> registeredPages() const;
bool hasValidLicense() const;
+ bool hasAcceptedAllLicenses() const;
private:
ProductKeyCheck();