Skip to content

Commit

Permalink
disable removal of last output, recalculate amounts after removal of …
Browse files Browse the repository at this point in the history
…inputs/outputs
  • Loading branch information
backpacker69 committed Mar 22, 2019
1 parent 5a8849b commit 642b715
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/qt/multisigdialog.cpp
Expand Up @@ -106,15 +106,15 @@ void MultisigDialog::updateRemoveEnabled()
}


//ppcTODO - this was removed in 84b695cc9d4dc90b1ccb99e2d92e1e76e138d911
// is it still needed?
// enabled = (ui->outputs->count() > 1);
// for(int i = 0; i < ui->outputs->count(); i++)
// {
// SendCoinsEntry *entry = qobject_cast<SendCoinsEntry *>(ui->outputs->itemAt(i)->widget());
// if(entry)
// entry->setRemoveEnabled(enabled);
// }
enabled = (ui->outputs->count() > 1);
for(int i = 0; i < ui->outputs->count(); i++)
{
SendCoinsEntry *entry = qobject_cast<SendCoinsEntry *>(ui->outputs->itemAt(i)->widget());
if(entry)
entry->setRemoveEnabled(enabled);
}

updateAmounts();
}

void MultisigDialog::on_createAddressButton_clicked()
Expand Down
5 changes: 5 additions & 0 deletions src/qt/sendcoinsentry.cpp
Expand Up @@ -89,6 +89,11 @@ void SendCoinsEntry::setModel(WalletModel *_model)
clear();
}

void SendCoinsEntry::setRemoveEnabled(bool enabled)
{
ui->deleteButton->setEnabled(enabled);
}

void SendCoinsEntry::clear()
{
// clear UI elements for normal payment
Expand Down
1 change: 1 addition & 0 deletions src/qt/sendcoinsentry.h
Expand Up @@ -48,6 +48,7 @@ class SendCoinsEntry : public QStackedWidget
void setFocus();

public Q_SLOTS:
void setRemoveEnabled(bool enabled);
void clear();
void checkSubtractFeeFromAmount();

Expand Down

0 comments on commit 642b715

Please sign in to comment.