#include "sendcoinsdialog.h"
#include "ui_sendcoinsdialog.h"
#include "walletmodel.h"
+#include "addresstablemodel.h"
#include "guiutil.h"
#include "addressbookpage.h"
{
ui->setupUi(this);
#if QT_VERSION >= 0x040700
+ ui->payTo->setPlaceholderText(tr("Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"));
ui->addAsLabel->setPlaceholderText(tr("Enter a label for this address to add it to your address book"));
#endif
+
GUIUtil::setupAddressWidget(ui->payTo, this);
// Set initial send-to address if provided
void SendCoinsDialog::on_addressBookButton_clicked()
{
- AddressBookPage dlg(AddressBookPage::ForSending, AddressBookPage::SendingTab);
+ AddressBookPage dlg(AddressBookPage::ForSending, AddressBookPage::SendingTab, this);
dlg.setModel(model->getAddressTableModel());
- dlg.exec();
- ui->payTo->setText(dlg.getReturnValue());
- ui->payAmount->setFocus();
+ if(dlg.exec())
+ {
+ ui->payTo->setText(dlg.getReturnValue());
+ ui->payAmount->setFocus();
+ }
}
void SendCoinsDialog::on_buttonBox_rejected()
void SendCoinsDialog::on_payTo_textChanged(const QString &address)
{
- ui->addAsLabel->setText(model->labelForAddress(address));
+ ui->addAsLabel->setText(model->getAddressTableModel()->labelForAddress(address));
}
void SendCoinsDialog::clear()
ui->addAsLabel->setText(QString());
ui->payAmount->setText(QString());
ui->payTo->setFocus();
+ ui->sendButton->setDefault(true);
}
void SendCoinsDialog::reject()