From fd983955b4dbdbd612fbdf5ed08d8c8a049fb840 Mon Sep 17 00:00:00 2001 From: Jaquee Date: Wed, 4 Jan 2017 17:25:22 +0100 Subject: view only wallets wizard: fix dots on pw page wizard: fix focus on pw field viewOnly: added success message --- src/libwalletqt/Wallet.cpp | 14 ++++++++++++++ src/libwalletqt/Wallet.h | 8 +++++++- 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'src/libwalletqt') diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp index 47f4a06a..b39851dc 100644 --- a/src/libwalletqt/Wallet.cpp +++ b/src/libwalletqt/Wallet.cpp @@ -158,6 +158,15 @@ void Wallet::initAsync(const QString &daemonAddress, quint64 upperTransactionLim m_walletImpl->initAsync(daemonAddress.toStdString(), upperTransactionLimit); } +//! create a view only wallet +bool Wallet::createViewOnly(const QString &path, const QString &password) const +{ + // Create path + QDir d = QFileInfo(path).absoluteDir(); + d.mkpath(d.absolutePath()); + return m_walletImpl->createWatchOnly(path.toStdString(),password.toStdString(),m_walletImpl->getSeedLanguage()); +} + bool Wallet::connectToDaemon() { return m_walletImpl->connectToDaemon(); @@ -168,6 +177,11 @@ void Wallet::setTrustedDaemon(bool arg) m_walletImpl->setTrustedDaemon(arg); } +bool Wallet::viewOnly() const +{ + return m_walletImpl->watchOnly(); +} + quint64 Wallet::balance() const { return m_walletImpl->balance(); diff --git a/src/libwalletqt/Wallet.h b/src/libwalletqt/Wallet.h index 63d3b1a3..e4ff026b 100644 --- a/src/libwalletqt/Wallet.h +++ b/src/libwalletqt/Wallet.h @@ -36,7 +36,7 @@ class Wallet : public QObject Q_PROPERTY(QString path READ path) Q_PROPERTY(AddressBookModel * addressBookModel READ addressBookModel) Q_PROPERTY(AddressBook * addressBook READ addressBook) - + Q_PROPERTY(bool viewOnly READ viewOnly) public: @@ -98,6 +98,9 @@ public: //! initializes wallet asynchronously Q_INVOKABLE void initAsync(const QString &daemonAddress, quint64 upperTransactionLimit, bool isRecovering = false, quint64 restoreHeight = 0); + //! create a view only wallet + Q_INVOKABLE bool createViewOnly(const QString &path, const QString &password) const; + //! connects to daemon Q_INVOKABLE bool connectToDaemon(); @@ -110,6 +113,9 @@ public: //! returns unlocked balance Q_INVOKABLE quint64 unlockedBalance() const; + //! returns if view only wallet + Q_INVOKABLE bool viewOnly() const; + //! returns current wallet's block height //! (can be less than daemon's blockchain height when wallet sync in progress) Q_INVOKABLE quint64 blockChainHeight() const; -- cgit v1.2.3