Fix bug with open trades row selection (#238)

This commit is contained in:
Manfred Karrer 2014-10-27 01:32:00 +01:00
parent 52da080f22
commit 008ae0ef52
3 changed files with 6 additions and 17 deletions

View File

@ -188,10 +188,6 @@ class PendingTradesModel extends UIModel {
trade.faultProperty().addListener(faultChangeListener);
fault.set(trade.faultProperty().get());
if (closedTrade != null) {
list.removeIf(e -> e.getTrade().getId().equals(closedTrade.getId()));
}
}
else {
txId.set(null);
@ -207,18 +203,16 @@ class PendingTradesModel extends UIModel {
tradeManager.fiatPaymentReceived(getTrade().getId());
}
void removePendingTrade() {
if (closedTrade != null) {
list.removeIf(e -> e.getTrade().getId().equals(closedTrade.getId()));
}
}
void withdraw(String toAddress) {
FutureCallback<Transaction> callback = new FutureCallback<Transaction>() {
@Override
public void onSuccess(@javax.annotation.Nullable Transaction transaction) {
if (transaction != null) {
log.info("onWithdraw onSuccess tx ID:" + transaction.getHashAsString());
if (closedTrade != null) {
list.removeIf(e -> e.getTrade().getId().equals(closedTrade.getId()));
}
}
}

View File

@ -133,10 +133,6 @@ public class PendingTradesPM extends PresentationModel<PendingTradesModel> {
model.fiatPaymentReceived();
}
void removePendingTrade() {
model.removePendingTrade();
}
void withdraw(String withdrawToAddress) {
// TODO address validation
if (withdrawToAddress != null && withdrawToAddress.length() > 0)

View File

@ -107,12 +107,12 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
setVolumeColumnCellFactory();
setDateColumnCellFactory();
scrollPane.vvalueProperty().addListener((ov, oldValue, newValue) -> {
/* scrollPane.vvalueProperty().addListener((ov, oldValue, newValue) -> {
log.debug("#### vvalueProperty " + newValue);
});
scrollPane.viewportBoundsProperty().addListener((ov, oldValue, newValue) -> {
log.debug("#### viewportBoundsProperty " + newValue);
});
});*/
table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
table.setPlaceholder(new Label("No pending trades available"));
@ -206,7 +206,6 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
@FXML
public void onWithdraw() {
setSummaryControlsVisible(false);
presentationModel.removePendingTrade();
presentationModel.withdraw(withdrawAddressTextField.getText());
Platform.runLater(() ->
navigation.navigationTo(Navigation.Item.MAIN, Navigation.Item.PORTFOLIO,