Disable connection controls when external program is selected

This commit is contained in:
Nathan McRae 2025-01-19 22:07:26 -08:00
parent 4eb8d60c64
commit 837b08c4cb
2 changed files with 10 additions and 1 deletions

View File

@ -22,6 +22,7 @@ import javafx.collections.ObservableList;
import javafx.event.Event;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.DatePicker;
import javafx.scene.control.ListCell;
@ -98,6 +99,9 @@ public class MainSettingsController {
@FXML
private TextField scheduleStartTimeField;
@FXML
private Button testConnectionButton;
@FXML
private RadioButton externalProgramRadioButton;
@ -313,6 +317,11 @@ public class MainSettingsController {
});
externalProgramCommandField.disableProperty().bind(externalProgramRadioButton.selectedProperty().not());
stationAddressField.disableProperty().bind(externalProgramRadioButton.selectedProperty());
usernameField.disableProperty().bind(externalProgramRadioButton.selectedProperty());
passwordField.disableProperty().bind(externalProgramRadioButton.selectedProperty());
testConnectionButton.disableProperty().bind(externalProgramRadioButton.selectedProperty());
}
@FXML

View File

@ -97,7 +97,7 @@
<TextField fx:id="usernameField" layoutX="444.0" layoutY="65.0" prefHeight="25.0" prefWidth="135.0" AnchorPane.rightAnchor="0.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 layoutX="188.0" layoutY="65.0" mnemonicParsing="false" onMousePressed="#handleTestConnectionButtonPress" text="Test connection" />
<Button fx:id="testConnectionButton" layoutX="188.0" layoutY="65.0" mnemonicParsing="false" onMousePressed="#handleTestConnectionButtonPress" text="Test connection" />
</children>
<VBox.margin>