17
17
18
18
package haveno .desktop .main .settings .preferences ;
19
19
20
- import static com .google .common .base .Preconditions .checkArgument ;
21
20
import com .google .inject .Inject ;
22
21
import com .google .inject .name .Named ;
23
22
import haveno .common .UserThread ;
47
46
import haveno .core .util .validation .IntegerValidator ;
48
47
import haveno .core .util .validation .RegexValidator ;
49
48
import haveno .core .util .validation .RegexValidatorFactory ;
50
- import haveno .core .xmr .wallet .Restrictions ;
51
49
import haveno .desktop .common .view .ActivatableViewAndModel ;
52
50
import haveno .desktop .common .view .FxmlView ;
53
51
import haveno .desktop .components .AutoTooltipButton ;
@@ -112,7 +110,7 @@ public class PreferencesView extends ActivatableViewAndModel<GridPane, Preferenc
112
110
notifyOnPreReleaseToggle ;
113
111
private int gridRow = 0 ;
114
112
private int displayCurrenciesGridRowIndex = 0 ;
115
- private InputTextField ignoreTradersListInputTextField , ignoreDustThresholdInputTextField ,
113
+ private InputTextField ignoreTradersListInputTextField ,
116
114
autoConfRequiredConfirmationsTf , autoConfServiceAddressTf , autoConfTradeLimitTf , /*referralIdInputTextField,*/
117
115
rpcUserTextField , blockNotifyPortTextField ;
118
116
private PasswordTextField rpcPwTextField ;
@@ -136,7 +134,7 @@ public class PreferencesView extends ActivatableViewAndModel<GridPane, Preferenc
136
134
private ObservableList <CryptoCurrency > allCryptoCurrencies ;
137
135
private ObservableList <TradeCurrency > tradeCurrencies ;
138
136
private InputTextField deviationInputTextField ;
139
- private ChangeListener <String > deviationListener , ignoreTradersListListener , ignoreDustThresholdListener ,
137
+ private ChangeListener <String > deviationListener , ignoreTradersListListener ,
140
138
rpcUserListener , rpcPwListener , blockNotifyPortListener ,
141
139
autoConfTradeLimitListener , autoConfServiceAddressListener ;
142
140
private ChangeListener <Boolean > deviationFocusedListener ;
@@ -209,7 +207,7 @@ protected void deactivate() {
209
207
///////////////////////////////////////////////////////////////////////////////////////////
210
208
211
209
private void initializeGeneralOptions () {
212
- int titledGroupBgRowSpan = displayStandbyModeFeature ? 8 : 7 ;
210
+ int titledGroupBgRowSpan = displayStandbyModeFeature ? 7 : 6 ;
213
211
TitledGroupBg titledGroupBg = addTitledGroupBg (root , gridRow , titledGroupBgRowSpan , Res .get ("setting.preferences.general" ));
214
212
GridPane .setColumnSpan (titledGroupBg , 1 );
215
213
@@ -259,35 +257,14 @@ private void initializeGeneralOptions() {
259
257
}
260
258
};
261
259
262
-
263
- // ignoreDustThreshold
264
- ignoreDustThresholdInputTextField = addInputTextField (root , ++gridRow , Res .get ("setting.preferences.ignoreDustThreshold" ));
265
- IntegerValidator validator = new IntegerValidator ();
266
- validator .setMinValue ((int ) Restrictions .getMinNonDustOutput ().value );
267
- validator .setMaxValue (2000 );
268
- ignoreDustThresholdInputTextField .setValidator (validator );
269
- ignoreDustThresholdListener = (observable , oldValue , newValue ) -> {
270
- try {
271
- int value = Integer .parseInt (newValue );
272
- checkArgument (value >= Restrictions .getMinNonDustOutput ().value ,
273
- "Input must be at least " + Restrictions .getMinNonDustOutput ().value );
274
- checkArgument (value <= 2000 ,
275
- "Input must not be higher than 2000 Satoshis" );
276
- if (!newValue .equals (oldValue )) {
277
- preferences .setIgnoreDustThreshold (value );
278
- }
279
- } catch (Throwable ignore ) {
280
- }
281
- };
282
-
283
260
if (displayStandbyModeFeature ) {
284
261
// AvoidStandbyModeService feature works only on OSX & Windows
285
262
avoidStandbyMode = addSlideToggleButton (root , ++gridRow ,
286
263
Res .get ("setting.preferences.avoidStandbyMode" ));
287
264
}
288
265
289
266
useSoundForNotifications = addSlideToggleButton (root , ++gridRow ,
290
- Res .get ("setting.preferences.useSoundForNotifications" ), Layout . GROUP_DISTANCE * - 1 ); // TODO: why must negative value be used to place toggle consistently?
267
+ Res .get ("setting.preferences.useSoundForNotifications" ));
291
268
}
292
269
293
270
private void initializeSeparator () {
@@ -636,7 +613,6 @@ private void activateGeneralOptions() {
636
613
ignoreTradersListInputTextField .setText (String .join (", " , preferences .getIgnoreTradersList ()));
637
614
/* referralIdService.getOptionalReferralId().ifPresent(referralId -> referralIdInputTextField.setText(referralId));
638
615
referralIdInputTextField.setPromptText(Res.get("setting.preferences.refererId.prompt"));*/
639
- ignoreDustThresholdInputTextField .setText (String .valueOf (preferences .getIgnoreDustThreshold ()));
640
616
userLanguageComboBox .setItems (languageCodes );
641
617
userLanguageComboBox .getSelectionModel ().select (preferences .getUserLanguage ());
642
618
userLanguageComboBox .setConverter (new StringConverter <>() {
@@ -696,7 +672,6 @@ public Country fromString(String string) {
696
672
697
673
ignoreTradersListInputTextField .textProperty ().addListener (ignoreTradersListListener );
698
674
//referralIdInputTextField.textProperty().addListener(referralIdListener);
699
- ignoreDustThresholdInputTextField .textProperty ().addListener (ignoreDustThresholdListener );
700
675
}
701
676
702
677
private void activateDisplayCurrencies () {
@@ -830,7 +805,6 @@ private void deactivateGeneralOptions() {
830
805
deviationInputTextField .focusedProperty ().removeListener (deviationFocusedListener );
831
806
ignoreTradersListInputTextField .textProperty ().removeListener (ignoreTradersListListener );
832
807
//referralIdInputTextField.textProperty().removeListener(referralIdListener);
833
- ignoreDustThresholdInputTextField .textProperty ().removeListener (ignoreDustThresholdListener );
834
808
}
835
809
836
810
private void deactivateDisplayCurrencies () {
0 commit comments