aboutsummaryrefslogtreecommitdiff
path: root/src/libwalletqt
diff options
context:
space:
mode:
authorJaquee <jaquee.monero@gmail.com>2017-01-04 17:25:22 +0100
committerJaquee <jaquee.monero@gmail.com>2017-01-15 12:32:25 +0100
commitfd983955b4dbdbd612fbdf5ed08d8c8a049fb840 (patch)
tree998ef5867e5439aa96c19439c1fe65eb244d51cb /src/libwalletqt
parent8f56e9839739c8b0d821b1b38c06e458a1ab6d06 (diff)
downloadmonzero-gui-fd983955b4dbdbd612fbdf5ed08d8c8a049fb840.tar.gz
monzero-gui-fd983955b4dbdbd612fbdf5ed08d8c8a049fb840.tar.xz
monzero-gui-fd983955b4dbdbd612fbdf5ed08d8c8a049fb840.zip
view only wallets
wizard: fix dots on pw page wizard: fix focus on pw field viewOnly: added success message
Diffstat (limited to 'src/libwalletqt')
-rw-r--r--src/libwalletqt/Wallet.cpp14
-rw-r--r--src/libwalletqt/Wallet.h8
2 files changed, 21 insertions, 1 deletions
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;