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

d843db7 Qt: remove "new" button during receive-mode in addressbook (Jonas Schnelli)

Pull request description:

  There are currently two ways how to generate new receiving addresses in the GUI (which leads to code duplication or required refactoring, see #12520).

  Since the address-book is probably something that should be removed in the long run, suppressing the new-button in receive-mode could be a first step in deprecating the address book.

  With this PR, users can still edit existing receiving address book entries and they can still create new sending address book entries.

Tree-SHA512: abe8d1b44bc3e1b53826ccf9d2b3f764264337758d95ca1fe1ef1bac72d47608cf454055fce3720e06634f0a5841a752ce643b4505b47d6e322b6fc71296e961
This commit is contained in:
Wladimir J. van der Laan 2018-03-20 09:15:08 +01:00
commit e476826338
No known key found for this signature in database
GPG Key ID: 1E4AED62986CD25D
3 changed files with 8 additions and 11 deletions

View File

@ -104,10 +104,12 @@ AddressBookPage::AddressBookPage(const PlatformStyle *platformStyle, Mode _mode,
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->deleteAddress->setVisible(true);
ui->newAddress->setVisible(true);
break;
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->deleteAddress->setVisible(false);
ui->newAddress->setVisible(false);
break;
}
@ -211,10 +213,11 @@ void AddressBookPage::on_newAddress_clicked()
if(!model)
return;
EditAddressDialog dlg(
tab == SendingTab ?
EditAddressDialog::NewSendingAddress :
EditAddressDialog::NewReceivingAddress, this);
if (tab == ReceivingTab) {
return;
}
EditAddressDialog dlg(EditAddressDialog::NewSendingAddress, this);
dlg.setModel(model);
if(dlg.exec())
{

View File

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

View File

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