Compare commits
8 Commits
a45ffdd864
...
2025-07-05
Author | SHA1 | Date | |
---|---|---|---|
ca502fd411 | |||
c8a1128e11 | |||
b9a2202c68 | |||
671844723f | |||
7a0ce063f1 | |||
62bfbb1923 | |||
2992572651 | |||
b25fea4549 |
@ -25,6 +25,7 @@ import javafx.fxml.FXMLLoader;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.control.Alert.AlertType;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.ButtonType;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.TextArea;
|
||||
@ -183,9 +184,20 @@ public class MainController implements Initializable {
|
||||
|
||||
Result<MainSettings, Exception> result = MainSettings.load();
|
||||
if (!result.hasSuccess()) {
|
||||
Alert alert = new Alert(Alert.AlertType.ERROR, "Unable to load settings file. See log for details. Reinitialize settings? This may overwrite existing settings.", ButtonType.YES, ButtonType.NO);
|
||||
String logPath = Main.getStatePath().resolve("main.log").toString();
|
||||
String message = "Unable to load settings file. See log file at " + logPath + " for details. Reinitialize settings? This may overwrite existing settings.";
|
||||
Alert alert = new Alert(Alert.AlertType.ERROR, message, ButtonType.NO, ButtonType.YES);
|
||||
alert.setTitle("Settings load error");
|
||||
alert.setHeaderText(null);
|
||||
|
||||
//Deactivate Defaultbehavior for yes-Button:
|
||||
Button yesButton = (Button) alert.getDialogPane().lookupButton( ButtonType.YES );
|
||||
yesButton.setDefaultButton( false );
|
||||
|
||||
//Activate Defaultbehavior for no-Button:
|
||||
Button noButton = (Button) alert.getDialogPane().lookupButton( ButtonType.NO );
|
||||
noButton.setDefaultButton( true );
|
||||
|
||||
Optional<ButtonType> promptResult = alert.showAndWait();
|
||||
|
||||
if (!promptResult.isPresent()) {
|
||||
|
@ -138,14 +138,12 @@ public class StationSelectionController {
|
||||
while (change.next()) {
|
||||
if (change.wasAdded()) {
|
||||
for (StationSettings addedStation : change.getAddedSubList()) {
|
||||
System.out.println("Added: " + addedStation.getName());
|
||||
}
|
||||
}
|
||||
if (change.wasRemoved()) {
|
||||
for (StationSettings removedStation : change.getRemoved()) {
|
||||
System.out.println("Removed: " + removedStation.getName());
|
||||
|
||||
try {
|
||||
StationSettings.deleteStationData(removedStation.getName());
|
||||
removedStation.deleteDir();
|
||||
} catch (IOException e) {
|
||||
logger.log(Level.SEVERE, "Exception when removing station directory", e);
|
||||
@ -170,7 +168,6 @@ public class StationSelectionController {
|
||||
|
||||
if (selectedStation != null) {
|
||||
stage.setUserData(selectedStation.getName());
|
||||
System.out.println("Selected Station: " + selectedStation.getName());
|
||||
}
|
||||
stage.close();
|
||||
}
|
||||
|
@ -112,6 +112,10 @@ public class StationSettings {
|
||||
}
|
||||
|
||||
public void deleteDir() throws IOException {
|
||||
if (!Files.exists(stationPath())) {
|
||||
return;
|
||||
}
|
||||
|
||||
Files.walkFileTree(stationPath(), new SimpleFileVisitor<Path>() {
|
||||
@Override
|
||||
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
|
||||
|
@ -533,16 +533,6 @@ public class StationSettingsController {
|
||||
}
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void handleTestRegisterScheduleButtonPress() {
|
||||
WindowsScheduler.registerSchedule(settings);
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void handleTestRunScheduleButtonPress() {
|
||||
WindowsScheduler.runSchedule(settings);
|
||||
}
|
||||
|
||||
public StringProperty stationAddressProperty() {
|
||||
return stationAddress;
|
||||
}
|
||||
@ -565,7 +555,6 @@ public class StationSettingsController {
|
||||
messagePeriod.set(settings.getMessagePeriod());
|
||||
username.set(settings.getUsername());
|
||||
password.set(settings.getPassword());
|
||||
System.out.println(settings.getPrefixes());
|
||||
prefixListView.getItems().addAll(settings.getPrefixes());
|
||||
scheduleStartDate.set(settings.getScheduleStart().withZoneSameInstant(ZoneId.systemDefault()).toLocalDate());
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss");
|
||||
|
@ -15,7 +15,7 @@
|
||||
<Label layoutX="20.0" layoutY="50.0" text="Homepage:" AnchorPane.leftAnchor="20.0" AnchorPane.topAnchor="50.0" />
|
||||
<TextField fx:id="homepageURLTextField" accessibleText="Homepage URL field" editable="false" layoutX="89.0" layoutY="46.0" prefHeight="25.0" prefWidth="501.0" text="asefa" AnchorPane.leftAnchor="89.0" AnchorPane.rightAnchor="10.0" />
|
||||
<Label layoutX="20.0" layoutY="80.0" text="Version:" AnchorPane.leftAnchor="20.0" AnchorPane.topAnchor="80.0" />
|
||||
<TextField fx:id="versionTextField" accessibleText="Application version field" editable="false" layoutX="72.0" layoutY="76.0" text="asefa" />
|
||||
<TextField fx:id="versionTextField" accessibleText="Application version field" editable="false" layoutX="72.0" layoutY="76.0" text="asefa" AnchorPane.leftAnchor="89.0" AnchorPane.rightAnchor="10.0" />
|
||||
<Label layoutX="20.0" layoutY="110.0" text="Application executable: " AnchorPane.leftAnchor="20.0" AnchorPane.topAnchor="110.0" />
|
||||
<TextField fx:id="executableTextField" accessibleText="Application executable path field" editable="false" layoutX="153.0" layoutY="106.0" prefHeight="25.0" prefWidth="403.0" text="sflejk" AnchorPane.leftAnchor="153.0" AnchorPane.rightAnchor="10.0" />
|
||||
<Label layoutX="20.0" layoutY="140.0" text="Config directory: " AnchorPane.leftAnchor="20.0" AnchorPane.topAnchor="140.0" />
|
||||
|
@ -3,4 +3,4 @@
|
||||
<?import javafx.scene.web.WebView?>
|
||||
|
||||
|
||||
<WebView fx:id="webView" prefHeight="391.0" prefWidth="440.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="name.nathanmcrae.numbersstation.HelpController" />
|
||||
<WebView fx:id="webView" prefHeight="597.0" prefWidth="652.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="name.nathanmcrae.numbersstation.HelpController" />
|
||||
|
@ -147,9 +147,6 @@
|
||||
<Label layoutX="115.0" layoutY="8.0" text="Starting from:" />
|
||||
<DatePicker fx:id="scheduleStartDatePicker" accessibleText="Message schedule start date" disable="${manageScheduleExternallyCheckBox.selected}" layoutX="115.0" layoutY="34.0" />
|
||||
<TextField fx:id="scheduleStartTimeField" accessibleText="Message schedule start time" disable="${manageScheduleExternallyCheckBox.selected}" layoutX="115.0" layoutY="64.0" text="23:24:49" />
|
||||
<Label layoutX="48.0" layoutY="102.0" text="TODO: Jitter" />
|
||||
<Button layoutX="377.0" layoutY="73.0" mnemonicParsing="false" onAction="#handleTestRegisterScheduleButtonPress" text="Test register scheduled task" />
|
||||
<Button layoutX="377.0" layoutY="107.0" mnemonicParsing="false" onAction="#handleTestRunScheduleButtonPress" text="Test running scheduled task" />
|
||||
|
||||
</children>
|
||||
</AnchorPane>
|
||||
|
@ -108,7 +108,6 @@
|
||||
<li>
|
||||
Set other options (See application reference for details)
|
||||
</li>
|
||||
<li>TODO: test post</li>
|
||||
</ol>
|
||||
|
||||
<h3>
|
||||
|
Reference in New Issue
Block a user