mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-09 19:32:03 +02:00
Merge pull request #3010
2fd3974
WalletManager: displayAmount should be static (xiphon)
This commit is contained in:
commit
c137a6ea36
@ -75,7 +75,7 @@ void QrCodeScanner::processCode(int type, const QString &data)
|
|||||||
emit notifyError(error, true);
|
emit notifyError(error, true);
|
||||||
}
|
}
|
||||||
qDebug() << "Parsed URI : " << address << " " << payment_id << " " << amount << " " << tx_description << " " << recipient_name << " " << error;
|
qDebug() << "Parsed URI : " << address << " " << payment_id << " " << amount << " " << tx_description << " " << recipient_name << " " << error;
|
||||||
QString s_amount = WalletManager::instance()->displayAmount(amount);
|
QString s_amount = WalletManager::displayAmount(amount);
|
||||||
qDebug() << "Amount passed " << s_amount ;
|
qDebug() << "Amount passed " << s_amount ;
|
||||||
emit decoded(address, payment_id, s_amount, tx_description, recipient_name, parsed_unknown_parameters);
|
emit decoded(address, payment_id, s_amount, tx_description, recipient_name, parsed_unknown_parameters);
|
||||||
}
|
}
|
||||||
|
@ -61,14 +61,14 @@ quint64 TransactionInfo::atomicAmount() const
|
|||||||
|
|
||||||
QString TransactionInfo::displayAmount() const
|
QString TransactionInfo::displayAmount() const
|
||||||
{
|
{
|
||||||
return WalletManager::instance()->displayAmount(m_amount);
|
return WalletManager::displayAmount(m_amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString TransactionInfo::fee() const
|
QString TransactionInfo::fee() const
|
||||||
{
|
{
|
||||||
if(m_fee == 0)
|
if(m_fee == 0)
|
||||||
return "";
|
return "";
|
||||||
return WalletManager::instance()->displayAmount(m_fee);
|
return WalletManager::displayAmount(m_fee);
|
||||||
}
|
}
|
||||||
|
|
||||||
quint64 TransactionInfo::blockHeight() const
|
quint64 TransactionInfo::blockHeight() const
|
||||||
@ -132,7 +132,7 @@ QString TransactionInfo::destinations_formatted() const
|
|||||||
for (auto const& t: m_transfers) {
|
for (auto const& t: m_transfers) {
|
||||||
if (!destinations.isEmpty())
|
if (!destinations.isEmpty())
|
||||||
destinations += "<br> ";
|
destinations += "<br> ";
|
||||||
destinations += WalletManager::instance()->displayAmount(t->amount()) + ": " + t->address();
|
destinations += WalletManager::displayAmount(t->amount()) + ": " + t->address();
|
||||||
}
|
}
|
||||||
return destinations;
|
return destinations;
|
||||||
}
|
}
|
||||||
|
@ -272,7 +272,7 @@ QString WalletManager::maximumAllowedAmountAsString() const
|
|||||||
return WalletManager::displayAmount(WalletManager::maximumAllowedAmount());
|
return WalletManager::displayAmount(WalletManager::maximumAllowedAmount());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString WalletManager::displayAmount(quint64 amount) const
|
QString WalletManager::displayAmount(quint64 amount)
|
||||||
{
|
{
|
||||||
return QString::fromStdString(Monero::Wallet::displayAmount(amount));
|
return QString::fromStdString(Monero::Wallet::displayAmount(amount));
|
||||||
}
|
}
|
||||||
@ -415,7 +415,7 @@ QVariantMap WalletManager::parse_uri_to_object(const QString &uri) const
|
|||||||
if (this->parse_uri(uri, address, payment_id, amount, tx_description, recipient_name, unknown_parameters, error)) {
|
if (this->parse_uri(uri, address, payment_id, amount, tx_description, recipient_name, unknown_parameters, error)) {
|
||||||
result.insert("address", address);
|
result.insert("address", address);
|
||||||
result.insert("payment_id", payment_id);
|
result.insert("payment_id", payment_id);
|
||||||
result.insert("amount", amount > 0 ? this->displayAmount(amount) : "");
|
result.insert("amount", amount > 0 ? displayAmount(amount) : "");
|
||||||
result.insert("tx_description", tx_description);
|
result.insert("tx_description", tx_description);
|
||||||
result.insert("recipient_name", recipient_name);
|
result.insert("recipient_name", recipient_name);
|
||||||
} else {
|
} else {
|
||||||
|
@ -129,7 +129,7 @@ public:
|
|||||||
Q_INVOKABLE QString errorString() const;
|
Q_INVOKABLE QString errorString() const;
|
||||||
|
|
||||||
//! since we can't call static method from QML, move it to this class
|
//! since we can't call static method from QML, move it to this class
|
||||||
Q_INVOKABLE QString displayAmount(quint64 amount) const;
|
Q_INVOKABLE static QString displayAmount(quint64 amount);
|
||||||
Q_INVOKABLE quint64 amountFromString(const QString &amount) const;
|
Q_INVOKABLE quint64 amountFromString(const QString &amount) const;
|
||||||
Q_INVOKABLE quint64 amountFromDouble(double amount) const;
|
Q_INVOKABLE quint64 amountFromDouble(double amount) const;
|
||||||
Q_INVOKABLE quint64 maximumAllowedAmount() const;
|
Q_INVOKABLE quint64 maximumAllowedAmount() const;
|
||||||
|
Loading…
Reference in New Issue
Block a user