use real ParseMoney function to parse input to Send dialog
This commit is contained in:
parent
dd8e82f797
commit
0eba00447e
1 changed files with 7 additions and 3 deletions
|
@ -8,7 +8,9 @@
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
#include "util.h"
|
||||||
#include "base58.h"
|
#include "base58.h"
|
||||||
|
|
||||||
SendCoinsDialog::SendCoinsDialog(QWidget *parent, const QString &address) :
|
SendCoinsDialog::SendCoinsDialog(QWidget *parent, const QString &address) :
|
||||||
|
@ -42,7 +44,7 @@ void SendCoinsDialog::on_sendButton_clicked()
|
||||||
{
|
{
|
||||||
QByteArray payTo = ui->payTo->text().toUtf8();
|
QByteArray payTo = ui->payTo->text().toUtf8();
|
||||||
uint160 payToHash = 0;
|
uint160 payToHash = 0;
|
||||||
double payAmount = 0.0;
|
int64 payAmount = 0.0;
|
||||||
bool valid = false;
|
bool valid = false;
|
||||||
|
|
||||||
if(!AddressToHash160(payTo.constData(), payToHash))
|
if(!AddressToHash160(payTo.constData(), payToHash))
|
||||||
|
@ -54,8 +56,9 @@ void SendCoinsDialog::on_sendButton_clicked()
|
||||||
ui->payTo->setFocus();
|
ui->payTo->setFocus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
payAmount = QLocale::system().toDouble(ui->payAmount->text(), &valid);
|
valid = ParseMoney(ui->payAmount->text().toStdString(), payAmount);
|
||||||
if(!valid || payAmount <= 0.0)
|
|
||||||
|
if(!valid || payAmount <= 0)
|
||||||
{
|
{
|
||||||
QMessageBox::warning(this, tr("Warning"),
|
QMessageBox::warning(this, tr("Warning"),
|
||||||
tr("The amount to pay must be a valid number larger than 0."),
|
tr("The amount to pay must be a valid number larger than 0."),
|
||||||
|
@ -64,6 +67,7 @@ void SendCoinsDialog::on_sendButton_clicked()
|
||||||
ui->payAmount->setFocus();
|
ui->payAmount->setFocus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
qDebug() << "Pay " << payAmount;
|
||||||
|
|
||||||
/* TODO: send command to core, once this succeeds do accept() */
|
/* TODO: send command to core, once this succeeds do accept() */
|
||||||
accept();
|
accept();
|
||||||
|
|
Loading…
Add table
Reference in a new issue