Write support for tx notes

Support still needs adding for displaying them in the history,
but at least they're saved in the cache now, and not ignored.
This commit is contained in:
moneromooo.monero
2016-11-05 23:19:28 +00:00
parent c9bb2f5718
commit d95e4a37cf
8 changed files with 56 additions and 9 deletions

View File

@@ -31,6 +31,15 @@ quint64 PendingTransaction::fee() const
return m_pimpl->fee();
}
QList<QString> PendingTransaction::txid() const
{
QList<QString> list;
std::vector<std::string> txid = m_pimpl->txid();
for (const auto &t: txid)
list.append(QString::fromStdString(t));
return list;
}
PendingTransaction::PendingTransaction(Bitmonero::PendingTransaction *pt, QObject *parent)
: QObject(parent), m_pimpl(pt)
{

View File

@@ -17,6 +17,7 @@ class PendingTransaction : public QObject
Q_PROPERTY(quint64 amount READ amount)
Q_PROPERTY(quint64 dust READ dust)
Q_PROPERTY(quint64 fee READ fee)
Q_PROPERTY(QList<QString> txid READ txid)
public:
enum Status {
@@ -39,6 +40,7 @@ public:
quint64 amount() const;
quint64 dust() const;
quint64 fee() const;
QList<QString> txid() const;
private:
explicit PendingTransaction(Bitmonero::PendingTransaction * pt, QObject *parent = 0);

View File

@@ -260,6 +260,15 @@ void Wallet::setPaymentId(const QString &paymentId)
m_paymentId = paymentId;
}
bool Wallet::setUserNote(const QString &txid, const QString &note)
{
return m_walletImpl->setUserNote(txid.toStdString(), note.toStdString());
}
QString Wallet::getUserNote(const QString &txid) const
{
return QString::fromStdString(m_walletImpl->getUserNote(txid.toStdString()));
}
Wallet::Wallet(Bitmonero::Wallet *w, QObject *parent)
: QObject(parent)

View File

@@ -138,6 +138,9 @@ public:
void setPaymentId(const QString &paymentId);
Q_INVOKABLE bool setUserNote(const QString &txid, const QString &note);
Q_INVOKABLE QString getUserNote(const QString &txid) const;
// TODO: setListenter() when it implemented in API
signals:
// emitted on every event happened with wallet