diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2019-08-06 15:01:48 -0500 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2019-08-06 15:01:48 -0500 |
| commit | 5f8cb04feed650a6ee5db16244d6b75e6c896921 (patch) | |
| tree | 1aa4bd7a20d0fcf21e18bd46718634f633a47d8d /src | |
| parent | 3f06560c5196b91552c82c884c703fa841241f98 (diff) | |
| parent | 2d72f55e57ace903d705cf617f305f366cf5665e (diff) | |
| download | monzero-gui-5f8cb04feed650a6ee5db16244d6b75e6c896921.tar.gz monzero-gui-5f8cb04feed650a6ee5db16244d6b75e6c896921.tar.xz monzero-gui-5f8cb04feed650a6ee5db16244d6b75e6c896921.zip | |
Merge pull request #2221
2d72f55 device: show address on device display (ph4r05)
Diffstat (limited to 'src')
| -rw-r--r-- | src/libwalletqt/Wallet.cpp | 12 | ||||
| -rw-r--r-- | src/libwalletqt/Wallet.h | 5 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp index 90172d15..0d7ca68c 100644 --- a/src/libwalletqt/Wallet.cpp +++ b/src/libwalletqt/Wallet.cpp @@ -253,6 +253,11 @@ void Wallet::initAsync(const QString &daemonAddress, quint64 upperTransactionLim }); } +bool Wallet::isHwBacked() const +{ + return m_walletImpl->getDeviceType() != Monero::Wallet::Device_Software; +} + //! create a view only wallet bool Wallet::createViewOnly(const QString &path, const QString &password) const { @@ -335,6 +340,13 @@ void Wallet::setSubaddressLabel(quint32 accountIndex, quint32 addressIndex, cons { m_walletImpl->setSubaddressLabel(accountIndex, addressIndex, label.toStdString()); } +void Wallet::deviceShowAddressAsync(quint32 accountIndex, quint32 addressIndex, const QString &paymentId) +{ + m_scheduler.run([this, accountIndex, addressIndex, paymentId] { + m_walletImpl->deviceShowAddress(accountIndex, addressIndex, paymentId.toStdString()); + emit deviceShowAddressShowed(); + }); +} void Wallet::refreshHeightAsync() { diff --git a/src/libwalletqt/Wallet.h b/src/libwalletqt/Wallet.h index 15da7a80..cbff25df 100644 --- a/src/libwalletqt/Wallet.h +++ b/src/libwalletqt/Wallet.h @@ -179,6 +179,10 @@ public: Q_INVOKABLE void addSubaddress(const QString& label); Q_INVOKABLE QString getSubaddressLabel(quint32 accountIndex, quint32 addressIndex) const; Q_INVOKABLE void setSubaddressLabel(quint32 accountIndex, quint32 addressIndex, const QString &label); + Q_INVOKABLE void deviceShowAddressAsync(quint32 accountIndex, quint32 addressIndex, const QString &paymentId); + + //! hw-device backed wallets + Q_INVOKABLE bool isHwBacked() const; //! returns if view only wallet Q_INVOKABLE bool viewOnly() const; @@ -353,6 +357,7 @@ signals: void deviceButtonPressed(); void transactionCommitted(bool status, PendingTransaction *t, const QStringList& txid); void heightRefreshed(quint64 walletHeight, quint64 daemonHeight, quint64 targetHeight) const; + void deviceShowAddressShowed(); // emitted when transaction is created async void transactionCreated(PendingTransaction * transaction, QString address, QString paymentId, quint32 mixinCount); |
