Files
UnrealEngineUWP/Engine/Source/Programs/UnsyncUI/UnsyncUI/MainWindow.xaml
Robert Millar 07e73ec536 Add support for syncing subsets of files in a directory in UnsyncUI.
File group is activated by finding any file that matches the regex, then groups from the regex can be used to populate the --include argument to Unsync CLI

#jira none
#rb yuriy.odonnell
#preflight none

[CL 21488502 by Robert Millar in ue5-main branch]
2022-08-22 14:42:55 -04:00

217 lines
8.2 KiB
XML

<!--Copyright Epic Games, Inc. All Rights Reserved.-->
<Window x:Class="UnsyncUI.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:local="clr-namespace:UnsyncUI"
mc:Ignorable="d"
Title="UnsyncUI v1.0.12"
Height="800"
Width="1600"
MinWidth="600"
MinHeight="400"
Closing="Window_Closing">
<Window.TaskbarItemInfo>
<TaskbarItemInfo ProgressState="{Binding ProgressState}" ProgressValue="{Binding ProgressValue}"/>
</Window.TaskbarItemInfo>
<Window.Resources>
<local:MainTabTemplateSelector x:Key="mainTabSelector">
<local:MainTabTemplateSelector.ProjectTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<local:BuildSelectorControl Grid.Row="1" />
</Grid>
</DataTemplate>
</local:MainTabTemplateSelector.ProjectTemplate>
<!-- Contents of the "Custom" project tab -->
<local:MainTabTemplateSelector.CustomTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<GroupBox Grid.Row="0" Header="Source">
<local:SelectFolderControl SelectedPath="{Binding SrcPath}" Description="Select a source directory to sync builds from."/>
</GroupBox>
<GroupBox Grid.Row="1" Header="Destination">
<local:SelectFolderControl SelectedPath="{Binding DstPath}" Description="Select a destination directory to sync builds to."/>
</GroupBox>
<GroupBox Grid.Row="2" Header="Include">
<TextBox Text="{Binding Include}" ToolTip="Comma-separated list parts of filenames to filter the download"/>
</GroupBox>
<TextBlock Grid.Row="3" Margin="4" HorizontalAlignment="Center">
<Hyperlink Command="{Binding OnSyncClicked}">Start Custom Sync</Hyperlink>
</TextBlock>
</Grid>
</DataTemplate>
</local:MainTabTemplateSelector.CustomTemplate>
</local:MainTabTemplateSelector>
</Window.Resources>
<Grid Margin="4">
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="476"/>
<ColumnDefinition Width="8"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<GroupBox Grid.Row="0" Header="Proxy">
<ComboBox ItemsSource="{Binding Config.Proxies}" SelectedItem="{Binding SelectedProxy}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock>
<Run Text="{Binding Name}" />
<TextBlock Visibility="{Binding Path, Converter={StaticResource VisConv_Collapsed}}">
<Run Text=" ("/>
<Run Text="{Binding Path}"/>
<Run Text=")"/>
</TextBlock>
</TextBlock>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</GroupBox>
<GroupBox Grid.Row="1" Header="Advanced">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<CheckBox Grid.Column="0" VerticalAlignment="Center" IsChecked="{Binding DryRun}" Content="Dry Run" HorizontalAlignment="Center" Margin="32,4,32,4"/>
<TextBox Grid.Column="1" Text="{Binding DFS}"/>
<TextBlock Grid.Column="2" VerticalAlignment="Center" Text="DFS Filter" Margin="16,4,16,4"/>
<TextBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Text="{Binding AdditionalArgs}" />
<TextBlock Grid.Row="1" Grid.Column="2" VerticalAlignment="Center" Text="Additional Args" Margin="16,4,16,4"/>
</Grid>
</GroupBox>
<GroupBox Grid.Row="2" Header="Projects">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TabControl Grid.Row ="1" ItemsSource="{Binding Tabs}" SelectedIndex="0" ContentTemplateSelector="{Binding Source={StaticResource mainTabSelector}}" SelectedItem="{Binding SelectedTab}">
<TabControl.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}"/>
</DataTemplate>
</TabControl.ItemTemplate>
</TabControl>
</Grid>
</GroupBox>
<GridSplitter Grid.Column="1" Grid.RowSpan="3" HorizontalAlignment="Stretch" Foreground="Transparent" Background="Transparent" />
<TextBlock Grid.Row="0" Grid.Column="2" Grid.RowSpan="3" TextAlignment="Center" VerticalAlignment="Center">
<TextBlock.Visibility>
<MultiBinding Converter="{StaticResource VisConv_All_Collapsed}">
<Binding Path="QueuedJobs.Count" Converter="{StaticResource NotConv}" />
<Binding Path="ActiveJob" Converter="{StaticResource NotConv}" />
<Binding Path="CompletedJobs.Count" Converter="{StaticResource NotConv}" />
</MultiBinding>
</TextBlock.Visibility>
<Run Text="To get started, search for builds in the left pane,"/>
<LineBreak/>
<Run Text="select one or more platforms and a destination folder, and click Start Sync."/>
</TextBlock>
<Grid Grid.Row="0" Grid.Column="2" Grid.RowSpan="3">
<Grid.Resources>
<GridLength x:Key="glStar">*</GridLength>
<GridLength x:Key="glAuto">auto</GridLength>
<local:ObjectConverter x:Key="rdHeightConv" TrueValue="{StaticResource glStar}" FalseValue="{StaticResource glAuto}"/>
<local:ObjectConverter x:Key="rdMinHeightConv" TrueValue="60" FalseValue="0"/>
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="{Binding ActiveJob, Converter={StaticResource rdHeightConv}}" MinHeight="{Binding ActiveJob, Converter={StaticResource rdMinHeightConv}}"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<!-- Queued Jobs Pane -->
<GroupBox Grid.Row="0" Visibility="{Binding QueuedJobs.Count, Converter={StaticResource VisConv_Collapsed}}">
<GroupBox.Header>
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">
<Run Text="{Binding QueuedJobs.Count, Mode=OneWay}" />
<Run Text="Queued Job(s)" />
<TextBlock>
<Run Text=" - " />
<Hyperlink Command="{Binding OnClearQueueClicked}">Cancel All</Hyperlink>
</TextBlock>
</TextBlock>
</GroupBox.Header>
<ItemsControl ItemsSource="{Binding QueuedJobs}">
<ItemsControl.ItemTemplate>
<ItemContainerTemplate>
<local:JobControl/>
</ItemContainerTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</GroupBox>
<!-- Active Job Pane -->
<GroupBox Grid.Row="1" Visibility="{Binding ActiveJob, Converter={StaticResource VisConv_Collapsed}}" Header="Active Job">
<local:JobControl DataContext="{Binding ActiveJob}"/>
</GroupBox>
<!-- Completed Jobs Pane -->
<GroupBox Grid.Row="2" Visibility="{Binding CompletedJobs.Count, Converter={StaticResource VisConv_Collapsed}}">
<GroupBox.Header>
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Center">
<Run Text="{Binding CompletedJobs.Count, Mode=OneWay}" />
<Run Text="Completed Job(s)" />
<TextBlock Visibility="{Binding CompletedJobs.Count, Converter={StaticResource VisConv_Collapsed}}">
<Run Text=" - " />
<Hyperlink Command="{Binding OnClearCompletedClicked}">Clear All</Hyperlink>
</TextBlock>
</TextBlock>
</GroupBox.Header>
<ItemsControl ItemsSource="{Binding CompletedJobs}">
<ItemsControl.ItemTemplate>
<ItemContainerTemplate>
<local:JobControl/>
</ItemContainerTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</GroupBox>
</Grid>
</Grid>
</Window>