From 5a083c0cff068de2624cc6812854f2a1a71d52c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 2 Sep 2025 18:47:46 +0200 Subject: [PATCH] Fix #14107 (GUI: add menu option to show EULA for cppcheck premium) --- gui/mainwindow.cpp | 8 ++++++++ gui/mainwindow.h | 3 +++ gui/mainwindow.ui | 8 +++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index d4dbc69bf9d..05212db30f8 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -77,6 +77,7 @@ #include #include #include +#include #include #include #include @@ -194,6 +195,8 @@ MainWindow::MainWindow(TranslationHandler* th, QSettings* settings) : // About menu connect(mUI->mActionAbout, &QAction::triggered, this, &MainWindow::about); connect(mUI->mActionLicense, &QAction::triggered, this, &MainWindow::showLicense); + mUI->mActionEULA->setVisible(isCppcheckPremium()); + connect(mUI->mActionEULA, &QAction::triggered, this, &MainWindow::showEULA); // View > Toolbar menu connect(mUI->mActionToolBarMain, SIGNAL(toggled(bool)), this, SLOT(toggleMainToolBar())); @@ -1646,6 +1649,11 @@ void MainWindow::showAuthors() dlg->exec(); } +void MainWindow::showEULA() +{ + QDesktopServices::openUrl(QUrl("https://www.cppcheck.com/EULA")); +} + void MainWindow::performSelectedFilesCheck(const QStringList &selectedFilesList) { reAnalyzeSelected(selectedFilesList); diff --git a/gui/mainwindow.h b/gui/mainwindow.h index 4999f101f80..76fda4f0de6 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -170,6 +170,9 @@ public slots: /** @brief Slot to to show authors list */ void showAuthors(); + /** @brief Slot to to show EULA */ + void showEULA(); + /** @brief Slot to save results */ void save(); diff --git a/gui/mainwindow.ui b/gui/mainwindow.ui index 6fb74bc0cb2..bf83b86a65e 100644 --- a/gui/mainwindow.ui +++ b/gui/mainwindow.ui @@ -124,7 +124,7 @@ 0 0 640 - 30 + 22 @@ -200,6 +200,7 @@ + @@ -1025,6 +1026,11 @@ Autosar + + + EULA... + +