corefx - moved background configuration to session menu, added icon path configuration to preferences

This commit is contained in:
Blake J. Harnden 2018-11-29 10:36:42 -08:00
parent 7e93b607c4
commit 6f0e22cc28
3 changed files with 10 additions and 6 deletions

View file

@ -16,10 +16,11 @@ import java.io.IOException;
public class GuiPreferencesDialog extends StageDialog { public class GuiPreferencesDialog extends StageDialog {
private static final Logger logger = LogManager.getLogger(); private static final Logger logger = LogManager.getLogger();
private @FXML JFXTextField xmlFilePathTextField; @FXML private JFXTextField xmlFilePathTextField;
private @FXML JFXTextField mobilityFilePathTextField; @FXML private JFXTextField mobilityFilePathTextField;
private @FXML JFXTextField shellCommandTextField; @FXML private JFXTextField shellCommandTextField;
private @FXML JFXButton saveButton; @FXML private JFXTextField iconPathTextField;
@FXML private JFXButton saveButton;
public GuiPreferencesDialog(Controller controller) { public GuiPreferencesDialog(Controller controller) {
super(controller, "/fxml/gui_preferences.fxml"); super(controller, "/fxml/gui_preferences.fxml");
@ -34,6 +35,7 @@ public class GuiPreferencesDialog extends StageDialog {
configuration.setXmlPath(xmlFilePathTextField.getText()); configuration.setXmlPath(xmlFilePathTextField.getText());
configuration.setMobilityPath(mobilityFilePathTextField.getText()); configuration.setMobilityPath(mobilityFilePathTextField.getText());
configuration.setShellCommand(shellCommandTextField.getText()); configuration.setShellCommand(shellCommandTextField.getText());
configuration.setIconPath(iconPathTextField.getText());
try { try {
ConfigUtils.save(configuration); ConfigUtils.save(configuration);
Toast.success("Updated preferences"); Toast.success("Updated preferences");
@ -48,6 +50,7 @@ public class GuiPreferencesDialog extends StageDialog {
xmlFilePathTextField.setText(configuration.getXmlPath()); xmlFilePathTextField.setText(configuration.getXmlPath());
mobilityFilePathTextField.setText(configuration.getMobilityPath()); mobilityFilePathTextField.setText(configuration.getMobilityPath());
shellCommandTextField.setText(configuration.getShellCommand()); shellCommandTextField.setText(configuration.getShellCommand());
iconPathTextField.setText(configuration.getIconPath());
show(); show();
} }
} }

View file

@ -5,7 +5,6 @@
<?import javafx.scene.control.TitledPane?> <?import javafx.scene.control.TitledPane?>
<?import javafx.scene.layout.VBox?> <?import javafx.scene.layout.VBox?>
<VBox maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" spacing="10.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1"> <VBox maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" spacing="10.0" xmlns="http://javafx.com/javafx/8.0.171" xmlns:fx="http://javafx.com/fxml/1">
<children> <children>
<TitledPane animated="false" collapsible="false" text="File Paths"> <TitledPane animated="false" collapsible="false" text="File Paths">
@ -16,6 +15,8 @@
<JFXTextField fx:id="xmlFilePathTextField" /> <JFXTextField fx:id="xmlFilePathTextField" />
<Label text="Mobility Files" /> <Label text="Mobility Files" />
<JFXTextField fx:id="mobilityFilePathTextField" /> <JFXTextField fx:id="mobilityFilePathTextField" />
<Label text="Icon Path" />
<JFXTextField fx:id="iconPathTextField" />
</children> </children>
</VBox> </VBox>
</content> </content>

View file

@ -28,7 +28,6 @@
</items> </items>
</Menu> </Menu>
<MenuItem mnemonicParsing="false" onAction="#onOptionsMenuNodeTypes" text="Nodes" /> <MenuItem mnemonicParsing="false" onAction="#onOptionsMenuNodeTypes" text="Nodes" />
<MenuItem mnemonicParsing="false" onAction="#onOptionsMenuBackground" text="Background" />
<MenuItem mnemonicParsing="false" onAction="#onOptionsMenuPreferences" text="Preferences" /> <MenuItem mnemonicParsing="false" onAction="#onOptionsMenuPreferences" text="Preferences" />
</items> </items>
</Menu> </Menu>
@ -37,6 +36,7 @@
<MenuItem mnemonicParsing="false" onAction="#onJoinSessionMenu" text="Join" /> <MenuItem mnemonicParsing="false" onAction="#onJoinSessionMenu" text="Join" />
<MenuItem mnemonicParsing="false" onAction="#onSessionHooksMenu" text="Hooks" /> <MenuItem mnemonicParsing="false" onAction="#onSessionHooksMenu" text="Hooks" />
<MenuItem mnemonicParsing="false" onAction="#onOptionsMenuLocation" text="Location" /> <MenuItem mnemonicParsing="false" onAction="#onOptionsMenuLocation" text="Location" />
<MenuItem mnemonicParsing="false" onAction="#onOptionsMenuBackground" text="Background" />
<MenuItem mnemonicParsing="false" onAction="#onSessionOptionsMenu" text="Options" /> <MenuItem mnemonicParsing="false" onAction="#onSessionOptionsMenu" text="Options" />
</items> </items>
</Menu> </Menu>