2020-10-15 13:00:03 +02:00
|
|
|
package it.cavallium;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
2020-10-20 02:54:32 +02:00
|
|
|
import java.time.Duration;
|
2020-10-15 13:00:03 +02:00
|
|
|
import javafx.fxml.FXML;
|
2020-10-20 02:54:32 +02:00
|
|
|
import javafx.scene.control.Button;
|
|
|
|
import javafx.scene.control.Spinner;
|
2020-10-15 13:00:03 +02:00
|
|
|
|
|
|
|
public class SecondaryController {
|
|
|
|
|
2020-10-20 02:54:32 +02:00
|
|
|
public Button closeButton;
|
|
|
|
public Spinner<Integer> delaySeconds;
|
|
|
|
|
|
|
|
@FXML
|
|
|
|
protected void initialize() {
|
|
|
|
delaySeconds.getValueFactory().setValue((int) App.getSettingsService().getDelayBetweenAdds().toSeconds());
|
|
|
|
}
|
|
|
|
|
2020-10-20 00:31:11 +02:00
|
|
|
@FXML
|
|
|
|
private void switchToPrimary() throws IOException {
|
2020-10-20 02:54:32 +02:00
|
|
|
var delaySecondsValue = Duration.ofSeconds(Math.max (0, (int) delaySeconds.getValueFactory().getValue()));
|
|
|
|
App.getSettingsService().setDelayBetweenAdds(delaySecondsValue);
|
2020-10-20 00:31:11 +02:00
|
|
|
App.setRoot("primary");
|
|
|
|
}
|
2020-10-15 13:00:03 +02:00
|
|
|
}
|