Show better text in PeerInfo if 0 trades

This commit is contained in:
Manfred Karrer 2017-10-08 21:03:08 -05:00
parent 361a520048
commit a76b4d17f5
No known key found for this signature in database
GPG Key ID: 401250966A6B2C46
2 changed files with 7 additions and 1 deletions

View File

@ -1343,6 +1343,7 @@ confidence.invalid=Transaction is invalid
peerInfo.title=Peer info
peerInfo.nrOfTrades=Number of completed trades:
peerInfo.notTradedYet=You have not traded with that user so far.
peerInfo.setTag=Set tag for that peer:
addressTextField.openWallet=Open your default bitcoin wallet

View File

@ -78,6 +78,8 @@ public class PeerInfoWithTagEditor extends Overlay<PeerInfoWithTagEditor> {
public PeerInfoWithTagEditor numTrades(int numTrades) {
this.numTrades = numTrades;
if (numTrades == 0)
width = 500;
return this;
}
@ -141,7 +143,10 @@ public class PeerInfoWithTagEditor extends Overlay<PeerInfoWithTagEditor> {
protected void addContent() {
FormBuilder.addLabelTextField(gridPane, ++rowIndex, Res.getWithCol("shared.onionAddress"), hostName).second.setMouseTransparent(false);
FormBuilder.addLabelTextField(gridPane, ++rowIndex, Res.get("peerInfo.nrOfTrades"), String.valueOf(numTrades));
FormBuilder.addLabelTextField(gridPane, ++rowIndex,
Res.get("peerInfo.nrOfTrades"),
numTrades > 0 ? String.valueOf(numTrades) : Res.get("peerInfo.notTradedYet"));
inputTextField = FormBuilder.addLabelInputTextField(gridPane, ++rowIndex, Res.get("peerInfo.setTag")).second;
Map<String, String> peerTagMap = preferences.getPeerTagMap();
String tag = peerTagMap.containsKey(hostName) ? peerTagMap.get(hostName) : "";