diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-07-07 17:33:15 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-07-07 17:33:15 +0200 |
commit | 3479849dc47acd2fb1e191ea690a0c507a97bb73 (patch) | |
tree | 1323c6d6a36a9e0fd63370b3dc3372939ba85543 /src/qt/sendcoinsdialog.cpp | |
parent | 5eaa1b435c144d841c9a03fb9c478ef760f22d8c (diff) |
convert to full tab-based ui
Diffstat (limited to 'src/qt/sendcoinsdialog.cpp')
-rw-r--r-- | src/qt/sendcoinsdialog.cpp | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 4b974371fe..8050baff38 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -3,7 +3,7 @@ #include "walletmodel.h" #include "guiutil.h" -#include "addressbookdialog.h" +#include "addressbookpage.h" #include "optionsmodel.h" #include <QApplication> @@ -11,6 +11,7 @@ #include <QMessageBox> #include <QLocale> #include <QDebug> +#include <QMessageBox> SendCoinsDialog::SendCoinsDialog(QWidget *parent, const QString &address) : QDialog(parent), @@ -61,6 +62,16 @@ void SendCoinsDialog::on_sendButton_clicked() // Add address to address book under label, if specified label = ui->addAsLabel->text(); + QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm send coins"), + tr("Are you sure you want to send %1 BTC to %2 (%3)?").arg(GUIUtil::formatMoney(payAmountParsed), label, ui->payTo->text()), + QMessageBox::Yes|QMessageBox::Cancel, + QMessageBox::Cancel); + + if(retval != QMessageBox::Yes) + { + return; + } + switch(model->sendCoins(ui->payTo->text(), payAmountParsed, label)) { case WalletModel::InvalidAddress: @@ -102,9 +113,8 @@ void SendCoinsDialog::on_pasteButton_clicked() void SendCoinsDialog::on_addressBookButton_clicked() { - AddressBookDialog dlg(AddressBookDialog::ForSending); + AddressBookPage dlg(AddressBookPage::ForSending, AddressBookPage::SendingTab); dlg.setModel(model->getAddressTableModel()); - dlg.setTab(AddressBookDialog::SendingTab); dlg.exec(); ui->payTo->setText(dlg.getReturnValue()); ui->payAmount->setFocus(); @@ -119,3 +129,21 @@ void SendCoinsDialog::on_payTo_textChanged(const QString &address) { ui->addAsLabel->setText(model->labelForAddress(address)); } + +void SendCoinsDialog::clear() +{ + ui->payTo->setText(QString()); + ui->addAsLabel->setText(QString()); + ui->payAmount->setText(QString()); + ui->payTo->setFocus(); +} + +void SendCoinsDialog::reject() +{ + clear(); +} + +void SendCoinsDialog::accept() +{ + clear(); +} |