9 #include "ui_sendcoinsentry.h"
18 #include <QApplication>
20 #include <QDoubleValidator>
28 setCurrentWidget(
ui->SendCoins);
32 ui->payToLayout_s->setSpacing(4);
39 connect(
ui->deleteButton, SIGNAL(clicked()),
this, SLOT(
deleteClicked()));
40 connect(
ui->deleteButton_is, SIGNAL(clicked()),
this, SLOT(
deleteClicked()));
41 connect(
ui->deleteButton_s, SIGNAL(clicked()),
this, SLOT(
deleteClicked()));
43 ui->deleteButton->setVisible(
false);
46 ui->addressBookButton->setVisible(
false);
48 QLocale lo(QLocale::C);
49 lo.setNumberOptions(QLocale::RejectGroupSeparator);
50 QDoubleValidator *dblVal =
new QDoubleValidator(0, MAX_MONEY_OUT, 8,
ui->payAmount);
51 dblVal->setNotation(QDoubleValidator::StandardNotation);
52 dblVal->setLocale(lo);
53 ui->payAmount->setValidator(dblVal);
75 ui->payAmount->setFocus();
82 ui->addAsLabel->clear();
83 ui->payAmount->clear();
107 ui->addAsLabel->clear();
108 ui->payAmount->clear();
110 ui->payTo_is->clear();
111 ui->memoTextLabel_is->clear();
112 ui->payAmount_is->clear();
114 ui->payTo_s->clear();
115 ui->memoTextLabel_s->clear();
116 ui->payAmount_s->clear();
127 static inline int64_t roundint64(
double d)
129 return (int64_t)(d > 0 ? d + 0.5 : d - 0.5);
133 double dAmount =
ui->payAmount->text().toDouble();
134 if (dAmount < 0.0 || dAmount > MAX_MONEY_OUT) {
136 msgBox.setWindowTitle(
"Invalid Amount");
137 msgBox.setText(
"Invalid amount entered. Please enter an amount less than 2.1B PRCY.");
139 msgBox.setIcon(QMessageBox::Warning);
142 CAmount nAmount = roundint64(dAmount * COIN);
157 QWidget::setTabOrder(prev,
ui->payTo);
158 QWidget::setTabOrder(
ui->payTo,
ui->addAsLabel);
160 return ui->deleteButton;
168 ui->addAsLabel->clear();
172 ui->payAmount->setText(QString::number((
double)(
recipient.
amount) / (
double)COIN,
'f', 3));
178 ui->payTo->setText(address);
179 ui->payAmount->setFocus();
184 return ui->payTo->text().isEmpty() &&
ui->payTo_is->text().isEmpty() &&
ui->payTo_s->text().isEmpty();
189 ui->payTo->setFocus();
208 if (!associatedLabel.isEmpty()) {
209 ui->addAsLabel->setText(associatedLabel);
219 else ui->payTo->setStyleSheet(
"border-color: red;");
225 else ui->payAmount->setStyleSheet(
"border-color: red;");