Skip to content

Commit

Permalink
[GUI] Send, add new entry validation.
Browse files Browse the repository at this point in the history
  • Loading branch information
furszy committed Sep 6, 2019
1 parent 97546ad commit 2719ddf
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/qt/pivx/send.cpp
Expand Up @@ -266,7 +266,13 @@ void SendWidget::onUriParsed(SendCoinsRecipient rcp){
}

void SendWidget::onAddEntryClicked(){
// TODO: Validations here..
// Check prev valid entries before add a new one.
for (SendMultiRow* entry : entries){
if(!entry || !entry->validate()) {
inform(tr("Invalid entry, previous entries must be valid before add a new one"));
return;
}
}
addEntry();
}

Expand All @@ -285,15 +291,13 @@ void SendWidget::onSendClicked(){

for (SendMultiRow* entry : entries){
// TODO: Check what is the UTXO splitter here..

// Validate send..
if(entry && entry->validate()) {
recipients.append(entry->getValue());
}else{
inform(tr("Invalid entry"));
return;
}

}

if (recipients.isEmpty()) {
Expand Down Expand Up @@ -356,7 +360,6 @@ bool SendWidget::send(QList<SendCoinsRecipient> recipients){
inform(tr("Transaction sent"));
return true;
}

}

dialog->deleteLater();
Expand Down Expand Up @@ -778,7 +781,6 @@ void SendWidget::resizeMenu(){
menuContacts->resizeList(width, menuContacts->height());
menuContacts->resize(width, menuContacts->height());
QPoint pos = focusedEntry->getEditLineRect().bottomLeft();
// TODO: Change this position..
pos.setX(pos.x() + 20);
pos.setY(pos.y() + ((focusedEntry->getEditHeight() - 12) * 3));
menuContacts->move(pos);
Expand Down

0 comments on commit 2719ddf

Please sign in to comment.