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

<!--
  ~ This file is part of Haveno.
  ~
  ~ Haveno is free software: you can redistribute it and/or modify it
  ~ under the terms of the GNU Affero General Public License as published by
  ~ the Free Software Foundation, either version 3 of the License, or (at
  ~ your option) any later version.
  ~
  ~ Haveno 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 Affero General Public
  ~ License for more details.
  ~
  ~ You should have received a copy of the GNU Affero General Public License
  ~ along with Haveno. If not, see <http://www.gnu.org/licenses/>.
  -->

<?import haveno.desktop.components.AutoTooltipButton?>
<?import haveno.desktop.components.AutoTooltipCheckBox?>
<?import haveno.desktop.components.AutoTooltipLabel?>
<?import haveno.desktop.components.AutoTooltipRadioButton?>
<?import haveno.desktop.components.HavenoTextField?>
<?import haveno.desktop.components.InputTextField?>
<?import haveno.desktop.components.TitledGroupBg?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.cell.PropertyValueFactory?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<GridPane fx:id="root" fx:controller="haveno.desktop.main.settings.network.NetworkSettingsView"
          hgap="5.0" vgap="20.0"
          AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
          AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"
          xmlns:fx="http://javafx.com/fxml">

    <padding>
        <Insets bottom="10.0" left="15.0" top="30.0" right="15"/>
    </padding>

    <TitledGroupBg fx:id="btcHeader" GridPane.rowSpan="5"/>
    <VBox GridPane.rowIndex="0" GridPane.hgrow="ALWAYS" GridPane.vgrow="SOMETIMES">
        <AutoTooltipLabel fx:id="moneroConnectionsLabel" styleClass="small-text"/>
        <TableView fx:id="moneroConnectionsTableView">
            <columns>
                <TableColumn fx:id="moneroConnectionAddressColumn" minWidth="220">
                    <cellValueFactory>
                        <PropertyValueFactory property="address"/>
                    </cellValueFactory>
                </TableColumn>
                <TableColumn fx:id="moneroConnectionConnectedColumn" minWidth="80" maxWidth="110">
                    <cellValueFactory>
                        <PropertyValueFactory property="connected"/>
                    </cellValueFactory>
                </TableColumn>
            </columns>
        </TableView>
        <AutoTooltipLabel fx:id="localhostXmrNodeInfoLabel" styleClass="small-text"/>
    </VBox>

    <VBox GridPane.rowIndex="1">
        <AutoTooltipLabel fx:id="useTorForXmrLabel" styleClass="small-text"/>
        <HBox spacing="10">
            <AutoTooltipRadioButton fx:id="useTorForXmrAfterSyncRadio"/>
            <AutoTooltipRadioButton fx:id="useTorForXmrOnRadio"/>
            <AutoTooltipRadioButton fx:id="useTorForXmrOffRadio"/>
        </HBox>
    </VBox>

    <VBox GridPane.rowIndex="2">
        <AutoTooltipLabel fx:id="moneroNodesLabel" styleClass="small-text"/>
        <HBox spacing="10">
            <AutoTooltipRadioButton fx:id="useProvidedNodesRadio"/>
            <AutoTooltipRadioButton fx:id="useCustomNodesRadio"/>
            <AutoTooltipRadioButton fx:id="usePublicNodesRadio"/>
        </HBox>
    </VBox>

    <VBox GridPane.rowIndex="3">
        <AutoTooltipLabel fx:id="xmrNodesLabel" styleClass="small-text"/>
        <InputTextField fx:id="xmrNodesInputTextField"/>
    </VBox>

    <VBox GridPane.rowIndex="4">
        <AutoTooltipLabel fx:id="rescanOutputsLabel" styleClass="small-text"/>
        <AutoTooltipButton fx:id="rescanOutputsButton"/>
    </VBox>

    <TitledGroupBg fx:id="p2pHeader" GridPane.rowIndex="5" GridPane.rowSpan="6">
        <padding>
            <Insets top="50.0"/>
        </padding>
        <GridPane.margin>
            <Insets bottom="-10" left="-10" right="-10" top="30"/>
        </GridPane.margin>
    </TitledGroupBg>

    <HavenoTextField fx:id="onionAddress" GridPane.rowIndex="5"
                   editable="false" focusTraversable="false" labelFloat="true">
        <GridPane.margin>
            <Insets top="60.0"/>
        </GridPane.margin>
    </HavenoTextField>

    <VBox GridPane.rowIndex="6" GridPane.hgrow="ALWAYS" GridPane.vgrow="SOMETIMES">
        <GridPane.margin>
            <Insets top="0" right="0" bottom="10" left="0"/>
        </GridPane.margin>
        <AutoTooltipLabel fx:id="p2PPeersLabel" styleClass="small-text"/>
        <TableView fx:id="p2pPeersTableView">
            <columns>
                <TableColumn fx:id="onionAddressColumn" minWidth="220">
                    <cellValueFactory>
                        <PropertyValueFactory property="onionAddress"/>
                    </cellValueFactory>
                </TableColumn>
                <TableColumn fx:id="connectionTypeColumn" minWidth="80" maxWidth="90">
                    <cellValueFactory>
                        <PropertyValueFactory property="connectionType"/>
                    </cellValueFactory>
                </TableColumn>
                <TableColumn fx:id="creationDateColumn" minWidth="180" maxWidth="180">
                    <cellValueFactory>
                        <PropertyValueFactory property="creationDate"/>
                    </cellValueFactory>
                </TableColumn>
                <TableColumn fx:id="roundTripTimeColumn" minWidth="80" maxWidth="80">
                    <cellValueFactory>
                        <PropertyValueFactory property="roundTripTime"/>
                    </cellValueFactory>
                </TableColumn>
                <TableColumn fx:id="sentBytesColumn" minWidth="100" maxWidth="120">
                    <cellValueFactory>
                        <PropertyValueFactory property="sentBytes"/>
                    </cellValueFactory>
                </TableColumn>
                <TableColumn fx:id="receivedBytesColumn" minWidth="100" maxWidth="120">
                    <cellValueFactory>
                        <PropertyValueFactory property="receivedBytes"/>
                    </cellValueFactory>
                </TableColumn>
                <TableColumn fx:id="peerTypeColumn" minWidth="170" maxWidth="170">
                    <cellValueFactory>
                        <PropertyValueFactory property="peerType"/>
                    </cellValueFactory>
                </TableColumn>
            </columns>
        </TableView>
    </VBox>

    <HavenoTextField fx:id="sentDataTextField" GridPane.rowIndex="7" editable="false"
                   focusTraversable="false" labelFloat="true"/>

    <HavenoTextField fx:id="receivedDataTextField" GridPane.rowIndex="8" editable="false"
                   focusTraversable="false" labelFloat="true"/>

    <HavenoTextField fx:id="chainHeightTextField" GridPane.rowIndex="9" editable="false"
                   focusTraversable="false" labelFloat="true"/>

    <AutoTooltipButton fx:id="openTorSettingsButton" GridPane.rowIndex="10" GridPane.columnIndex="0"/>

    <columnConstraints>
        <ColumnConstraints hgrow="ALWAYS" minWidth="500"/>
    </columnConstraints>
</GridPane>


