refactor!: rename Titano to Chronos and move CI and releases to Gitea (#6)
CI / Build and test (push) Successful in 8m14s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 13m19s
CI / PostgreSQL 16 integration (push) Successful in 4m49s
CI / PostgreSQL 17 integration (push) Successful in 5m28s
CI / Docker image (push) Successful in 53s
Release / Server image (push) Failing after 10s
CI / Build and test (push) Successful in 8m14s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 13m19s
CI / PostgreSQL 16 integration (push) Successful in 4m49s
CI / PostgreSQL 17 integration (push) Successful in 5m28s
CI / Docker image (push) Successful in 53s
Release / Server image (push) Failing after 10s
The owner renamed the product and moved the repository to the self-hosted Gitea (https://gitea.encke-hake.ts.net/BalboSoft/Chronos) for more control, and asked for Actions and a first automatic release with the server package and the Windows exe (docs/requests/2026-10-23-chronos-gitea.md). - Chronos everywhere: a byte-exact rename of contents and paths, then a per-language review of the forms the old name's ending had dictated. - Gitea instead of GitHub: the update check, licence, issue and support links read ChronosReleasesUrl; the update check takes the highest stable version, offers a pre-release build its final release and reports a repository it cannot see as a failed check. EULA, security policy and Gitea issue forms live at the repository root. - Gitea Actions for the Linux act_runner (.gitea/workflows): CI, release, nightly image and performance gates in the .NET SDK container with git checkout and the system SQLite. The release cross-compiles the Windows programs, checks their icon, version and DPI manifest, packs installers and zips, publishes the Gitea release and pushes the server image (REGISTRY_TOKEN). Windows-only tests run in an opt-in job on a Windows runner (WINDOWS_RUNNER). - New Chronos.Tools commands: zip, gitea-release, postgres-ci (replaces the docker-exec script, which Gitea's service containers do not allow; the throw-away server runs without durability) and pe-check. - Timed tests take their budget from TestTiming (CHRONOS_TEST_TIME_FACTOR, 3 on the shared runner; the weekly performance gates keep theirs). BREAKING CHANGE: programs, settings, data folders, file types, environment variables and the Docker image use the new name; nothing is migrated from Titano, which never had a release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #6.
This commit is contained in:
1 parent
c99842cc86
commit
f2b58522b9
1801 files changed
+11804
-10676
No files matched your search
@@ -0,0 +1,723 @@
|
||||
<UserControl x:Class="Chronos.App.Sections.ImportView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="clr-namespace:Chronos.Ui.Controls;assembly=Chronos.Ui"
|
||||
xmlns:l="clr-namespace:Chronos.Ui.Localization;assembly=Chronos.Ui"
|
||||
xmlns:imp="clr-namespace:Chronos.App.Import"
|
||||
xmlns:shell="clr-namespace:Chronos.App.Shell">
|
||||
<UserControl.InputBindings>
|
||||
<KeyBinding Key="Enter" Modifiers="Control" Command="{Binding StartCommand}" />
|
||||
</UserControl.InputBindings>
|
||||
<UserControl.Resources>
|
||||
<!-- Keyboard focus drawn inside the element: an outer ring would be clipped by the scroll viewer around lists. -->
|
||||
<Style x:Key="Focus.Inset">
|
||||
<Setter Property="Control.Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Border BorderBrush="{DynamicResource Brush.Accent}" BorderThickness="2" CornerRadius="{StaticResource Radius.Control}" SnapsToDevicePixels="True" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- Devices list entry (Import.html): 54 px, Surface fill, Stroke border; selected = accent border; disabled while copying. -->
|
||||
<Style x:Key="ListBoxItem.Device" TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}">
|
||||
<Setter Property="Height" Value="54" />
|
||||
<Setter Property="Margin" Value="0,0,0,8" />
|
||||
<Setter Property="Padding" Value="12,0" />
|
||||
<Setter Property="Background" Value="{DynamicResource Brush.Surface}" />
|
||||
<Setter Property="FocusVisualStyle" Value="{StaticResource Focus.Inset}" />
|
||||
<Setter Property="ToolTip" Value="{Binding ToolTip}" />
|
||||
<Setter Property="ToolTipService.ShowOnDisabled" Value="True" />
|
||||
<Setter Property="AutomationProperties.Name" Value="{Binding Title}" />
|
||||
<Setter Property="AutomationProperties.HelpText" Value="{Binding ToolTip}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<Border x:Name="Bd" Background="{DynamicResource Brush.Surface}" BorderThickness="1" BorderBrush="{DynamicResource Brush.Stroke}"
|
||||
CornerRadius="{StaticResource Radius.Control}" Padding="{TemplateBinding Padding}">
|
||||
<ContentPresenter VerticalAlignment="Center" />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource Brush.Card}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource Brush.Card}" />
|
||||
<Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Brush.Accent}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Opacity" Value="0.4" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="ToolTip" Value="{l:Loc Import.Blocked.Copying}" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<!-- One form line: a label column at least 116 px wide, as wide as the longest label of the form, then the controls (Import.html grid). -->
|
||||
<Style x:Key="Import.Row" TargetType="HeaderedContentControl">
|
||||
<Setter Property="Focusable" Value="False" />
|
||||
<Setter Property="Margin" Value="0,0,0,10" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="HeaderedContentControl">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" MinWidth="116" SharedSizeGroup="ImportLabel" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{TemplateBinding Header}" Style="{StaticResource Text.Label}" TextTrimming="None" VerticalAlignment="Top" Margin="0,6,12,0" />
|
||||
<ContentPresenter Grid.Column="1" VerticalAlignment="Center" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="Import.Choice" TargetType="FrameworkElement">
|
||||
<Setter Property="Margin" Value="0,4,18,4" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
<Style TargetType="RadioButton" BasedOn="{StaticResource {x:Type RadioButton}}">
|
||||
<Setter Property="Margin" Value="0,4,18,4" />
|
||||
</Style>
|
||||
<Style TargetType="CheckBox" BasedOn="{StaticResource {x:Type CheckBox}}">
|
||||
<Setter Property="Margin" Value="0,4,18,4" />
|
||||
</Style>
|
||||
|
||||
<!-- Unit words beside a field ("gap … min"): dimmed with the field they belong to. -->
|
||||
<Style x:Key="Text.Unit" TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="{DynamicResource Brush.TextMuted}" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Opacity" Value="0.4" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<!-- Up to four digits (gap ≤ 1440) in 56 px: half the usual side padding. -->
|
||||
<Style x:Key="TextBox.Small" TargetType="TextBox" BasedOn="{StaticResource TextBox.Number}">
|
||||
<Setter Property="Width" Value="56" />
|
||||
<Setter Property="Height" Value="30" />
|
||||
<Setter Property="Padding" Value="4,0" />
|
||||
<Setter Property="Margin" Value="6,0" />
|
||||
<Setter Property="FlowDirection" Value="LeftToRight" />
|
||||
</Style>
|
||||
|
||||
<!-- File paths and name templates stay left to right in every language (BRIEF §16). -->
|
||||
<Style x:Key="TextBox.NameTemplate" TargetType="TextBox" BasedOn="{StaticResource TextBox.Mono}">
|
||||
<Setter Property="Height" Value="30" />
|
||||
<Setter Property="FlowDirection" Value="LeftToRight" />
|
||||
</Style>
|
||||
|
||||
<!-- The folder path is in use only with the Folder destination (Import.html: faint text otherwise). -->
|
||||
<Style x:Key="TextBox.FolderPath" TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
|
||||
<Setter Property="Width" Value="190" />
|
||||
<Setter Property="Height" Value="30" />
|
||||
<Setter Property="FlowDirection" Value="LeftToRight" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsFolderDestination}" Value="False">
|
||||
<Setter Property="Foreground" Value="{DynamicResource Brush.TextFaint}" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<!-- A path or file name in a cell: left to right, at the start of the cell in either direction. -->
|
||||
<Style x:Key="Text.CellPath" TargetType="TextBlock" BasedOn="{StaticResource Text.Cell}">
|
||||
<Setter Property="FlowDirection" Value="LeftToRight" />
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
</Style>
|
||||
|
||||
<!-- Sizes carry the language's unit ("18,6 كيلوبايت"): they read in its direction, at the end of the cell like their header. -->
|
||||
<Style x:Key="Text.HeaderEnd" TargetType="TextBlock" BasedOn="{StaticResource Text.Header}">
|
||||
<Setter Property="TextAlignment" Value="Right" />
|
||||
</Style>
|
||||
|
||||
<!-- Row actions (DESIGN §4 tables): revealed on the row it acts on, still in the tab order. -->
|
||||
<Style x:Key="Button.RowAction" TargetType="Button" BasedOn="{StaticResource Button.Row}">
|
||||
<Setter Property="Opacity" Value="0" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsMouseOver, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" Value="True">
|
||||
<Setter Property="Opacity" Value="1" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" Value="True">
|
||||
<Setter Property="Opacity" Value="1" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" Value="True">
|
||||
<Setter Property="Opacity" Value="1" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<!-- Session table rows (36 px). -->
|
||||
<Style x:Key="Session.Grid" TargetType="Grid">
|
||||
<Setter Property="Height" Value="36" />
|
||||
</Style>
|
||||
<Style x:Key="ListBoxItem.Session" TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItem.PlainRow}">
|
||||
<Setter Property="AutomationProperties.Name" Value="{Binding Row.TimeText}" />
|
||||
</Style>
|
||||
<!-- Show plan and failure rows: focusable, so the arrow keys move through a long list. -->
|
||||
<Style x:Key="ListBoxItem.PlanRow" TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItem.Row}">
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="FocusVisualStyle" Value="{StaticResource Focus.Inset}" />
|
||||
<Setter Property="AutomationProperties.Name" Value="{Binding Source}" />
|
||||
<Setter Property="AutomationProperties.HelpText" Value="{Binding Destination}" />
|
||||
</Style>
|
||||
<Style x:Key="ListBoxItem.Failure" TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItem.Row}">
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="FocusVisualStyle" Value="{StaticResource Focus.Inset}" />
|
||||
<Setter Property="AutomationProperties.Name" Value="{Binding}" />
|
||||
</Style>
|
||||
|
||||
<!-- "Folder…" (Import.html): transparent, 1 px dashed Stroke border. -->
|
||||
<Style x:Key="Button.Dashed" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
|
||||
<Setter Property="FocusVisualStyle" Value="{StaticResource Focus.Inset}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Grid>
|
||||
<Rectangle x:Name="Edge" Fill="Transparent" Stroke="{DynamicResource Brush.Stroke}" StrokeThickness="1" StrokeDashArray="4 3" RadiusX="6" RadiusY="6" />
|
||||
<ContentPresenter Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="Center" />
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="Edge" Property="Fill" Value="{DynamicResource Brush.Card}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Opacity" Value="0.4" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid Margin="20,16">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.36*" MinWidth="220" MaxWidth="300" />
|
||||
<ColumnDefinition Width="16" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- ===================== Devices (declared top to bottom: the tab order follows) ===================== -->
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<DockPanel Height="32" Margin="0,0,0,8">
|
||||
<Button DockPanel.Dock="Right" Style="{StaticResource Button.Icon}" ui:ButtonIcon.Glyph="{StaticResource Icon.Refresh}" Command="{Binding RefreshCommand}"
|
||||
ToolTip="{l:Loc Tooltips.Import.Refresh}" AutomationProperties.Name="{l:Loc Import.Devices.Refresh}" />
|
||||
<TextBlock Text="{l:Loc Import.Devices.Title}" Style="{StaticResource Text.Section}" VerticalAlignment="Center" />
|
||||
</DockPanel>
|
||||
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" Focusable="False" IsEnabled="{Binding CanChangeSource}">
|
||||
<StackPanel>
|
||||
<ListBox ItemsSource="{Binding Sources}" SelectedItem="{Binding SelectedSource}" ItemContainerStyle="{StaticResource ListBoxItem.Device}"
|
||||
AutomationProperties.Name="{l:Loc Import.Devices.Title}">
|
||||
<!-- The surrounding ScrollViewer scrolls the list and "Folder…" together (Import.html: Folder… follows the cards). -->
|
||||
<ListBox.Template>
|
||||
<ControlTemplate TargetType="ListBox">
|
||||
<ItemsPresenter />
|
||||
</ControlTemplate>
|
||||
</ListBox.Template>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type imp:ImportSource}">
|
||||
<Grid x:Name="Root">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:Icon x:Name="Glyph" Glyph="{StaticResource Icon.Card}" Size="18" Margin="0,0,10,0" VerticalAlignment="Center" />
|
||||
<StackPanel Grid.Column="1" VerticalAlignment="Center">
|
||||
<TextBlock Text="{Binding Title}" FontWeight="SemiBold" TextTrimming="CharacterEllipsis" />
|
||||
<TextBlock Text="{Binding Subtitle}" Style="{StaticResource Text.Secondary}" TextTrimming="CharacterEllipsis" Margin="0,2,0,0" />
|
||||
</StackPanel>
|
||||
<ui:StatusGlyph x:Name="State" Grid.Column="2" Kind="Online" Margin="8,0,0,0" VerticalAlignment="Center" />
|
||||
</Grid>
|
||||
<DataTemplate.Triggers>
|
||||
<DataTrigger Binding="{Binding Kind}" Value="Drive">
|
||||
<Setter TargetName="Glyph" Property="Glyph" Value="{StaticResource Icon.Drive}" />
|
||||
<Setter TargetName="State" Property="Kind" Value="Offline" />
|
||||
<Setter TargetName="Root" Property="TextElement.Foreground" Value="{DynamicResource Brush.TextMuted}" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Kind}" Value="Folder">
|
||||
<Setter TargetName="Glyph" Property="Glyph" Value="{StaticResource Icon.Folder}" />
|
||||
<Setter TargetName="State" Property="Visibility" Value="Collapsed" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding IsKnown}" Value="False">
|
||||
<Setter TargetName="State" Property="Kind" Value="Offline" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding IsInserted}" Value="False">
|
||||
<Setter TargetName="Root" Property="Opacity" Value="0.6" />
|
||||
<Setter TargetName="State" Property="Kind" Value="Offline" />
|
||||
</DataTrigger>
|
||||
</DataTemplate.Triggers>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
<Button x:Name="FolderSourceButton" Style="{StaticResource Button.Dashed}" Height="44" HorizontalContentAlignment="Left" Command="{Binding PickFolderCommand}"
|
||||
ToolTip="{Binding FolderSourceToolTip}" AutomationProperties.Name="{l:Loc Import.Devices.Folder}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ui:Icon Glyph="{StaticResource Icon.Folder}" Margin="0,0,10,0" Foreground="{DynamicResource Brush.TextMuted}" />
|
||||
<TextBlock Text="{l:Loc Import.Devices.Folder}" Foreground="{DynamicResource Brush.TextMuted}" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
<CheckBox Grid.Row="2" Margin="0,8,0,0" IsChecked="{Binding AutoImport}" IsEnabled="{Binding CanAutoImport}" ToolTip="{Binding AutoImportToolTip}"
|
||||
VerticalContentAlignment="Top" AutomationProperties.Name="{l:Loc Import.Devices.Auto}">
|
||||
<TextBlock Text="{l:Loc Import.Devices.Auto}" TextWrapping="Wrap" Foreground="{DynamicResource Brush.TextMuted}" />
|
||||
</CheckBox>
|
||||
</Grid>
|
||||
|
||||
<!-- ===================== Profile, form and plan ===================== -->
|
||||
<Border Grid.Column="2" Style="{StaticResource Border.Panel}" Padding="20,16">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Profile header: nickname (or its field for a new card), identity, Edit ▾ (declared in reading order for Tab). -->
|
||||
<Grid Margin="0,0,0,14" MinHeight="32">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{Binding SourceTitle}" Style="{StaticResource Text.Title}" VerticalAlignment="Center" MaxWidth="320" TextTrimming="CharacterEllipsis"
|
||||
Visibility="{Binding IsNicknameOpen, Converter={x:Static ui:InverseBoolToVisibilityConverter.Instance}}" />
|
||||
<TextBox x:Name="NicknameBox" Width="240" Text="{Binding Nickname.Text, UpdateSourceTrigger=PropertyChanged}" shell:EditBehavior.Field="{Binding Nickname}"
|
||||
ui:Field.Placeholder="{l:Loc Import.Profile.Nickname}" ToolTip="{Binding Nickname.ToolTip}" AutomationProperties.Name="{l:Loc Import.Profile.Nickname}"
|
||||
Visibility="{Binding IsNicknameOpen, Converter={StaticResource BoolToVisibility}}" />
|
||||
<TextBlock Grid.Column="1" Text="{Binding IdentityText}" Foreground="{DynamicResource Brush.TextMuted}" VerticalAlignment="Center" Margin="12,0,12,0"
|
||||
TextTrimming="CharacterEllipsis" ToolTip="{Binding IdentityText}" />
|
||||
<Button x:Name="EditButton" Grid.Column="2" Click="OnOpenMenu" IsEnabled="{Binding CanEditProfile}" ToolTip="{Binding EditToolTip}"
|
||||
AutomationProperties.Name="{l:Loc Import.Profile.Edit}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{l:Loc Import.Profile.Edit}" VerticalAlignment="Center" />
|
||||
<ui:Icon Glyph="{StaticResource Icon.ChevronDown}" Margin="6,0,0,0" />
|
||||
</StackPanel>
|
||||
<Button.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="{l:Loc Import.Profile.Rename}" Command="{Binding RenameCommand}" ToolTip="{l:Loc Tooltips.Import.Rename}" />
|
||||
<MenuItem Header="{l:Loc Import.Profile.Camera}" Command="{Binding FollowCameraCommand}" IsCheckable="False" IsChecked="{Binding FollowsCamera, Mode=OneWay}"
|
||||
ToolTip="{Binding FollowCameraToolTip}" ToolTipService.ShowOnDisabled="True" />
|
||||
<MenuItem Header="{l:Loc Import.Profile.CopyFrom}" ItemsSource="{Binding OtherCards}" ToolTip="{l:Loc Tooltips.Import.CopyFrom}">
|
||||
<MenuItem.ItemContainerStyle>
|
||||
<Style TargetType="MenuItem" BasedOn="{StaticResource {x:Type MenuItem}}">
|
||||
<Setter Property="Header" Value="{Binding Name}" />
|
||||
<Setter Property="Command" Value="{Binding Command}" />
|
||||
<Setter Property="ToolTip" Value="{l:Loc Tooltips.Import.CopyFrom}" />
|
||||
</Style>
|
||||
</MenuItem.ItemContainerStyle>
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem Header="{l:Loc Import.Profile.Forget}" Command="{Binding ForgetCommand}" ToolTip="{l:Loc Tooltips.Import.Forget}" />
|
||||
</ContextMenu>
|
||||
</Button.ContextMenu>
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
<!-- The form (Import.html grid). -->
|
||||
<StackPanel Grid.Row="1" IsEnabled="{Binding IsFormEnabled}" Grid.IsSharedSizeScope="True">
|
||||
<HeaderedContentControl Style="{StaticResource Import.Row}" Header="{l:Loc Import.Label.Destination}">
|
||||
<WrapPanel>
|
||||
<RadioButton Content="{l:Loc Import.Destination.Archive}" IsChecked="{Binding IsArchiveDestination}"
|
||||
IsEnabled="{Binding CanUseArchive}" ToolTip="{Binding ArchiveToolTip}" />
|
||||
<RadioButton Content="{l:Loc Import.Destination.Folder}" IsChecked="{Binding IsFolderDestination}"
|
||||
ToolTip="{l:Loc Tooltips.Import.FolderDestination}" Margin="0,4,8,4" />
|
||||
<TextBox x:Name="FolderPathBox" Style="{StaticResource TextBox.FolderPath}"
|
||||
Text="{Binding FolderPath.Text, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}" shell:EditBehavior.Field="{Binding FolderPath}"
|
||||
ToolTip="{Binding FolderPath.ToolTip}" AutomationProperties.Name="{l:Loc Import.Destination.FolderPlaceholder}"
|
||||
ui:Field.Placeholder="{l:Loc Import.Destination.FolderPlaceholder}" />
|
||||
<Button Style="{StaticResource Button.Icon}" Width="30" MinWidth="30" Height="30" Margin="6,0,18,0" Content="…" Command="{Binding ChooseDestinationCommand}"
|
||||
ToolTip="{l:Loc Tooltips.Import.ChooseFolder}" AutomationProperties.Name="{l:Loc Import.Destination.Choose}" />
|
||||
<RadioButton IsChecked="{Binding IsServerDestination}" IsEnabled="{Binding CanUseServer}" ToolTip="{Binding ServerToolTip}"
|
||||
AutomationProperties.Name="{Binding ServerChoiceName}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{l:Loc Import.Destination.Server}" />
|
||||
<ui:Icon Glyph="{StaticResource Icon.Server}" Margin="10,0,6,0" Foreground="{DynamicResource Brush.Accent}" />
|
||||
<TextBlock Text="{Binding ServerName}" Foreground="{DynamicResource Brush.Accent}" />
|
||||
</StackPanel>
|
||||
</RadioButton>
|
||||
</WrapPanel>
|
||||
</HeaderedContentControl>
|
||||
|
||||
<HeaderedContentControl Style="{StaticResource Import.Row}" Header="{l:Loc Import.Label.Scan}">
|
||||
<WrapPanel>
|
||||
<CheckBox Content="{l:Loc Import.Scan.Subfolders}" IsChecked="{Binding IncludeSubfolders}" ToolTip="{l:Loc Tooltips.Import.Subfolders}" />
|
||||
<CheckBox Content="{l:Loc Import.Scan.Sessions}" IsChecked="{Binding SplitSessions}" ToolTip="{l:Loc Tooltips.Import.Sessions}" />
|
||||
<StackPanel Orientation="Horizontal" Style="{StaticResource Import.Choice}" IsEnabled="{Binding SplitSessions}">
|
||||
<TextBlock Text="{l:Loc Import.Scan.Gap}" Style="{StaticResource Text.Unit}" />
|
||||
<TextBox x:Name="GapBox" Style="{StaticResource TextBox.Small}" Text="{Binding GapMinutes.Text, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}"
|
||||
shell:EditBehavior.Field="{Binding GapMinutes}" ToolTip="{Binding GapMinutes.ToolTip}" AutomationProperties.Name="{l:Loc Import.Scan.GapName}" />
|
||||
<TextBlock Text="{l:Loc Import.Scan.Minutes}" Style="{StaticResource Text.Unit}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Style="{StaticResource Import.Choice}">
|
||||
<TextBlock Text="{l:Loc Import.Scan.Minimum}" Style="{StaticResource Text.Unit}" />
|
||||
<TextBox Style="{StaticResource TextBox.Small}" Text="{Binding MinimumFrames.Text, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}"
|
||||
shell:EditBehavior.Field="{Binding MinimumFrames}" ToolTip="{Binding MinimumFrames.ToolTip}" AutomationProperties.Name="{l:Loc Import.Scan.MinimumName}" />
|
||||
<TextBlock Text="{l:Loc Import.Scan.Frames}" Style="{StaticResource Text.Unit}" />
|
||||
</StackPanel>
|
||||
<CheckBox Content="{l:Loc Import.Scan.Verify}" IsChecked="{Binding VerifyCopies}" ToolTip="{l:Loc Tooltips.Import.Verify}" />
|
||||
</WrapPanel>
|
||||
</HeaderedContentControl>
|
||||
|
||||
<HeaderedContentControl Style="{StaticResource Import.Row}" Header="{l:Loc Import.Label.Names}">
|
||||
<StackPanel>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" MinWidth="140" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" MinWidth="140" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox Style="{StaticResource TextBox.NameTemplate}" Text="{Binding FolderTemplate.Text, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}"
|
||||
shell:EditBehavior.Field="{Binding FolderTemplate}" ToolTip="{Binding FolderTemplate.ToolTip}" GotKeyboardFocus="OnFolderTemplateFocus"
|
||||
AutomationProperties.Name="{l:Loc Import.Names.Folder}" />
|
||||
<TextBlock Grid.Column="1" Text="/" Style="{StaticResource Text.Unit}" Foreground="{DynamicResource Brush.TextFaint}" Margin="10,0" />
|
||||
<TextBox Grid.Column="2" Style="{StaticResource TextBox.NameTemplate}"
|
||||
Text="{Binding FileTemplate.Text, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=True}" shell:EditBehavior.Field="{Binding FileTemplate}"
|
||||
ToolTip="{Binding FileTemplate.ToolTip}" GotKeyboardFocus="OnFileTemplateFocus" AutomationProperties.Name="{l:Loc Import.Names.File}" />
|
||||
<Button x:Name="TokensButton" Grid.Column="3" Style="{StaticResource Button.Icon}" Width="30" MinWidth="30" Height="30" Margin="10,0,0,0" Content="{}{ }"
|
||||
Click="OnOpenMenu" ToolTip="{l:Loc Tooltips.Import.Tokens}" AutomationProperties.Name="{l:Loc Import.Names.Tokens}">
|
||||
<Button.ContextMenu>
|
||||
<ContextMenu ItemsSource="{Binding Tokens}" MaxHeight="420">
|
||||
<ContextMenu.ItemContainerStyle>
|
||||
<Style TargetType="MenuItem" BasedOn="{StaticResource {x:Type MenuItem}}">
|
||||
<Setter Property="Header" Value="{Binding Text}" />
|
||||
<Setter Property="ToolTip" Value="{Binding ToolTip}" />
|
||||
<Setter Property="Command" Value="{Binding DataContext.InsertTokenCommand, RelativeSource={RelativeSource AncestorType=ContextMenu}}" />
|
||||
<Setter Property="CommandParameter" Value="{Binding}" />
|
||||
</Style>
|
||||
</ContextMenu.ItemContainerStyle>
|
||||
</ContextMenu>
|
||||
</Button.ContextMenu>
|
||||
</Button>
|
||||
</Grid>
|
||||
<TextBlock Text="{Binding NamePreview}" Style="{StaticResource Text.Secondary}" Foreground="{DynamicResource Brush.TextFaint}" Margin="0,6,0,0"
|
||||
TextTrimming="CharacterEllipsis" ToolTip="{Binding NamePreview}" FlowDirection="LeftToRight" HorizontalAlignment="Left" />
|
||||
</StackPanel>
|
||||
</HeaderedContentControl>
|
||||
|
||||
<HeaderedContentControl Style="{StaticResource Import.Row}" Header="{l:Loc Import.Label.Duplicates}">
|
||||
<WrapPanel>
|
||||
<RadioButton Content="{l:Loc Import.Duplicates.Skip}" IsChecked="{Binding SkipDuplicates}" ToolTip="{l:Loc Tooltips.Import.Skip}" />
|
||||
<RadioButton Content="{l:Loc Import.Duplicates.Again}" IsChecked="{Binding ImportDuplicatesAgain}" ToolTip="{l:Loc Tooltips.Import.Again}" />
|
||||
</WrapPanel>
|
||||
</HeaderedContentControl>
|
||||
|
||||
<HeaderedContentControl Style="{StaticResource Import.Row}" Header="{l:Loc Import.Label.After}" Margin="0">
|
||||
<WrapPanel>
|
||||
<RadioButton Content="{l:Loc Import.After.Keep}" IsChecked="{Binding KeepCard}" ToolTip="{l:Loc Tooltips.Import.Keep}" />
|
||||
<RadioButton Content="{l:Loc Import.After.Delete}" IsChecked="{Binding DeleteImported}" IsEnabled="{Binding CardActionsApply}"
|
||||
ToolTip="{Binding DeleteChoiceToolTip}" />
|
||||
<RadioButton Content="{l:Loc Import.After.Format}" IsChecked="{Binding FormatCard}" IsEnabled="{Binding CardActionsApply}"
|
||||
ToolTip="{Binding FormatChoiceToolTip}" />
|
||||
<Border Width="1" Height="20" Background="{DynamicResource Brush.Stroke}" Margin="0,0,18,0" VerticalAlignment="Center" />
|
||||
<CheckBox Content="{l:Loc Import.After.Eject}" IsChecked="{Binding Eject}" ToolTip="{l:Loc Tooltips.Import.EjectChoice}" />
|
||||
<CheckBox Content="{l:Loc Import.After.Deep}" IsChecked="{Binding DeepAnalysis}" IsEnabled="{Binding IsArchiveDestination}" ToolTip="{Binding DeepToolTip}" />
|
||||
</WrapPanel>
|
||||
</HeaderedContentControl>
|
||||
</StackPanel>
|
||||
|
||||
<!-- ===================== Plan panel ===================== -->
|
||||
<Border Grid.Row="2" Style="{StaticResource Border.Card}" Padding="16,14" Margin="0,14,0,0" IsEnabled="{Binding IsPlanPanelEnabled}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<DockPanel Margin="0,0,0,10">
|
||||
<TextBlock DockPanel.Dock="Left" Text="{l:Loc Import.Plan.Title}" Style="{StaticResource Text.Section}" VerticalAlignment="Center" />
|
||||
<TextBlock DockPanel.Dock="Right" Text="{Binding SpaceText}" Foreground="{DynamicResource Brush.TextMuted}" Margin="12,0,0,0" VerticalAlignment="Center"
|
||||
ToolTip="{l:Loc Tooltips.Import.Space}" Visibility="{Binding IsSpaceShort, Converter={x:Static ui:InverseBoolToVisibilityConverter.Instance}}" />
|
||||
<ui:StatusGlyph DockPanel.Dock="Right" Kind="Warning" Text="{Binding SpaceText}" FontSize="13" Margin="12,0,0,0" VerticalAlignment="Center"
|
||||
ToolTip="{l:Loc Tooltips.Import.Space}" Visibility="{Binding IsSpaceShort, Converter={StaticResource BoolToVisibility}}" />
|
||||
<TextBlock DockPanel.Dock="Right" Text="{Binding ImportedBeforeText}" Foreground="{DynamicResource Brush.TextMuted}" Margin="12,0,0,0" VerticalAlignment="Center"
|
||||
ToolTip="{l:Loc Tooltips.Import.ImportedBefore}" />
|
||||
<ui:StatusGlyph DockPanel.Dock="Right" Kind="{Binding DuplicatesKind}" Text="{Binding DuplicatesText}" FontSize="13" Margin="12,0,0,0" VerticalAlignment="Center"
|
||||
ToolTip="{l:Loc Tooltips.Import.Duplicates}" Visibility="{Binding HasPlan, Converter={StaticResource BoolToVisibility}}" />
|
||||
<TextBlock Text="{Binding TotalsText}" Foreground="{DynamicResource Brush.TextMuted}" Margin="12,0,0,0" VerticalAlignment="Center"
|
||||
Typography.NumeralAlignment="Tabular" TextTrimming="CharacterEllipsis" ToolTip="{Binding TotalsText}" />
|
||||
</DockPanel>
|
||||
|
||||
<!-- No source, reading the card, or the reason no plan can be made: one sentence and one action. -->
|
||||
<StackPanel Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center" MaxWidth="420"
|
||||
Visibility="{Binding ShowsStatus, Converter={StaticResource BoolToVisibility}}">
|
||||
<TextBlock x:Name="StatusLine" Text="{Binding StatusText, NotifyOnTargetUpdated=True}" ToolTip="{Binding StatusDetail}" Foreground="{DynamicResource Brush.TextMuted}"
|
||||
TextAlignment="Center" TextWrapping="Wrap" AutomationProperties.LiveSetting="Polite" />
|
||||
<ProgressBar IsIndeterminate="{Binding IsBusyPlanning}" Width="240" Margin="0,12,0,0" AutomationProperties.LabeledBy="{Binding ElementName=StatusLine}"
|
||||
Visibility="{Binding IsBusyPlanning, Converter={StaticResource BoolToVisibility}}" />
|
||||
<Button x:Name="StatusActionButton" Content="{Binding StatusActionText}" Command="{Binding StatusActionCommand}" ToolTip="{Binding StatusActionToolTip}"
|
||||
HorizontalAlignment="Center" Margin="0,12,0,0" Visibility="{Binding HasStatusAction, Converter={StaticResource BoolToVisibility}}" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Sessions of the plan with editable titles. -->
|
||||
<Grid Grid.Row="1" Visibility="{Binding HasPlan, Converter={StaticResource BoolToVisibility}}" Grid.IsSharedSizeScope="True">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<!-- The right margin is the list's scroll bar (always shown, 10 px), so header and cells line up. -->
|
||||
<Grid TextElement.FontSize="12" Margin="0,0,10,4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" MinWidth="110" SharedSizeGroup="SessionTime" />
|
||||
<ColumnDefinition Width="0.85*" MinWidth="70" />
|
||||
<ColumnDefinition Width="Auto" MinWidth="56" SharedSizeGroup="SessionSize" />
|
||||
<ColumnDefinition Width="0.9*" MinWidth="48" />
|
||||
<ColumnDefinition Width="1.6*" MinWidth="140" />
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="SessionAction" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Style="{StaticResource Text.Header}" Text="{l:Loc Import.Session.Column.Session}" ToolTip="{l:Loc Import.Session.Column.Session}" />
|
||||
<TextBlock Grid.Column="1" Style="{StaticResource Text.Header}" Text="{l:Loc Import.Session.Column.Frames}" Margin="10,0,0,0" ToolTip="{l:Loc Import.Session.Column.Frames}" />
|
||||
<TextBlock Grid.Column="2" Style="{StaticResource Text.HeaderEnd}" Text="{l:Loc Import.Session.Column.Size}" Margin="10,0,0,0" ToolTip="{l:Loc Import.Session.Column.Size}" />
|
||||
<TextBlock Grid.Column="3" Style="{StaticResource Text.Header}" Text="{l:Loc Import.Session.Column.Camera}" Margin="10,0,0,0" ToolTip="{l:Loc Import.Session.Column.Camera}" />
|
||||
<TextBlock Grid.Column="4" Style="{StaticResource Text.Header}" Text="{l:Loc Import.Session.Column.Sequence}" Margin="10,0,0,0" ToolTip="{l:Loc Import.Session.Column.Sequence}" />
|
||||
</Grid>
|
||||
<ListBox x:Name="SessionRows" Grid.Row="1" ItemsSource="{Binding Sessions}" ItemContainerStyle="{StaticResource ListBoxItem.Session}"
|
||||
AutomationProperties.Name="{l:Loc Import.Plan.Title}" KeyboardNavigation.TabNavigation="Continue" ScrollViewer.VerticalScrollBarVisibility="Visible">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type imp:ImportSessionRowViewModel}">
|
||||
<Grid Style="{StaticResource Session.Grid}" TextElement.FontSize="12">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" MinWidth="110" SharedSizeGroup="SessionTime" />
|
||||
<ColumnDefinition Width="0.85*" MinWidth="70" />
|
||||
<ColumnDefinition Width="Auto" MinWidth="56" SharedSizeGroup="SessionSize" />
|
||||
<ColumnDefinition Width="0.9*" MinWidth="48" />
|
||||
<ColumnDefinition Width="1.6*" MinWidth="140" />
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="SessionAction" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Style="{StaticResource Text.Cell}" Text="{Binding Row.TimeText}" ToolTip="{Binding Row.TimeText}" />
|
||||
<TextBlock Grid.Column="1" Style="{StaticResource Text.Cell}" Text="{Binding Row.FramesText}" Margin="10,0,0,0" ToolTip="{Binding Row.FramesText}" />
|
||||
<TextBlock Grid.Column="2" Style="{StaticResource Text.CellNumber}" Text="{Binding Row.SizeText}" Margin="10,0,0,0" />
|
||||
<TextBlock Grid.Column="3" Style="{StaticResource Text.Cell}" Text="{Binding Row.CameraText}" Margin="10,0,0,0" ToolTip="{Binding Row.CameraText}" />
|
||||
<DockPanel Grid.Column="4" Margin="10,0,0,0">
|
||||
<TextBlock x:Name="Target" DockPanel.Dock="Right" Text="{l:Loc Import.Session.NewShort}" Foreground="{DynamicResource Brush.Accent}"
|
||||
VerticalAlignment="Center" Margin="8,0,0,0" ToolTip="{Binding Row.TargetText}" />
|
||||
<TextBox Height="26" Padding="8,0" Text="{Binding Title.Text, UpdateSourceTrigger=PropertyChanged}" shell:EditBehavior.Field="{Binding Title}"
|
||||
IsEnabled="{Binding IsEditable}" ui:Field.Placeholder="{Binding Placeholder}" ToolTip="{Binding TitleToolTip}" ToolTipService.ShowOnDisabled="True"
|
||||
AutomationProperties.Name="{Binding TitleName}" />
|
||||
</DockPanel>
|
||||
<Button x:Name="Merge" Grid.Column="5" Style="{StaticResource Button.RowAction}" Margin="8,0,0,0" Content="{l:Loc Import.Session.Merge}"
|
||||
Command="{Binding MergeCommand}" ToolTip="{Binding MergeToolTip}" AutomationProperties.Name="{Binding MergeName}"
|
||||
AutomationProperties.HelpText="{Binding MergeToolTip}" Visibility="{Binding HasMerge, Converter={StaticResource BoolToVisibility}}" />
|
||||
</Grid>
|
||||
<DataTemplate.Triggers>
|
||||
<DataTrigger Binding="{Binding Row.IsNew}" Value="False">
|
||||
<Setter TargetName="Target" Property="Text" Value="{l:Loc Import.Session.AddsShort}" />
|
||||
<Setter TargetName="Target" Property="Foreground" Value="{DynamicResource Brush.TextMuted}" />
|
||||
</DataTrigger>
|
||||
<!-- While copying the plan is fixed: no row action to reveal. -->
|
||||
<DataTrigger Binding="{Binding IsEditable}" Value="False">
|
||||
<Setter TargetName="Merge" Property="Visibility" Value="Hidden" />
|
||||
</DataTrigger>
|
||||
</DataTemplate.Triggers>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</Grid>
|
||||
|
||||
<!-- The verification result and the after-import actions. -->
|
||||
<Grid Grid.Row="1" Grid.RowSpan="2" DataContext="{Binding Result}" Visibility="{Binding DataContext.IsDone, RelativeSource={RelativeSource AncestorType=UserControl}, Converter={StaticResource BoolToVisibility}}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<!-- The glyph colours the result; the text beside it is what screen readers announce. The figures move under it when the card is too
|
||||
narrow for both (Romanian at 1200 px). -->
|
||||
<WrapPanel>
|
||||
<ui:StatusGlyph x:Name="ResultGlyph" Kind="{Binding ResultKind}" VerticalAlignment="Center" />
|
||||
<TextBlock Text="{Binding ResultText, NotifyOnTargetUpdated=True}" Foreground="{Binding Foreground, ElementName=ResultGlyph}" FontSize="16" FontWeight="SemiBold"
|
||||
VerticalAlignment="Center" Typography.NumeralAlignment="Tabular" ToolTip="{l:Loc Tooltips.Import.Result}" AutomationProperties.LiveSetting="Polite" />
|
||||
<TextBlock Text="{Binding DetailText}" Foreground="{DynamicResource Brush.TextMuted}" Margin="14,0,0,0" VerticalAlignment="Center" />
|
||||
</WrapPanel>
|
||||
<ListBox Grid.Row="1" ItemsSource="{Binding Failures}" Margin="0,8,0,0" ItemContainerStyle="{StaticResource ListBoxItem.Failure}"
|
||||
Visibility="{Binding HasFailures, Converter={StaticResource BoolToVisibility}}" AutomationProperties.Name="{l:Loc Import.Result.FailuresName}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" Style="{StaticResource Text.Cell}" Foreground="{DynamicResource Brush.Error}" Height="28" Padding="0,6,0,0" ToolTip="{Binding}" />
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
<StackPanel Grid.Row="2" Margin="0,10,0,0" Visibility="{Binding OffersCheck, Converter={StaticResource BoolToVisibility}}">
|
||||
<TextBlock Text="{Binding EraseText}" Typography.NumeralAlignment="Tabular" />
|
||||
<TextBlock Text="{Binding BusyText, NotifyOnTargetUpdated=True}" Foreground="{DynamicResource Brush.TextMuted}" Margin="0,4,0,0"
|
||||
AutomationProperties.LiveSetting="Polite" Visibility="{Binding BusyText, Converter={x:Static ui:NullToCollapsedConverter.Instance}}" />
|
||||
<ItemsControl ItemsSource="{Binding KeptReasons}" Focusable="False" MaxHeight="80" Margin="0,4,0,0">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ui:StatusGlyph Kind="Warning" Text="{Binding}" FontSize="12" ToolTip="{l:Loc Tooltips.Import.Kept}" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
<WrapPanel Grid.Row="3" Margin="0,12,0,0">
|
||||
<Button Content="{l:Loc Import.Result.Check}" Command="{Binding CheckCommand}" ToolTip="{Binding CheckToolTip}" Margin="0,0,8,0"
|
||||
Visibility="{Binding OffersCheck, Converter={StaticResource BoolToVisibility}}" />
|
||||
<Button Style="{StaticResource Button.Destructive}" Content="{Binding DeleteText}" Command="{Binding DeleteCommand}" ToolTip="{Binding DeleteToolTip}"
|
||||
Margin="0,0,8,0" Visibility="{Binding OffersDelete, Converter={StaticResource BoolToVisibility}}" />
|
||||
<Button Style="{StaticResource Button.Destructive}" Content="{l:Loc Import.Result.Format}" Command="{Binding FormatCommand}" ToolTip="{Binding FormatToolTip}"
|
||||
Margin="0,0,8,0" Visibility="{Binding OffersFormat, Converter={StaticResource BoolToVisibility}}" />
|
||||
<Button Command="{Binding EjectCommand}" ToolTip="{Binding EjectToolTip}" Margin="0,0,8,0" AutomationProperties.Name="{l:Loc Import.Result.Eject}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ui:Icon Glyph="{StaticResource Icon.Eject}" Margin="0,0,6,0" />
|
||||
<TextBlock Text="{l:Loc Import.Result.Eject}" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button Content="{l:Loc Import.Result.Library}" Command="{Binding OpenLibraryCommand}" ToolTip="{l:Loc Tooltips.Import.Library}" Margin="0,0,8,0" />
|
||||
<Button x:Name="NewImportButton" Content="{l:Loc Import.Result.New}" Command="{Binding DataContext.NewImportCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
|
||||
ToolTip="{l:Loc Tooltips.Import.New}" />
|
||||
</WrapPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- The import failed or was cancelled: what happened in one sentence (its full text in the tooltip), and Retry. -->
|
||||
<StackPanel Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center" MaxWidth="520" Visibility="{Binding IsFailed, Converter={StaticResource BoolToVisibility}}">
|
||||
<DockPanel>
|
||||
<ui:Icon DockPanel.Dock="Left" Glyph="{StaticResource Icon.Cross}" Size="12" Foreground="{DynamicResource Brush.Error}" VerticalAlignment="Top" Margin="0,3,6,0" />
|
||||
<TextBlock x:Name="FailureLine" Text="{Binding ErrorText, NotifyOnTargetUpdated=True}" Foreground="{DynamicResource Brush.Error}" TextWrapping="Wrap"
|
||||
TextTrimming="CharacterEllipsis" LineHeight="18" LineStackingStrategy="BlockLineHeight" MaxHeight="54" ToolTip="{Binding FailureToolTip}"
|
||||
AutomationProperties.LiveSetting="Assertive" />
|
||||
</DockPanel>
|
||||
<Button x:Name="RetryButton" Content="{l:Loc Import.Failed.Retry}" Command="{Binding RetryCommand}" ToolTip="{l:Loc Tooltips.Import.Retry}"
|
||||
HorizontalAlignment="Center" Margin="0,12,0,0" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Footer: Show plan and Import, or the progress while copying. -->
|
||||
<DockPanel Grid.Row="2" Margin="0,10,0,0" Visibility="{Binding HasPlan, Converter={StaticResource BoolToVisibility}}">
|
||||
<Button x:Name="ShowPlanButton" DockPanel.Dock="Left" Content="{l:Loc Import.Plan.Show}" Command="{Binding ShowPlanCommand}" ToolTip="{l:Loc Tooltips.Import.ShowPlan}"
|
||||
Visibility="{Binding IsRunning, Converter={x:Static ui:InverseBoolToVisibilityConverter.Instance}}" />
|
||||
<Button DockPanel.Dock="Right" Style="{StaticResource Button.Primary}" Height="36" Padding="22,0" Content="{Binding StartText}" Command="{Binding StartCommand}"
|
||||
ToolTip="{Binding StartToolTip}" Visibility="{Binding IsRunning, Converter={x:Static ui:InverseBoolToVisibilityConverter.Instance}}" />
|
||||
<Button x:Name="CancelButton" DockPanel.Dock="Right" Content="{l:Loc Import.Progress.Cancel}" Command="{Binding CancelCommand}" ToolTip="{l:Loc Tooltips.Import.Cancel}" Margin="12,0,0,0"
|
||||
Visibility="{Binding IsRunning, Converter={StaticResource BoolToVisibility}}" />
|
||||
<Grid Visibility="{Binding IsRunning, Converter={StaticResource BoolToVisibility}}" VerticalAlignment="Center">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ProgressBar Maximum="1" Value="{Binding Progress, Mode=OneWay}" VerticalAlignment="Center" AutomationProperties.LabeledBy="{Binding ElementName=ProgressLine}" />
|
||||
<TextBlock x:Name="ProgressLine" Grid.Column="1" Text="{Binding ProgressText, NotifyOnTargetUpdated=True}" Foreground="{DynamicResource Brush.TextMuted}" Margin="12,0,0,0"
|
||||
Typography.NumeralAlignment="Tabular" AutomationProperties.LiveSetting="Polite" />
|
||||
</Grid>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!-- ===================== Show plan ===================== -->
|
||||
<Border Grid.RowSpan="3" Style="{StaticResource Border.Panel}" Background="{DynamicResource Brush.Surface}" Padding="0" Margin="-8"
|
||||
Visibility="{Binding IsDetailsOpen, Converter={StaticResource BoolToVisibility}}" KeyboardNavigation.TabNavigation="Cycle"
|
||||
KeyboardNavigation.ControlTabNavigation="Cycle" KeyboardNavigation.DirectionalNavigation="Contained">
|
||||
<Border.InputBindings>
|
||||
<KeyBinding Key="Escape" Command="{Binding CloseDetailsCommand}" />
|
||||
</Border.InputBindings>
|
||||
<Grid DataContext="{Binding Details}" Margin="16,12" Grid.IsSharedSizeScope="True">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<DockPanel>
|
||||
<Button x:Name="ClosePlanButton" DockPanel.Dock="Right" Style="{StaticResource Button.IconSubtle}" ui:ButtonIcon.Glyph="{StaticResource Icon.Close}"
|
||||
Command="{Binding DataContext.CloseDetailsCommand, RelativeSource={RelativeSource AncestorType=UserControl}}" ToolTip="{l:Loc Tooltips.Import.ClosePlan}"
|
||||
AutomationProperties.Name="{l:Loc Import.Details.Close}" />
|
||||
<TextBlock Text="{l:Loc Import.Details.Title}" Style="{StaticResource Text.Title}" VerticalAlignment="Center" />
|
||||
<TextBlock Text="{Binding TotalsText}" Foreground="{DynamicResource Brush.TextMuted}" Margin="14,0,0,0" VerticalAlignment="Center" TextTrimming="CharacterEllipsis"
|
||||
Typography.NumeralAlignment="Tabular" ToolTip="{Binding TotalsText}" />
|
||||
</DockPanel>
|
||||
<ItemsControl Grid.Row="1" ItemsSource="{Binding Conflicts}" Focusable="False" Margin="0,8,0,0" MaxHeight="96">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<ui:StatusGlyph Kind="Warning" Text="{Binding}" FontSize="12" Margin="0,2" ToolTip="{l:Loc Tooltips.Import.Conflict}" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<!-- The right margin is the list's scroll bar (always shown, 10 px), so header and cells line up. -->
|
||||
<Grid Grid.Row="2" Margin="0,10,10,4" TextElement.FontSize="12">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1.2*" MinWidth="120" />
|
||||
<ColumnDefinition Width="1.8*" MinWidth="180" />
|
||||
<ColumnDefinition Width="*" MinWidth="110" />
|
||||
<ColumnDefinition Width="Auto" MinWidth="64" SharedSizeGroup="PlanSize" />
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="PlanAction" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Style="{StaticResource Text.Header}" Text="{l:Loc Import.Details.Column.Source}" ToolTip="{l:Loc Import.Details.Column.Source}" />
|
||||
<TextBlock Grid.Column="1" Style="{StaticResource Text.Header}" Text="{l:Loc Import.Details.Column.Destination}" Margin="10,0,0,0" ToolTip="{l:Loc Import.Details.Column.Destination}" />
|
||||
<TextBlock Grid.Column="2" Style="{StaticResource Text.Header}" Text="{l:Loc Import.Details.Column.Action}" Margin="10,0,0,0" ToolTip="{l:Loc Import.Details.Column.Action}" />
|
||||
<TextBlock Grid.Column="3" Style="{StaticResource Text.HeaderEnd}" Text="{l:Loc Import.Session.Column.Size}" Margin="10,0,0,0" ToolTip="{l:Loc Import.Session.Column.Size}" />
|
||||
</Grid>
|
||||
<ListBox x:Name="PlanRows" Grid.Row="3" ItemsSource="{Binding Rows}" ItemContainerStyle="{StaticResource ListBoxItem.PlanRow}" AutomationProperties.Name="{l:Loc Import.Details.Title}"
|
||||
KeyboardNavigation.TabNavigation="Continue" ScrollViewer.VerticalScrollBarVisibility="Visible">
|
||||
<ListBox.ItemTemplate>
|
||||
<!-- A file: its name on the card, its new name, what happens, its size. A session: its heading over two columns, its folder below. -->
|
||||
<DataTemplate DataType="{x:Type imp:PlanDetailRow}">
|
||||
<Grid x:Name="Row" Height="36" TextElement.FontSize="12">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1.2*" MinWidth="120" />
|
||||
<ColumnDefinition Width="1.8*" MinWidth="180" />
|
||||
<ColumnDefinition Width="*" MinWidth="110" />
|
||||
<ColumnDefinition Width="Auto" MinWidth="64" SharedSizeGroup="PlanSize" />
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="PlanAction" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock x:Name="Source" Style="{StaticResource Text.Cell}" Text="{Binding SourceText}" ToolTip="{Binding Source}" />
|
||||
<TextBlock x:Name="Destination" Grid.Column="1" Style="{StaticResource Text.CellPath}" Text="{Binding DestinationText}" Margin="10,0,0,0"
|
||||
ToolTip="{Binding Destination}" />
|
||||
<TextBlock x:Name="Action" Grid.Column="2" Style="{StaticResource Text.Cell}" Text="{Binding ActionText}" Margin="10,0,0,0" ToolTip="{Binding ActionText}" />
|
||||
<TextBlock Grid.Column="3" Style="{StaticResource Text.CellNumber}" Text="{Binding SizeText}" Margin="10,0,0,0" />
|
||||
<Button x:Name="Split" Grid.Column="4" Style="{StaticResource Button.RowAction}" Margin="10,0,4,0" Content="{l:Loc Import.Details.Split}"
|
||||
Command="{Binding DataContext.SplitCommand, RelativeSource={RelativeSource AncestorType=UserControl}}" CommandParameter="{Binding}"
|
||||
ToolTip="{l:Loc Tooltips.Import.Split}" AutomationProperties.Name="{Binding SplitName}" Visibility="Hidden" />
|
||||
</Grid>
|
||||
<DataTemplate.Triggers>
|
||||
<DataTrigger Binding="{Binding CanSplit}" Value="True">
|
||||
<Setter TargetName="Split" Property="Visibility" Value="Visible" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Kind}" Value="File">
|
||||
<Setter TargetName="Source" Property="FlowDirection" Value="LeftToRight" />
|
||||
<Setter TargetName="Source" Property="HorizontalAlignment" Value="Left" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Kind}" Value="Session">
|
||||
<Setter TargetName="Row" Property="Height" Value="50" />
|
||||
<Setter TargetName="Source" Property="FontWeight" Value="SemiBold" />
|
||||
<Setter TargetName="Source" Property="Grid.ColumnSpan" Value="2" />
|
||||
<Setter TargetName="Destination" Property="Grid.Row" Value="1" />
|
||||
<Setter TargetName="Destination" Property="Grid.Column" Value="0" />
|
||||
<Setter TargetName="Destination" Property="Grid.ColumnSpan" Value="4" />
|
||||
<Setter TargetName="Destination" Property="Margin" Value="0,2,0,8" />
|
||||
<Setter TargetName="Destination" Property="Foreground" Value="{DynamicResource Brush.TextMuted}" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding IsSkipped}" Value="True">
|
||||
<Setter TargetName="Row" Property="Opacity" Value="0.6" />
|
||||
<Setter TargetName="Action" Property="Foreground" Value="{DynamicResource Brush.TextMuted}" />
|
||||
</DataTrigger>
|
||||
</DataTemplate.Triggers>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
Reference in new issue
Block a user