explicitly commit spinner editor value when closing dialogs

This commit is contained in:
Craig Raw 2022-05-23 08:19:48 +02:00
parent ddcb3e6f61
commit a324224e2a
5 changed files with 14 additions and 1 deletions

2
drongo

@ -1 +1 @@
Subproject commit d24243ce20a9d10f77cfe95f172940743a94a8a7
Subproject commit 8e50815a3faca8ddc03bf20935ee9ee13b897066

View file

@ -83,6 +83,10 @@ public class AdvancedController implements Initializable {
});
}
public void close() {
gapLimit.commitValue();
}
private ObservableList<Integer> getWatchListItems(Wallet wallet) {
return FXCollections.observableList(DEFAULT_WATCH_LIST_ITEMS.stream().filter(val -> val < 0 || val > wallet.getGapLimit()).collect(Collectors.toList()));
}

View file

@ -36,6 +36,10 @@ public class AdvancedDialog extends Dialog<Boolean> {
dialogPane.setPrefHeight(300);
AppServices.moveToActiveWindowScreen(this);
setOnCloseRequest(event -> {
settingsAdvancedController.close();
});
setResultConverter(dialogButton -> dialogButton == passwordButtonType);
}
catch(IOException e) {

View file

@ -135,6 +135,10 @@ public class MixToController implements Initializable {
});
}
public void close() {
minMixes.commitValue();
}
public MixConfig getMixConfig() {
return mixConfig;
}

View file

@ -51,6 +51,7 @@ public class MixToDialog extends Dialog<MixConfig> {
setResultConverter(dialogButton -> dialogButton == applyButtonType ? mixToController.getMixConfig() : null);
setOnCloseRequest(event -> {
mixToController.close();
EventManager.get().unregister(this);
});
EventManager.get().register(this);