<UserControl x:Class="UniGetUI.Avalonia.Views.Pages.SettingsPages.General"
             xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:automation="clr-namespace:Avalonia.Automation;assembly=Avalonia.Controls"
             xmlns:vm="using:UniGetUI.Avalonia.ViewModels.Pages.SettingsPages"
             xmlns:settings="using:UniGetUI.Avalonia.Views.Controls.Settings"
             xmlns:t="using:UniGetUI.Avalonia.MarkupExtensions"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d"
             x:DataType="vm:GeneralViewModel">

    <ScrollViewer HorizontalScrollBarVisibility="Disabled">
        <StackPanel Orientation="Vertical">

            <settings:TranslatedTextBlock Text="Language"
                                          FontSize="14"
                                          FontWeight="SemiBold"
                                          Margin="44,32,4,8"
                                          automation:AutomationProperties.HeadingLevel="2"/>

            <settings:ComboboxCard x:Name="LanguageSelector"
                                   CornerRadius="8"/>

            <settings:TranslatedTextBlock Text="UniGetUI updater"
                                          FontSize="14"
                                          FontWeight="SemiBold"
                                          Margin="44,32,4,8"
                                          automation:AutomationProperties.HeadingLevel="2"/>

            <settings:CheckboxButtonCard x:Name="GeneralUpdaterCard"
                                         SettingName="DisableAutoUpdateWingetUI"
                                         CheckboxText="{t:Translate Update UniGetUI automatically}"
                                         ButtonText="{t:Translate Check for updates}"
                                         ButtonAlwaysOn="True"
                                         CornerRadius="8,8,0,0"/>

            <settings:CheckboxCard x:Name="EnableUniGetUIBetaCard"
                                   SettingName="EnableUniGetUIBeta"
                                   Text="{t:Translate Install prerelease versions of UniGetUI}"
                                   CornerRadius="0"
                                   BorderThickness="1,0,1,1"/>

            <settings:CheckboxCard x:Name="ReleaseNotesOnUpdateCard"
                                   SettingName="DisableReleaseNotesOnUpdate"
                                   Text="{t:Translate Show the release notes after UniGetUI is updated}"
                                   CornerRadius="0,0,8,8"
                                   BorderThickness="1,0,1,1"/>

            <settings:TranslatedTextBlock Text="Telemetry"
                                          FontSize="14"
                                          FontWeight="SemiBold"
                                          Margin="44,32,4,8"
                                          automation:AutomationProperties.HeadingLevel="2"/>

            <settings:ButtonCard x:Name="GeneralTelemetryCard"
                                 CornerRadius="8"
                                 Text="{t:Translate Manage telemetry settings}"
                                 ButtonText="{t:Translate Manage}"
                                 Command="{Binding ShowTelemetryDialogCommand}"
                                 CommandParameter="{Binding $self}"/>

            <settings:TranslatedTextBlock Text="Privacy"
                                          FontSize="14"
                                          FontWeight="SemiBold"
                                          Margin="44,32,4,8"
                                          automation:AutomationProperties.HeadingLevel="2"/>

            <settings:CheckboxCard x:Name="GeneralPrivacyCard"
                                   SettingName="RedactUsernameInLog"
                                   CornerRadius="8"
                                   Text="{t:Translate Hide my username from the logs}"
                                   WarningText="{t:Translate Text='Replaces your username with **** in the logs. Restart UniGetUI to also hide it from already-recorded entries.'}"
                                   StateChangedCommand="{Binding ToggleRedactUsernameCommand}"/>

            <settings:TranslatedTextBlock Text="Manage UniGetUI settings"
                                          FontSize="14"
                                          FontWeight="SemiBold"
                                          Margin="44,32,4,8"
                                          automation:AutomationProperties.HeadingLevel="2"/>

            <settings:ButtonCard x:Name="GeneralImportCard"
                                 CornerRadius="8,8,0,0"
                                 Text="{t:Translate Import settings from a local file}"
                                 ButtonText="{t:Translate Import}"
                                 Command="{Binding ImportSettingsCommand}"
                                 CommandParameter="{Binding $self}"/>

            <settings:ButtonCard x:Name="ExportSettingsCard"
                                 BorderThickness="1,0"
                                 CornerRadius="0"
                                 Text="{t:Translate Export settings to a local file}"
                                 ButtonText="{t:Translate Export}"
                                 Command="{Binding ExportSettingsCommand}"
                                 CommandParameter="{Binding $self}"/>

            <settings:ButtonCard x:Name="ResetSettingsCard"
                                 CornerRadius="0,0,8,8"
                                 Text="{t:Translate Reset UniGetUI}"
                                 ButtonText="{t:Translate Reset UniGetUI}"
                                 Command="{Binding ResetSettingsCommand}"
                                 CommandParameter="{Binding $self}"/>

            <settings:TranslatedTextBlock Text="Related settings"
                                          FontSize="14"
                                          FontWeight="SemiBold"
                                          Margin="44,32,4,8"
                                          automation:AutomationProperties.HeadingLevel="2"/>

            <settings:SettingsPageButton CornerRadius="8"
                                         Margin="0,0,0,20"
                                         Icon="Interactive"
                                         Text="{t:Translate User interface preferences}"
                                         UnderText="{t:Translate Text='Application theme, startup page, package icons, clear successful installs automatically'}"
                                         Command="{Binding NavigateToInterfaceCommand}"/>

        </StackPanel>
    </ScrollViewer>

</UserControl>
