forked from Public/monero-gui
Transfer page: validate amount
This commit is contained in:
@@ -122,17 +122,27 @@ QString WalletManager::walletLanguage(const QString &locale)
|
||||
return "English";
|
||||
}
|
||||
|
||||
QString WalletManager::displayAmount(quint64 amount)
|
||||
quint64 WalletManager::maximumAllowedAmount() const
|
||||
{
|
||||
return Bitmonero::Wallet::maximumAllowedAmount();
|
||||
}
|
||||
|
||||
QString WalletManager::maximumAllowedAmountAsSting() const
|
||||
{
|
||||
return WalletManager::displayAmount(WalletManager::maximumAllowedAmount());
|
||||
}
|
||||
|
||||
QString WalletManager::displayAmount(quint64 amount) const
|
||||
{
|
||||
return QString::fromStdString(Bitmonero::Wallet::displayAmount(amount));
|
||||
}
|
||||
|
||||
quint64 WalletManager::amountFromString(const QString &amount)
|
||||
quint64 WalletManager::amountFromString(const QString &amount) const
|
||||
{
|
||||
return Bitmonero::Wallet::amountFromString(amount.toStdString());
|
||||
}
|
||||
|
||||
quint64 WalletManager::amountFromDouble(double amount)
|
||||
quint64 WalletManager::amountFromDouble(double amount) const
|
||||
{
|
||||
return Bitmonero::Wallet::amountFromDouble(amount);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace Bitmonero {
|
||||
class WalletManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum LogLevel {
|
||||
LogLevel_Silent = Bitmonero::WalletManagerFactory::LogLevel_Silent,
|
||||
@@ -79,9 +80,13 @@ public:
|
||||
|
||||
|
||||
//! since we can't call static method from QML, move it to this class
|
||||
Q_INVOKABLE QString displayAmount(quint64 amount);
|
||||
Q_INVOKABLE quint64 amountFromString(const QString &amount);
|
||||
Q_INVOKABLE quint64 amountFromDouble(double amount);
|
||||
Q_INVOKABLE QString displayAmount(quint64 amount) const;
|
||||
Q_INVOKABLE quint64 amountFromString(const QString &amount) const;
|
||||
Q_INVOKABLE quint64 amountFromDouble(double amount) const;
|
||||
Q_INVOKABLE quint64 maximumAllowedAmount() const;
|
||||
|
||||
// QML JS engine doesn't support unsigned integers
|
||||
Q_INVOKABLE QString maximumAllowedAmountAsSting() const;
|
||||
|
||||
void setLogLevel(int logLevel);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user