Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 2b4132f
Author: Filippo Ferrario <[email protected]>
Date:   Tue Aug 15 23:02:52 2023 +0200

    Code Quality: Create alike RichCommands inheritance (files-community#13155)

commit bd8c78f
Author: hishitetsu <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Date:   Sun Aug 13 12:29:35 2023 -0400

    Preview: v2.5.22 (files-community#13190)

commit f77259a
Author: d2dyno <[email protected]>
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 <[email protected]>
Date:   Sun Aug 13 16:20:48 2023 +0200

    Feature: Redesigned the left-hand sidebar (files-community#13052)

commit 3d88463
Author: Lukiluc29 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit beae745
Author: hishitetsu <[email protected]>
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 <[email protected]>
Date:   Tue Aug 8 19:03:10 2023 +0200

    Code Quality: Fixed issue with clicking search box (files-community#13158)

    Co-authored-by: hishitetsu <[email protected]>

commit 311b380
Author: Filippo Ferrario <[email protected]>
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 <[email protected]>
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 <[email protected]>
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] <[email protected]>
    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] <[email protected]>
    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] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit e7281fe
Author: Yair <[email protected]>
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)
  • Loading branch information
yaira2 committed Aug 16, 2023
1 parent 13cc213 commit 15e2621
Show file tree
Hide file tree
Showing 129 changed files with 4,162 additions and 3,381 deletions.
2 changes: 1 addition & 1 deletion src/Files.App (Package)/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<Identity
Name="FilesDev"
Publisher="CN=Files"
Version="2.5.21.0" />
Version="2.5.22.0" />

<Properties>
<DisplayName>Files - Dev</DisplayName>
Expand Down
8 changes: 4 additions & 4 deletions src/Files.App.Storage/NativeStorage/NativeFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ namespace Files.App.Storage.NativeStorage
/// <inheritdoc cref="IFile"/>
public class NativeFile : NativeStorable<FileInfo>, ILocatableFile, IModifiableFile, IFileExtended, INestedFile
{
public NativeFile(FileInfo fileInfo)
: base(fileInfo)
public NativeFile(FileInfo fileInfo, string? name = null)
: base(fileInfo, name)
{
}

public NativeFile(string path)
: this(new FileInfo(path))
public NativeFile(string path, string? name = null)
: this(new FileInfo(path), name)
{
}

Expand Down
8 changes: 4 additions & 4 deletions src/Files.App.Storage/NativeStorage/NativeFolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ namespace Files.App.Storage.NativeStorage
/// <inheritdoc cref="IFolder"/>
public class NativeFolder : NativeStorable<DirectoryInfo>, ILocatableFolder, IModifiableFolder, IMutableFolder, IFolderExtended, INestedFolder, IDirectCopy, IDirectMove
{
public NativeFolder(DirectoryInfo directoryInfo)
: base(directoryInfo)
public NativeFolder(DirectoryInfo directoryInfo, string? name = null)
: base(directoryInfo, name)
{
}

public NativeFolder(string path)
: this(new DirectoryInfo(path))
public NativeFolder(string path, string? name = null)
: this(new DirectoryInfo(path), name)
{
}

Expand Down
8 changes: 4 additions & 4 deletions src/Files.App.Storage/NativeStorage/NativeStorable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ public abstract class NativeStorable<TStorage> : ILocatableStorable, INestedStor
protected readonly TStorage storage;

/// <inheritdoc/>
public virtual string Path { get; protected set; }
public string Path { get; protected set; }

/// <inheritdoc/>
public virtual string Name { get; protected set; }
public string Name { get; protected set; }

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

protected NativeStorable(TStorage storage)
protected NativeStorable(TStorage storage, string? name = null)
{
this.storage = storage;
Path = storage.FullName;
Name = storage.Name;
Name = name ?? storage.Name;
Id = storage.FullName;
}

Expand Down
27 changes: 24 additions & 3 deletions src/Files.App.Storage/NativeStorage/NativeStorageService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
// Licensed under the MIT License. See the LICENSE.

using Files.Core.Storage;
using Files.Core.Storage.LocatableStorage;
using Files.Shared.Helpers;
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Windows.Storage;

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

/// <inheritdoc/>
public Task<IFolder> GetFolderAsync(string id, CancellationToken cancellationToken = default)
public async Task<IFolder> GetFolderAsync(string id, CancellationToken cancellationToken = default)
{
if (!Directory.Exists(id))
throw new DirectoryNotFoundException();

return Task.FromResult<IFolder>(new NativeFolder(id));
// A special folder should use the localized name
if (PathHelpers.IsSpecialFolder(id))
{
var storageFolder = await TryGetStorageFolderAsync(id);
return new NativeFolder(id, storageFolder?.DisplayName);
}

return new NativeFolder(id);

async Task<StorageFolder?> TryGetStorageFolderAsync(string path)
{
try
{
return await StorageFolder.GetFolderFromPathAsync(path);
}
catch (Exception)
{
return null;
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,27 @@

namespace Files.App.Actions
{
internal class DecompressArchiveHere : BaseUIAction, IAction
internal abstract class BaseCompressArchiveAction : BaseUIAction, IAction
{
private readonly IContentPageContext context;
protected readonly IContentPageContext context;

public string Label
=> "ExtractHere".GetLocalizedResource();
public abstract string Label { get; }

public string Description
=> "DecompressArchiveHereDescription".GetLocalizedResource();
public abstract string Description { get; }

public override bool IsExecutable =>
IsContextPageTypeAdaptedToCommand() &&
ArchiveHelpers.CanDecompress(context.SelectedItems) &&
ArchiveHelpers.CanCompress(context.SelectedItems) &&
UIHelpers.CanShowDialog;

public DecompressArchiveHere()
public BaseCompressArchiveAction()
{
context = Ioc.Default.GetRequiredService<IContentPageContext>();

context.PropertyChanged += Context_PropertyChanged;
}

public Task ExecuteAsync()
{
return ArchiveHelpers.DecompressArchiveHere(context.ShellPage);
}
public abstract Task ExecuteAsync();

private bool IsContextPageTypeAdaptedToCommand()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.App.Dialogs;
using Microsoft.UI.Xaml.Controls;

namespace Files.App.Actions
{
internal sealed class CompressIntoArchiveAction : BaseCompressArchiveAction
{
public override string Label
=> "CreateArchive".GetLocalizedResource();

public override string Description
=> "CompressIntoArchiveDescription".GetLocalizedResource();

public CompressIntoArchiveAction()
{
}

public override async Task ExecuteAsync()
{
var (sources, directory, fileName) = ArchiveHelpers.GetCompressDestination(context.ShellPage);

var dialog = new CreateArchiveDialog
{
FileName = fileName,
};

var result = await dialog.TryShowAsync();

if (!dialog.CanCreate || result != ContentDialogResult.Primary)
return;

IArchiveCreator creator = new ArchiveCreator
{
Sources = sources,
Directory = directory,
FileName = dialog.FileName,
Password = dialog.Password,
FileFormat = dialog.FileFormat,
CompressionLevel = dialog.CompressionLevel,
SplittingSize = dialog.SplittingSize,
};

await ArchiveHelpers.CompressArchiveAsync(creator);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

namespace Files.App.Actions
{
internal sealed class CompressIntoSevenZipAction : BaseCompressArchiveAction
{
public override string Label
=> string.Format("CreateNamedArchive".GetLocalizedResource(), $"{ArchiveHelpers.DetermineArchiveNameFromSelection(context.SelectedItems)}.7z");

public override string Description
=> "CompressIntoSevenZipDescription".GetLocalizedResource();

public CompressIntoSevenZipAction()
{
}

public override Task ExecuteAsync()
{
var (sources, directory, fileName) = ArchiveHelpers.GetCompressDestination(context.ShellPage);

IArchiveCreator creator = new ArchiveCreator
{
Sources = sources,
Directory = directory,
FileName = fileName,
FileFormat = ArchiveFormats.SevenZip,
};

return ArchiveHelpers.CompressArchiveAsync(creator);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

namespace Files.App.Actions
{
internal sealed class CompressIntoZipAction : BaseCompressArchiveAction
{
public override string Label
=> string.Format("CreateNamedArchive".GetLocalizedResource(), $"{ArchiveHelpers.DetermineArchiveNameFromSelection(context.SelectedItems)}.zip");

public override string Description
=> "CompressIntoZipDescription".GetLocalizedResource();

public CompressIntoZipAction()
{
}

public override Task ExecuteAsync()
{
var (sources, directory, fileName) = ArchiveHelpers.GetCompressDestination(context.ShellPage);

IArchiveCreator creator = new ArchiveCreator
{
Sources = sources,
Directory = directory,
FileName = fileName,
FileFormat = ArchiveFormats.Zip,
};

return ArchiveHelpers.CompressArchiveAsync(creator);
}
}
}

This file was deleted.

Loading

0 comments on commit 15e2621

Please sign in to comment.