support moving trades to failed trades with right click (#1978)

This commit is contained in:
woodser 2025-09-26 00:03:14 -04:00 committed by GitHub
parent 518ebaff88
commit 4ca05692dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -239,7 +239,15 @@ public class PendingTradesView extends ActivatableViewAndModel<VBox, PendingTrad
log.warn("Unable to get offerPayload - {}", e.toString());
}
});
rowMenu.getItems().add(duplicateItem);
MenuItem moveToFailedItem = new MenuItem(Res.get("portfolio.pending.failedTrade.moveTradeToFailedIcon.tooltip"));
moveToFailedItem.setOnAction((event) -> {
if (isMaybeInvalidTrade(row.getItem().getTrade())) {
onMoveInvalidTradeToFailedTrades(row.getItem().getTrade());
} else {
model.dataModel.tradeManager.onMoveInvalidTradeToFailedTrades(row.getItem().getTrade());
}
});
rowMenu.getItems().addAll(duplicateItem, moveToFailedItem);
row.contextMenuProperty().bind(
Bindings.when(Bindings.isNotNull(row.itemProperty()))
.then(rowMenu)