aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo.monero <moneromooo.monero@users.noreply.github.com>2016-11-24 11:14:46 +0000
committermoneromooo.monero <moneromooo.monero@users.noreply.github.com>2016-11-29 12:36:53 +0000
commit87d07515a8570caaad0eeda7e74152e67ab7db45 (patch)
tree250b15fffc741896bfb5ea68bed19be6d9f9b769
parentaf4e49cd0f4b871ae15a1793232e3a81d85e3126 (diff)
downloadmonzero-gui-87d07515a8570caaad0eeda7e74152e67ab7db45.tar.gz
monzero-gui-87d07515a8570caaad0eeda7e74152e67ab7db45.tar.xz
monzero-gui-87d07515a8570caaad0eeda7e74152e67ab7db45.zip
libwalletqt: add a few daemon read access routines
-rw-r--r--main.qml2
-rw-r--r--src/libwalletqt/WalletManager.cpp30
-rw-r--r--src/libwalletqt/WalletManager.h8
3 files changed, 40 insertions, 0 deletions
diff --git a/main.qml b/main.qml
index 5f28e415..3f4e4aea 100644
--- a/main.qml
+++ b/main.qml
@@ -176,6 +176,8 @@ ApplicationWindow {
}
+ walletManager.setDaemonAddress(persistentSettings.daemon_address)
+
// wallet already opened with wizard, we just need to initialize it
if (typeof wizard.settings['wallet'] !== 'undefined') {
console.log("using wizard wallet")
diff --git a/src/libwalletqt/WalletManager.cpp b/src/libwalletqt/WalletManager.cpp
index de800776..a5f4818a 100644
--- a/src/libwalletqt/WalletManager.cpp
+++ b/src/libwalletqt/WalletManager.cpp
@@ -174,6 +174,36 @@ QString WalletManager::checkPayment(const QString &address, const QString &txid,
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)
{
Bitmonero::WalletManagerFactory::setLogLevel(logLevel);
diff --git a/src/libwalletqt/WalletManager.h b/src/libwalletqt/WalletManager.h
index 8e63050a..687008e9 100644
--- a/src/libwalletqt/WalletManager.h
+++ b/src/libwalletqt/WalletManager.h
@@ -13,6 +13,7 @@ namespace Bitmonero {
class WalletManager : public QObject
{
Q_OBJECT
+ Q_PROPERTY(bool connected READ connected)
public:
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 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
Q_INVOKABLE QString urlToLocalPath(const QUrl &url) const;
Q_INVOKABLE QUrl localPathToUrl(const QString &path) const;