File tree Expand file tree Collapse file tree 5 files changed +29
-7
lines changed
desktop/src/main/java/haveno/desktop/main Expand file tree Collapse file tree 5 files changed +29
-7
lines changed Original file line number Diff line number Diff line change @@ -262,6 +262,7 @@ protected void doActivate() {
262
262
263
263
buyerAsTakerWithoutDepositSlider .setSelected (model .dataModel .getBuyerAsTakerWithoutDeposit ().get ());
264
264
265
+ triggerPriceInputTextField .setText (model .triggerPrice .get ());
265
266
extraInfoTextArea .setText (model .dataModel .extraInfo .get ());
266
267
}
267
268
}
Original file line number Diff line number Diff line change @@ -501,7 +501,10 @@ private void createListeners() {
501
501
};
502
502
503
503
extraInfoStringListener = (ov , oldValue , newValue ) -> {
504
- onExtraInfoTextAreaChanged ();
504
+ if (newValue != null ) {
505
+ extraInfo .set (newValue );
506
+ onExtraInfoTextAreaChanged ();
507
+ }
505
508
};
506
509
507
510
isWalletFundedListener = (ov , oldValue , newValue ) -> updateButtonDisableState ();
@@ -582,6 +585,7 @@ private void removeListeners() {
582
585
dataModel .getVolume ().removeListener (volumeListener );
583
586
dataModel .getSecurityDepositPct ().removeListener (securityDepositAsDoubleListener );
584
587
dataModel .getBuyerAsTakerWithoutDeposit ().removeListener (buyerAsTakerWithoutDepositListener );
588
+ dataModel .getExtraInfo ().removeListener (extraInfoStringListener );
585
589
586
590
//dataModel.feeFromFundingTxProperty.removeListener(feeFromFundingTxListener);
587
591
dataModel .getIsXmrWalletFunded ().removeListener (isWalletFundedListener );
@@ -843,7 +847,7 @@ public void onExtraInfoTextAreaChanged() {
843
847
extraInfoValidationResult .set (getExtraInfoValidationResult ());
844
848
updateButtonDisableState ();
845
849
if (extraInfoValidationResult .get ().isValid ) {
846
- dataModel . setExtraInfo ( extraInfo . get () );
850
+ setExtraInfoToModel ( );
847
851
}
848
852
}
849
853
Original file line number Diff line number Diff line change 26
26
import haveno .core .offer .CreateOfferService ;
27
27
import haveno .core .offer .Offer ;
28
28
import haveno .core .offer .OfferUtil ;
29
+ import haveno .core .offer .OpenOffer ;
29
30
import haveno .core .offer .OpenOfferManager ;
30
31
import haveno .core .payment .PaymentAccount ;
31
32
import haveno .core .provider .price .PriceFeedService ;
@@ -89,13 +90,15 @@ public void populateData(Offer offer) {
89
90
setPrice (offer .getPrice ());
90
91
setVolume (offer .getVolume ());
91
92
setUseMarketBasedPrice (offer .isUseMarketBasedPrice ());
92
- setBuyerAsTakerWithoutDeposit (offer .hasBuyerAsTakerWithoutDeposit ());
93
-
94
- setSecurityDepositPct (getSecurityAsPercent (offer ));
95
-
96
93
if (offer .isUseMarketBasedPrice ()) {
97
94
setMarketPriceMarginPct (offer .getMarketPriceMarginPct ());
98
95
}
96
+ setBuyerAsTakerWithoutDeposit (offer .hasBuyerAsTakerWithoutDeposit ());
97
+ setSecurityDepositPct (getSecurityAsPercent (offer ));
98
+ setExtraInfo (offer .getOfferExtraInfo ());
99
+
100
+ OpenOffer openOffer = openOfferManager .getOpenOffer (offer .getId ()).orElse (null );
101
+ if (openOffer != null ) setTriggerPrice (openOffer .getTriggerPrice ());
99
102
}
100
103
101
104
private double getSecurityAsPercent (Offer offer ) {
Original file line number Diff line number Diff line change 29
29
import haveno .core .provider .price .PriceFeedService ;
30
30
import haveno .core .user .Preferences ;
31
31
import haveno .core .util .FormattingUtils ;
32
+ import haveno .core .util .PriceUtil ;
32
33
import haveno .core .util .coin .CoinFormatter ;
33
34
import haveno .core .util .validation .AmountValidator4Decimals ;
34
35
import haveno .core .util .validation .AmountValidator8Decimals ;
@@ -76,6 +77,16 @@ public void initWithData(OfferPayload offerPayload) {
76
77
public void activate () {
77
78
super .activate ();
78
79
dataModel .populateData (offer );
80
+
81
+ long triggerPriceAsLong = dataModel .getTriggerPrice ();
82
+ dataModel .setTriggerPrice (triggerPriceAsLong );
83
+ if (triggerPriceAsLong > 0 ) {
84
+ triggerPrice .set (PriceUtil .formatMarketPrice (triggerPriceAsLong , dataModel .getCurrencyCode ()));
85
+ } else {
86
+ triggerPrice .set ("" );
87
+ }
88
+ onTriggerPriceTextFieldChanged ();
89
+
79
90
triggerFocusOutOnAmountFields ();
80
91
onFocusOutPriceAsPercentageTextField (true , false );
81
92
}
Original file line number Diff line number Diff line change @@ -137,6 +137,9 @@ public void applyOpenOffer(OpenOffer openOffer) {
137
137
securityDepositPct .set (securityDepositPercent );
138
138
139
139
allowAmountUpdate = false ;
140
+
141
+ triggerPrice = openOffer .getTriggerPrice ();
142
+ extraInfo .set (offer .getOfferExtraInfo ());
140
143
}
141
144
142
145
@ Override
@@ -164,10 +167,10 @@ public void populateData() {
164
167
setPrice (offer .getPrice ());
165
168
setVolume (offer .getVolume ());
166
169
setUseMarketBasedPrice (offer .isUseMarketBasedPrice ());
167
- setTriggerPrice (openOffer .getTriggerPrice ());
168
170
if (offer .isUseMarketBasedPrice ()) {
169
171
setMarketPriceMarginPct (offer .getMarketPriceMarginPct ());
170
172
}
173
+ setTriggerPrice (openOffer .getTriggerPrice ());
171
174
setExtraInfo (offer .getOfferExtraInfo ());
172
175
}
173
176
You can’t perform that action at this time.
0 commit comments