Skip to content

Commit b038141

Browse files
committed
Fix #14107 (GUI: add menu option to show EULA for cppcheck premium) (#7788)
1 parent 8c0a1a0 commit b038141

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

gui/mainwindow.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
#include <QCloseEvent>
7777
#include <QCoreApplication>
7878
#include <QDateTime>
79+
#include <QDesktopServices>
7980
#include <QDebug>
8081
#include <QDialog>
8182
#include <QDir>
@@ -193,6 +194,8 @@ MainWindow::MainWindow(TranslationHandler* th, QSettings* settings) :
193194
// About menu
194195
connect(mUI->mActionAbout, &QAction::triggered, this, &MainWindow::about);
195196
connect(mUI->mActionLicense, &QAction::triggered, this, &MainWindow::showLicense);
197+
mUI->mActionEULA->setVisible(isCppcheckPremium());
198+
connect(mUI->mActionEULA, &QAction::triggered, this, &MainWindow::showEULA);
196199

197200
// View > Toolbar menu
198201
connect(mUI->mActionToolBarMain, SIGNAL(toggled(bool)), this, SLOT(toggleMainToolBar()));
@@ -1643,6 +1646,11 @@ void MainWindow::showAuthors()
16431646
dlg->exec();
16441647
}
16451648

1649+
void MainWindow::showEULA()
1650+
{
1651+
QDesktopServices::openUrl(QUrl("https://www.cppcheck.com/EULA"));
1652+
}
1653+
16461654
void MainWindow::performSelectedFilesCheck(const QStringList &selectedFilesList)
16471655
{
16481656
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)