Merge pull request #2178

8bc9fbe WalletManager: async setDaemonAddress (xiphon)
This commit is contained in:
luigi1111 2019-06-05 22:30:46 -05:00
commit da39be9a8d
No known key found for this signature in database
GPG key ID: F4ACA0183641E010
3 changed files with 8 additions and 6 deletions

View file

@ -253,7 +253,7 @@ ApplicationWindow {
}
// Local daemon settings
walletManager.setDaemonAddress(localDaemonAddress)
walletManager.setDaemonAddressAsync(localDaemonAddress);
// enable timers
userInActivityTimer.running = true;
@ -605,7 +605,7 @@ ApplicationWindow {
persistentSettings.useRemoteNode = true;
currentDaemonAddress = persistentSettings.remoteNodeAddress;
currentWallet.initAsync(currentDaemonAddress);
walletManager.setDaemonAddress(currentDaemonAddress);
walletManager.setDaemonAddressAsync(currentDaemonAddress);
remoteNodeConnected = true;
}
@ -617,7 +617,7 @@ ApplicationWindow {
persistentSettings.useRemoteNode = false;
currentDaemonAddress = localDaemonAddress
currentWallet.initAsync(currentDaemonAddress);
walletManager.setDaemonAddress(currentDaemonAddress);
walletManager.setDaemonAddressAsync(currentDaemonAddress);
remoteNodeConnected = false;
}

View file

@ -344,9 +344,11 @@ QString WalletManager::paymentIdFromAddress(const QString &address, NetworkType:
return QString::fromStdString(Monero::Wallet::paymentIdFromAddress(address.toStdString(), static_cast<Monero::NetworkType>(nettype)));
}
void WalletManager::setDaemonAddress(const QString &address)
void WalletManager::setDaemonAddressAsync(const QString &address)
{
m_pimpl->setDaemonAddress(address.toStdString());
QtConcurrent::run([this, address] {
m_pimpl->setDaemonAddress(address.toStdString());
});
}
bool WalletManager::connected() const

View file

@ -150,7 +150,7 @@ public:
Q_INVOKABLE QString paymentIdFromAddress(const QString &address, NetworkType::Type nettype) const;
Q_INVOKABLE void setDaemonAddress(const QString &address);
Q_INVOKABLE void setDaemonAddressAsync(const QString &address);
Q_INVOKABLE bool connected() const;
Q_INVOKABLE quint64 networkDifficulty() const;
Q_INVOKABLE quint64 blockchainHeight() const;