25 lines
698 B
Java
25 lines
698 B
Java
package it.cavallium;
|
|
|
|
import java.io.IOException;
|
|
import java.time.Duration;
|
|
import javafx.fxml.FXML;
|
|
import javafx.scene.control.Button;
|
|
import javafx.scene.control.Spinner;
|
|
|
|
public class SecondaryController {
|
|
|
|
public Button closeButton;
|
|
public Spinner<Integer> delaySeconds;
|
|
|
|
@FXML
|
|
protected void initialize() {
|
|
delaySeconds.getValueFactory().setValue((int) App.getSettingsService().getDelayBetweenAdds().toSeconds());
|
|
}
|
|
|
|
@FXML
|
|
private void switchToPrimary() throws IOException {
|
|
var delaySecondsValue = Duration.ofSeconds(Math.max (0, (int) delaySeconds.getValueFactory().getValue()));
|
|
App.getSettingsService().setDelayBetweenAdds(delaySecondsValue);
|
|
App.setRoot("primary");
|
|
}
|
|
} |