<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~ Minosoft
  ~ Copyright (C) 2020-2022 Moritz Zwerger
  ~
  ~ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  ~
  ~ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  ~
  ~ You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
  ~
  ~ This software is not affiliated with Mojang AB, the original developer of Minecraft.
  -->

<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<HBox xmlns:fx="http://javafx.com/fxml/1" prefHeight="250.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/17"> <!--fx:controller="de.bixilon.minosoft.gui.eros.dialog.UpdateServerDialog" -->
    <GridPane HBox.hgrow="ALWAYS">
        <columnConstraints>
            <ColumnConstraints hgrow="ALWAYS"/>
        </columnConstraints>
        <rowConstraints>
            <RowConstraints valignment="CENTER" vgrow="ALWAYS"/>
            <RowConstraints/>
            <RowConstraints/>
        </rowConstraints>
        <TextFlow fx:id="descriptionFX" prefHeight="200.0" prefWidth="200.0">
            <GridPane.margin>
                <Insets bottom="20.0" left="5.0" right="20.0" top="20.0"/>
            </GridPane.margin>
            <Text text="Please enter the server name and their hostname/IP address"/>
        </TextFlow>
        <GridPane GridPane.rowIndex="1">
            <columnConstraints>
                <ColumnConstraints hgrow="NEVER"/>
                <ColumnConstraints hgrow="ALWAYS"/>
            </columnConstraints>
            <rowConstraints>
                <RowConstraints valignment="CENTER" vgrow="NEVER"/>
                <RowConstraints valignment="CENTER" vgrow="NEVER"/>
                <RowConstraints valignment="CENTER" vgrow="NEVER"/>
                <RowConstraints valignment="CENTER" vgrow="NEVER"/>
                <RowConstraints minHeight="10.0" prefHeight="30.0" valignment="CENTER" vgrow="ALWAYS"/>
            </rowConstraints>

            <TextFlow fx:id="serverNameLabelFX">
                <GridPane.margin>
                    <Insets left="5.0" right="30.0" top="15.0"/>
                </GridPane.margin>
                <Text text="Server name"/>
            </TextFlow>
            <TextField fx:id="serverNameFX" promptText="A Minosoft server" GridPane.columnIndex="1">
                <GridPane.margin>
                    <Insets left="5.0" right="5.0"/>
                </GridPane.margin>
            </TextField>

            <TextFlow fx:id="serverAddressLabelFX" GridPane.rowIndex="1">
                <GridPane.margin>
                    <Insets left="5.0" right="30.0" top="15.0"/>
                </GridPane.margin>
                <Text text="Server address"/>
            </TextFlow>
            <TextField fx:id="serverAddressFX" promptText="127.0.0.1:25565" GridPane.columnIndex="1" GridPane.rowIndex="1">
                <GridPane.margin>
                    <Insets left="5.0" right="5.0"/>
                </GridPane.margin>
            </TextField>

            <TextFlow fx:id="forcedVersionLabelFX" GridPane.rowIndex="2">
                <GridPane.margin>
                    <Insets left="5.0" right="30.0" top="15.0"/>
                </GridPane.margin>
                <Text text="Forced version"/>
            </TextFlow>
            <GridPane GridPane.columnIndex="1" GridPane.rowIndex="2">
                <columnConstraints>
                    <ColumnConstraints hgrow="ALWAYS"/>
                    <ColumnConstraints hgrow="NEVER"/>
                </columnConstraints>
                <rowConstraints>
                    <RowConstraints vgrow="NEVER"/>
                </rowConstraints>
                <ComboBox fx:id="forcedVersionFX" maxWidth="Infinity">
                    <GridPane.margin>
                        <Insets left="5.0" right="10.0"/>
                    </GridPane.margin>
                </ComboBox>
                <GridPane GridPane.columnIndex="1">
                    <columnConstraints>
                        <ColumnConstraints hgrow="NEVER"/>
                    </columnConstraints>
                    <rowConstraints>
                        <RowConstraints vgrow="NEVER"/>
                        <RowConstraints vgrow="NEVER"/>
                    </rowConstraints>
                    <CheckBox fx:id="showReleasesFX" text="Releases">
                        <GridPane.margin>
                            <Insets bottom="5.0" left="5.0" right="5.0" top="5.0"/>
                        </GridPane.margin>
                    </CheckBox>
                    <CheckBox fx:id="showSnapshotsFX" text="Snapshots" GridPane.rowIndex="1">
                        <GridPane.margin>
                            <Insets bottom="5.0" left="5.0" right="5.0" top="5.0"/>
                        </GridPane.margin>
                    </CheckBox>
                </GridPane>
            </GridPane>

            <TextFlow fx:id="profilesLabelFX" GridPane.rowIndex="3">
                <GridPane.margin>
                    <Insets left="5.0" right="30.0" top="15.0"/>
                </GridPane.margin>
                <Text text="Profiles"/>
            </TextFlow>
            <Button fx:id="openProfileSelectDialogButtonFX" onAction="#openProfileSelectDialog" maxWidth="Infinity" text="Open profile select dialog" textAlignment="CENTER" GridPane.columnIndex="1" GridPane.rowIndex="3">
                <GridPane.margin>
                    <Insets bottom="5.0" left="5.0" right="5.0" top="5.0"/>
                </GridPane.margin>
            </Button>
        </GridPane>
        <GridPane GridPane.rowIndex="2">
            <columnConstraints>
                <ColumnConstraints hgrow="ALWAYS"/>
                <ColumnConstraints hgrow="NEVER"/>
                <ColumnConstraints hgrow="NEVER"/>
            </columnConstraints>
            <rowConstraints>
                <RowConstraints/>
                <RowConstraints vgrow="NEVER"/>
            </rowConstraints>
            <Button fx:id="modifyServerButtonFX" defaultButton="true" disable="true" onAction="#modify" text="Update server" GridPane.columnIndex="2" GridPane.rowIndex="1">
                <GridPane.margin>
                    <Insets bottom="10.0" left="5.0" right="10.0" top="5.0"/>
                </GridPane.margin>
            </Button>
            <Button fx:id="cancelButtonFX" onAction="#cancel" text="Cancel" GridPane.columnIndex="1" GridPane.rowIndex="1">
                <GridPane.margin>
                    <Insets bottom="10.0" left="5.0" right="5.0" top="5.0"/>
                </GridPane.margin>
            </Button>
        </GridPane>
    </GridPane>
</HBox>
