Added "Receive" page. Hide all pages except "Transfer" and "Receive".

This commit is contained in:
Ilya Kitaev
2016-06-26 18:04:45 +03:00
parent 88d9be953b
commit 17f38a930e
13 changed files with 359 additions and 11 deletions

View File

@@ -88,10 +88,11 @@ bool Wallet::refresh()
return result;
}
PendingTransaction *Wallet::createTransaction(const QString &dst_addr, quint64 amount, quint32 mixin_count)
PendingTransaction *Wallet::createTransaction(const QString &dst_addr, const QString &payment_id,
quint64 amount, quint32 mixin_count)
{
Bitmonero::PendingTransaction * ptImpl = m_walletImpl->createTransaction(
dst_addr.toStdString(), amount, mixin_count);
dst_addr.toStdString(), payment_id.toStdString(), amount, mixin_count);
PendingTransaction * result = new PendingTransaction(ptImpl, this);
return result;
}
@@ -112,6 +113,26 @@ TransactionHistory *Wallet::history()
}
QString Wallet::generatePaymentId() const
{
return QString::fromStdString(Bitmonero::Wallet::genPaymentId());
}
QString Wallet::integratedAddress(const QString &paymentId) const
{
return QString::fromStdString(m_walletImpl->integratedAddress(paymentId.toStdString()));
}
QString Wallet::paymentId() const
{
return m_paymentId;
}
void Wallet::setPaymentId(const QString &paymentId)
{
m_paymentId = paymentId;
}
Wallet::Wallet(Bitmonero::Wallet *w, QObject *parent)
: QObject(parent), m_walletImpl(w), m_history(nullptr)

View File

@@ -23,6 +23,7 @@ class Wallet : public QObject
Q_PROPERTY(quint64 balance READ balance)
Q_PROPERTY(quint64 unlockedBalance READ unlockedBalance)
Q_PROPERTY(TransactionHistory * history READ history)
Q_PROPERTY(QString paymentId READ paymentId WRITE setPaymentId)
public:
enum Status {
@@ -75,7 +76,7 @@ public:
Q_INVOKABLE bool refresh();
//! creates transaction
Q_INVOKABLE PendingTransaction * createTransaction(const QString &dst_addr,
Q_INVOKABLE PendingTransaction * createTransaction(const QString &dst_addr, const QString &payment_id,
quint64 amount, quint32 mixin_count);
//! deletes transaction and frees memory
@@ -84,6 +85,18 @@ public:
//! returns transaction history
TransactionHistory * history();
//! generate payment id
Q_INVOKABLE QString generatePaymentId() const;
//! integrated address
Q_INVOKABLE QString integratedAddress(const QString &paymentId) const;
//! saved payment id
QString paymentId() const;
void setPaymentId(const QString &paymentId);
// TODO: setListenter() when it implemented in API
signals:
void updated();
@@ -99,6 +112,7 @@ private:
Bitmonero::Wallet * m_walletImpl;
// history lifetime managed by wallet;
TransactionHistory * m_history;
QString m_paymentId;
};
#endif // WALLET_H