From 0d2993408a3c0225eee7390d6c9f715e94ecb116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 8 Nov 2022 13:33:57 +0100 Subject: [PATCH] GUI: Install link when new version is available --- gui/mainwindow.cpp | 11 ++++++++++- gui/mainwindow.ui | 9 +++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 97b6da44a..4a41cebea 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -1951,9 +1951,18 @@ void MainWindow::replyFinished(QNetworkReply *reply) { const int latestVersion = getVersion(str.trimmed()); if (appVersion < latestVersion) { if (mSettings->value(SETTINGS_CHECK_VERSION, 0).toInt() != latestVersion) { + QString install; + if (isCppcheckPremium()) { +#ifdef Q_OS_WIN + const QString url("https://cppchecksolutions.com/cppcheck-premium-installation"); +#else + const QString url("https://cppchecksolutions.com/cppcheck-premium-linux-installation"); +#endif + install = "" + tr("Install") + ""; + } mUI->mButtonHideInformation->setVisible(true); mUI->mLabelInformation->setVisible(true); - mUI->mLabelInformation->setText(tr("New version available: %1").arg(str.trimmed())); + mUI->mLabelInformation->setText(tr("New version available: %1. %2").arg(str.trimmed()).arg(install)); } } } diff --git a/gui/mainwindow.ui b/gui/mainwindow.ui index 6f7841023..a7a641c4a 100644 --- a/gui/mainwindow.ui +++ b/gui/mainwindow.ui @@ -83,6 +83,15 @@ Checking for updates + + Qt::RichText + + + true + + + Qt::TextBrowserInteraction +