Skip to content

Commit d08a384

Browse files
committed
Merge branch 'main' of https://github.com/files-community/Files into terminal
2 parents d2f437d + 49a1664 commit d08a384

File tree

202 files changed

+23408
-7377
lines changed

Some content is hidden

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

202 files changed

+23408
-7377
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,13 @@ I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING:
77
-->
88

99
**Resolved / Related Issues**
10-
- [ ] Were these changes approved in an issue or discussion with the project maintainers? In order to prevent extra work, feature requests and changes to the codebase must be approved before the pull request will be reviewed. This prevents extra work for the contributors and maintainers.
11-
Closes #issue...
1210

13-
**Validation**
14-
How did you test these changes?
15-
- [ ] Did you build the app and test your changes?
16-
- [ ] Did you check for accessibility? You can use Accessibility Insights for this.
17-
- [ ] Did you remove any strings from the en-us resource file?
18-
- [ ] Did you search the solution to see if the string is still being used?
19-
- [ ] Did you implement any design changes to an existing feature?
20-
- [ ] Was this change approved?
21-
- [ ] Are there any other steps that were used to validate these changes?
22-
1. Open app ...
23-
2. Click settings button ...
11+
To prevent extra work, all changes to the Files codebase must link to an approved issue marked as `Ready to build`. Please insert the issue number following the hashtag with the issue number that this Pull Request resolves.
12+
- Closes #
2413

25-
**Screenshots (optional)**
26-
Add screenshots here.
14+
**Steps used to test these changes**
15+
16+
Stability is a top priority for Files and all changes are required to go through testing before being merged into the repo. Please include a list of steps that you used to test this PR.
17+
18+
1. Opened Files ...
19+
2. ...

crowdin.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
11
commit_message: 'fix: new translations in %original_file_name% (%original_file_name%) from Crowdin'
2-
append_commit_message: false
2+
append_commit_message:
33
files:
44
- source: /src/Files.App/Strings/en-US/*.resw
55
translation: /src/Files.App/Strings/%locale%/%original_file_name%
6-
languages_mapping:
7-
locale:
8-
af: af
9-
ar: ar
10-
bg: bg
11-
ca: ca
12-
da: da
13-
el: el
14-
ka: ka
15-
no: nb-NO
16-
zh-CN: zh-Hans
17-
zh-TW: zh-Hant
18-
vi: vi
19-
ta: ta
20-
lt-LT: lt

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<DisableXbfLineInfo>False</DisableXbfLineInfo>
1515
<GenerateTestArtifacts>True</GenerateTestArtifacts>
1616
<AppxBundleAutoResourcePackageQualifiers>Scale|DXFeatureLevel</AppxBundleAutoResourcePackageQualifiers>
17-
<AppxDefaultResourceQualifiers>Language=en-US;af;ar;bg;ca;cs-CZ;da;da-DK;de-DE;el;en-GB;es-ES;es-419;fa-IR;fi-FI;fil-PH;fr-FR;he-IL;hi-IN;hu-HU;id-ID;it-IT;ja-JP;ka;ko-KR;lt;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>
17+
<AppxDefaultResourceQualifiers>Language=en-US;af;ar;bg;ca;cs-CZ;da;de-DE;el;en-GB;es-ES;es-419;fa-IR;fi-FI;fil-PH;fr-FR;he-IL;hi-IN;hr-HR;hu-HU;id-ID;it-IT;ja-JP;ka;km-KH;ko-KR;ku-Arab;lt-LT;lv-LV;nb-NO;nl-NL;or-IN;pl-PL;pt-BR;pt-PT;ro-RO;ru-RU;sk-SK;sq-AL;sr-Cyrl;sv-SE;ta;th-TH;tr-TR;uk-UA;vi;zh-Hans;zh-Hant</AppxDefaultResourceQualifiers>
1818
<UapAppxPackageBuildMode>StoreUpload</UapAppxPackageBuildMode>
1919
<HoursBetweenUpdateChecks>255</HoursBetweenUpdateChecks>
2020
<EntryPointProjectUniqueName>..\Files.App\Files.App.csproj</EntryPointProjectUniqueName>
@@ -107,7 +107,7 @@
107107
</ProjectReference>
108108
</ItemGroup>
109109
<ItemGroup>
110-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240404000" IncludeAssets="build" />
110+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240428000" IncludeAssets="build" />
111111
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.3233" IncludeAssets="build" />
112112
</ItemGroup>
113113
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<Identity
1717
Name="FilesDev"
1818
Publisher="CN=Files"
19-
Version="3.3.6.0" />
19+
Version="3.4.0.0" />
2020

2121
<Properties>
2222
<DisplayName>Files - Dev</DisplayName>
@@ -37,7 +37,6 @@
3737
<Resource Language="ca" />
3838
<Resource Language="cs-CZ" />
3939
<Resource Language="da" />
40-
<Resource Language="da-DK" />
4140
<Resource Language="de-DE" />
4241
<Resource Language="el" />
4342
<Resource Language="en-GB" />
@@ -55,8 +54,10 @@
5554
<Resource Language="it-IT" />
5655
<Resource Language="ja-JP" />
5756
<Resource Language="ka" />
57+
<Resource Language="km-KH" />
5858
<Resource Language="ko-KR" />
59-
<Resource Language="lt" />
59+
<Resource Language="ku-Arab" />
60+
<Resource Language="lt-LT" />
6061
<Resource Language="lv-LV" />
6162
<Resource Language="nb-NO" />
6263
<Resource Language="nl-NL" />
@@ -66,7 +67,9 @@
6667
<Resource Language="pt-PT" />
6768
<Resource Language="ro-RO" />
6869
<Resource Language="ru-RU" />
69-
<Resource Language="sk-SK" />
70+
<Resource Language="sk-SK" />
71+
<Resource Language="sq-AL" />
72+
<Resource Language="sr-Cyrl" />
7073
<Resource Language="sv-SE" />
7174
<Resource Language="ta" />
7275
<Resource Language="th-TH" />

src/Files.App.Server/AppInstanceMonitor.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
// Copyright (c) 2024 Files Community
22
// Licensed under the MIT License. See the LICENSE.
33

4+
using System.Collections.Concurrent;
45
using System.Diagnostics;
56

67
namespace Files.App.Server;
78

89
public sealed class AppInstanceMonitor
910
{
1011
private static int processCount = 0;
12+
internal static ConcurrentDictionary<int, ConcurrentBag<IDisposable>> AppInstanceResources = new();
1113

1214
public static void StartMonitor(int processId)
1315
{
@@ -19,10 +21,18 @@ public static void StartMonitor(int processId)
1921

2022
private static void Process_Exited(object? sender, EventArgs e)
2123
{
22-
if (sender is Process process)
24+
if (sender is Process { Id: var processId } process)
2325
{
2426
process.Dispose();
2527

28+
if (AppInstanceResources.TryRemove(processId, out var instances))
29+
{
30+
foreach (var instance in instances)
31+
{
32+
instance.Dispose();
33+
}
34+
}
35+
2636
if (Interlocked.Decrement(ref processCount) == 0)
2737
{
2838
Program.ExitSignalEvent.Set();

src/Files.App.Server/Database/FileTagsDatabase.cs

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using LiteDB;
77
using Microsoft.Win32;
88
using System.Runtime.CompilerServices;
9+
using System.Runtime.InteropServices;
910
using System.Runtime.InteropServices.WindowsRuntime;
1011
using System.Text;
1112
using Windows.ApplicationModel;
@@ -17,13 +18,16 @@
1718

1819
namespace Files.App.Server.Database
1920
{
20-
public sealed class FileTagsDatabase
21+
public sealed class FileTagsDatabase : IDisposable
2122
{
2223
private readonly static string FileTagsKey = @$"Software\Files Community\{Package.Current.Id.FullName}\v1\FileTags";
2324

2425
private readonly static string FileTagsDbPath = Path.Combine(ApplicationData.Current.LocalFolder.Path, "filetags.db");
2526
private const string FileTagsCollectionName = "taggedfiles";
2627

28+
private readonly GCHandle _handle;
29+
private bool _disposed = false;
30+
2731
static FileTagsDatabase()
2832
{
2933
if (File.Exists(FileTagsDbPath))
@@ -44,6 +48,25 @@ static FileTagsDatabase()
4448
}
4549
}
4650

51+
public FileTagsDatabase()
52+
{
53+
throw new NotSupportedException($"Instantiating {nameof(FileTagsDatabase)} by non-parameterized constructor is not supported.");
54+
}
55+
56+
public FileTagsDatabase(int processId)
57+
{
58+
_handle = GCHandle.Alloc(this, GCHandleType.Pinned);
59+
60+
if (AppInstanceMonitor.AppInstanceResources.TryGetValue(processId, out var instances))
61+
{
62+
instances.Add(this);
63+
}
64+
else
65+
{
66+
AppInstanceMonitor.AppInstanceResources[processId] = [this];
67+
}
68+
}
69+
4770
private static void UpdateDb(LiteDatabase database)
4871
{
4972
if (database.UserVersion == 0)
@@ -279,5 +302,14 @@ private void IterateKeys(List<TaggedFile> list, string path, int depth)
279302
IterateKeys(list, CombineKeys(path, subKey), depth + 1);
280303
}
281304
}
305+
306+
public void Dispose()
307+
{
308+
if (!_disposed)
309+
{
310+
_disposed = true;
311+
_handle.Free();
312+
}
313+
}
282314
}
283315
}

src/Files.App.Server/Database/LayoutPreferencesDatabase.cs

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using LiteDB;
66
using Microsoft.Win32;
77
using System.Runtime.CompilerServices;
8+
using System.Runtime.InteropServices;
89
using Windows.ApplicationModel;
910
using Windows.Storage;
1011
using static Files.App.Server.Data.LayoutPreferencesRegistry;
@@ -13,13 +14,16 @@
1314

1415
namespace Files.App.Server.Database
1516
{
16-
public sealed class LayoutPreferencesDatabase
17+
public sealed class LayoutPreferencesDatabase : IDisposable
1718
{
1819
private readonly static string LayoutSettingsKey = @$"Software\Files Community\{Package.Current.Id.FullName}\v1\LayoutPreferences";
1920

2021
private readonly static string LayoutSettingsDbPath = Path.Combine(ApplicationData.Current.LocalFolder.Path, "user_settings.db");
2122
private const string LayoutSettingsCollectionName = "layoutprefs";
2223

24+
private readonly GCHandle _handle;
25+
private bool _disposed = false;
26+
2327
static LayoutPreferencesDatabase()
2428
{
2529
if (File.Exists(LayoutSettingsDbPath))
@@ -37,6 +41,25 @@ static LayoutPreferencesDatabase()
3741
}
3842
}
3943

44+
public LayoutPreferencesDatabase()
45+
{
46+
throw new NotSupportedException($"Instantiating {nameof(LayoutPreferencesDatabase)} by non-parameterized constructor is not supported.");
47+
}
48+
49+
public LayoutPreferencesDatabase(int processId)
50+
{
51+
_handle = GCHandle.Alloc(this, GCHandleType.Pinned);
52+
53+
if (AppInstanceMonitor.AppInstanceResources.TryGetValue(processId, out var instances))
54+
{
55+
instances.Add(this);
56+
}
57+
else
58+
{
59+
AppInstanceMonitor.AppInstanceResources[processId] = [this];
60+
}
61+
}
62+
4063
public LayoutPreferencesItem? GetPreferences(string filePath, ulong? frn)
4164
{
4265
return FindPreferences(filePath, frn)?.LayoutPreferencesManager;
@@ -197,5 +220,14 @@ private void IterateKeys(List<LayoutPreferences> list, string path, int depth)
197220

198221
return null;
199222
}
223+
224+
public void Dispose()
225+
{
226+
if (!_disposed)
227+
{
228+
_disposed = true;
229+
_handle.Free();
230+
}
231+
}
200232
}
201233
}

src/Files.App.Server/Files.App.Server.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<OutputType>WinExe</OutputType>
55
<DefaultLanguage>en-US</DefaultLanguage>
66
<AppxBundleAutoResourcePackageQualifiers>Scale|DXFeatureLevel</AppxBundleAutoResourcePackageQualifiers>
7-
<AppxDefaultResourceQualifiers>Language=en-US;af;ar;bg;ca;cs-CZ;da;da-DK;de-DE;el;en-GB;es-ES;es-419;fa-IR;fi-FI;fil-PH;fr-FR;he-IL;hi-IN;hu-HU;id-ID;it-IT;ja-JP;ka;ko-KR;lt;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>
7+
<AppxDefaultResourceQualifiers>Language=en-US;af;ar;bg;ca;cs-CZ;da;de-DE;el;en-GB;es-ES;es-419;fa-IR;fi-FI;fil-PH;fr-FR;he-IL;hi-IN;hr-HR;hu-HU;id-ID;it-IT;ja-JP;ka;km-KH;ko-KR;ku-Arab;lt-LT;lv-LV;nb-NO;nl-NL;or-IN;pl-PL;pt-BR;pt-PT;ro-RO;ru-RU;sk-SK;sq-AL;sr-Cyrl;sv-SE;ta;th-TH;tr-TR;uk-UA;vi;zh-Hans;zh-Hant</AppxDefaultResourceQualifiers>
88
<TargetFramework>net8.0-windows10.0.22621.0</TargetFramework>
99
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
1010
<ImplicitUsings>enable</ImplicitUsings>

src/Files.App/Actions/Content/Archives/Compress/BaseCompressArchiveAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public BaseCompressArchiveAction()
2323
context.PropertyChanged += Context_PropertyChanged;
2424
}
2525

26-
public abstract Task ExecuteAsync();
26+
public abstract Task ExecuteAsync(object? parameter = null);
2727

2828
private bool IsContextPageTypeAdaptedToCommand()
2929
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public CompressIntoArchiveAction()
1919
{
2020
}
2121

22-
public override async Task ExecuteAsync()
22+
public override async Task ExecuteAsync(object? parameter = null)
2323
{
2424
if (context.ShellPage is null)
2525
return;

0 commit comments

Comments
 (0)