Adapt dispute flow to match new design

This commit is contained in:
Christoph Atteneder 2018-11-08 17:08:51 +01:00
parent f6d8b69c90
commit d843e73b7f
No known key found for this signature in database
GPG key ID: CD5DC1C529CDFD3B
5 changed files with 120 additions and 113 deletions

View file

@ -1660,22 +1660,22 @@ Please open the download directory, shut down the application and install the ne
displayUpdateDownloadWindow.download.openDir=Open download directory
disputeSummaryWindow.title=Summary
disputeSummaryWindow.openDate=Ticket opening date:
disputeSummaryWindow.role=Trader's role:
disputeSummaryWindow.evidence=Evidence:
disputeSummaryWindow.openDate=Ticket opening date
disputeSummaryWindow.role=Trader's role
disputeSummaryWindow.evidence=Evidence
disputeSummaryWindow.evidence.tamperProof=Tamper proof evidence
disputeSummaryWindow.evidence.id=ID Verification
disputeSummaryWindow.evidence.video=Video/Screencast
disputeSummaryWindow.payout=Trade amount payout:
disputeSummaryWindow.payout=Trade amount payout
disputeSummaryWindow.payout.getsTradeAmount=BTC {0} gets trade amount payout
disputeSummaryWindow.payout.getsAll=BTC {0} gets all
disputeSummaryWindow.payout.custom=Custom payout
disputeSummaryWindow.payout.adjustAmount=Amount entered exceeds available amount of {0}.\n\
We adjust this input field to the max possible value.
disputeSummaryWindow.payoutAmount.buyer=Buyer's payout amount:
disputeSummaryWindow.payoutAmount.seller=Seller's payout amount:
disputeSummaryWindow.payoutAmount.invert=Use loser as publisher:
disputeSummaryWindow.reason=Reason of dispute:
disputeSummaryWindow.payoutAmount.buyer=Buyer's payout amount
disputeSummaryWindow.payoutAmount.seller=Seller's payout amount
disputeSummaryWindow.payoutAmount.invert=Use loser as publisher
disputeSummaryWindow.reason=Reason of dispute
disputeSummaryWindow.reason.bug=Bug
disputeSummaryWindow.reason.usability=Usability
disputeSummaryWindow.reason.protocolViolation=Protocol violation
@ -1683,7 +1683,7 @@ disputeSummaryWindow.reason.noReply=No reply
disputeSummaryWindow.reason.scam=Scam
disputeSummaryWindow.reason.other=Other
disputeSummaryWindow.reason.bank=Bank
disputeSummaryWindow.summaryNotes=Summary notes:
disputeSummaryWindow.summaryNotes=Summary notes
disputeSummaryWindow.addSummaryNotes=Add summary notes
disputeSummaryWindow.close.button=Close ticket
disputeSummaryWindow.close.msg=Ticket closed on {0}\n\n\

View file

@ -124,6 +124,7 @@ bg color of non edit textFields: fafafa
-bs-rd-separator: #DBDBDB;
-bs-rd-separator-dark: #D5E0D6;
-bs-rd-error-red: #dd0000; /* 5 usages */
-bs-rd-message-bubble: #0086C6;
-bs-red: #D73030; /* 5 usages */
-fx-box-border: -bs-rd-grey-medium-light;
@ -1501,7 +1502,7 @@ textfield */
}
#message-bubble-blue {
-fx-background-color: -fx-accent;
-fx-background-color: -bs-rd-message-bubble;
-fx-background-radius: 10 10 10 10;
}
@ -1746,8 +1747,8 @@ textfield */
}
.my-message-header {
-fx-text-fill: -fx-accent;
-fx-fill: -fx-accent;
-fx-text-fill: -bs-rd-message-bubble;
-fx-fill: -bs-rd-message-bubble;
-fx-font-size: 0.846em;
}

View file

@ -67,6 +67,8 @@ import com.google.common.io.ByteStreams;
import de.jensd.fx.fontawesome.AwesomeDude;
import de.jensd.fx.fontawesome.AwesomeIcon;
import com.jfoenix.controls.JFXTextArea;
import javafx.stage.FileChooser;
import javafx.scene.Scene;
@ -121,6 +123,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@ -257,10 +260,10 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
TableColumn<Dispute, Dispute> stateColumn = getStateColumn();
tableView.getColumns().add(stateColumn);
tradeIdColumn.setComparator((o1, o2) -> o1.getTradeId().compareTo(o2.getTradeId()));
dateColumn.setComparator((o1, o2) -> o1.getOpeningDate().compareTo(o2.getOpeningDate()));
buyerOnionAddressColumn.setComparator((o1, o2) -> getBuyerOnionAddressColumnLabel(o1).compareTo(getBuyerOnionAddressColumnLabel(o2)));
sellerOnionAddressColumn.setComparator((o1, o2) -> getSellerOnionAddressColumnLabel(o1).compareTo(getSellerOnionAddressColumnLabel(o2)));
tradeIdColumn.setComparator(Comparator.comparing(Dispute::getTradeId));
dateColumn.setComparator(Comparator.comparing(Dispute::getOpeningDate));
buyerOnionAddressColumn.setComparator(Comparator.comparing(this::getBuyerOnionAddressColumnLabel));
sellerOnionAddressColumn.setComparator(Comparator.comparing(this::getSellerOnionAddressColumnLabel));
marketColumn.setComparator((o1, o2) -> formatter.getCurrencyPair(o1.getContract().getOfferPayload().getCurrencyCode()).compareTo(o2.getContract().getOfferPayload().getCurrencyCode()));
dateColumn.setSortType(TableColumn.SortType.DESCENDING);
@ -282,7 +285,7 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
keyEventEventHandler = event -> {
if (Utilities.isAltOrCtrlPressed(KeyCode.L, event)) {
Map<String, List<Dispute>> map = new HashMap<>();
disputeManager.getDisputesAsObservableList().stream().forEach(dispute -> {
disputeManager.getDisputesAsObservableList().forEach(dispute -> {
String tradeId = dispute.getTradeId();
List<Dispute> list;
if (!map.containsKey(tradeId))
@ -292,13 +295,13 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
list.add(dispute);
});
List<List<Dispute>> disputeGroups = new ArrayList<>();
map.entrySet().stream().forEach(entry -> disputeGroups.add(entry.getValue()));
map.forEach((key, value) -> disputeGroups.add(value));
disputeGroups.sort((o1, o2) -> !o1.isEmpty() && !o2.isEmpty() ? o1.get(0).getOpeningDate().compareTo(o2.get(0).getOpeningDate()) : 0);
StringBuilder stringBuilder = new StringBuilder();
// We don't translate that as it is not intended for the public
stringBuilder.append("Summary of all disputes (No. of disputes: ").append(disputeGroups.size()).append(")\n\n");
disputeGroups.stream().forEach(disputeGroup -> {
disputeGroups.forEach(disputeGroup -> {
Dispute dispute0 = disputeGroup.get(0);
stringBuilder.append("##########################################################################################/\n")
.append("## Trade ID: ")
@ -317,14 +320,14 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
}
stringBuilder.append("##########################################################################################/\n")
.append("\n");
disputeGroup.stream().forEach(dispute -> {
disputeGroup.forEach(dispute -> {
stringBuilder
.append("*******************************************************************************************\n")
.append("** Trader's ID: ")
.append(dispute.getTraderId())
.append("\n*******************************************************************************************\n")
.append("\n");
dispute.getDisputeCommunicationMessages().stream().forEach(m -> {
dispute.getDisputeCommunicationMessages().forEach(m -> {
String role = m.isSenderIsTrader() ? ">> Trader's msg: " : "<< Arbitrator's msg: ";
stringBuilder.append(role)
.append(m.getMessage())
@ -409,18 +412,18 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
startDate = new Date(0); // print all from start
HashMap<String, Dispute> map = new HashMap<>();
disputeManager.getDisputesAsObservableList().stream().forEach(dispute -> map.put(dispute.getDepositTxId(), dispute));
disputeManager.getDisputesAsObservableList().forEach(dispute -> map.put(dispute.getDepositTxId(), dispute));
final Date finalStartDate = startDate;
List<Dispute> disputes = new ArrayList<>(map.values());
disputes.sort((o1, o2) -> o1.getOpeningDate().compareTo(o2.getOpeningDate()));
disputes.sort(Comparator.comparing(Dispute::getOpeningDate));
List<List<Dispute>> subLists = Lists.partition(disputes, 1000);
StringBuilder sb = new StringBuilder();
// We don't translate that as it is not intended for the public
subLists.stream().forEach(list -> {
subLists.forEach(list -> {
StringBuilder sb1 = new StringBuilder("\n<html><head><script type=\"text/javascript\">function load(){\n");
StringBuilder sb2 = new StringBuilder("\n}</script></head><body onload=\"load()\">\n");
list.stream().forEach(dispute -> {
list.forEach(dispute -> {
if (dispute.getOpeningDate().after(finalStartDate)) {
String txId = dispute.getDepositTxId();
sb1.append("window.open(\"https://blockchain.info/tx/").append(txId).append("\", '_blank');\n");
@ -676,7 +679,7 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
disputeCommunicationMessages = selectedDispute.getDisputeCommunicationMessages();
SortedList<DisputeCommunicationMessage> sortedList = new SortedList<>(disputeCommunicationMessages);
sortedList.setComparator((o1, o2) -> new Date(o1.getDate()).compareTo(new Date(o2.getDate())));
sortedList.setComparator(Comparator.comparing(o -> new Date(o.getDate())));
messageListView = new ListView<>(sortedList);
messageListView.setId("message-list-view");
@ -688,7 +691,7 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
messagesAnchorPane = new AnchorPane();
VBox.setVgrow(messagesAnchorPane, Priority.ALWAYS);
inputTextArea = new TextArea();
inputTextArea = new JFXTextArea();
inputTextArea.setPrefHeight(70);
inputTextArea.setWrapText(true);
if (!(this instanceof ArbitratorDisputeView))
@ -740,10 +743,10 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
messagesAnchorPane.getChildren().addAll(tableGroupHeadline, messageListView);
}
messageListView.setCellFactory(new Callback<ListView<DisputeCommunicationMessage>, ListCell<DisputeCommunicationMessage>>() {
messageListView.setCellFactory(new Callback<>() {
@Override
public ListCell<DisputeCommunicationMessage> call(ListView<DisputeCommunicationMessage> list) {
return new ListCell<DisputeCommunicationMessage>() {
return new ListCell<>() {
ChangeListener<Boolean> sendMsgBusyAnimationListener;
final Pane bg = new Pane();
final ImageView arrow = new ImageView();
@ -801,7 +804,7 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
AnchorPane.setBottomAnchor(attachmentsBox, bottomBorder + 10);
boolean senderIsTrader = message.isSenderIsTrader();
boolean isMyMsg = isTrader ? senderIsTrader : !senderIsTrader;
boolean isMyMsg = isTrader == senderIsTrader;
arrow.setVisible(!message.isSystemMessage());
arrow.setManaged(!message.isSystemMessage());
@ -1007,7 +1010,7 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
///////////////////////////////////////////////////////////////////////////////////////////
private TableColumn<Dispute, Dispute> getSelectColumn() {
TableColumn<Dispute, Dispute> column = new AutoTooltipTableColumn<Dispute, Dispute>(Res.get("shared.select"));
TableColumn<Dispute, Dispute> column = new AutoTooltipTableColumn<>(Res.get("shared.select"));
column.setMinWidth(80);
column.setMaxWidth(80);
column.setSortable(false);
@ -1015,13 +1018,12 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
column.setCellValueFactory((addressListItem) ->
new ReadOnlyObjectWrapper<>(addressListItem.getValue()));
column.setCellFactory(
new Callback<TableColumn<Dispute, Dispute>, TableCell<Dispute,
Dispute>>() {
new Callback<>() {
@Override
public TableCell<Dispute, Dispute> call(TableColumn<Dispute,
Dispute> column) {
return new TableCell<Dispute, Dispute>() {
return new TableCell<>() {
Button button;
@ -1050,7 +1052,7 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
}
private TableColumn<Dispute, Dispute> getContractColumn() {
TableColumn<Dispute, Dispute> column = new AutoTooltipTableColumn<Dispute, Dispute>(Res.get("shared.details")) {
TableColumn<Dispute, Dispute> column = new AutoTooltipTableColumn<>(Res.get("shared.details")) {
{
setMinWidth(80);
setSortable(false);
@ -1058,11 +1060,11 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
};
column.setCellValueFactory((dispute) -> new ReadOnlyObjectWrapper<>(dispute.getValue()));
column.setCellFactory(
new Callback<TableColumn<Dispute, Dispute>, TableCell<Dispute, Dispute>>() {
new Callback<>() {
@Override
public TableCell<Dispute, Dispute> call(TableColumn<Dispute, Dispute> column) {
return new TableCell<Dispute, Dispute>() {
return new TableCell<>() {
Button button;
@Override
@ -1090,17 +1092,17 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
}
private TableColumn<Dispute, Dispute> getDateColumn() {
TableColumn<Dispute, Dispute> column = new AutoTooltipTableColumn<Dispute, Dispute>(Res.get("shared.date")) {
TableColumn<Dispute, Dispute> column = new AutoTooltipTableColumn<>(Res.get("shared.date")) {
{
setMinWidth(180);
}
};
column.setCellValueFactory((dispute) -> new ReadOnlyObjectWrapper<>(dispute.getValue()));
column.setCellFactory(
new Callback<TableColumn<Dispute, Dispute>, TableCell<Dispute, Dispute>>() {
new Callback<>() {
@Override
public TableCell<Dispute, Dispute> call(TableColumn<Dispute, Dispute> column) {
return new TableCell<Dispute, Dispute>() {
return new TableCell<>() {
@Override
public void updateItem(final Dispute item, boolean empty) {
super.updateItem(item, empty);
@ -1116,17 +1118,17 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
}
private TableColumn<Dispute, Dispute> getTradeIdColumn() {
TableColumn<Dispute, Dispute> column = new AutoTooltipTableColumn<Dispute, Dispute>(Res.get("shared.tradeId")) {
TableColumn<Dispute, Dispute> column = new AutoTooltipTableColumn<>(Res.get("shared.tradeId")) {
{
setMinWidth(110);
}
};
column.setCellValueFactory((dispute) -> new ReadOnlyObjectWrapper<>(dispute.getValue()));
column.setCellFactory(
new Callback<TableColumn<Dispute, Dispute>, TableCell<Dispute, Dispute>>() {
new Callback<>() {
@Override
public TableCell<Dispute, Dispute> call(TableColumn<Dispute, Dispute> column) {
return new TableCell<Dispute, Dispute>() {
return new TableCell<>() {
private HyperlinkWithIcon field;
@Override
@ -1157,17 +1159,17 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
}
private TableColumn<Dispute, Dispute> getBuyerOnionAddressColumn() {
TableColumn<Dispute, Dispute> column = new AutoTooltipTableColumn<Dispute, Dispute>(Res.get("support.buyerAddress")) {
TableColumn<Dispute, Dispute> column = new AutoTooltipTableColumn<>(Res.get("support.buyerAddress")) {
{
setMinWidth(170);
}
};
column.setCellValueFactory((dispute) -> new ReadOnlyObjectWrapper<>(dispute.getValue()));
column.setCellFactory(
new Callback<TableColumn<Dispute, Dispute>, TableCell<Dispute, Dispute>>() {
new Callback<>() {
@Override
public TableCell<Dispute, Dispute> call(TableColumn<Dispute, Dispute> column) {
return new TableCell<Dispute, Dispute>() {
return new TableCell<>() {
@Override
public void updateItem(final Dispute item, boolean empty) {
super.updateItem(item, empty);
@ -1183,17 +1185,17 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
}
private TableColumn<Dispute, Dispute> getSellerOnionAddressColumn() {
TableColumn<Dispute, Dispute> column = new AutoTooltipTableColumn<Dispute, Dispute>(Res.get("support.sellerAddress")) {
TableColumn<Dispute, Dispute> column = new AutoTooltipTableColumn<>(Res.get("support.sellerAddress")) {
{
setMinWidth(170);
}
};
column.setCellValueFactory((dispute) -> new ReadOnlyObjectWrapper<>(dispute.getValue()));
column.setCellFactory(
new Callback<TableColumn<Dispute, Dispute>, TableCell<Dispute, Dispute>>() {
new Callback<>() {
@Override
public TableCell<Dispute, Dispute> call(TableColumn<Dispute, Dispute> column) {
return new TableCell<Dispute, Dispute>() {
return new TableCell<>() {
@Override
public void updateItem(final Dispute item, boolean empty) {
super.updateItem(item, empty);
@ -1236,17 +1238,17 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
}
private TableColumn<Dispute, Dispute> getMarketColumn() {
TableColumn<Dispute, Dispute> column = new AutoTooltipTableColumn<Dispute, Dispute>(Res.get("shared.market")) {
TableColumn<Dispute, Dispute> column = new AutoTooltipTableColumn<>(Res.get("shared.market")) {
{
setMinWidth(130);
}
};
column.setCellValueFactory((dispute) -> new ReadOnlyObjectWrapper<>(dispute.getValue()));
column.setCellFactory(
new Callback<TableColumn<Dispute, Dispute>, TableCell<Dispute, Dispute>>() {
new Callback<>() {
@Override
public TableCell<Dispute, Dispute> call(TableColumn<Dispute, Dispute> column) {
return new TableCell<Dispute, Dispute>() {
return new TableCell<>() {
@Override
public void updateItem(final Dispute item, boolean empty) {
super.updateItem(item, empty);
@ -1262,17 +1264,17 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
}
private TableColumn<Dispute, Dispute> getRoleColumn() {
TableColumn<Dispute, Dispute> column = new AutoTooltipTableColumn<Dispute, Dispute>(Res.get("support.role")) {
TableColumn<Dispute, Dispute> column = new AutoTooltipTableColumn<>(Res.get("support.role")) {
{
setMinWidth(130);
}
};
column.setCellValueFactory((dispute) -> new ReadOnlyObjectWrapper<>(dispute.getValue()));
column.setCellFactory(
new Callback<TableColumn<Dispute, Dispute>, TableCell<Dispute, Dispute>>() {
new Callback<>() {
@Override
public TableCell<Dispute, Dispute> call(TableColumn<Dispute, Dispute> column) {
return new TableCell<Dispute, Dispute>() {
return new TableCell<>() {
@Override
public void updateItem(final Dispute item, boolean empty) {
super.updateItem(item, empty);
@ -1292,21 +1294,21 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
}
private TableColumn<Dispute, Dispute> getStateColumn() {
TableColumn<Dispute, Dispute> column = new AutoTooltipTableColumn<Dispute, Dispute>(Res.get("support.state")) {
TableColumn<Dispute, Dispute> column = new AutoTooltipTableColumn<>(Res.get("support.state")) {
{
setMinWidth(50);
}
};
column.setCellValueFactory((dispute) -> new ReadOnlyObjectWrapper<>(dispute.getValue()));
column.setCellFactory(
new Callback<TableColumn<Dispute, Dispute>, TableCell<Dispute, Dispute>>() {
new Callback<>() {
@Override
public TableCell<Dispute, Dispute> call(TableColumn<Dispute, Dispute> column) {
return new TableCell<Dispute, Dispute>() {
return new TableCell<>() {
public ReadOnlyBooleanProperty closedProperty;
public ChangeListener<Boolean> listener;
ReadOnlyBooleanProperty closedProperty;
ChangeListener<Boolean> listener;
@Override
public void updateItem(final Dispute item, boolean empty) {

View file

@ -19,7 +19,6 @@ package bisq.desktop.main.overlays.windows;
import bisq.desktop.main.MainView;
import bisq.desktop.main.overlays.Overlay;
import bisq.desktop.util.FormBuilder;
import bisq.desktop.util.Layout;
import bisq.core.arbitration.Dispute;
@ -45,9 +44,10 @@ import javafx.stage.Window;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.control.Tooltip;
import javafx.scene.layout.GridPane;
import javafx.geometry.Insets;
@ -117,18 +117,18 @@ public class ContractWindow extends Overlay<ContractWindow> {
PaymentAccountPayload sellerPaymentAccountPayload = contract.getSellerPaymentAccountPayload();
addTitledGroupBg(gridPane, ++rowIndex, rows, Res.get("contractWindow.title"));
addTopLabelTextFieldWithCopyIcon(gridPane, rowIndex, Res.getWithCol("shared.offerId"), offer.getId(),
addConfirmationLabelTextFieldWithCopyIcon(gridPane, rowIndex, Res.get("shared.offerId"), offer.getId(),
Layout.FIRST_ROW_DISTANCE).second.setMouseTransparent(false);
FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.get("contractWindow.dates"),
addConfirmationLabelLabel(gridPane, ++rowIndex, Res.get("contractWindow.dates"),
formatter.formatDateTime(offer.getDate()) + " / " + formatter.formatDateTime(dispute.getTradeDate()));
String currencyCode = offer.getCurrencyCode();
FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.getWithCol("shared.offerType"),
addConfirmationLabelLabel(gridPane, ++rowIndex, Res.get("shared.offerType"),
formatter.getDirectionBothSides(offer.getDirection(), currencyCode));
FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.getWithCol("shared.tradePrice"),
addConfirmationLabelLabel(gridPane, ++rowIndex, Res.get("shared.tradePrice"),
formatter.formatPrice(contract.getTradePrice()));
FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.getWithCol("shared.tradeAmount"),
addConfirmationLabelLabel(gridPane, ++rowIndex, Res.get("shared.tradeAmount"),
formatter.formatCoinWithCode(contract.getTradeAmount()));
FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, formatter.formatVolumeLabel(currencyCode, ":"),
addConfirmationLabelLabel(gridPane, ++rowIndex, formatter.formatVolumeLabel(currencyCode, ":"),
formatter.formatVolumeWithCode(contract.getTradePrice().getVolumeByAmount(contract.getTradeAmount())));
String securityDeposit = Res.getWithColAndCap("shared.buyer") +
" " +
@ -137,43 +137,43 @@ public class ContractWindow extends Overlay<ContractWindow> {
Res.getWithColAndCap("shared.seller") +
" " +
formatter.formatCoinWithCode(offer.getSellerSecurityDeposit());
FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.getWithCol("shared.securityDeposit"), securityDeposit);
addTopLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, Res.get("contractWindow.btcAddresses"),
addConfirmationLabelLabel(gridPane, ++rowIndex, Res.get("shared.securityDeposit"), securityDeposit);
addConfirmationLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, Res.get("contractWindow.btcAddresses"),
contract.getBuyerPayoutAddressString() + " / " +
contract.getSellerPayoutAddressString()).second.setMouseTransparent(false);
addTopLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, Res.get("contractWindow.onions"),
addConfirmationLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, Res.get("contractWindow.onions"),
contract.getBuyerNodeAddress().getFullAddress() + " / " + contract.getSellerNodeAddress().getFullAddress());
addTopLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, Res.get("contractWindow.numDisputes"),
addConfirmationLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, Res.get("contractWindow.numDisputes"),
disputeManager.getNrOfDisputes(true, contract) + " / " + disputeManager.getNrOfDisputes(false, contract));
addTopLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, Res.get("shared.paymentDetails", Res.get("shared.buyer")),
addConfirmationLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, Res.get("shared.paymentDetails", Res.get("shared.buyer")),
contract.getBuyerPaymentAccountPayload().getPaymentDetails()).second.setMouseTransparent(false);
addTopLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, Res.get("shared.paymentDetails", Res.get("shared.seller")),
addConfirmationLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, Res.get("shared.paymentDetails", Res.get("shared.seller")),
sellerPaymentAccountPayload.getPaymentDetails()).second.setMouseTransparent(false);
addTopLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, Res.get("shared.arbitrator"), contract.getArbitratorNodeAddress().getFullAddress());
addConfirmationLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, Res.get("shared.arbitrator"), contract.getArbitratorNodeAddress().getFullAddress());
if (showAcceptedCountryCodes) {
String countries;
Tooltip tooltip = null;
if (CountryUtil.containsAllSepaEuroCountries(acceptedCountryCodes)) {
countries = Res.getWithCol("shared.allEuroCountries");
countries = Res.get("shared.allEuroCountries");
} else {
countries = CountryUtil.getCodesString(acceptedCountryCodes);
tooltip = new Tooltip(CountryUtil.getNamesByCodesString(acceptedCountryCodes));
}
TextField acceptedCountries = FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.getWithCol("shared.acceptedTakerCountries"), countries).second;
Label acceptedCountries = addConfirmationLabelLabel(gridPane, ++rowIndex, Res.get("shared.acceptedTakerCountries"), countries).second;
if (tooltip != null) acceptedCountries.setTooltip(new Tooltip());
}
if (showAcceptedBanks) {
if (offer.getPaymentMethod().equals(PaymentMethod.SAME_BANK)) {
FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.getWithCol("shared.bankName"), acceptedBanks.get(0));
addConfirmationLabelLabel(gridPane, ++rowIndex, Res.get("shared.bankName"), acceptedBanks.get(0));
} else if (offer.getPaymentMethod().equals(PaymentMethod.SPECIFIC_BANKS)) {
String value = Joiner.on(", ").join(acceptedBanks);
Tooltip tooltip = new Tooltip(Res.getWithCol("shared.acceptedBanks") + value);
TextField acceptedBanksTextField = FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.getWithCol("shared.acceptedBanks"), value).second;
Tooltip tooltip = new Tooltip(Res.get("shared.acceptedBanks") + value);
Label acceptedBanksTextField = addConfirmationLabelLabel(gridPane, ++rowIndex, Res.get("shared.acceptedBanks"), value).second;
acceptedBanksTextField.setMouseTransparent(false);
acceptedBanksTextField.setTooltip(tooltip);
}
@ -182,15 +182,15 @@ public class ContractWindow extends Overlay<ContractWindow> {
addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.makerFeeTxId"), offer.getOfferFeePaymentTxId());
addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.takerFeeTxId"), contract.getTakerFeeTxID());
if (dispute.getDepositTxSerialized() != null)
addLabelTxIdTextField(gridPane, ++rowIndex, Res.getWithCol("shared.depositTransactionId"), dispute.getDepositTxId());
addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.depositTransactionId"), dispute.getDepositTxId());
if (dispute.getPayoutTxSerialized() != null)
addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.payoutTxId"), dispute.getPayoutTxId());
if (dispute.getContractHash() != null)
addTopLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, Res.get("contractWindow.contractHash"),
addConfirmationLabelTextFieldWithCopyIcon(gridPane, ++rowIndex, Res.get("contractWindow.contractHash"),
Utils.HEX.encode(dispute.getContractHash())).second.setMouseTransparent(false);
Button viewContractButton = addTopLabelButton(gridPane, ++rowIndex, Res.get("shared.contractAsJson"),
Button viewContractButton = addConfirmationLabelButton(gridPane, ++rowIndex, Res.get("shared.contractAsJson"),
Res.get("shared.viewContractAsJson"), 0).second;
viewContractButton.setDefaultButton(false);
viewContractButton.setOnAction(e -> {
@ -223,6 +223,7 @@ public class ContractWindow extends Overlay<ContractWindow> {
});
Button closeButton = addButtonAfterGroup(gridPane, ++rowIndex, Res.get("shared.close"));
GridPane.setColumnSpan(closeButton, 2);
//TODO app wide focus
//closeButton.requestFocus();
closeButton.setOnAction(e -> {

View file

@ -22,7 +22,6 @@ import bisq.desktop.components.AutoTooltipRadioButton;
import bisq.desktop.components.InputTextField;
import bisq.desktop.main.overlays.Overlay;
import bisq.desktop.main.overlays.popups.Popup;
import bisq.desktop.util.FormBuilder;
import bisq.desktop.util.Layout;
import bisq.core.arbitration.Dispute;
@ -39,12 +38,15 @@ import bisq.core.util.BSFormatter;
import bisq.common.UserThread;
import bisq.common.util.Tuple2;
import bisq.common.util.Tuple3;
import org.bitcoinj.core.AddressFormatException;
import org.bitcoinj.core.Coin;
import javax.inject.Inject;
import com.jfoenix.controls.JFXTextArea;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
@ -59,6 +61,7 @@ import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.geometry.HPos;
import javafx.geometry.Insets;
import javafx.geometry.VPos;
@ -122,7 +125,7 @@ public class DisputeSummaryWindow extends Overlay<DisputeSummaryWindow> {
this.dispute = dispute;
rowIndex = -1;
width = 1118;
width = 700;
createGridPane();
addContent();
display();
@ -169,6 +172,7 @@ public class DisputeSummaryWindow extends Overlay<DisputeSummaryWindow> {
super.createGridPane();
gridPane.setPadding(new Insets(35, 40, 30, 40));
gridPane.getStyleClass().add("grid-pane");
gridPane.getColumnConstraints().get(0).setHalignment(HPos.LEFT);
}
private void addContent() {
@ -242,9 +246,10 @@ public class DisputeSummaryWindow extends Overlay<DisputeSummaryWindow> {
private void addInfoPane() {
Contract contract = dispute.getContract();
addTitledGroupBg(gridPane, ++rowIndex, 16, Res.get("disputeSummaryWindow.title"));
FormBuilder.addTopLabelTextField(gridPane, rowIndex, Res.getWithCol("shared.tradeId"), dispute.getShortTradeId(), Layout.FIRST_ROW_DISTANCE);
FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.get("disputeSummaryWindow.openDate"), formatter.formatDateTime(dispute.getOpeningDate()));
addTitledGroupBg(gridPane, ++rowIndex, 16, Res.get("disputeSummaryWindow.title")).getStyleClass().add("last");
addConfirmationLabelLabel(gridPane, rowIndex, Res.get("shared.tradeId"), dispute.getShortTradeId(),
Layout.TWICE_FIRST_ROW_DISTANCE);
addConfirmationLabelLabel(gridPane, ++rowIndex, Res.get("disputeSummaryWindow.openDate"), formatter.formatDateTime(dispute.getOpeningDate()));
if (dispute.isDisputeOpenerIsMaker()) {
if (dispute.isDisputeOpenerIsBuyer())
role = Res.get("support.buyerOfferer");
@ -256,12 +261,12 @@ public class DisputeSummaryWindow extends Overlay<DisputeSummaryWindow> {
else
role = Res.get("support.sellerTaker");
}
FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.get("disputeSummaryWindow.role"), role);
FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.getWithCol("shared.tradeAmount"),
addConfirmationLabelLabel(gridPane, ++rowIndex, Res.get("disputeSummaryWindow.role"), role);
addConfirmationLabelLabel(gridPane, ++rowIndex, Res.get("shared.tradeAmount"),
formatter.formatCoinWithCode(contract.getTradeAmount()));
FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.getWithCol("shared.tradePrice"),
addConfirmationLabelLabel(gridPane, ++rowIndex, Res.get("shared.tradePrice"),
formatter.formatPrice(contract.getTradePrice()));
FormBuilder.addTopLabelTextField(gridPane, ++rowIndex, Res.getWithCol("shared.tradeVolume"),
addConfirmationLabelLabel(gridPane, ++rowIndex, Res.get("shared.tradeVolume"),
formatter.formatVolumeWithCode(contract.getTradePrice().getVolumeByAmount(contract.getTradeAmount())));
}
@ -287,8 +292,6 @@ public class DisputeSummaryWindow extends Overlay<DisputeSummaryWindow> {
}
private void addTradeAmountPayoutControls() {
Label distributionLabel = addLabel(gridPane, ++rowIndex, Res.get("disputeSummaryWindow.payout"), 10);
GridPane.setValignment(distributionLabel, VPos.TOP);
buyerGetsTradeAmountRadioButton = new AutoTooltipRadioButton(Res.get("disputeSummaryWindow.payout.getsTradeAmount",
Res.get("shared.buyer")));
@ -300,15 +303,15 @@ public class DisputeSummaryWindow extends Overlay<DisputeSummaryWindow> {
Res.get("shared.seller")));
customRadioButton = new AutoTooltipRadioButton(Res.get("disputeSummaryWindow.payout.custom"));
VBox radioButtonPane = new VBox();
radioButtonPane.setSpacing(10);
radioButtonPane.getChildren().addAll(buyerGetsTradeAmountRadioButton, buyerGetsAllRadioButton,
sellerGetsTradeAmountRadioButton, sellerGetsAllRadioButton,
customRadioButton);
GridPane.setRowIndex(radioButtonPane, rowIndex);
GridPane.setColumnIndex(radioButtonPane, 1);
GridPane.setMargin(radioButtonPane, new Insets(10, 0, 0, 0));
gridPane.getChildren().add(radioButtonPane);
addTopLabelWithVBox(gridPane, ++rowIndex, Res.get("disputeSummaryWindow.payout"),
radioButtonPane, 10).second.getChildren();
tradeAmountToggleGroup = new ToggleGroup();
buyerGetsTradeAmountRadioButton.setToggleGroup(tradeAmountToggleGroup);
@ -401,12 +404,10 @@ public class DisputeSummaryWindow extends Overlay<DisputeSummaryWindow> {
sellerPayoutAmountInputTextField.setEditable(false);
isLoserPublisherCheckBox = addLabelCheckBox(gridPane, ++rowIndex,
Res.get("disputeSummaryWindow.payoutAmount.invert"));
Res.get("disputeSummaryWindow.payoutAmount.invert"), 15);
}
private void addReasonControls() {
Label label = addLabel(gridPane, ++rowIndex, Res.get("disputeSummaryWindow.reason"), 10);
GridPane.setValignment(label, VPos.TOP);
reasonWasBugRadioButton = new AutoTooltipRadioButton(Res.get("disputeSummaryWindow.reason.bug"));
reasonWasUsabilityIssueRadioButton = new AutoTooltipRadioButton(Res.get("disputeSummaryWindow.reason.usability"));
reasonProtocolViolationRadioButton = new AutoTooltipRadioButton(Res.get("disputeSummaryWindow.reason.protocolViolation"));
@ -420,10 +421,11 @@ public class DisputeSummaryWindow extends Overlay<DisputeSummaryWindow> {
feeRadioButtonPane.getChildren().addAll(reasonWasBugRadioButton, reasonWasUsabilityIssueRadioButton,
reasonProtocolViolationRadioButton, reasonNoReplyRadioButton,
reasonWasBankRadioButton, reasonWasScamRadioButton, reasonWasOtherRadioButton);
GridPane.setRowIndex(feeRadioButtonPane, rowIndex);
GridPane.setColumnIndex(feeRadioButtonPane, 1);
GridPane.setMargin(feeRadioButtonPane, new Insets(10, 0, 10, 0));
gridPane.getChildren().add(feeRadioButtonPane);
GridPane.setColumnSpan(
addTopLabelWithVBox(gridPane, ++rowIndex,
Res.get("disputeSummaryWindow.reason"),
feeRadioButtonPane, 10).second, 2);
reasonToggleGroup = new ToggleGroup();
reasonWasBugRadioButton.setToggleGroup(reasonToggleGroup);
@ -482,23 +484,24 @@ public class DisputeSummaryWindow extends Overlay<DisputeSummaryWindow> {
}
private void addSummaryNotes() {
Label label = addLabel(gridPane, ++rowIndex, Res.get("disputeSummaryWindow.summaryNotes"), 0);
GridPane.setValignment(label, VPos.TOP);
summaryNotesTextArea = new TextArea();
summaryNotesTextArea = new JFXTextArea();
summaryNotesTextArea.setPromptText(Res.get("disputeSummaryWindow.addSummaryNotes"));
summaryNotesTextArea.setWrapText(true);
final Tuple2<Label, VBox> topLabelWithVBox = addTopLabelWithVBox(gridPane, rowIndex,
Res.get("disputeSummaryWindow.summaryNotes"), summaryNotesTextArea, 0);
GridPane.setColumnSpan(topLabelWithVBox.second, 2);
summaryNotesTextArea.setPrefHeight(50);
summaryNotesTextArea.textProperty().bindBidirectional(disputeResult.summaryNotesProperty());
GridPane.setRowIndex(summaryNotesTextArea, rowIndex);
GridPane.setColumnIndex(summaryNotesTextArea, 1);
gridPane.getChildren().add(summaryNotesTextArea);
}
private void addButtons(Contract contract) {
Tuple2<Button, Button> tuple = add2ButtonsAfterGroup(gridPane, ++rowIndex,
Tuple3<Button, Button, HBox> tuple = add2ButtonsWithBox(gridPane, ++rowIndex,
Res.get("disputeSummaryWindow.close.button"),
Res.get("shared.cancel"));
Res.get("shared.cancel"), 15, true);
//GridPane.setColumnSpan(tuple.third, 2);
Button closeTicketButton = tuple.first;
closeTicketButton.disableProperty().bind(Bindings.createBooleanBinding(
() -> tradeAmountToggleGroup.getSelectedToggle() == null