Skip to content

Commit

Permalink
Add duration
Browse files Browse the repository at this point in the history
  • Loading branch information
chimp1984 committed Dec 14, 2019
1 parent b47b0aa commit 7af7fa1
Showing 1 changed file with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import bisq.core.trade.Contract;
import bisq.core.trade.Trade;
import bisq.core.trade.TradeManager;
import bisq.core.util.FormattingUtils;
import bisq.core.util.coin.CoinFormatter;

import bisq.network.p2p.NodeAddress;
Expand Down Expand Up @@ -281,19 +282,24 @@ private void showCompactReport() {
disputeGroups.forEach(disputeGroup -> {
if (disputeGroup.size() > 0) {
Dispute dispute0 = disputeGroup.get(0);
Date openingDate = dispute0.getOpeningDate();
stringBuilder.append("\n")
.append("Dispute nr. ")
.append(disputeIndex.incrementAndGet())
.append("\n")
.append("Opening date: ")
.append(DisplayUtils.formatDateTime(dispute0.getOpeningDate()))
.append(DisplayUtils.formatDateTime(openingDate))
.append("\n");

DisputeResult disputeResult0 = dispute0.getDisputeResultProperty().get();
String summaryNotes0 = "";
if (disputeResult0 != null) {
Date closeDate = disputeResult0.getCloseDate();
long duration = closeDate.getTime() - openingDate.getTime();
stringBuilder.append("Close date: ")
.append(DisplayUtils.formatDateTime(disputeResult0.getCloseDate()))
.append(DisplayUtils.formatDateTime(closeDate))
.append("\n")
.append("Duration: ")
.append(FormattingUtils.formatDurationAsWords(duration))
.append("\n");

summaryNotes0 = disputeResult0.getSummaryNotesProperty().get();
Expand Down Expand Up @@ -330,11 +336,11 @@ private void showCompactReport() {
stringBuilder.append(k).append(": ").append(v.size()).append("\n");
});


String message = stringBuilder.toString();
new Popup().headLine("Compact summary of all disputes (" + disputeGroups.size() + ")")
.maxMessageLength(500)
.information(message)
.width(1000)
.width(1200)
.actionButtonText("Copy to clipboard")
.onAction(() -> Utilities.copyToClipboard(message))
.show();
Expand Down Expand Up @@ -398,8 +404,9 @@ private void showFullReport() {
String message = stringBuilder.toString();
// We don't translate that as it is not intended for the public
new Popup().headLine("All disputes (" + disputeGroups.size() + ")")
.maxMessageLength(1000)
.information(message)
.width(1000)
.width(1200)
.actionButtonText("Copy")
.onAction(() -> Utilities.copyToClipboard(message))
.show();
Expand Down

0 comments on commit 7af7fa1

Please sign in to comment.