Skip to content

Commit c29edaf

Browse files
authored
Merge branch 'main' into SaveSessionWhenException
2 parents 112f6b5 + 9f2c050 commit c29edaf

File tree

176 files changed

+15202
-2542
lines changed

Some content is hidden

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

176 files changed

+15202
-2542
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Files also offers advanced features such as file tagging for easy organization,
2727
- MSVC v143 - VS 2022 C++ x64/x86 or ARM64 build tools (latest)
2828
- C++ ATL for latest v143 build tools (x86 & x64 or ARM64)
2929
- Git for Windows
30-
- [Windows App SDK 1.2](https://learn.microsoft.com/windows/apps/windows-app-sdk/downloads#current-releases)
30+
- [Windows App SDK 1.3](https://learn.microsoft.com/windows/apps/windows-app-sdk/downloads#current-releases)
3131

3232
### 2. Clone the repository
3333

specs/RichCommand/CommandList.md

Lines changed: 117 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
xmlns:uap4="http://schemas.microsoft.com/appx/manifest/uap/windows10/4"
1111
xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5"
1212
IgnorableNamespaces="uap uap5 mp rescap desktop6 desktop4 desktop">
13-
<Identity Name="FilesDev" Publisher="CN=Files" Version="2.4.61.0" />
13+
<Identity Name="FilesDev" Publisher="CN=Files" Version="2.4.62.0" />
1414
<Properties>
1515
<DisplayName>Files - Dev</DisplayName>
1616
<PublisherDisplayName>Yair A</PublisherDisplayName>

src/Files.App/Actions/BaseUIAction.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using CommunityToolkit.Mvvm.ComponentModel;
2+
using Files.App.Helpers;
3+
using System.ComponentModel;
4+
5+
namespace Files.App.Actions
6+
{
7+
internal abstract class BaseUIAction : ObservableObject
8+
{
9+
public virtual bool IsExecutable => UIHelpers.CanShowDialog;
10+
11+
public BaseUIAction()
12+
{
13+
UIHelpers.PropertyChanged += UIHelpers_PropertyChanged;
14+
}
15+
16+
private void UIHelpers_PropertyChanged(object? sender, PropertyChangedEventArgs e)
17+
{
18+
if (e.PropertyName is nameof(UIHelpers.CanShowDialog))
19+
OnPropertyChanged(nameof(IsExecutable));
20+
}
21+
}
22+
}

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
1-
using CommunityToolkit.Mvvm.ComponentModel;
2-
using CommunityToolkit.Mvvm.DependencyInjection;
1+
using CommunityToolkit.Mvvm.DependencyInjection;
32
using Files.App.Contexts;
43
using Files.App.Dialogs;
54
using Files.App.Extensions;
65
using Files.App.Filesystem.Archive;
76
using Files.App.Helpers;
7+
using Microsoft.UI.Xaml.Controls;
88
using System.ComponentModel;
99
using System.Threading.Tasks;
1010

1111
namespace Files.App.Actions
1212
{
13-
internal class CompressIntoArchiveAction : ObservableObject, IAction
13+
internal class CompressIntoArchiveAction : BaseUIAction, IAction
1414
{
1515
private readonly IContentPageContext context = Ioc.Default.GetRequiredService<IContentPageContext>();
1616

1717
public string Label => "CreateArchive".GetLocalizedResource();
1818

19-
public string Description => "TODO: Need to be described.";
19+
public string Description => "CompressIntoArchiveDescription".GetLocalizedResource();
2020

21-
public bool IsExecutable => IsContextPageTypeAdaptedToCommand()
22-
&& ArchiveHelpers.CanCompress(context.SelectedItems);
21+
public override bool IsExecutable =>
22+
IsContextPageTypeAdaptedToCommand() &&
23+
ArchiveHelpers.CanCompress(context.SelectedItems) &&
24+
UIHelpers.CanShowDialog;
2325

2426
public CompressIntoArchiveAction()
2527
{
@@ -34,9 +36,9 @@ public async Task ExecuteAsync()
3436
{
3537
FileName = fileName,
3638
};
37-
await dialog.ShowAsync();
39+
var result = await dialog.TryShowAsync();
3840

39-
if (!dialog.CanCreate)
41+
if (!dialog.CanCreate || result != ContentDialogResult.Primary)
4042
return;
4143

4244
IArchiveCreator creator = new ArchiveCreator

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ internal class CompressIntoSevenZipAction : ObservableObject, IAction
1515

1616
public string Label => string.Format("CreateNamedArchive".GetLocalizedResource(), $"{ArchiveHelpers.DetermineArchiveNameFromSelection(context.SelectedItems)}.7z");
1717

18-
public string Description => "TODO: Need to be described.";
18+
public string Description => "CompressIntoSevenZipDescription".GetLocalizedResource();
1919

2020
public bool IsExecutable => IsContextPageTypeAdaptedToCommand()
2121
&& ArchiveHelpers.CanCompress(context.SelectedItems);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ internal class CompressIntoZipAction : ObservableObject, IAction
1515

1616
public string Label => string.Format("CreateNamedArchive".GetLocalizedResource(), $"{ArchiveHelpers.DetermineArchiveNameFromSelection(context.SelectedItems)}.zip");
1717

18-
public string Description => "TODO: Need to be described.";
18+
public string Description => "CompressIntoZipDescription".GetLocalizedResource();
1919

2020
public bool IsExecutable => IsContextPageTypeAdaptedToCommand()
2121
&& ArchiveHelpers.CanCompress(context.SelectedItems);

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using CommunityToolkit.Mvvm.ComponentModel;
2-
using CommunityToolkit.Mvvm.DependencyInjection;
1+
using CommunityToolkit.Mvvm.DependencyInjection;
32
using Files.App.Commands;
43
using Files.App.Contexts;
54
using Files.App.Extensions;
@@ -9,18 +8,20 @@
98

109
namespace Files.App.Actions
1110
{
12-
internal class DecompressArchive : ObservableObject, IAction
11+
internal class DecompressArchive : BaseUIAction, IAction
1312
{
1413
private readonly IContentPageContext context = Ioc.Default.GetRequiredService<IContentPageContext>();
1514

1615
public string Label => "ExtractFiles".GetLocalizedResource();
1716

18-
public string Description => "TODO: Need to be described.";
17+
public string Description => "DecompressArchiveDescription".GetLocalizedResource();
1918

2019
public HotKey HotKey { get; } = new(Keys.E, KeyModifiers.Ctrl);
2120

22-
public bool IsExecutable => IsContextPageTypeAdaptedToCommand()
23-
&& ArchiveHelpers.CanDecompress(context.SelectedItems);
21+
public override bool IsExecutable =>
22+
IsContextPageTypeAdaptedToCommand() &&
23+
ArchiveHelpers.CanDecompress(context.SelectedItems) &&
24+
UIHelpers.CanShowDialog;
2425

2526
public DecompressArchive()
2627
{

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using CommunityToolkit.Mvvm.ComponentModel;
2-
using CommunityToolkit.Mvvm.DependencyInjection;
1+
using CommunityToolkit.Mvvm.DependencyInjection;
32
using Files.App.Contexts;
43
using Files.App.Extensions;
54
using Files.App.Helpers;
@@ -8,16 +7,18 @@
87

98
namespace Files.App.Actions
109
{
11-
internal class DecompressArchiveHere : ObservableObject, IAction
10+
internal class DecompressArchiveHere : BaseUIAction, IAction
1211
{
1312
private readonly IContentPageContext context = Ioc.Default.GetRequiredService<IContentPageContext>();
1413

1514
public string Label => "ExtractHere".GetLocalizedResource();
1615

17-
public string Description => "TODO: Need to be described.";
16+
public string Description => "DecompressArchiveHereDescription".GetLocalizedResource();
1817

19-
public bool IsExecutable => IsContextPageTypeAdaptedToCommand()
20-
&& ArchiveHelpers.CanDecompress(context.SelectedItems);
18+
public override bool IsExecutable =>
19+
IsContextPageTypeAdaptedToCommand() &&
20+
ArchiveHelpers.CanDecompress(context.SelectedItems) &&
21+
UIHelpers.CanShowDialog;
2122

2223
public DecompressArchiveHere()
2324
{

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using CommunityToolkit.Mvvm.ComponentModel;
2-
using CommunityToolkit.Mvvm.DependencyInjection;
1+
using CommunityToolkit.Mvvm.DependencyInjection;
32
using Files.App.Contexts;
43
using Files.App.Extensions;
54
using Files.App.Helpers;
@@ -10,16 +9,18 @@
109

1110
namespace Files.App.Actions
1211
{
13-
internal class DecompressArchiveToChildFolderAction : ObservableObject, IAction
12+
internal class DecompressArchiveToChildFolderAction : BaseUIAction, IAction
1413
{
1514
private readonly IContentPageContext context = Ioc.Default.GetRequiredService<IContentPageContext>();
1615

1716
public string Label => ComputeLabel();
1817

19-
public string Description => "TODO: Need to be described.";
18+
public string Description => "DecompressArchiveToChildFolderDescription".GetLocalizedResource();
2019

21-
public bool IsExecutable => IsContextPageTypeAdaptedToCommand()
22-
&& ArchiveHelpers.CanDecompress(context.SelectedItems);
20+
public override bool IsExecutable =>
21+
IsContextPageTypeAdaptedToCommand() &&
22+
ArchiveHelpers.CanDecompress(context.SelectedItems) &&
23+
UIHelpers.CanShowDialog;
2324

2425
public DecompressArchiveToChildFolderAction()
2526
{

src/Files.App/Actions/Content/Background/SetAsLockscreenBackgroundAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ internal class SetAsLockscreenBackgroundAction : BaseSetAsAction
1010
{
1111
public override string Label { get; } = "SetAsLockscreen".GetLocalizedResource();
1212

13-
public override string Description => "TODO: Need to be described.";
13+
public override string Description => "SetAsLockscreenBackgroundDescription".GetLocalizedResource();
1414

1515
public override RichGlyph Glyph { get; } = new("\uEE3F");
1616

src/Files.App/Actions/Content/Background/SetAsSlideshowBackgroundAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ internal class SetAsSlideshowBackgroundAction : BaseSetAsAction
1010
{
1111
public override string Label { get; } = "SetAsSlideshow".GetLocalizedResource();
1212

13-
public override string Description => "TODO: Need to be described.";
13+
public override string Description => "SetAsSlideshowBackgroundDescription".GetLocalizedResource();
1414

1515
public override RichGlyph Glyph { get; } = new("\uE91B");
1616

src/Files.App/Actions/Content/Background/SetAsWallpaperBackgroundAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ internal class SetAsWallpaperBackgroundAction : BaseSetAsAction
1010
{
1111
public override string Label { get; } = "SetAsBackground".GetLocalizedResource();
1212

13-
public override string Description => "TODO: Need to be described.";
13+
public override string Description => "SetAsWallpaperBackgroundDescription".GetLocalizedResource();
1414

1515
public override RichGlyph Glyph { get; } = new("\uE91B");
1616

src/Files.App/Actions/Content/ImageManipulation/RotateLeftAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ internal class RotateLeftAction : BaseRotateAction
88
{
99
public override string Label { get; } = "RotateLeft".GetLocalizedResource();
1010

11-
public override string Description => "TODO: Need to be described.";
11+
public override string Description => "RotateLeftDescription".GetLocalizedResource();
1212

1313
public override RichGlyph Glyph { get; } = new RichGlyph(opacityStyle: "ColorIconRotateLeft");
1414

src/Files.App/Actions/Content/ImageManipulation/RotateRightAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ internal class RotateRightAction : BaseRotateAction
88
{
99
public override string Label { get; } = "RotateRight".GetLocalizedResource();
1010

11-
public override string Description => "TODO: Need to be described.";
11+
public override string Description => "RotateRightDescription".GetLocalizedResource();
1212

1313
public override RichGlyph Glyph { get; } = new RichGlyph(opacityStyle: "ColorIconRotateRight");
1414

src/Files.App/Actions/Content/Install/InstallFontAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ internal class InstallFontAction : ObservableObject, IAction
1616

1717
public string Label => "Install".GetLocalizedResource();
1818

19-
public string Description => "TODO: Need to be described.";
19+
public string Description => "InstallFontDescription".GetLocalizedResource();
2020

2121
public bool IsExecutable => context.SelectedItems.Any() &&
2222
context.SelectedItems.All(x => FileExtensionHelpers.IsFontFile(x.FileExtension)) &&

src/Files.App/Actions/Content/Install/InstallInfDriverAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ internal class InstallInfDriverAction : ObservableObject, IAction
1616

1717
public string Label => "Install".GetLocalizedResource();
1818

19-
public string Description => "TODO: Need to be described.";
19+
public string Description => "InstallInfDriverDescription".GetLocalizedResource();
2020

2121
public RichGlyph Glyph { get; } = new("\uE9F5");
2222

src/Files.App/Actions/Content/QuickLook/LaunchQuickLookAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ internal class LaunchQuickLookAction : ObservableObject, IAction
2020

2121
public string Label => "LaunchQuickLook".GetLocalizedResource();
2222

23-
public string Description => "TODO: Need to be described.";
23+
public string Description => "LaunchQuickLookDescription".GetLocalizedResource();
2424

2525
public LaunchQuickLookAction()
2626
{

src/Files.App/Actions/Content/RefreshItemsAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ internal class RefreshItemsAction : ObservableObject, IAction
1313
private readonly IContentPageContext context = Ioc.Default.GetRequiredService<IContentPageContext>();
1414

1515
public string Label { get; } = "Refresh".GetLocalizedResource();
16-
public string Description { get; } = "TODO";
16+
public string Description { get; } = "RefreshItemsDescription".GetLocalizedResource();
1717

1818
public RichGlyph Glyph { get; } = new("\uE72C");
1919

src/Files.App/Actions/Content/Run/RunAsAdminAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ internal class RunAsAdminAction : ObservableObject, IAction
1515
public bool IsExecutable => context.SelectedItem is not null &&
1616
FileExtensionHelpers.IsExecutableFile(context.SelectedItem.FileExtension);
1717
public string Label => "RunAsAdministrator".GetLocalizedResource();
18-
public string Description => "TODO: Need to be described.";
18+
public string Description => "RunAsAdminDescription".GetLocalizedResource();
1919
public RichGlyph Glyph => new("\uE7EF");
2020

2121
public RunAsAdminAction()

src/Files.App/Actions/Content/Run/RunAsAnotherUserAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ internal class RunAsAnotherUserAction : ObservableObject, IAction
1515
public bool IsExecutable => context.SelectedItem is not null &&
1616
FileExtensionHelpers.IsExecutableFile(context.SelectedItem.FileExtension);
1717
public string Label => "BaseLayoutContextFlyoutRunAsAnotherUser/Text".GetLocalizedResource();
18-
public string Description => "TODO: Need to be described.";
18+
public string Description => "RunAsAnotherUserDescription".GetLocalizedResource();
1919
public RichGlyph Glyph => new("\uE7EE");
2020

2121
public RunAsAnotherUserAction()

src/Files.App/Actions/Content/Run/RunWithPowershellAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ internal class RunWithPowershellAction : ObservableObject, IAction
1919

2020
public string Label => "RunWithPowerShell".GetLocalizedResource();
2121

22-
public string Description => "TODO: Need to be described.";
22+
public string Description => "RunWithPowershellDescription".GetLocalizedResource();
2323

2424
public RichGlyph Glyph => new("\uE756");
2525

src/Files.App/Actions/Content/Selection/ClearSelectionAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ internal class ClearSelectionAction : IAction
1212

1313
public string Label { get; } = "ClearSelection".GetLocalizedResource();
1414

15-
public string Description => "TODO: Need to be described.";
15+
public string Description => "ClearSelectionDescription".GetLocalizedResource();
1616

1717
public RichGlyph Glyph { get; } = new("\uE8E6");
1818

src/Files.App/Actions/Content/Selection/InvertSelectionAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ internal class InvertSelectionAction : IAction
1212

1313
public string Label { get; } = "InvertSelection".GetLocalizedResource();
1414

15-
public string Description => "TODO: Need to be described.";
15+
public string Description => "InvertSelectionDescription".GetLocalizedResource();
1616

1717
public RichGlyph Glyph { get; } = new("\uE746");
1818

src/Files.App/Actions/Content/Selection/SelectAllAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ internal class SelectAllAction : IAction
1212

1313
public string Label { get; } = "SelectAll".GetLocalizedResource();
1414

15-
public string Description => "TODO: Need to be described.";
15+
public string Description => "SelectAllDescription".GetLocalizedResource();
1616

1717
public RichGlyph Glyph { get; } = new("\uE8B3");
1818

src/Files.App/Actions/Content/Selection/ToggleSelectAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Files.App.Actions
99
internal class ToggleSelectAction : IAction
1010
{
1111
public string Label { get; } = "ToggleSelect".GetLocalizedResource();
12-
public string Description => "TODO: Need to be described.";
12+
public string Description => "ToggleSelectDescription".GetLocalizedResource();
1313

1414
public HotKey HotKey { get; } = new(Keys.Space, KeyModifiers.Ctrl);
1515

src/Files.App/Actions/Content/Share/ShareItemAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ internal class ShareItemAction : ObservableObject, IAction
1616

1717
public string Label => "Share".GetLocalizedResource();
1818

19-
public string Description => "TODO: Need to be described.";
19+
public string Description => "ShareItemDescription".GetLocalizedResource();
2020

2121
public RichGlyph Glyph { get; } = new RichGlyph(opacityStyle: "ColorIconShare");
2222

0 commit comments

Comments
 (0)