Browse Source

Stop nagging for updates if the user presses cancel

import_zecw
Aditya Kulkarni 5 years ago
parent
commit
7026a530ff
  1. 1
      .gitignore
  2. 11
      src/rpc.cpp

1
.gitignore

@ -4,6 +4,7 @@ release/
x64/
artifacts/
.vscode/
res/libsodium/libsodium*
src/ui_*.h
*.autosave
src/precompiled.h.cpp

11
src/rpc.cpp

@ -943,8 +943,14 @@ void RPC::checkForUpdate(bool silent) {
}
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;
if (maxVersion > currentVersion) {
if (maxVersion > currentVersion && maxVersion > maxHiddenVersion) {
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?")
.arg(maxVersion.toString())
@ -952,6 +958,9 @@ void RPC::checkForUpdate(bool silent) {
QMessageBox::Yes, QMessageBox::Cancel);
if (ans == QMessageBox::Yes) {
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 {
if (!silent) {

Loading…
Cancel
Save