mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-25 20:15:54 +00:00
libwalletqt: add a few daemon read access routines
This commit is contained in:
parent
af4e49cd0f
commit
87d07515a8
3 changed files with 40 additions and 0 deletions
2
main.qml
2
main.qml
|
@ -176,6 +176,8 @@ ApplicationWindow {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
walletManager.setDaemonAddress(persistentSettings.daemon_address)
|
||||||
|
|
||||||
// wallet already opened with wizard, we just need to initialize it
|
// wallet already opened with wizard, we just need to initialize it
|
||||||
if (typeof wizard.settings['wallet'] !== 'undefined') {
|
if (typeof wizard.settings['wallet'] !== 'undefined') {
|
||||||
console.log("using wizard wallet")
|
console.log("using wizard wallet")
|
||||||
|
|
|
@ -174,6 +174,36 @@ QString WalletManager::checkPayment(const QString &address, const QString &txid,
|
||||||
return QString::fromStdString(result);
|
return QString::fromStdString(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WalletManager::setDaemonAddress(const QString &address)
|
||||||
|
{
|
||||||
|
m_pimpl->setDaemonAddress(address.toStdString());
|
||||||
|
}
|
||||||
|
|
||||||
|
bool WalletManager::connected() const
|
||||||
|
{
|
||||||
|
return m_pimpl->connected();
|
||||||
|
}
|
||||||
|
|
||||||
|
quint64 WalletManager::networkDifficulty() const
|
||||||
|
{
|
||||||
|
return m_pimpl->networkDifficulty();
|
||||||
|
}
|
||||||
|
|
||||||
|
quint64 WalletManager::blockchainHeight() const
|
||||||
|
{
|
||||||
|
return m_pimpl->blockchainHeight();
|
||||||
|
}
|
||||||
|
|
||||||
|
quint64 WalletManager::blockchainTargetHeight() const
|
||||||
|
{
|
||||||
|
return m_pimpl->blockchainTargetHeight();
|
||||||
|
}
|
||||||
|
|
||||||
|
double WalletManager::miningHashRate() const
|
||||||
|
{
|
||||||
|
return m_pimpl->miningHashRate();
|
||||||
|
}
|
||||||
|
|
||||||
void WalletManager::setLogLevel(int logLevel)
|
void WalletManager::setLogLevel(int logLevel)
|
||||||
{
|
{
|
||||||
Bitmonero::WalletManagerFactory::setLogLevel(logLevel);
|
Bitmonero::WalletManagerFactory::setLogLevel(logLevel);
|
||||||
|
|
|
@ -13,6 +13,7 @@ namespace Bitmonero {
|
||||||
class WalletManager : public QObject
|
class WalletManager : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
Q_PROPERTY(bool connected READ connected)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum LogLevel {
|
enum LogLevel {
|
||||||
|
@ -95,6 +96,13 @@ public:
|
||||||
|
|
||||||
Q_INVOKABLE QString checkPayment(const QString &address, const QString &txid, const QString &txkey, const QString &daemon_address) const;
|
Q_INVOKABLE QString checkPayment(const QString &address, const QString &txid, const QString &txkey, const QString &daemon_address) const;
|
||||||
|
|
||||||
|
Q_INVOKABLE void setDaemonAddress(const QString &address);
|
||||||
|
Q_INVOKABLE bool connected() const;
|
||||||
|
Q_INVOKABLE quint64 networkDifficulty() const;
|
||||||
|
Q_INVOKABLE quint64 blockchainHeight() const;
|
||||||
|
Q_INVOKABLE quint64 blockchainTargetHeight() const;
|
||||||
|
Q_INVOKABLE double miningHashRate() const;
|
||||||
|
|
||||||
// QML missing such functionality, implementing these helpers here
|
// QML missing such functionality, implementing these helpers here
|
||||||
Q_INVOKABLE QString urlToLocalPath(const QUrl &url) const;
|
Q_INVOKABLE QString urlToLocalPath(const QUrl &url) const;
|
||||||
Q_INVOKABLE QUrl localPathToUrl(const QString &path) const;
|
Q_INVOKABLE QUrl localPathToUrl(const QString &path) const;
|
||||||
|
|
Loading…
Reference in a new issue