Fix concurrent modification possibility for validators

This commit is contained in:
crschnick
2026-04-04 00:44:39 +00:00
parent 1cce2fd259
commit b20aed0d3c
@@ -11,6 +11,7 @@ import io.xpipe.app.prefs.PersonalizationCategory;
import io.xpipe.app.prefs.TerminalCategory;
import io.xpipe.app.util.DocumentationLink;
import javafx.application.Platform;
import javafx.scene.layout.Region;
public class AppConfigurationDialog {
@@ -20,32 +21,35 @@ public class AppConfigurationDialog {
return;
}
var options = new OptionsBuilder()
.sub(PersonalizationCategory.languageChoice())
.sub(PersonalizationCategory.themeChoice())
.sub(TerminalCategory.terminalChoice(false))
.sub(EditorCategory.editorChoice())
.sub(PasswordManagerCategory.passwordManagerChoice())
.buildComp();
options.style("initial-setup");
options.style("prefs-container");
// Enforce that everything is created on the platform thread to align with prefs comp
Platform.runLater(() -> {
var options = new OptionsBuilder()
.sub(PersonalizationCategory.languageChoice())
.sub(PersonalizationCategory.themeChoice())
.sub(TerminalCategory.terminalChoice(false))
.sub(EditorCategory.editorChoice())
.sub(PasswordManagerCategory.passwordManagerChoice())
.buildComp();
options.style("initial-setup");
options.style("prefs-container");
var scroll = new ScrollComp(options);
scroll.apply(struc -> {
struc.prefHeightProperty().bind(((Region) struc.getContent()).heightProperty());
var scroll = new ScrollComp(options);
scroll.apply(struc -> {
struc.prefHeightProperty().bind(((Region) struc.getContent()).heightProperty());
});
scroll.minWidth(650);
scroll.prefWidth(650);
var modal = ModalOverlay.of("initialSetup", scroll);
modal.addButton(new ModalButton(
"docs",
() -> {
DocumentationLink.INTRO.open();
},
false,
false));
modal.addButton(ModalButton.ok());
AppDialog.show(modal);
});
scroll.minWidth(650);
scroll.prefWidth(650);
var modal = ModalOverlay.of("initialSetup", scroll);
modal.addButton(new ModalButton(
"docs",
() -> {
DocumentationLink.INTRO.open();
},
false,
false));
modal.addButton(ModalButton.ok());
AppDialog.show(modal);
}
}