Skip to content

Commit e6e045f

Browse files
authored
Fix #14107 (GUI: add menu option to show EULA for cppcheck premium) (#7788)
1 parent 2b51b48 commit e6e045f

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

gui/mainwindow.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
#include <QCloseEvent>
7878
#include <QCoreApplication>
7979
#include <QDateTime>
80+
#include <QDesktopServices>
8081
#include <QDebug>
8182
#include <QDialog>
8283
#include <QDir>
@@ -194,6 +195,8 @@ MainWindow::MainWindow(TranslationHandler* th, QSettings* settings) :
194195
// About menu
195196
connect(mUI->mActionAbout, &QAction::triggered, this, &MainWindow::about);
196197
connect(mUI->mActionLicense, &QAction::triggered, this, &MainWindow::showLicense);
198+
mUI->mActionEULA->setVisible(isCppcheckPremium());
199+
connect(mUI->mActionEULA, &QAction::triggered, this, &MainWindow::showEULA);
197200

198201
// View > Toolbar menu
199202
connect(mUI->mActionToolBarMain, SIGNAL(toggled(bool)), this, SLOT(toggleMainToolBar()));
@@ -1646,6 +1649,11 @@ void MainWindow::showAuthors()
16461649
dlg->exec();
16471650
}
16481651

1652+
void MainWindow::showEULA()
1653+
{
1654+
QDesktopServices::openUrl(QUrl("https://www.cppcheck.com/EULA"));
1655+
}
1656+
16491657
void MainWindow::performSelectedFilesCheck(const QStringList &selectedFilesList)
16501658
{
16511659
reAnalyzeSelected(selectedFilesList);

gui/mainwindow.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ public slots:
170170
/** @brief Slot to to show authors list */
171171
void showAuthors();
172172

173+
/** @brief Slot to to show EULA */
174+
void showEULA();
175+
173176
/** @brief Slot to save results */
174177
void save();
175178

gui/mainwindow.ui

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
<x>0</x>
125125
<y>0</y>
126126
<width>640</width>
127-
<height>30</height>
127+
<height>22</height>
128128
</rect>
129129
</property>
130130
<widget class="QMenu" name="mMenuFile">
@@ -200,6 +200,7 @@
200200
<addaction name="mActionHelpContents"/>
201201
<addaction name="mActionLicense"/>
202202
<addaction name="mActionAuthors"/>
203+
<addaction name="mActionEULA"/>
203204
<addaction name="separator"/>
204205
<addaction name="mActionAbout"/>
205206
</widget>
@@ -1025,6 +1026,11 @@
10251026
<string>Autosar</string>
10261027
</property>
10271028
</action>
1029+
<action name="mActionEULA">
1030+
<property name="text">
1031+
<string>EULA...</string>
1032+
</property>
1033+
</action>
10281034
</widget>
10291035
<customwidgets>
10301036
<customwidget>

0 commit comments

Comments
 (0)