6#include <qt/forms/ui_editaddressdialog.h>
11#include <QDataWidgetMapper>
16 mode(_mode), model(nullptr) {
23 setWindowTitle(tr(
"New sending address"));
26 setWindowTitle(tr(
"Edit receiving address"));
27 ui->addressEdit->setEnabled(
false);
30 setWindowTitle(tr(
"Edit sending address"));
34 mapper =
new QDataWidgetMapper(
this);
35 mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit);
39 &EditAddressDialog::reject);
40 mapper->setItemDelegate(delegate);
61 mapper->setCurrentIndex(row);
99 QMessageBox::warning(
this, windowTitle(),
100 tr(
"The entered address \"%1\" is not a "
101 "valid Bitcoin address.")
102 .arg(
ui->addressEdit->text()),
103 QMessageBox::Ok, QMessageBox::Ok);
106 QMessageBox::warning(
this, windowTitle(),
108 QMessageBox::Ok, QMessageBox::Ok);
111 QMessageBox::critical(
this, windowTitle(),
112 tr(
"Could not unlock wallet."),
113 QMessageBox::Ok, QMessageBox::Ok);
116 QMessageBox::critical(
this, windowTitle(),
117 tr(
"New key generation failed."),
118 QMessageBox::Ok, QMessageBox::Ok);
127 QString dup_address =
ui->addressEdit->text();
131 if (existing_purpose ==
"receive" &&
133 return tr(
"Address \"%1\" already exists as a receiving address with "
135 "\"%2\" and so cannot be added as a sending address.")
137 .arg(existing_label);
139 return tr(
"The entered address \"%1\" is already in the address book with "
142 .arg(existing_label);
151 ui->addressEdit->setText(_address);
Qt model of the address book in the core.
OutputType GetDefaultAddressType() const
EditStatus getEditStatus() const
@ WALLET_UNLOCK_FAILURE
Wallet could not be unlocked to create new receiving address.
@ NO_CHANGES
No changes were made during edit operation.
@ INVALID_ADDRESS
Unparseable address.
@ KEY_GENERATION_FAILURE
Generating a new public key for a receiving address failed.
@ DUPLICATE_ADDRESS
Address already in address book.
@ Address
Bitcoin address.
@ Label
User specified label.
static const QString Send
Specifies send address.
QString addRow(const QString &type, const QString &label, const QString &address, const OutputType address_type)
QString purposeForAddress(const QString &address) const
Look up purpose for address in address book, if not found return empty string.
QString labelForAddress(const QString &address) const
Look up label for address in address book, if not found return empty string.
Dialog for editing an address and associated information.
Ui::EditAddressDialog * ui
EditAddressDialog(Mode mode, QWidget *parent=nullptr)
QString getDuplicateAddressWarning() const
Return a descriptive string when adding an already-existing address fails.
void setModel(AddressTableModel *model)
QDataWidgetMapper * mapper
AddressTableModel * model
void setAddress(const QString &address)
QString getAddress() const
void handleCloseWindowShortcut(QWidget *w)
void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent)