forked from files-community/Files
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDecompressArchiveDialog.xaml
123 lines (107 loc) · 3.75 KB
/
DecompressArchiveDialog.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<!-- Copyright (c) Files Community. Licensed under the MIT License. -->
<ContentDialog
x:Class="Files.App.Dialogs.DecompressArchiveDialog"
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:helpers="using:Files.App.Helpers"
xmlns:items="using:Files.App.Data.Items"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:uc="using:Files.App.UserControls"
Title="{helpers:ResourceString Name=ExtractArchive}"
CornerRadius="{StaticResource OverlayCornerRadius}"
DefaultButton="Primary"
HighContrastAdjustment="None"
PrimaryButtonClick="ContentDialog_PrimaryButtonClick"
PrimaryButtonText="{helpers:ResourceString Name=Extract}"
RequestedTheme="{x:Bind RootAppElement.RequestedTheme, Mode=OneWay}"
SecondaryButtonText="{helpers:ResourceString Name=Cancel}"
Style="{StaticResource DefaultContentDialogStyle}"
mc:Ignorable="d">
<Border MinWidth="400" Margin="0,16,0,0">
<StackPanel Orientation="Vertical" Spacing="12">
<!-- Extract To Path -->
<Grid
x:Name="ExtractPathGrid"
x:Load="{x:Bind ViewModel.ShowPathSelection}"
ColumnSpacing="8"
RowSpacing="8">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!-- Header -->
<TextBlock
Grid.Row="0"
Grid.ColumnSpan="2"
Text="{helpers:ResourceString Name=ExtractToPath}" />
<!-- Path Box -->
<TextBox
x:Name="DestinationFolderPath"
Grid.Row="1"
Grid.Column="0"
HorizontalAlignment="Stretch"
IsReadOnly="True"
Text="{x:Bind ViewModel.DestinationFolderPath, Mode=OneWay}" />
<Button
x:Name="SelectDestination"
Grid.Row="1"
Grid.Column="1"
Command="{x:Bind ViewModel.SelectDestinationCommand}"
Content="{helpers:ResourceString Name=Browse}" />
</Grid>
<!-- Password -->
<StackPanel
x:Name="PasswordStackPanel"
x:Load="{x:Bind ViewModel.IsArchiveEncrypted}"
Orientation="Vertical"
Spacing="8">
<TextBlock
x:Name="PasswordHeader"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Text="{helpers:ResourceString Name=ArchivePassword}" />
<PasswordBox
x:Name="Password"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
PlaceholderText="{helpers:ResourceString Name=Password}" />
</StackPanel>
<!-- Encoding -->
<StackPanel
x:Name="EncodingStackPanel"
x:Load="{x:Bind ViewModel.IsArchiveEncodingUndetermined, Mode=OneWay}"
Orientation="Vertical"
Spacing="8">
<TextBlock
x:Name="EncodingHeader"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Text="{helpers:ResourceString Name=Encoding}" />
<ComboBox
x:Name="EncodingBox"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
ItemsSource="{x:Bind ViewModel.EncodingOptions, Mode=OneWay}"
SelectedItem="{x:Bind ViewModel.SelectedEncoding, Mode=TwoWay}">
<uc:ComboBoxEx.ItemTemplate>
<DataTemplate x:DataType="items:EncodingItem">
<TextBlock Text="{x:Bind Name}" />
</DataTemplate>
</uc:ComboBoxEx.ItemTemplate>
</uc:ComboBoxEx>
</StackPanel>
<!-- Open when complete -->
<CheckBox
x:Name="OpenDestination"
Grid.Row="3"
x:Load="{x:Bind ViewModel.ShowPathSelection}"
Content="{helpers:ResourceString Name=DecompressArchiveDialogOpenDestinationWhenComplete/Content}"
IsChecked="{x:Bind ViewModel.OpenDestinationFolderOnCompletion, Mode=TwoWay}" />
</StackPanel>
</Border>
</ContentDialog>