#endif
#if QT_VERSION >= 0x040700
- ui->payTo->setPlaceholderText(tr("Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)"));
+ ui->payTo->setPlaceholderText(tr("Enter a NovaCoin address (e.g. 4Zo1ga6xuKuQ7JV7M9rGDoxdbYwV5zgQJ5)"));
ui->addAsLabel->setPlaceholderText(tr("Enter a label for this address to add it to your address book"));
#endif
setFocusPolicy(Qt::TabFocus);
void SendCoinsEntry::on_addressBookButton_clicked()
{
+ if(!model)
+ return;
AddressBookPage dlg(AddressBookPage::ForSending, AddressBookPage::SendingTab, this);
dlg.setModel(model->getAddressTableModel());
if(dlg.exec())
void SendCoinsEntry::on_payTo_textChanged(const QString &address)
{
- ui->addAsLabel->setText(model->getAddressTableModel()->labelForAddress(address));
+ if(!model)
+ return;
+ // Fill in label from address book, if address has an associated label
+ QString associatedLabel = model->getAddressTableModel()->labelForAddress(address);
+ if(!associatedLabel.isEmpty())
+ ui->addAsLabel->setText(associatedLabel);
}
void SendCoinsEntry::setModel(WalletModel *model)
{
this->model = model;
+ clear();
}
void SendCoinsEntry::setRemoveEnabled(bool enabled)
ui->addAsLabel->clear();
ui->payAmount->clear();
ui->payTo->setFocus();
- if(model)
+ if(model && model->getOptionsModel())
{
ui->payAmount->setDisplayUnit(model->getOptionsModel()->getDisplayUnit());
}
return ui->payTo->text().isEmpty();
}
+void SendCoinsEntry::setFocus()
+{
+ ui->payTo->setFocus();
+}
+