Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UI] Send screen, total amounts refresh after custom options cleaned. #999

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/coincontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class CCoinControl

bool HasSelected() const
{
return (setSelected.size() > 0);
return (!setSelected.empty());
}

bool IsSelected(const uint256& hash, unsigned int n) const
Expand Down
10 changes: 6 additions & 4 deletions src/qt/pivx/send.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ SendWidget::SendWidget(PIVXGUI* parent) :
connect(ui->btnCoinControl, SIGNAL(clicked()), this, SLOT(onCoinControlClicked()));
connect(ui->btnChangeAddress, SIGNAL(clicked()), this, SLOT(onChangeAddressClicked()));
connect(ui->btnUri, SIGNAL(clicked()), this, SLOT(onOpenUriClicked()));
connect(ui->pushButtonReset, SIGNAL(clicked()), this, SLOT(onResetCustomOptions()));
connect(ui->pushButtonReset, &QPushButton::clicked, [this](){ onResetCustomOptions(true); });

setCssProperty(ui->coinWidget, "container-coin-type");
setCssProperty(ui->labelLine, "container-divider");
Expand Down Expand Up @@ -221,18 +221,21 @@ void SendWidget::loadWalletModel() {
}

void SendWidget::clearAll(){
onResetCustomOptions();
onResetCustomOptions(false);
if(customFeeDialog) customFeeDialog->clear();
ui->pushButtonFee->setText(tr("Customize Fee"));
if(walletModel) walletModel->setWalletDefaultFee();
clearEntries();
refreshAmounts();
}

void SendWidget::onResetCustomOptions(){
void SendWidget::onResetCustomOptions(bool fRefreshAmounts){
CoinControlDialog::coinControl->SetNull();
ui->btnChangeAddress->setActive(false);
ui->btnCoinControl->setActive(false);
if (fRefreshAmounts) {
refreshAmounts();
}
}

void SendWidget::clearEntries(){
Expand Down Expand Up @@ -365,7 +368,6 @@ bool SendWidget::send(QList<SendCoinsRecipient> recipients){
processSendCoinsReturn(sendStatus);

if (sendStatus.status == WalletModel::OK) {
CoinControlDialog::coinControl->UnSelectAll();
clearAll();
inform(tr("Transaction sent"));
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/qt/pivx/send.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private slots:
void refreshView();
void onContactMultiClicked();
void onDeleteClicked();
void onResetCustomOptions();
void onResetCustomOptions(bool fRefreshAmounts);
private:
Ui::send *ui;
QPushButton *coinIcon;
Expand Down