forked from sim0n00ps/OF-DL
395 lines
23 KiB
XML
395 lines
23 KiB
XML
<Window xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:vm="using:OF_DL.Gui.ViewModels"
|
|
x:Class="OF_DL.Gui.Views.MainWindow"
|
|
x:DataType="vm:MainWindowViewModel"
|
|
Width="1320"
|
|
Height="860"
|
|
MinWidth="900"
|
|
MinHeight="700"
|
|
Title="OF DL"
|
|
Background="#EEF3FB"
|
|
mc:Ignorable="d">
|
|
<Window.Styles>
|
|
<Style Selector="Border.surface">
|
|
<Setter Property="Background" Value="#FFFFFF" />
|
|
<Setter Property="BorderBrush" Value="#DDE5F3" />
|
|
<Setter Property="BorderThickness" Value="1" />
|
|
<Setter Property="CornerRadius" Value="12" />
|
|
</Style>
|
|
|
|
<Style Selector="Button.primary">
|
|
<Setter Property="Background" Value="#2E6EEA" />
|
|
<Setter Property="Foreground" Value="#FFFFFF" />
|
|
<Setter Property="Padding" Value="14,8" />
|
|
<Setter Property="CornerRadius" Value="8" />
|
|
<Setter Property="FontWeight" Value="SemiBold" />
|
|
</Style>
|
|
|
|
<Style Selector="Button.secondary">
|
|
<Setter Property="Background" Value="#FFFFFF" />
|
|
<Setter Property="Foreground" Value="#1F2A44" />
|
|
<Setter Property="Padding" Value="14,8" />
|
|
<Setter Property="CornerRadius" Value="8" />
|
|
<Setter Property="BorderBrush" Value="#CFD9EB" />
|
|
<Setter Property="BorderThickness" Value="1" />
|
|
<Setter Property="FontWeight" Value="SemiBold" />
|
|
</Style>
|
|
</Window.Styles>
|
|
|
|
<Grid RowDefinitions="Auto,Auto,*">
|
|
<Menu Grid.Row="0">
|
|
<MenuItem Header="_File">
|
|
<MenuItem Header="_Logout"
|
|
IsVisible="{Binding IsAuthenticated}"
|
|
Command="{Binding LogoutCommand}" />
|
|
<MenuItem Header="E_xit" Command="{Binding ExitApplicationCommand}" />
|
|
</MenuItem>
|
|
<MenuItem Header="_Edit">
|
|
<MenuItem Header="_Refresh Users" Command="{Binding RefreshUsersCommand}" />
|
|
<MenuItem Header="Edit _Config" Command="{Binding EditConfigCommand}" />
|
|
</MenuItem>
|
|
</Menu>
|
|
|
|
<Border Grid.Row="1"
|
|
Padding="16"
|
|
BorderThickness="0,0,0,1"
|
|
BorderBrush="#CFD9EB"
|
|
Background="#DDEAFF">
|
|
<Grid ColumnDefinitions="*,Auto" VerticalAlignment="Center">
|
|
<TextBlock Grid.Column="0"
|
|
Foreground="#304261"
|
|
FontWeight="SemiBold"
|
|
Text="{Binding AuthenticatedUserDisplay}"
|
|
TextWrapping="Wrap"
|
|
VerticalAlignment="Center" />
|
|
|
|
<StackPanel Grid.Column="1"
|
|
Orientation="Horizontal"
|
|
Spacing="8"
|
|
HorizontalAlignment="Right">
|
|
<Button IsVisible="{Binding IsDownloading}"
|
|
Classes="primary"
|
|
Background="#D84E4E"
|
|
Command="{Binding StopWorkCommand}"
|
|
Content="Stop" />
|
|
<Button Classes="secondary"
|
|
IsVisible="{Binding IsAuthenticated}"
|
|
Command="{Binding LogoutCommand}"
|
|
Content="Logout" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<Grid Grid.Row="2" Margin="14">
|
|
<StackPanel IsVisible="{Binding IsLoadingScreen}"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Spacing="12"
|
|
Width="420">
|
|
<TextBlock HorizontalAlignment="Center"
|
|
FontSize="22"
|
|
FontWeight="SemiBold"
|
|
Text="Loading" />
|
|
<ProgressBar IsIndeterminate="True" Height="14" />
|
|
<TextBlock HorizontalAlignment="Center" Text="{Binding LoadingMessage}" TextWrapping="Wrap" />
|
|
</StackPanel>
|
|
|
|
<ScrollViewer IsVisible="{Binding IsConfigScreen}">
|
|
<StackPanel Spacing="14" Margin="2,0,4,0">
|
|
<TextBlock FontSize="22" FontWeight="SemiBold" Text="Configuration" />
|
|
|
|
<Grid ColumnDefinitions="3*,5*" Margin="0,0,0,2">
|
|
<Border Grid.Column="0" Classes="surface" Padding="12" Margin="0,0,10,0">
|
|
<StackPanel Spacing="8">
|
|
<TextBlock FontSize="16" FontWeight="Bold" Foreground="#1F2A44" Text="External" />
|
|
<TextBlock FontWeight="SemiBold"
|
|
Foreground="#1F2A44"
|
|
Text="FFmpeg Path" />
|
|
<Grid ColumnDefinitions="*,Auto">
|
|
<TextBox Grid.Column="0"
|
|
VerticalAlignment="Center"
|
|
Text="{Binding FfmpegPath}"
|
|
Watermark="Select ffmpeg executable" />
|
|
<Button Grid.Column="1"
|
|
Margin="8,0,0,0"
|
|
Classes="secondary"
|
|
Content="Browse..."
|
|
Click="OnBrowseFfmpegPathClick" />
|
|
</Grid>
|
|
<TextBlock IsVisible="{Binding HasFfmpegPathError}"
|
|
Foreground="#FF5A5A"
|
|
Text="{Binding FfmpegPathError}"
|
|
TextWrapping="Wrap" />
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<Border Grid.Column="1" Classes="surface" Padding="12">
|
|
<StackPanel Spacing="8">
|
|
<TextBlock FontSize="16"
|
|
FontWeight="Bold"
|
|
Foreground="#1F2A44"
|
|
Text="Download Media Types" />
|
|
|
|
<StackPanel Spacing="4">
|
|
<TextBlock FontWeight="SemiBold" Foreground="#1F2A44" Text="Media Types" />
|
|
<ItemsControl ItemsSource="{Binding MediaTypeOptions}">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<WrapPanel Orientation="Horizontal" />
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate x:DataType="vm:MultiSelectOptionViewModel">
|
|
<CheckBox Margin="0,0,14,6"
|
|
Content="{Binding DisplayName}"
|
|
IsChecked="{Binding IsSelected}" />
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
<TextBlock IsVisible="{Binding HasMediaTypesError}"
|
|
Foreground="#FF5A5A"
|
|
Text="{Binding MediaTypesError}"
|
|
TextWrapping="Wrap" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Spacing="4">
|
|
<TextBlock FontWeight="SemiBold" Foreground="#1F2A44" Text="Sources" />
|
|
<ItemsControl ItemsSource="{Binding MediaSourceOptions}">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<WrapPanel Orientation="Horizontal" />
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate x:DataType="vm:MultiSelectOptionViewModel">
|
|
<CheckBox Margin="0,0,14,6"
|
|
Content="{Binding DisplayName}"
|
|
IsChecked="{Binding IsSelected}" />
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
<TextBlock IsVisible="{Binding HasMediaSourcesError}"
|
|
Foreground="#FF5A5A"
|
|
Text="{Binding MediaSourcesError}"
|
|
TextWrapping="Wrap" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</Border>
|
|
</Grid>
|
|
|
|
<Border Classes="surface" Padding="12">
|
|
<ItemsControl ItemsSource="{Binding ConfigCategories}">
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<WrapPanel Orientation="Horizontal" />
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate x:DataType="vm:ConfigCategoryViewModel">
|
|
<Border Classes="surface"
|
|
Width="600"
|
|
Margin="0,0,12,12"
|
|
Padding="10">
|
|
<StackPanel Spacing="8">
|
|
<TextBlock FontSize="16"
|
|
FontWeight="Bold"
|
|
Foreground="#1F2A44"
|
|
Text="{Binding CategoryName}" />
|
|
<StackPanel IsVisible="{Binding IsDownloadBehavior}"
|
|
Spacing="4"
|
|
Margin="0,0,0,10"
|
|
x:CompileBindings="False">
|
|
<TextBlock FontWeight="SemiBold"
|
|
Foreground="#1F2A44"
|
|
Text="Download Path" />
|
|
<Grid ColumnDefinitions="*,Auto">
|
|
<TextBox Grid.Column="0"
|
|
VerticalAlignment="Center"
|
|
HorizontalAlignment="Stretch"
|
|
Text="{Binding DataContext.DownloadPath, RelativeSource={RelativeSource AncestorType=Window}}"
|
|
Watermark="Select download folder" />
|
|
<Button Grid.Column="1"
|
|
Margin="8,0,0,0"
|
|
Classes="secondary"
|
|
Content="Browse..."
|
|
Click="OnBrowseDownloadPathClick" />
|
|
</Grid>
|
|
<TextBlock IsVisible="{Binding DataContext.HasDownloadPathError, RelativeSource={RelativeSource AncestorType=Window}}"
|
|
Foreground="#FF5A5A"
|
|
Text="{Binding DataContext.DownloadPathError, RelativeSource={RelativeSource AncestorType=Window}}"
|
|
TextWrapping="Wrap" />
|
|
</StackPanel>
|
|
<ItemsControl ItemsSource="{Binding Fields}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate x:DataType="vm:ConfigFieldViewModel">
|
|
<Grid Margin="0,0,0,10" ColumnDefinitions="190,*">
|
|
<TextBlock Grid.Column="0"
|
|
Margin="0,6,10,0"
|
|
FontWeight="SemiBold"
|
|
Foreground="#1F2A44"
|
|
Text="{Binding DisplayName}"
|
|
TextWrapping="Wrap" />
|
|
<StackPanel Grid.Column="1" Spacing="4">
|
|
<CheckBox IsVisible="{Binding IsBoolean}"
|
|
IsChecked="{Binding BoolValue}" />
|
|
|
|
<ComboBox IsVisible="{Binding IsEnum}"
|
|
HorizontalAlignment="Stretch"
|
|
ItemsSource="{Binding EnumOptions}"
|
|
SelectedItem="{Binding EnumValue}" />
|
|
|
|
<DatePicker IsVisible="{Binding IsDate}"
|
|
HorizontalAlignment="Stretch"
|
|
SelectedDate="{Binding DateValue}" />
|
|
|
|
<NumericUpDown IsVisible="{Binding IsNumeric}"
|
|
HorizontalAlignment="Stretch"
|
|
Value="{Binding NumericValue}"
|
|
Increment="1"
|
|
FormatString="N0" />
|
|
|
|
<TextBox IsVisible="{Binding IsTextInput}"
|
|
HorizontalAlignment="Stretch"
|
|
AcceptsReturn="{Binding IsMultiline}"
|
|
TextWrapping="Wrap"
|
|
MinHeight="{Binding TextBoxMinHeight}"
|
|
Text="{Binding TextValue}" />
|
|
|
|
<TextBlock IsVisible="{Binding HasError}"
|
|
Foreground="#FF5A5A"
|
|
Text="{Binding ErrorMessage}"
|
|
TextWrapping="Wrap" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</StackPanel>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</Border>
|
|
|
|
<StackPanel Orientation="Horizontal" Spacing="10" HorizontalAlignment="Right">
|
|
<Button Content="Save Configuration"
|
|
Classes="primary"
|
|
Command="{Binding SaveConfigCommand}" />
|
|
<Button Content="Cancel"
|
|
Classes="secondary"
|
|
Command="{Binding CancelConfigCommand}" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
|
|
<StackPanel IsVisible="{Binding IsAuthScreen}"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Width="640"
|
|
Spacing="14">
|
|
<TextBlock HorizontalAlignment="Center"
|
|
FontSize="24"
|
|
FontWeight="SemiBold"
|
|
Text="Authentication Required" />
|
|
<TextBlock TextWrapping="Wrap"
|
|
TextAlignment="Center"
|
|
HorizontalAlignment="Center"
|
|
Text="{Binding AuthScreenMessage}" />
|
|
<StackPanel Orientation="Horizontal" Spacing="10" HorizontalAlignment="Center">
|
|
<Button Content="Login with Browser"
|
|
Classes="primary"
|
|
Command="{Binding StartBrowserLoginCommand}" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
|
|
<Grid IsVisible="{Binding IsUserSelectionScreen}" RowDefinitions="Auto,*,Auto" ColumnDefinitions="2*,3*">
|
|
<Border Grid.Row="0"
|
|
Grid.ColumnSpan="2"
|
|
Padding="10"
|
|
Margin="0,0,0,10"
|
|
Classes="surface">
|
|
<StackPanel Orientation="Horizontal" Spacing="8" VerticalAlignment="Center">
|
|
<Button Content="Select All" Classes="secondary" Command="{Binding SelectAllUsersCommand}" />
|
|
<Button Content="Select None" Classes="secondary" Command="{Binding SelectNoUsersCommand}" />
|
|
<ComboBox Width="280"
|
|
PlaceholderText="Select a list of users"
|
|
ItemsSource="{Binding UserLists}"
|
|
SelectedItem="{Binding SelectedListName}" />
|
|
<Button Content="Download Purchased Tab"
|
|
Classes="secondary"
|
|
Command="{Binding DownloadPurchasedTabCommand}" />
|
|
<Button Content="Download Selected"
|
|
Classes="primary"
|
|
Command="{Binding DownloadSelectedCommand}" />
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<Border Grid.Row="1"
|
|
Grid.Column="0"
|
|
Margin="0,0,8,0"
|
|
Padding="10"
|
|
Classes="surface">
|
|
<Grid RowDefinitions="Auto,*">
|
|
<StackPanel Grid.Row="0" Spacing="3">
|
|
<TextBlock FontWeight="SemiBold" Foreground="#1F2A44" Text="Users" />
|
|
<TextBlock Foreground="#4A5B78" Text="{Binding SelectedUsersSummary}" />
|
|
</StackPanel>
|
|
<ListBox Grid.Row="1" Margin="0,8,0,0" ItemsSource="{Binding AvailableUsers}">
|
|
<ListBox.ItemTemplate>
|
|
<DataTemplate x:DataType="vm:SelectableUserViewModel">
|
|
<CheckBox Content="{Binding Username}" IsChecked="{Binding IsSelected}" />
|
|
</DataTemplate>
|
|
</ListBox.ItemTemplate>
|
|
</ListBox>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<Border Grid.Row="1"
|
|
Grid.Column="1"
|
|
Margin="8,0,0,0"
|
|
Padding="10"
|
|
Classes="surface">
|
|
<Grid RowDefinitions="Auto,*">
|
|
<TextBlock Grid.Row="0" FontWeight="SemiBold" Foreground="#1F2A44" Text="Activity Log" />
|
|
<ListBox Grid.Row="1" Margin="0,8,0,0" ItemsSource="{Binding ActivityLog}" />
|
|
</Grid>
|
|
</Border>
|
|
|
|
<Border Grid.Row="2"
|
|
Grid.ColumnSpan="2"
|
|
Margin="0,10,0,0"
|
|
Padding="10"
|
|
Classes="surface"
|
|
IsVisible="{Binding IsDownloadProgressVisible}">
|
|
<StackPanel Spacing="8">
|
|
<TextBlock FontWeight="SemiBold" Foreground="#1F2A44"
|
|
Text="{Binding DownloadProgressDescription}" />
|
|
<ProgressBar IsIndeterminate="{Binding IsDownloadProgressIndeterminate}"
|
|
Minimum="0"
|
|
Maximum="{Binding DownloadProgressMaximum}"
|
|
Value="{Binding DownloadProgressValue}" />
|
|
</StackPanel>
|
|
</Border>
|
|
</Grid>
|
|
|
|
<StackPanel IsVisible="{Binding IsErrorScreen}"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Width="640"
|
|
Spacing="14">
|
|
<TextBlock HorizontalAlignment="Center"
|
|
FontSize="24"
|
|
FontWeight="SemiBold"
|
|
Text="Startup Error" />
|
|
<TextBlock TextWrapping="Wrap" Text="{Binding ErrorMessage}" />
|
|
<StackPanel Orientation="Horizontal" Spacing="10" HorizontalAlignment="Center">
|
|
<Button Content="Retry Startup" Classes="primary" Command="{Binding RetryStartupCommand}" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Grid>
|
|
</Window>
|