Remove FTP/SCP and replace with Wordpress

This commit is contained in:
Nathan McRae 2025-02-02 17:28:03 -08:00
parent ebf8a6b7c1
commit fccec5faa6
3 changed files with 26 additions and 39 deletions

View File

@ -23,10 +23,9 @@ public class StationSettings {
private String username;
public enum MessageMethod {
FTP,
EXTERNAL_PROGRAM,
SFTP,
SCP,
EXTERNAL_PROGRAM
WORDPRESS
}
public enum MessagePeriod {

View File

@ -105,15 +105,9 @@ public class StationSettingsController {
@FXML
private RadioButton monthlyRadioButton;
@FXML
private RadioButton ftpRadioButton;
@FXML
private RadioButton sftpRadioButton;
@FXML
private RadioButton scpRadioButton;
@FXML
private TextField scheduleStartTimeField;
@ -138,6 +132,9 @@ public class StationSettingsController {
@FXML
private RadioButton weeklyRadioButton;
@FXML
private RadioButton wordpressRadioButton;
public StationSettingsController() { }
@FXML
@ -267,26 +264,22 @@ public class StationSettingsController {
});
messageMethodGroup.selectedToggleProperty().addListener((observable, oldValue, newValue) -> {
if (newValue == ftpRadioButton) {
messageMethod.set(StationSettings.MessageMethod.FTP);
if (newValue == externalProgramRadioButton) {
messageMethod.set(StationSettings.MessageMethod.EXTERNAL_PROGRAM);
} else if (newValue == sftpRadioButton) {
messageMethod.set(StationSettings.MessageMethod.SFTP);
} else if (newValue == scpRadioButton) {
messageMethod.set(StationSettings.MessageMethod.SCP);
} else if (newValue == externalProgramRadioButton) {
messageMethod.set(StationSettings.MessageMethod.EXTERNAL_PROGRAM);
} else if (newValue == wordpressRadioButton) {
messageMethod.set(StationSettings.MessageMethod.WORDPRESS);
}
});
messageMethod.addListener((observable, oldValue, newValue) -> {
if (newValue == StationSettings.MessageMethod.FTP) {
messageMethodGroup.selectToggle(ftpRadioButton);
if (newValue == StationSettings.MessageMethod.EXTERNAL_PROGRAM) {
messageMethodGroup.selectToggle(externalProgramRadioButton);
} else if (newValue == StationSettings.MessageMethod.SFTP) {
messageMethodGroup.selectToggle(sftpRadioButton);
} else if (newValue == StationSettings.MessageMethod.SCP) {
messageMethodGroup.selectToggle(scpRadioButton);
} else if (newValue == StationSettings.MessageMethod.EXTERNAL_PROGRAM) {
messageMethodGroup.selectToggle(externalProgramRadioButton);
} else if (newValue == StationSettings.MessageMethod.WORDPRESS) {
messageMethodGroup.selectToggle(wordpressRadioButton);
}
});

View File

@ -63,42 +63,37 @@
</children>
</AnchorPane>
<Separator prefWidth="200.0" />
<AnchorPane prefHeight="170.0" prefWidth="578.0">
<AnchorPane prefHeight="167.0" prefWidth="578.0">
<children>
<Label layoutY="6.0" text="Send messages via:">
<font>
<Font size="14.0" />
</font>
</Label>
<Label layoutX="170.0" layoutY="9.0" text="Numbers station address:" />
<TextField fx:id="stationAddressField" layoutX="188.0" layoutY="33.0" prefHeight="25.0" prefWidth="390.0" AnchorPane.leftAnchor="188.0" AnchorPane.rightAnchor="0.0" />
<RadioButton fx:id="ftpRadioButton" layoutX="16.0" layoutY="44.0" mnemonicParsing="false" text="FTP">
<toggleGroup>
<Label layoutX="170.0" layoutY="39.0" text="Numbers station address:" />
<TextField fx:id="stationAddressField" layoutX="188.0" layoutY="63.0" prefHeight="25.0" prefWidth="390.0" AnchorPane.leftAnchor="188.0" AnchorPane.rightAnchor="0.0" />
<RadioButton fx:id="sftpRadioButton" layoutX="16.0" layoutY="42.0" mnemonicParsing="false" text="SFTP">
<toggleGroup>
<ToggleGroup fx:id="messageMethodGroup" />
</toggleGroup>
</toggleGroup>
</RadioButton>
<RadioButton fx:id="sftpRadioButton" layoutX="16.0" layoutY="74.0" mnemonicParsing="false" text="SFTP">
<RadioButton fx:id="wordpressRadioButton" layoutX="16.0" layoutY="72.0" mnemonicParsing="false" text="Wordpress">
<toggleGroup>
<fx:reference source="messageMethodGroup" />
</toggleGroup>
</RadioButton>
<RadioButton fx:id="scpRadioButton" layoutX="16.0" layoutY="104.0" mnemonicParsing="false" text="SCP">
<RadioButton fx:id="externalProgramRadioButton" layoutX="16.0" layoutY="102.0" mnemonicParsing="false" text="External program:">
<toggleGroup>
<fx:reference source="messageMethodGroup" />
</toggleGroup>
</RadioButton>
<RadioButton fx:id="externalProgramRadioButton" layoutX="16.0" layoutY="134.0" mnemonicParsing="false" text="External program:">
<toggleGroup>
<fx:reference source="messageMethodGroup" />
</toggleGroup>
</RadioButton>
<Label layoutX="380.0" layoutY="69.0" text="Username:" AnchorPane.rightAnchor="142.0" />
<Label layoutX="182.0" layoutY="99.0" text="Username:" AnchorPane.rightAnchor="340.0" />
<Label layoutX="380.0" layoutY="99.0" text="Password:" AnchorPane.rightAnchor="142.0" />
<TextField fx:id="usernameField" layoutX="444.0" layoutY="65.0" prefHeight="25.0" prefWidth="135.0" AnchorPane.rightAnchor="0.0" />
<TextField fx:id="usernameField" layoutX="245.0" layoutY="95.0" prefHeight="25.0" prefWidth="135.0" AnchorPane.rightAnchor="198.0" />
<PasswordField fx:id="passwordField" layoutX="444.0" layoutY="95.0" prefHeight="25.0" prefWidth="135.0" AnchorPane.rightAnchor="0.0" />
<TextField fx:id="externalProgramCommandField" layoutX="140.0" layoutY="131.0" prefHeight="25.0" prefWidth="438.0" AnchorPane.leftAnchor="140.0" AnchorPane.rightAnchor="0.0" />
<Button fx:id="testConnectionButton" layoutX="188.0" layoutY="65.0" mnemonicParsing="false" onMousePressed="#handleTestConnectionButtonPress" text="Test connection" />
<Label fx:id="connectionTestStatusLabel" layoutX="188.0" layoutY="99.0" prefHeight="17.0" prefWidth="185.0" AnchorPane.leftAnchor="188.0" AnchorPane.rightAnchor="205.0" />
<TextField fx:id="externalProgramCommandField" layoutX="-2.0" layoutY="131.0" prefHeight="25.0" prefWidth="580.0" AnchorPane.leftAnchor="-2.0" AnchorPane.rightAnchor="0.0" />
<Button fx:id="testConnectionButton" layoutX="464.0" layoutY="7.0" mnemonicParsing="false" onMousePressed="#handleTestConnectionButtonPress" text="Test connection" />
<Label fx:id="connectionTestStatusLabel" layoutX="257.0" layoutY="11.0" prefHeight="17.0" prefWidth="196.0" AnchorPane.leftAnchor="257.0" AnchorPane.rightAnchor="125.0" />
</children>
<VBox.margin>