From 39c84b2c3f3a190bc5e31a2d874bd8d4daf3e394 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Wed, 2 Aug 2017 19:37:35 -0700 Subject: [PATCH] Stop autosaving, switch to save + reload buttons. --- .../org/nwapw/abacus/fx/AbacusController.java | 15 +++++++-------- src/main/resources/abacus.fxml | 6 ++++-- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/nwapw/abacus/fx/AbacusController.java b/src/main/java/org/nwapw/abacus/fx/AbacusController.java index 29ee546..ebd7437 100644 --- a/src/main/java/org/nwapw/abacus/fx/AbacusController.java +++ b/src/main/java/org/nwapw/abacus/fx/AbacusController.java @@ -51,8 +51,6 @@ public class AbacusController implements PluginListener { private ComboBox numberImplementationBox; @FXML private ListView enabledPluginView; - @FXML - private Button reloadButton; /** * The list of history entries, created by the users. @@ -94,11 +92,6 @@ public class AbacusController implements PluginListener { historyTable.setItems(historyData); numberImplementationOptions = FXCollections.observableArrayList(); numberImplementationBox.setItems(numberImplementationOptions); - numberImplementationBox.valueProperty().addListener((observable, oldValue, newValue) - -> { - abacus.getConfiguration().setNumberImplementation(newValue); - abacus.getConfiguration().saveTo(Abacus.CONFIG_FILE); - }); historyTable.getSelectionModel().setCellSelectionEnabled(true); enabledPlugins = FXCollections.observableArrayList(); enabledPluginView.setItems(enabledPlugins); @@ -146,7 +139,13 @@ public class AbacusController implements PluginListener { if(!pluginEntry.isEnabled()) disabledPlugins.add(pluginEntry.getClassName()); } abacus.getPluginManager().reload(); - abacus.getConfiguration().saveTo(Abacus.CONFIG_FILE); + } + + @FXML + private void performSave(){ + Configuration configuration = abacus.getConfiguration(); + configuration.setNumberImplementation(numberImplementationBox.getSelectionModel().getSelectedItem()); + configuration.saveTo(Abacus.CONFIG_FILE); } @Override diff --git a/src/main/resources/abacus.fxml b/src/main/resources/abacus.fxml index 14e809f..8d8567c 100644 --- a/src/main/resources/abacus.fxml +++ b/src/main/resources/abacus.fxml @@ -49,8 +49,10 @@ -