Stop nagging for updates if the user presses cancel
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,6 +4,7 @@ release/
|
|||||||
x64/
|
x64/
|
||||||
artifacts/
|
artifacts/
|
||||||
.vscode/
|
.vscode/
|
||||||
|
res/libsodium/libsodium*
|
||||||
src/ui_*.h
|
src/ui_*.h
|
||||||
*.autosave
|
*.autosave
|
||||||
src/precompiled.h.cpp
|
src/precompiled.h.cpp
|
||||||
|
|||||||
11
src/rpc.cpp
11
src/rpc.cpp
@@ -943,8 +943,14 @@ void RPC::checkForUpdate(bool silent) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto currentVersion = QVersionNumber::fromString(APP_VERSION);
|
auto currentVersion = QVersionNumber::fromString(APP_VERSION);
|
||||||
|
|
||||||
|
// Get the max version that the user has hidden updates for
|
||||||
|
QSettings s;
|
||||||
|
auto maxHiddenVersion = QVersionNumber::fromString(s.value("update/lastversion", "0.0.0").toString());
|
||||||
|
|
||||||
qDebug() << "Version check: Current " << currentVersion << ", Available " << maxVersion;
|
qDebug() << "Version check: Current " << currentVersion << ", Available " << maxVersion;
|
||||||
if (maxVersion > currentVersion) {
|
|
||||||
|
if (maxVersion > currentVersion && maxVersion > maxHiddenVersion) {
|
||||||
auto ans = QMessageBox::information(main, QObject::tr("Update Available"),
|
auto ans = QMessageBox::information(main, QObject::tr("Update Available"),
|
||||||
QObject::tr("A new release v%1 is available! You have v%2.\n\nWould you like to visit the releases page?")
|
QObject::tr("A new release v%1 is available! You have v%2.\n\nWould you like to visit the releases page?")
|
||||||
.arg(maxVersion.toString())
|
.arg(maxVersion.toString())
|
||||||
@@ -952,6 +958,9 @@ void RPC::checkForUpdate(bool silent) {
|
|||||||
QMessageBox::Yes, QMessageBox::Cancel);
|
QMessageBox::Yes, QMessageBox::Cancel);
|
||||||
if (ans == QMessageBox::Yes) {
|
if (ans == QMessageBox::Yes) {
|
||||||
QDesktopServices::openUrl(QUrl("https://github.com/ZcashFoundation/zec-qt-wallet/releases"));
|
QDesktopServices::openUrl(QUrl("https://github.com/ZcashFoundation/zec-qt-wallet/releases"));
|
||||||
|
} else {
|
||||||
|
// If the user selects cancel, don't bother them again for this version
|
||||||
|
s.setValue("update/lastversion", maxVersion.toString());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!silent) {
|
if (!silent) {
|
||||||
|
|||||||
Reference in New Issue
Block a user