Qt: remove "new" button during receive-mode in addressbook

pull/12721/head
Jonas Schnelli 7 years ago
parent 00d1680498
commit d843db7733
No known key found for this signature in database
GPG Key ID: 1EB776BB03C7922D

@ -104,10 +104,12 @@ AddressBookPage::AddressBookPage(const PlatformStyle *platformStyle, Mode _mode,
case SendingTab: case SendingTab:
ui->labelExplanation->setText(tr("These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.")); ui->labelExplanation->setText(tr("These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins."));
ui->deleteAddress->setVisible(true); ui->deleteAddress->setVisible(true);
ui->newAddress->setVisible(true);
break; break;
case ReceivingTab: case ReceivingTab:
ui->labelExplanation->setText(tr("These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.")); ui->labelExplanation->setText(tr("These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction."));
ui->deleteAddress->setVisible(false); ui->deleteAddress->setVisible(false);
ui->newAddress->setVisible(false);
break; break;
} }
@ -211,10 +213,11 @@ void AddressBookPage::on_newAddress_clicked()
if(!model) if(!model)
return; return;
EditAddressDialog dlg( if (tab == ReceivingTab) {
tab == SendingTab ? return;
EditAddressDialog::NewSendingAddress : }
EditAddressDialog::NewReceivingAddress, this);
EditAddressDialog dlg(EditAddressDialog::NewSendingAddress, this);
dlg.setModel(model); dlg.setModel(model);
if(dlg.exec()) if(dlg.exec())
{ {

@ -26,10 +26,6 @@ EditAddressDialog::EditAddressDialog(Mode _mode, QWidget *parent) :
switch(mode) switch(mode)
{ {
case NewReceivingAddress:
setWindowTitle(tr("New receiving address"));
ui->addressEdit->setEnabled(false);
break;
case NewSendingAddress: case NewSendingAddress:
setWindowTitle(tr("New sending address")); setWindowTitle(tr("New sending address"));
break; break;
@ -74,10 +70,9 @@ bool EditAddressDialog::saveCurrentRow()
switch(mode) switch(mode)
{ {
case NewReceivingAddress:
case NewSendingAddress: case NewSendingAddress:
address = model->addRow( address = model->addRow(
mode == NewSendingAddress ? AddressTableModel::Send : AddressTableModel::Receive, AddressTableModel::Send,
ui->labelEdit->text(), ui->labelEdit->text(),
ui->addressEdit->text(), ui->addressEdit->text(),
g_address_type); g_address_type);

@ -25,7 +25,6 @@ class EditAddressDialog : public QDialog
public: public:
enum Mode { enum Mode {
NewReceivingAddress,
NewSendingAddress, NewSendingAddress,
EditReceivingAddress, EditReceivingAddress,
EditSendingAddress EditSendingAddress

Loading…
Cancel
Save