From 4559563269e1c6b4203c39db8ffdb4397241bda8 Mon Sep 17 00:00:00 2001 From: Bytecoin Developer Date: Tue, 11 Jun 2019 17:00:26 +0200 Subject: [PATCH] Add the batch of release v3.4.5 commits --- README.md | 2 +- ReleaseNotes.md | 6 ++++++ azure-pipelines.yml | 1 + src/application.cpp | 25 ++++++++++++++++++++++++- src/application.h | 1 + src/bytecoin-gui.pro | 2 +- src/version.h | 4 ++-- src/walletd.cpp | 4 +++- 8 files changed, 39 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index fd31652..835b3ae 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # bytecoin-gui -[![Build Status](https://dev.azure.com/bcndev/bytecoin/_apis/build/status/bytecoin-desktop?branchName=releases/3.4.4)](https://dev.azure.com/bcndev/bytecoin/_build/latest?definitionId=2&branchName=releases/3.4.4) +[![Build Status](https://dev.azure.com/bcndev/bytecoin/_apis/build/status/bytecoin-desktop?branchName=releases/3.4.5)](https://dev.azure.com/bcndev/bytecoin/_build/latest?definitionId=2&branchName=releases/3.4.5) ## How to build binaries from source code diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 14f4a8d..ea05f1e 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,5 +1,11 @@ ## Release Notes +### v3.4.5 (Amethyst) + +- Disabled asking passwords for wallets with empty passwords. +- Disabled asking passwords for hardware wallets. +- Updated the Bytecoin daemons. + ### v3.4.4 (Amethyst) - Added a menu item to create hardware wallets. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d907df6..f21e978 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -88,6 +88,7 @@ jobs: displayName: Clone desktop code - script: | + sudo apt-get update sudo apt-get install -y qt5-qmake qtbase5-dev qtbase5-dev-tools qt5-default displayName: Install qt diff --git a/src/application.cpp b/src/application.cpp index 09d1b38..83fd745 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -46,6 +46,7 @@ WalletApplication::WalletApplication(int& argc, char** argv) , walletd_(nullptr) , walletModel_(new WalletModel(this)) , downloader_(new FileDownloader(this)) + , tryToOpenWithEmptyPassword_(false) , crashDialog_(new CrashDialog()) , m_isAboutToQuit(false) { @@ -148,8 +149,11 @@ bool WalletApplication::init() if(isFirstRun) firstRun(); else + { // createWalletd(); + tryToOpenWithEmptyPassword_ = true; emit createWalletdSignal(QPrivateSignal{}); + } checkForUpdate(); return true; @@ -344,7 +348,18 @@ void WalletApplication::daemonFinished(int exitCode, QProcess::ExitStatus /*exit qDebug("[WalletApplication] Daemon finished. Return code: %s (%d)", metaEnum.valueToKey(static_cast(exitCode)), exitCode); - const QString walletdMsg = BuiltinWalletd::errorMessage(static_cast(exitCode)); + + const BuiltinWalletd::ReturnCodes returnCode = static_cast(exitCode); + + if (returnCode == BuiltinWalletd::ReturnCodes::WALLET_FILE_DECRYPT_ERROR && tryToOpenWithEmptyPassword_) + { + tryToOpenWithEmptyPassword_ = false; + restartDaemon(); + return; + } + tryToOpenWithEmptyPassword_ = false; + + const QString walletdMsg = BuiltinWalletd::errorMessage(returnCode); const QString msg = !walletdMsg.isEmpty() ? walletdMsg : tr("Walletd just crashed. %1. Return code %2. ").arg(walletd->errorString()).arg(exitCode); @@ -426,6 +441,7 @@ void WalletApplication::openWallet(QWidget* parent) if (fileName.isEmpty()) return; + tryToOpenWithEmptyPassword_ = true; runBuiltinWalletd(fileName, false, false, false, QByteArray{}, QByteArray{}); } @@ -486,6 +502,13 @@ void WalletApplication::importKeys(QWidget* parent) void WalletApplication::requestPassword() { + if (tryToOpenWithEmptyPassword_) + { + BuiltinWalletd* walletd = static_cast(walletd_); + walletd->setPassword(QString{}); + return; + } + AskPasswordDialog dlg(false, m_mainWindow); BuiltinWalletd* walletd = static_cast(walletd_); connect(walletd, &BuiltinWalletd::daemonErrorOccurredSignal, &dlg, &AskPasswordDialog::reject); diff --git a/src/application.h b/src/application.h index 2c89146..c7fc2c7 100644 --- a/src/application.h +++ b/src/application.h @@ -49,6 +49,7 @@ class WalletApplication: public QApplication WalletModel* walletModel_; FileDownloader* downloader_; QTimer checkForUpdateTimer_; + bool tryToOpenWithEmptyPassword_; QScopedPointer crashDialog_; bool m_isAboutToQuit; diff --git a/src/bytecoin-gui.pro b/src/bytecoin-gui.pro index 18d6c0d..c26b14a 100644 --- a/src/bytecoin-gui.pro +++ b/src/bytecoin-gui.pro @@ -15,7 +15,7 @@ TEMPLATE = app macx: QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.11 macx: ICON = images/bytecoin.icns win32: RC_ICONS = images/bytecoin.ico -win32: VERSION = 3.19.5.30 +win32: VERSION = 3.19.6.11 #QMAKE_CXXFLAGS += -fno-omit-frame-pointer -fsanitize=address,undefined #LIBS += -lasan -lubsan diff --git a/src/version.h b/src/version.h index c47d8fe..c101dc2 100644 --- a/src/version.h +++ b/src/version.h @@ -5,10 +5,10 @@ namespace WalletGUI { -constexpr char VERSION[] = "3.4.4"; +constexpr char VERSION[] = "3.4.5"; constexpr char CODENAME[] = "Amethyst"; constexpr char VERSION_SUFFIX[] = "stable"; -constexpr char REVISION[] = "20190530"; +constexpr char REVISION[] = "20190611"; // returns <0, if newVersion is worse than currentVersion, returns >0, if newVersion is better, and returns 0, if versions are equal int compareVersion(const QString& newVersion, const QString& currentVersion); diff --git a/src/walletd.cpp b/src/walletd.cpp index d8d8158..bd3be16 100644 --- a/src/walletd.cpp +++ b/src/walletd.cpp @@ -563,8 +563,10 @@ void BuiltinWalletd::daemonStarted() setState(State::RUNNING); const bool restoreFromMnemonic = !createNew_ && !mnemonic_.isEmpty(); - if (createLegacy_ || createNew_ || restoreFromMnemonic || createHardware_) + if (createLegacy_ || createNew_ || restoreFromMnemonic) emit requestPasswordWithConfirmationSignal(); + else if (createHardware_) + setPassword(QString{}); else if (!changePassword_) emit requestPasswordSignal();