Skip to content

Commit 485dbac

Browse files
committed
Merge branch 'main' into nav
2 parents 854be20 + 6a335a9 commit 485dbac

File tree

106 files changed

+2826
-405
lines changed

Some content is hidden

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

106 files changed

+2826
-405
lines changed

Files.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,4 +626,4 @@ Global
626626
GlobalSection(ExtensibilityGlobals) = postSolution
627627
SolutionGuid = {0E62043C-A7A1-4982-9EC9-4CDB2939B776}
628628
EndGlobalSection
629-
EndGlobal
629+
EndGlobal

builds/azure-pipelines-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121
- task: UseDotNet@2
122122
inputs:
123123
packageType: sdk
124-
version: 8.0.x
124+
version: 8.0.303
125125
includePreviewVersions: false
126126

127127
- task: CmdLine@2

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="3.6.17.0" />
19+
Version="3.7.3.0" />
2020

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

src/Files.App.CsWin32/NativeMethods.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"public": true,
55
"comInterop": {
66
"preserveSigMethods": [
7-
"IEnumShellItems.Next"
7+
"*"
88
]
99
}
1010
}

src/Files.App/Actions/FileSystem/OpenItemAction.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@ public RichGlyph Glyph
2222
public HotKey HotKey
2323
=> new(Keys.Enter);
2424

25-
private const int MaxOpenCount = 10;
2625

2726
public bool IsExecutable =>
2827
context.HasSelection &&
29-
context.SelectedItems.Count <= MaxOpenCount &&
3028
!(context.ShellPage is ColumnShellPage &&
3129
context.SelectedItem?.PrimaryItemAttribute == StorageItemTypes.Folder);
3230

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Copyright (c) 2024 Files Community
2+
// Licensed under the MIT License. See the LICENSE.
3+
4+
namespace Files.App.Actions
5+
{
6+
internal sealed class NavigateHomeAction : ObservableObject, IAction
7+
{
8+
private readonly IContentPageContext context;
9+
10+
public string Label
11+
=> "Home".GetLocalizedResource();
12+
13+
public string Description
14+
=> "NavigateHomeDescription".GetLocalizedResource();
15+
16+
public RichGlyph Glyph
17+
=> new("\uE80F");
18+
19+
public bool IsExecutable
20+
=> context.PageType is not ContentPageTypes.Home;
21+
22+
public NavigateHomeAction()
23+
{
24+
context = Ioc.Default.GetRequiredService<IContentPageContext>();
25+
26+
context.PropertyChanged += Context_PropertyChanged;
27+
}
28+
29+
public Task ExecuteAsync(object? parameter = null)
30+
{
31+
context.ShellPage!.NavigateHome();
32+
33+
return Task.CompletedTask;
34+
}
35+
36+
private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e)
37+
{
38+
switch (e.PropertyName)
39+
{
40+
case nameof(IContentPageContext.PageType):
41+
OnPropertyChanged(nameof(IsExecutable));
42+
break;
43+
}
44+
}
45+
}
46+
}

src/Files.App/Data/Commands/ActionCommand.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ public Task ExecuteAsync(object? parameter = null)
145145
{
146146
if (IsExecutable)
147147
{
148-
SentrySdk.Metrics.Increment("actions", tags: new Dictionary<string, string> { { "command", Code.ToString() } });
148+
// Re-enable when Metris feature is available again
149+
// SentrySdk.Metrics.Increment("actions", tags: new Dictionary<string, string> { { "command", Code.ToString() } });
149150
return Action.ExecuteAsync(parameter);
150151
}
151152

src/Files.App/Data/Commands/Manager/CommandCodes.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ public enum CommandCodes
179179
NavigateBack,
180180
NavigateForward,
181181
NavigateUp,
182+
NavigateHome,
182183

183184
// Other
184185
DuplicateCurrentTab,

src/Files.App/Data/Commands/Manager/CommandManager.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ public IRichCommand this[HotKey hotKey]
175175
public IRichCommand NavigateBack => commands[CommandCodes.NavigateBack];
176176
public IRichCommand NavigateForward => commands[CommandCodes.NavigateForward];
177177
public IRichCommand NavigateUp => commands[CommandCodes.NavigateUp];
178+
public IRichCommand NavigateHome => commands[CommandCodes.NavigateHome];
178179
public IRichCommand DuplicateCurrentTab => commands[CommandCodes.DuplicateCurrentTab];
179180
public IRichCommand DuplicateSelectedTab => commands[CommandCodes.DuplicateSelectedTab];
180181
public IRichCommand CloseTabsToTheLeftCurrent => commands[CommandCodes.CloseTabsToTheLeftCurrent];
@@ -366,6 +367,7 @@ public IEnumerator<IRichCommand> GetEnumerator() =>
366367
[CommandCodes.NavigateBack] = new NavigateBackAction(),
367368
[CommandCodes.NavigateForward] = new NavigateForwardAction(),
368369
[CommandCodes.NavigateUp] = new NavigateUpAction(),
370+
[CommandCodes.NavigateHome] = new NavigateHomeAction(),
369371
[CommandCodes.DuplicateCurrentTab] = new DuplicateCurrentTabAction(),
370372
[CommandCodes.DuplicateSelectedTab] = new DuplicateSelectedTabAction(),
371373
[CommandCodes.CloseTabsToTheLeftCurrent] = new CloseTabsToTheLeftCurrentAction(),

src/Files.App/Data/Commands/Manager/ICommandManager.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ public interface ICommandManager : IEnumerable<IRichCommand>
164164
IRichCommand NavigateBack { get; }
165165
IRichCommand NavigateForward { get; }
166166
IRichCommand NavigateUp { get; }
167+
IRichCommand NavigateHome { get; }
167168

168169
IRichCommand DuplicateCurrentTab { get; }
169170
IRichCommand DuplicateSelectedTab { get; }

0 commit comments

Comments
 (0)