Skip to content

Commit

Permalink
Merge branch 'SmallRefactor' of https://github.com/cinqmilleans/Files
Browse files Browse the repository at this point in the history
…into SmallRefactor
  • Loading branch information
cinqmilleans committed Dec 23, 2022
2 parents 9ef6b28 + bb6cb22 commit 95de900
Show file tree
Hide file tree
Showing 89 changed files with 8,144 additions and 1,705 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github: [yaichenbaum]
github: [yaira2]
62 changes: 31 additions & 31 deletions builds/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,36 +91,36 @@ steps:
command: 'build'
arguments: './tests/Files.InteractionTests/Files.InteractionTests.csproj --configuration $(buildConfiguration)'

#- task: PowerShell@2
# inputs:
# targetType: 'inline'
# script: |
# # Find correct folder and run app install script.
# cd $(appxPackageDir)

# $AppBundle = Get-ChildItem -Filter Files*Test -Name
# echo $AppBundle
# cd $AppBundle
# ./Install.ps1 -Force
# Get-AppxPackage
# errorActionPreference: 'continue'
# failOnStderr: true
# workingDirectory: '$(System.DefaultWorkingDirectory)'


#- task: Windows Application Driver@0
# inputs:
# OperationType: 'Start'
# AgentResolution: '1080p'

#- task: VSTest@2
# inputs:
# testSelector: 'testAssemblies'
# testAssemblyVer2: |
# **\$(buildConfiguration)\Files.InteractionTests\net7.0\Files.InteractionTests.dll
# !**\*TestAdapter.dll
# !**\obj\**
# searchFolder: '$(System.DefaultWorkingDirectory)'
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
# Find correct folder and run app install script.
cd $(appxPackageDir)
$AppBundle = Get-ChildItem -Filter Files*Test -Name
echo $AppBundle
cd $AppBundle
./Install.ps1 -Force
Get-AppxPackage
errorActionPreference: 'continue'
failOnStderr: true
workingDirectory: '$(System.DefaultWorkingDirectory)'


- task: Windows Application Driver@0
inputs:
OperationType: 'Start'
AgentResolution: '1080p'

- task: VSTest@2
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\*Files.InteractionTests.dll
!**\*TestAdapter.dll
!**\obj\**
searchFolder: '$(System.DefaultWorkingDirectory)'

- task: CopyFiles@2
displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
Expand All @@ -132,4 +132,4 @@ steps:
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
PathtoPublish: '$(build.artifactstagingdirectory)'
2 changes: 1 addition & 1 deletion src/Files.App (Package)/Files.Package.wapproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<DisableXbfLineInfo>False</DisableXbfLineInfo>
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<AppxBundleAutoResourcePackageQualifiers>Scale|DXFeatureLevel</AppxBundleAutoResourcePackageQualifiers>
<AppxDefaultResourceQualifiers>Language=en-US;af;ar;bg;ca;cs-CZ;da;da-DK;de-DE;el;en-GB;es-ES;es-419;fil-PH;fr-FR;he-IL;hi-IN;hu-HU;id-ID;it-IT;ja-JP;ka;ko-KR;lv-LV;nb-NO;nl-NL;or-IN;pl-PL;pt-BR;pt-PT;ro-RO;ru-RU;sk-SK;sv-SE;ta;th-TH;tr-TR;uk-UA;vi;zh-Hans;zh-Hant</AppxDefaultResourceQualifiers>
<AppxDefaultResourceQualifiers>Language=en-US;af;ar;bg;ca;cs-CZ;da;da-DK;de-DE;el;en-GB;es-ES;es-419;fi-FI;fil-PH;fr-FR;he-IL;hi-IN;hu-HU;id-ID;it-IT;ja-JP;ka;ko-KR;lv-LV;nb-NO;nl-NL;or-IN;pl-PL;pt-BR;pt-PT;ro-RO;ru-RU;sk-SK;sv-SE;ta;th-TH;tr-TR;uk-UA;vi;zh-Hans;zh-Hant</AppxDefaultResourceQualifiers>
<UapAppxPackageBuildMode>StoreUpload</UapAppxPackageBuildMode>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
<EntryPointProjectUniqueName>..\Files.App\Files.App.csproj</EntryPointProjectUniqueName>
Expand Down
1 change: 1 addition & 0 deletions src/Files.App (Package)/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<Resource Language="en-GB"/>
<Resource Language="es-ES"/>
<Resource Language="es-419"/>
<Resource Language="fi-FI"/>
<Resource Language="fil-PH"/>
<Resource Language="fr-FR"/>
<Resource Language="he-IL"/>
Expand Down
5 changes: 3 additions & 2 deletions src/Files.App/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)

_ = InitializeAppComponentsAsync().ContinueWith(t => Logger.Warn(t.Exception, "Error during InitializeAppComponentsAsync()"), TaskContinuationOptions.OnlyOnFaulted);

_ = Window.InitializeApplication(activatedEventArgs);
_ = Window.InitializeApplication(activatedEventArgs.Data);
}

private void EnsureWindowIsInitialized()
Expand All @@ -264,8 +264,9 @@ private void Window_Activated(object sender, WindowActivatedEventArgs args)
public void OnActivated(AppActivationArguments activatedEventArgs)
{
Logger.Info($"App activated. Activated args type: {activatedEventArgs.Data.GetType().Name}");
var data = activatedEventArgs.Data;
// InitializeApplication accesses UI, needs to be called on UI thread
_ = Window.DispatcherQueue.EnqueueAsync(() => Window.InitializeApplication(activatedEventArgs));
_ = Window.DispatcherQueue.EnqueueAsync(() => Window.InitializeApplication(data));
}

/// <summary>
Expand Down
Binary file not shown.
156 changes: 156 additions & 0 deletions src/Files.App/Dialogs/CreateArchiveDialog.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
<ContentDialog
x:Class="Files.App.Dialogs.CreateArchiveDialog"
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:local="using:Files.App.Dialogs"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="{helpers:ResourceString Name=CreateArchive}"
d:DesignHeight="300"
d:DesignWidth="400"
CloseButtonText="{helpers:ResourceString Name=Cancel}"
Closing="ContentDialog_Closing"
CornerRadius="{StaticResource OverlayCornerRadius}"
DefaultButton="Primary"
IsPrimaryButtonEnabled="True"
Loaded="ContentDialog_Loaded"
PrimaryButtonText="{helpers:ResourceString Name=Create}"
RequestedTheme="{x:Bind helpers:ThemeHelper.RootTheme}"
Style="{StaticResource DefaultContentDialogStyle}"
mc:Ignorable="d">
<StackPanel Width="440" Spacing="8">

<!-- Archive Name -->
<Grid
Padding="12"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
BorderThickness="1"
ColumnSpacing="8"
CornerRadius="4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock
Grid.Column="0"
VerticalAlignment="Center"
Text="{helpers:ResourceString Name=Name}" />
<TextBox
x:Name="FileNameBox"
Grid.Column="1"
Width="260"
PlaceholderText="{helpers:ResourceString Name=EnterName}"
Text="{x:Bind ViewModel.FileName, Mode=TwoWay}" />
</Grid>

<!-- Archive Options -->
<Grid
Padding="12"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
BorderThickness="1"
ColumnSpacing="8"
CornerRadius="4"
RowSpacing="12">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<!-- Archive Format -->
<TextBlock
Grid.Row="0"
Grid.Column="0"
VerticalAlignment="Center"
Text="{helpers:ResourceString Name=Format}" />
<ComboBox
x:Name="FileFormatSelector"
Grid.Row="0"
Grid.Column="1"
Width="160"
ItemsSource="{x:Bind ViewModel.FileFormats}"
SelectedItem="{x:Bind ViewModel.FileFormat, Mode=TwoWay}"
DisplayMemberPath="Label"
SelectedValuePath="Key" />

<!-- Compression Level -->
<TextBlock
Grid.Row="1"
Grid.Column="0"
VerticalAlignment="Center"
Text="{helpers:ResourceString Name=CompressionLevel}" />
<ComboBox
x:Name="CompressionLevelSelector"
Grid.Row="1"
Grid.Column="1"
Width="160"
HorizontalAlignment="Right"
DisplayMemberPath="Label"
ItemsSource="{x:Bind ViewModel.CompressionLevels}"
SelectedItem="{x:Bind ViewModel.CompressionLevel, Mode=TwoWay}"
SelectedValuePath="Key" />

<!-- Splitting Size -->
<TextBlock
Grid.Row="2"
Grid.Column="0"
VerticalAlignment="Center"
Text="{helpers:ResourceString Name=SplittingSize}" />
<ComboBox
x:Name="SplittingSizeSelector"
Grid.Row="2"
Grid.Column="1"
Width="160"
HorizontalAlignment="Right"
IsEnabled="{x:Bind ViewModel.CanSplit, Mode=OneWay}"
ItemsSource="{x:Bind ViewModel.SplittingSizes}"
SelectedItem="{x:Bind ViewModel.SplittingSize, Mode=TwoWay}"
SelectedValuePath="Key">
<ComboBox.ItemTemplate>
<DataTemplate x:DataType="local:SplittingSizeItem">
<StackPanel Orientation="Horizontal" Spacing="4">
<TextBlock Text="{x:Bind Label}" />
<TextBlock Text="{x:Bind Separator}" Visibility="{Binding IsDropDownOpen, ElementName=SplittingSizeSelector}" />
<TextBlock Text="{x:Bind Description}" Visibility="{Binding IsDropDownOpen, ElementName=SplittingSizeSelector}" />
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</Grid>

<!-- Encryption Options -->
<Expander
HorizontalAlignment="Stretch"
Header="{helpers:ResourceString Name=Encryption}"
IsExpanded="{x:Bind ViewModel.UseEncryption, Mode=TwoWay}">
<Expander.Content>
<Grid Width="400">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock
Grid.Column="0"
VerticalAlignment="Center"
Text="{helpers:ResourceString Name=Password}" />
<PasswordBox
x:Name="PasswordBox"
Grid.Column="1"
Width="260"
IsPasswordRevealButtonEnabled="True"
Loading="PasswordBox_Loading"
Password="{x:Bind ViewModel.Password, Mode=TwoWay}"
PasswordRevealMode="Peek"
PlaceholderText="{helpers:ResourceString Name=Password}" />
</Grid>
</Expander.Content>
</Expander>
</StackPanel>
</ContentDialog>
Loading

0 comments on commit 95de900

Please sign in to comment.