GUI: Install link when new version is available
This commit is contained in:
parent
bd95efc987
commit
0d2993408a
|
@ -1951,9 +1951,18 @@ void MainWindow::replyFinished(QNetworkReply *reply) {
|
||||||
const int latestVersion = getVersion(str.trimmed());
|
const int latestVersion = getVersion(str.trimmed());
|
||||||
if (appVersion < latestVersion) {
|
if (appVersion < latestVersion) {
|
||||||
if (mSettings->value(SETTINGS_CHECK_VERSION, 0).toInt() != 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 = "<a href=\"" + url + "\">" + tr("Install") + "</a>";
|
||||||
|
}
|
||||||
mUI->mButtonHideInformation->setVisible(true);
|
mUI->mButtonHideInformation->setVisible(true);
|
||||||
mUI->mLabelInformation->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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,6 +83,15 @@
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Checking for updates</string>
|
<string>Checking for updates</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::RichText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="openExternalLinks">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::TextBrowserInteraction</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|
Loading…
Reference in New Issue