diff options
| author | Ilya Kitaev <mbg033@gmail.com> | 2016-08-19 14:44:44 +0300 |
|---|---|---|
| committer | Ilya Kitaev <mbg033@gmail.com> | 2016-08-19 14:44:44 +0300 |
| commit | 8d93f01db434ffd873e095d55abeeae7d8021f6f (patch) | |
| tree | 4ff1e7b9e902602ad7651d18d948fd3d596f2836 /src | |
| parent | d3234bb91564ee8327b111e0acf2a83153929c25 (diff) | |
| download | monzero-gui-8d93f01db434ffd873e095d55abeeae7d8021f6f.tar.gz monzero-gui-8d93f01db434ffd873e095d55abeeae7d8021f6f.tar.xz monzero-gui-8d93f01db434ffd873e095d55abeeae7d8021f6f.zip | |
WalletManager::openWalletAsync integrating with UI
Diffstat (limited to 'src')
| -rw-r--r-- | src/libwalletqt/WalletManager.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libwalletqt/WalletManager.cpp b/src/libwalletqt/WalletManager.cpp index 50a61553..da5c4cd7 100644 --- a/src/libwalletqt/WalletManager.cpp +++ b/src/libwalletqt/WalletManager.cpp @@ -40,6 +40,13 @@ Wallet *WalletManager::openWallet(const QString &path, const QString &password, Bitmonero::Wallet * w = m_pimpl->openWallet(path.toStdString(), password.toStdString(), testnet); Wallet * wallet = new Wallet(w); + + // move wallet to the GUI thread. Otherwise it wont be emitting signals + if (wallet->thread() != qApp->thread()) { + wallet->moveToThread(qApp->thread()); + } + + return wallet; } @@ -84,7 +91,7 @@ void WalletManager::closeWalletAsync(Wallet *wallet) this, [this, watcher]() { QFuture<QString> future = watcher->future(); watcher->deleteLater(); - emit future.result(); + emit walletClosed(future.result()); }); } |
