Skip to content

Commit

Permalink
Add cancel button to SelectDepositTxPopup
Browse files Browse the repository at this point in the history
  • Loading branch information
ManfredKarrer committed Jan 18, 2016
1 parent 2e363a3 commit 276e02e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,12 @@ private void tryOpenDispute(boolean isSupportTicket) {
if (candidates.size() == 1)
doOpenDispute(isSupportTicket, candidates.get(0));
else if (candidates.size() > 1)
new SelectDepositTxPopup().transactions(candidates).onSelect(transaction -> {
doOpenDispute(isSupportTicket, transaction);
}).show();
new SelectDepositTxPopup().transactions(candidates)
.onSelect(transaction -> {
doOpenDispute(isSupportTicket, transaction);
})
.closeButtonText("Cancel")
.show();
else
log.error("Trade.depositTx is null and we did not find any MultiSig transaction.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import io.bitsquare.common.util.Tuple2;
import javafx.collections.FXCollections;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
import javafx.scene.control.Label;
import javafx.util.StringConverter;
Expand All @@ -37,7 +36,6 @@

public class SelectDepositTxPopup extends Popup {
private static final Logger log = LoggerFactory.getLogger(SelectDepositTxPopup.class);
private Button emptyWalletButton;
private ComboBox<Transaction> transactionsComboBox;
private List<Transaction> transaction;
private Optional<Consumer<Transaction>> selectHandlerOptional;
Expand All @@ -59,6 +57,7 @@ public SelectDepositTxPopup show() {
createGridPane();
addHeadLine();
addContent();
addCloseButton();
createPopup();
return this;
}
Expand Down Expand Up @@ -86,6 +85,7 @@ private void addContent() {

Tuple2<Label, ComboBox> tuple = addLabelComboBox(gridPane, ++rowIndex);
transactionsComboBox = tuple.second;
transactionsComboBox.setPromptText("Select deposit transaction");
transactionsComboBox.setConverter(new StringConverter<Transaction>() {
@Override
public String toString(Transaction transaction) {
Expand All @@ -100,6 +100,7 @@ public Transaction fromString(String string) {
transactionsComboBox.setItems(FXCollections.observableArrayList(transaction));
transactionsComboBox.setOnAction(event -> {
selectHandlerOptional.get().accept(transactionsComboBox.getSelectionModel().getSelectedItem());
hide();
});
}

Expand Down

0 comments on commit 276e02e

Please sign in to comment.