Compare commits

...

8 Commits

Author SHA1 Message Date
ca502fd411 Remove schedule test buttons 2025-07-05 18:18:36 -07:00
c8a1128e11 Widen default help window size 2025-07-05 17:47:49 -07:00
b9a2202c68 Make version field full-width 2025-07-05 17:47:30 -07:00
671844723f Don't error if station doesn't have dir when deleted 2025-07-05 17:47:18 -07:00
7a0ce063f1 Add deletion of station schedule info when station is removed
Task scheduler entry for Windows, cron entry for *nix
2025-07-05 17:46:56 -07:00
62bfbb1923 Add log path to settings load error
Since they wouldn't be able to run the application to see the log path.

Also make no the default option
2025-07-05 17:44:49 -07:00
2992572651 Remove some unnecessary printlns 2025-07-05 13:47:51 -07:00
b25fea4549 Remove jitter todo from settings page 2025-06-08 12:28:57 -07:00
8 changed files with 20 additions and 22 deletions

View File

@ -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()) {

View File

@ -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();
}

View File

@ -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 {

View File

@ -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");

View File

@ -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" />

View File

@ -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" />

View File

@ -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>

View File

@ -108,7 +108,6 @@
<li>
Set other options (See application reference for details)
</li>
<li>TODO: test post</li>
</ol>
<h3>