Skip to content

Commit 15e2621

Browse files
committed
Squashed commit of the following:
commit 2b4132f Author: Filippo Ferrario <102259289+ferrariofilippo@users.noreply.github.com> Date: Tue Aug 15 23:02:52 2023 +0200 Code Quality: Create alike RichCommands inheritance (files-community#13155) commit bd8c78f Author: hishitetsu <66369541+hishitetsu@users.noreply.github.com> Date: Wed Aug 16 05:50:24 2023 +0900 Fix: Fixed issue where deleted items were displayed in tag search results (files-community#13202) commit 4b5ed37 Author: hishitetsu <66369541+hishitetsu@users.noreply.github.com> Date: Tue Aug 15 03:27:18 2023 +0900 Fix: Fixed issue where closing the last closed tab would open it when starting the next session (files-community#13198) commit 6e37d69 Author: Marco Franzen <mail@marco-franzen.de> Date: Mon Aug 14 16:17:14 2023 +0200 Fix: Fixed crash that would occur when deleting or restoring files (files-community#13195) commit 001e8eb Author: Yair <39923744+yaira2@users.noreply.github.com> Date: Sun Aug 13 12:29:35 2023 -0400 Preview: v2.5.22 (files-community#13190) commit f77259a Author: d2dyno <53011783+d2dyno1@users.noreply.github.com> Date: Sun Aug 13 17:28:48 2023 +0200 Fix: Fixed issue where items in the Tags widget were not localized (files-community#13149) commit 9c34c31 Author: Marcel Wagner <marcel.alex.wagner@outlook.com> Date: Sun Aug 13 16:20:48 2023 +0200 Feature: Redesigned the left-hand sidebar (files-community#13052) commit 3d88463 Author: Lukiluc29 <128183422+Lukiluc29@users.noreply.github.com> Date: Sun Aug 13 16:20:24 2023 +0200 Fix: Fixed the corner radius on the drive details page (files-community#13179) commit 89e3d03 Author: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Thu Aug 10 09:14:38 2023 +0900 Feature: Updated the design of the home page headers (files-community#13053) commit f02c4a0 Author: Yair <39923744+yaira2@users.noreply.github.com> Date: Wed Aug 9 17:16:26 2023 -0400 Feature: Increased the default width of the Git status column (files-community#13168) commit c979c22 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed Aug 9 00:55:38 2023 -0400 Build(deps): Bump Microsoft.Data.Sqlite.Core from 7.0.9 to 7.0.10 (files-community#13163) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit beae745 Author: hishitetsu <66369541+hishitetsu@users.noreply.github.com> Date: Wed Aug 9 12:01:49 2023 +0900 Fix: Fixed issue where the back button in the Properties window wasn't working properly (files-community#13162) commit 7f52809 Author: Filippo Ferrario <102259289+ferrariofilippo@users.noreply.github.com> Date: Tue Aug 8 19:03:10 2023 +0200 Code Quality: Fixed issue with clicking search box (files-community#13158) Co-authored-by: hishitetsu <66369541+hishitetsu@users.noreply.github.com> commit 311b380 Author: Filippo Ferrario <102259289+ferrariofilippo@users.noreply.github.com> Date: Tue Aug 8 17:27:37 2023 +0200 Fix: Fixed an issue where clicking an empty space would scroll to the top of the file list (files-community#13157) commit 0988113 Author: Filippo Ferrario <102259289+ferrariofilippo@users.noreply.github.com> Date: Tue Aug 8 17:21:34 2023 +0200 Feature: Show BitLocker options in main menu for drives (files-community#13142) commit 3221267 Author: Filippo Ferrario <102259289+ferrariofilippo@users.noreply.github.com> Date: Tue Aug 8 17:17:48 2023 +0200 Feature: Display error message when transferring files that are too large for FAT32 (files-community#13137) commit be42aea Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Aug 8 10:30:20 2023 -0400 Build(deps): Bump Vanara.Windows.Shell from 3.4.15 to 3.4.16 (files-community#13153) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit 53d99af Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Aug 8 08:37:00 2023 -0400 Build(deps): Bump Vanara.PInvoke.Mpr from 3.4.15 to 3.4.16 (files-community#13152) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit 43624b3 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Aug 8 08:36:50 2023 -0400 Build(deps): Bump Vanara.Windows.Extensions from 3.4.15 to 3.4.16 (files-community#13151) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> commit e7281fe Author: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon Aug 7 21:39:09 2023 -0400 Fix: Fixed issue where clicking DataGrid headers didn't change the sort direction (files-community#13150)
1 parent 13cc213 commit 15e2621

File tree

129 files changed

+4162
-3381
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+4162
-3381
lines changed

src/Files.App (Package)/Package.appxmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<Identity
1717
Name="FilesDev"
1818
Publisher="CN=Files"
19-
Version="2.5.21.0" />
19+
Version="2.5.22.0" />
2020

2121
<Properties>
2222
<DisplayName>Files - Dev</DisplayName>

src/Files.App.Storage/NativeStorage/NativeFile.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ namespace Files.App.Storage.NativeStorage
1515
/// <inheritdoc cref="IFile"/>
1616
public class NativeFile : NativeStorable<FileInfo>, ILocatableFile, IModifiableFile, IFileExtended, INestedFile
1717
{
18-
public NativeFile(FileInfo fileInfo)
19-
: base(fileInfo)
18+
public NativeFile(FileInfo fileInfo, string? name = null)
19+
: base(fileInfo, name)
2020
{
2121
}
2222

23-
public NativeFile(string path)
24-
: this(new FileInfo(path))
23+
public NativeFile(string path, string? name = null)
24+
: this(new FileInfo(path), name)
2525
{
2626
}
2727

src/Files.App.Storage/NativeStorage/NativeFolder.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ namespace Files.App.Storage.NativeStorage
2222
/// <inheritdoc cref="IFolder"/>
2323
public class NativeFolder : NativeStorable<DirectoryInfo>, ILocatableFolder, IModifiableFolder, IMutableFolder, IFolderExtended, INestedFolder, IDirectCopy, IDirectMove
2424
{
25-
public NativeFolder(DirectoryInfo directoryInfo)
26-
: base(directoryInfo)
25+
public NativeFolder(DirectoryInfo directoryInfo, string? name = null)
26+
: base(directoryInfo, name)
2727
{
2828
}
2929

30-
public NativeFolder(string path)
31-
: this(new DirectoryInfo(path))
30+
public NativeFolder(string path, string? name = null)
31+
: this(new DirectoryInfo(path), name)
3232
{
3333
}
3434

src/Files.App.Storage/NativeStorage/NativeStorable.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ public abstract class NativeStorable<TStorage> : ILocatableStorable, INestedStor
1717
protected readonly TStorage storage;
1818

1919
/// <inheritdoc/>
20-
public virtual string Path { get; protected set; }
20+
public string Path { get; protected set; }
2121

2222
/// <inheritdoc/>
23-
public virtual string Name { get; protected set; }
23+
public string Name { get; protected set; }
2424

2525
/// <inheritdoc/>
2626
public virtual string Id { get; }
2727

28-
protected NativeStorable(TStorage storage)
28+
protected NativeStorable(TStorage storage, string? name = null)
2929
{
3030
this.storage = storage;
3131
Path = storage.FullName;
32-
Name = storage.Name;
32+
Name = name ?? storage.Name;
3333
Id = storage.FullName;
3434
}
3535

src/Files.App.Storage/NativeStorage/NativeStorageService.cs

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
// Licensed under the MIT License. See the LICENSE.
33

44
using Files.Core.Storage;
5-
using Files.Core.Storage.LocatableStorage;
5+
using Files.Shared.Helpers;
6+
using System;
67
using System.IO;
78
using System.Threading;
89
using System.Threading.Tasks;
10+
using Windows.Storage;
911

1012
namespace Files.App.Storage.NativeStorage
1113
{
@@ -22,12 +24,31 @@ public Task<IFile> GetFileAsync(string id, CancellationToken cancellationToken =
2224
}
2325

2426
/// <inheritdoc/>
25-
public Task<IFolder> GetFolderAsync(string id, CancellationToken cancellationToken = default)
27+
public async Task<IFolder> GetFolderAsync(string id, CancellationToken cancellationToken = default)
2628
{
2729
if (!Directory.Exists(id))
2830
throw new DirectoryNotFoundException();
2931

30-
return Task.FromResult<IFolder>(new NativeFolder(id));
32+
// A special folder should use the localized name
33+
if (PathHelpers.IsSpecialFolder(id))
34+
{
35+
var storageFolder = await TryGetStorageFolderAsync(id);
36+
return new NativeFolder(id, storageFolder?.DisplayName);
37+
}
38+
39+
return new NativeFolder(id);
40+
41+
async Task<StorageFolder?> TryGetStorageFolderAsync(string path)
42+
{
43+
try
44+
{
45+
return await StorageFolder.GetFolderFromPathAsync(path);
46+
}
47+
catch (Exception)
48+
{
49+
return null;
50+
}
51+
}
3152
}
3253
}
3354
}

src/Files.App/Actions/Content/Archives/DecompressArchiveHere.cs renamed to src/Files.App/Actions/Content/Archives/Compress/BaseCompressArchiveAction.cs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,27 @@
33

44
namespace Files.App.Actions
55
{
6-
internal class DecompressArchiveHere : BaseUIAction, IAction
6+
internal abstract class BaseCompressArchiveAction : BaseUIAction, IAction
77
{
8-
private readonly IContentPageContext context;
8+
protected readonly IContentPageContext context;
99

10-
public string Label
11-
=> "ExtractHere".GetLocalizedResource();
10+
public abstract string Label { get; }
1211

13-
public string Description
14-
=> "DecompressArchiveHereDescription".GetLocalizedResource();
12+
public abstract string Description { get; }
1513

1614
public override bool IsExecutable =>
1715
IsContextPageTypeAdaptedToCommand() &&
18-
ArchiveHelpers.CanDecompress(context.SelectedItems) &&
16+
ArchiveHelpers.CanCompress(context.SelectedItems) &&
1917
UIHelpers.CanShowDialog;
2018

21-
public DecompressArchiveHere()
19+
public BaseCompressArchiveAction()
2220
{
2321
context = Ioc.Default.GetRequiredService<IContentPageContext>();
2422

2523
context.PropertyChanged += Context_PropertyChanged;
2624
}
2725

28-
public Task ExecuteAsync()
29-
{
30-
return ArchiveHelpers.DecompressArchiveHere(context.ShellPage);
31-
}
26+
public abstract Task ExecuteAsync();
3227

3328
private bool IsContextPageTypeAdaptedToCommand()
3429
{
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Copyright (c) 2023 Files Community
2+
// Licensed under the MIT License. See the LICENSE.
3+
4+
using Files.App.Dialogs;
5+
using Microsoft.UI.Xaml.Controls;
6+
7+
namespace Files.App.Actions
8+
{
9+
internal sealed class CompressIntoArchiveAction : BaseCompressArchiveAction
10+
{
11+
public override string Label
12+
=> "CreateArchive".GetLocalizedResource();
13+
14+
public override string Description
15+
=> "CompressIntoArchiveDescription".GetLocalizedResource();
16+
17+
public CompressIntoArchiveAction()
18+
{
19+
}
20+
21+
public override async Task ExecuteAsync()
22+
{
23+
var (sources, directory, fileName) = ArchiveHelpers.GetCompressDestination(context.ShellPage);
24+
25+
var dialog = new CreateArchiveDialog
26+
{
27+
FileName = fileName,
28+
};
29+
30+
var result = await dialog.TryShowAsync();
31+
32+
if (!dialog.CanCreate || result != ContentDialogResult.Primary)
33+
return;
34+
35+
IArchiveCreator creator = new ArchiveCreator
36+
{
37+
Sources = sources,
38+
Directory = directory,
39+
FileName = dialog.FileName,
40+
Password = dialog.Password,
41+
FileFormat = dialog.FileFormat,
42+
CompressionLevel = dialog.CompressionLevel,
43+
SplittingSize = dialog.SplittingSize,
44+
};
45+
46+
await ArchiveHelpers.CompressArchiveAsync(creator);
47+
}
48+
}
49+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright (c) 2023 Files Community
2+
// Licensed under the MIT License. See the LICENSE.
3+
4+
namespace Files.App.Actions
5+
{
6+
internal sealed class CompressIntoSevenZipAction : BaseCompressArchiveAction
7+
{
8+
public override string Label
9+
=> string.Format("CreateNamedArchive".GetLocalizedResource(), $"{ArchiveHelpers.DetermineArchiveNameFromSelection(context.SelectedItems)}.7z");
10+
11+
public override string Description
12+
=> "CompressIntoSevenZipDescription".GetLocalizedResource();
13+
14+
public CompressIntoSevenZipAction()
15+
{
16+
}
17+
18+
public override Task ExecuteAsync()
19+
{
20+
var (sources, directory, fileName) = ArchiveHelpers.GetCompressDestination(context.ShellPage);
21+
22+
IArchiveCreator creator = new ArchiveCreator
23+
{
24+
Sources = sources,
25+
Directory = directory,
26+
FileName = fileName,
27+
FileFormat = ArchiveFormats.SevenZip,
28+
};
29+
30+
return ArchiveHelpers.CompressArchiveAsync(creator);
31+
}
32+
}
33+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright (c) 2023 Files Community
2+
// Licensed under the MIT License. See the LICENSE.
3+
4+
namespace Files.App.Actions
5+
{
6+
internal sealed class CompressIntoZipAction : BaseCompressArchiveAction
7+
{
8+
public override string Label
9+
=> string.Format("CreateNamedArchive".GetLocalizedResource(), $"{ArchiveHelpers.DetermineArchiveNameFromSelection(context.SelectedItems)}.zip");
10+
11+
public override string Description
12+
=> "CompressIntoZipDescription".GetLocalizedResource();
13+
14+
public CompressIntoZipAction()
15+
{
16+
}
17+
18+
public override Task ExecuteAsync()
19+
{
20+
var (sources, directory, fileName) = ArchiveHelpers.GetCompressDestination(context.ShellPage);
21+
22+
IArchiveCreator creator = new ArchiveCreator
23+
{
24+
Sources = sources,
25+
Directory = directory,
26+
FileName = fileName,
27+
FileFormat = ArchiveFormats.Zip,
28+
};
29+
30+
return ArchiveHelpers.CompressArchiveAsync(creator);
31+
}
32+
}
33+
}

src/Files.App/Actions/Content/Archives/CompressIntoArchiveAction.cs

Lines changed: 0 additions & 79 deletions
This file was deleted.

0 commit comments

Comments
 (0)