mirror of
https://github.com/DanilaFe/abacus
synced 2024-12-22 15:30:09 -08:00
Stop autosaving, switch to save + reload buttons.
This commit is contained in:
parent
2f1ed5f0d1
commit
be28e26607
|
@ -51,8 +51,6 @@ public class AbacusController implements PluginListener {
|
||||||
private ComboBox<String> numberImplementationBox;
|
private ComboBox<String> numberImplementationBox;
|
||||||
@FXML
|
@FXML
|
||||||
private ListView<ToggleablePlugin> enabledPluginView;
|
private ListView<ToggleablePlugin> enabledPluginView;
|
||||||
@FXML
|
|
||||||
private Button reloadButton;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The list of history entries, created by the users.
|
* The list of history entries, created by the users.
|
||||||
|
@ -94,11 +92,6 @@ public class AbacusController implements PluginListener {
|
||||||
historyTable.setItems(historyData);
|
historyTable.setItems(historyData);
|
||||||
numberImplementationOptions = FXCollections.observableArrayList();
|
numberImplementationOptions = FXCollections.observableArrayList();
|
||||||
numberImplementationBox.setItems(numberImplementationOptions);
|
numberImplementationBox.setItems(numberImplementationOptions);
|
||||||
numberImplementationBox.valueProperty().addListener((observable, oldValue, newValue)
|
|
||||||
-> {
|
|
||||||
abacus.getConfiguration().setNumberImplementation(newValue);
|
|
||||||
abacus.getConfiguration().saveTo(Abacus.CONFIG_FILE);
|
|
||||||
});
|
|
||||||
historyTable.getSelectionModel().setCellSelectionEnabled(true);
|
historyTable.getSelectionModel().setCellSelectionEnabled(true);
|
||||||
enabledPlugins = FXCollections.observableArrayList();
|
enabledPlugins = FXCollections.observableArrayList();
|
||||||
enabledPluginView.setItems(enabledPlugins);
|
enabledPluginView.setItems(enabledPlugins);
|
||||||
|
@ -146,7 +139,13 @@ public class AbacusController implements PluginListener {
|
||||||
if(!pluginEntry.isEnabled()) disabledPlugins.add(pluginEntry.getClassName());
|
if(!pluginEntry.isEnabled()) disabledPlugins.add(pluginEntry.getClassName());
|
||||||
}
|
}
|
||||||
abacus.getPluginManager().reload();
|
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
|
@Override
|
||||||
|
|
|
@ -49,8 +49,10 @@
|
||||||
<ListView fx:id="enabledPluginView"
|
<ListView fx:id="enabledPluginView"
|
||||||
GridPane.rowIndex="1" GridPane.columnIndex="0"
|
GridPane.rowIndex="1" GridPane.columnIndex="0"
|
||||||
GridPane.columnSpan="2" maxHeight="100"/>
|
GridPane.columnSpan="2" maxHeight="100"/>
|
||||||
<Button fx:id="reloadButton" text="Reload" GridPane.rowIndex="2" GridPane.columnIndex="0"
|
<HBox GridPane.columnIndex="0" GridPane.columnSpan="2" GridPane.rowIndex="2" spacing="10">
|
||||||
onAction="#performReload"/>
|
<Button text="Apply" onAction="#performSave"/>
|
||||||
|
<Button text="Reload" onAction="#performReload"/>
|
||||||
|
</HBox>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
</Tab>
|
</Tab>
|
||||||
</TabPane>
|
</TabPane>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user