From 250ad3e73575f398c7e73dca7f87158f94d3fe52 Mon Sep 17 00:00:00 2001 From: Devin Slothower <93222657+Devin-Slothower@users.noreply.github.com> Date: Sun, 11 Aug 2024 18:11:58 -0400 Subject: [PATCH 01/25] Feature: Add support for flattening folders --- .../FileSystem/FlattenRecursiveAction.cs | 107 ++++++++++++++++++ .../Actions/FileSystem/FlattenSingleAction.cs | 102 +++++++++++++++++ .../Data/Commands/Manager/CommandCodes.cs | 4 + .../Data/Commands/Manager/CommandManager.cs | 4 + .../Data/Commands/Manager/ICommandManager.cs | 3 + .../Data/Contracts/IGeneralSettingsService.cs | 5 + .../ContentPageContextFlyoutFactory.cs | 16 +++ .../Properties/Resources.Designer.cs | 63 +++++++++++ src/Files.App/Properties/Resources.resx | 101 +++++++++++++++++ .../Settings/GeneralSettingsService.cs | 6 + src/Files.App/Strings/en-US/Resources.resw | 12 ++ 11 files changed, 423 insertions(+) create mode 100644 src/Files.App/Actions/FileSystem/FlattenRecursiveAction.cs create mode 100644 src/Files.App/Actions/FileSystem/FlattenSingleAction.cs create mode 100644 src/Files.App/Properties/Resources.Designer.cs create mode 100644 src/Files.App/Properties/Resources.resx diff --git a/src/Files.App/Actions/FileSystem/FlattenRecursiveAction.cs b/src/Files.App/Actions/FileSystem/FlattenRecursiveAction.cs new file mode 100644 index 000000000000..ff925784291c --- /dev/null +++ b/src/Files.App/Actions/FileSystem/FlattenRecursiveAction.cs @@ -0,0 +1,107 @@ +using System.IO; +using Windows.Storage; +using Microsoft.Extensions.Logging; + +namespace Files.App.Actions +{ + internal sealed class FlattenRecursiveAction : ObservableObject, IAction + { + private readonly IContentPageContext context; + + public string Label + => "FlattenRecursive".GetLocalizedResource(); + + public string Description + => "FlattenDescription".GetLocalizedResource(); + + public bool IsExecutable => + context.ShellPage is not null && + context.HasSelection && + context.SelectedItem?.PrimaryItemAttribute is StorageItemTypes.Folder; + + public FlattenRecursiveAction() + { + context = Ioc.Default.GetRequiredService(); + + context.PropertyChanged += Context_PropertyChanged; + } + + public async Task ExecuteAsync(object? parameter = null) + { + if (context.ShellPage?.ShellViewModel is null) + return; + + var items = context.SelectedItems; + + if (items is null || !items.Any() || items.Any(item => !item.IsFolder)) + return; + + foreach (var item in items) + { + await FlattenFolderAsync(item.ItemPath); + } + } + + private async Task FlattenFolderAsync(string folderPath) + { + var containedFolders = await Task.Run(() => Directory.GetDirectories(folderPath)); + var containedFiles = await Task.Run(() => Directory.GetFiles(folderPath)); + + foreach (var containedFolder in containedFolders) + { + await FlattenFolderAsync(containedFolder); + + var folderName = Path.GetFileName(containedFolder); + var destinationPath = Path.Combine(context.ShellPage?.ShellViewModel?.CurrentFolder?.ItemPath ?? string.Empty, folderName); + + if (Directory.Exists(destinationPath)) + continue; + + try + { + Directory.Move(containedFolder, destinationPath); + } + catch (Exception ex) + { + App.Logger.LogWarning(ex.Message, $"Folder '{folderName}' already exists in the destination folder."); + } + } + + foreach (var containedFile in containedFiles) + { + var fileName = Path.GetFileName(containedFile); + var destinationPath = Path.Combine(context.ShellPage?.ShellViewModel?.CurrentFolder?.ItemPath ?? string.Empty, fileName); + + if (File.Exists(destinationPath)) + continue; + + try + { + File.Move(containedFile, destinationPath); + } + catch (Exception ex) + { + App.Logger.LogWarning(ex.Message, $"Failed to move file '{fileName}'."); + } + } + + if (Directory.GetFiles(folderPath).Length == 0 && Directory.GetDirectories(folderPath).Length == 0) + { + try + { + Directory.Delete(folderPath); + } + catch (Exception ex) + { + App.Logger.LogWarning(ex.Message, $"Failed to delete folder '{folderPath}'."); + } + } + } + + private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e) + { + if (e.PropertyName is nameof(IContentPageContext.HasSelection)) + OnPropertyChanged(nameof(IsExecutable)); + } + } +} diff --git a/src/Files.App/Actions/FileSystem/FlattenSingleAction.cs b/src/Files.App/Actions/FileSystem/FlattenSingleAction.cs new file mode 100644 index 000000000000..7cdf72645504 --- /dev/null +++ b/src/Files.App/Actions/FileSystem/FlattenSingleAction.cs @@ -0,0 +1,102 @@ +using System.IO; +using Windows.Storage; +using Microsoft.Extensions.Logging; + +namespace Files.App.Actions +{ + internal sealed class FlattenSingleAction : ObservableObject, IAction + { + private readonly IContentPageContext context; + + public string Label + => "FlattenSingle".GetLocalizedResource(); + + public string Description + => "FlattenDescription".GetLocalizedResource(); + + public bool IsExecutable => + context.ShellPage is not null && + context.HasSelection && + context.SelectedItem?.PrimaryItemAttribute is StorageItemTypes.Folder; + + public FlattenSingleAction() + { + context = Ioc.Default.GetRequiredService(); + + context.PropertyChanged += Context_PropertyChanged; + } + + public async Task ExecuteAsync(object? parameter = null) + { + if (context.ShellPage?.ShellViewModel is null) + return; + + var items = context.SelectedItems; + + if (items is null || !items.Any() || items.Any(item => !item.IsFolder)) + return; + + foreach (var item in items) + { + var folderPath = item.ItemPath; + + var containedFolders = await Task.Run(() => Directory.GetDirectories(folderPath)); + var containedFiles = await Task.Run(() => Directory.GetFiles(folderPath)); + + foreach (var containedFolder in containedFolders) + { + var folderName = Path.GetFileName(containedFolder); + var destinationPath = Path.Combine(context.ShellPage?.ShellViewModel?.CurrentFolder?.ItemPath ?? string.Empty, folderName); + + if (Directory.Exists(destinationPath)) + continue; + + try + { + Directory.Move(containedFolder, destinationPath); + } + catch (Exception ex) + { + App.Logger.LogWarning(ex.Message, $"Folder '{folderName}' already exists in the destination folder."); + } + } + + foreach (var containedFile in containedFiles) + { + var fileName = Path.GetFileName(containedFile); + var destinationPath = Path.Combine(context.ShellPage?.ShellViewModel?.CurrentFolder?.ItemPath ?? string.Empty, fileName); + + if (File.Exists(destinationPath)) + continue; + + try + { + File.Move(containedFile, destinationPath); + } + catch (Exception ex) + { + App.Logger.LogWarning(ex.Message, $"Failed to move file '{fileName}'."); + } + } + + if (Directory.GetFiles(folderPath).Length == 0 && Directory.GetDirectories(folderPath).Length == 0) + { + try + { + Directory.Delete(folderPath); + } + catch (Exception ex) + { + App.Logger.LogWarning(ex.Message, $"Failed to delete folder '{folderPath}'."); + } + } + } + } + + private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e) + { + if (e.PropertyName is nameof(IContentPageContext.HasSelection)) + OnPropertyChanged(nameof(IsExecutable)); + } + } +} diff --git a/src/Files.App/Data/Commands/Manager/CommandCodes.cs b/src/Files.App/Data/Commands/Manager/CommandCodes.cs index 4fcb658347f3..8d41798b0feb 100644 --- a/src/Files.App/Data/Commands/Manager/CommandCodes.cs +++ b/src/Files.App/Data/Commands/Manager/CommandCodes.cs @@ -97,6 +97,10 @@ public enum CommandCodes DecompressArchiveHereSmart, DecompressArchiveToChildFolder, + // Folder + FlattenSingle, + FlattenRecursive, + // Image Manipulation RotateLeft, RotateRight, diff --git a/src/Files.App/Data/Commands/Manager/CommandManager.cs b/src/Files.App/Data/Commands/Manager/CommandManager.cs index 0c79b2359316..a2a25c97522d 100644 --- a/src/Files.App/Data/Commands/Manager/CommandManager.cs +++ b/src/Files.App/Data/Commands/Manager/CommandManager.cs @@ -102,6 +102,8 @@ public IRichCommand this[HotKey hotKey] public IRichCommand DecompressArchiveHere => commands[CommandCodes.DecompressArchiveHere]; public IRichCommand DecompressArchiveHereSmart => commands[CommandCodes.DecompressArchiveHereSmart]; public IRichCommand DecompressArchiveToChildFolder => commands[CommandCodes.DecompressArchiveToChildFolder]; + public IRichCommand FlattenSingle => commands[CommandCodes.FlattenSingle]; + public IRichCommand FlattenRecursive => commands[CommandCodes.FlattenRecursive]; public IRichCommand RotateLeft => commands[CommandCodes.RotateLeft]; public IRichCommand RotateRight => commands[CommandCodes.RotateRight]; public IRichCommand OpenItem => commands[CommandCodes.OpenItem]; @@ -289,6 +291,8 @@ public IEnumerator GetEnumerator() => [CommandCodes.DecompressArchiveHere] = new DecompressArchiveHere(), [CommandCodes.DecompressArchiveHereSmart] = new DecompressArchiveHereSmart(), [CommandCodes.DecompressArchiveToChildFolder] = new DecompressArchiveToChildFolderAction(), + [CommandCodes.FlattenSingle] = new FlattenSingleAction(), + [CommandCodes.FlattenRecursive] = new FlattenRecursiveAction(), [CommandCodes.RotateLeft] = new RotateLeftAction(), [CommandCodes.RotateRight] = new RotateRightAction(), [CommandCodes.OpenItem] = new OpenItemAction(), diff --git a/src/Files.App/Data/Commands/Manager/ICommandManager.cs b/src/Files.App/Data/Commands/Manager/ICommandManager.cs index 28dd60747175..a7bc383dbc54 100644 --- a/src/Files.App/Data/Commands/Manager/ICommandManager.cs +++ b/src/Files.App/Data/Commands/Manager/ICommandManager.cs @@ -89,6 +89,9 @@ public interface ICommandManager : IEnumerable IRichCommand DecompressArchiveHereSmart { get; } IRichCommand DecompressArchiveToChildFolder { get; } + IRichCommand FlattenSingle { get; } + IRichCommand FlattenRecursive { get; } + IRichCommand RotateLeft { get; } IRichCommand RotateRight { get; } diff --git a/src/Files.App/Data/Contracts/IGeneralSettingsService.cs b/src/Files.App/Data/Contracts/IGeneralSettingsService.cs index 7235767ac91e..ca8e6ebdf3e3 100644 --- a/src/Files.App/Data/Contracts/IGeneralSettingsService.cs +++ b/src/Files.App/Data/Contracts/IGeneralSettingsService.cs @@ -225,6 +225,11 @@ public interface IGeneralSettingsService : IBaseSettingsService, INotifyProperty /// bool ShowCompressionOptions { get; set; } + /// + /// Gets or sets a value indicating whether or not to show the flatten options e.g. single, recursive. + /// + bool ShowFlattenOptions { get; set; } + /// /// Gets or sets a value indicating whether or not to show the Send To menu. /// diff --git a/src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs b/src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs index ee692342572a..c1f8e8cfbf1a 100644 --- a/src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs +++ b/src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs @@ -539,6 +539,22 @@ public static List GetBaseItemMenuItems( ShowItem = UserSettingsService.GeneralSettingsService.ShowCompressionOptions && StorageArchiveService.CanDecompress(selectedItems) }, new ContextMenuFlyoutItemViewModel() + { + Text = "Flatten".GetLocalizedResource(), + ShowInSearchPage = true, + ThemedIconModel = new ThemedIconModel() + { + ThemedIconStyle = "App.ThemedIcons.Folder", + }, + Items = + [ + new ContextMenuFlyoutItemViewModelBuilder(Commands.FlattenSingle).Build(), + new ContextMenuFlyoutItemViewModelBuilder(Commands.FlattenRecursive).Build(), + ], + IsHidden = selectedItems.Count != 1 || !selectedItems.Any(item => item?.PrimaryItemAttribute is StorageItemTypes.Folder) || !itemsSelected, + ShowItem = UserSettingsService.GeneralSettingsService.ShowFlattenOptions + }, + new ContextMenuFlyoutItemViewModel() { Text = "SendTo".GetLocalizedResource(), Tag = "SendTo", diff --git a/src/Files.App/Properties/Resources.Designer.cs b/src/Files.App/Properties/Resources.Designer.cs new file mode 100644 index 000000000000..17906955ad29 --- /dev/null +++ b/src/Files.App/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Files.App.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Files.App.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/src/Files.App/Properties/Resources.resx b/src/Files.App/Properties/Resources.resx new file mode 100644 index 000000000000..4fdb1b6aff69 --- /dev/null +++ b/src/Files.App/Properties/Resources.resx @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/src/Files.App/Services/Settings/GeneralSettingsService.cs b/src/Files.App/Services/Settings/GeneralSettingsService.cs index c8b4ee439561..0fd40db81125 100644 --- a/src/Files.App/Services/Settings/GeneralSettingsService.cs +++ b/src/Files.App/Services/Settings/GeneralSettingsService.cs @@ -297,6 +297,12 @@ public bool ShowSystemTrayIcon set => Set(value); } + public bool ShowFlattenOptions + { + get => Get(true); + set => Set(value); + } + public FileNameConflictResolveOptionType ConflictsResolveOption { get => (FileNameConflictResolveOptionType)Get((long)FileNameConflictResolveOptionType.GenerateNewName); diff --git a/src/Files.App/Strings/en-US/Resources.resw b/src/Files.App/Strings/en-US/Resources.resw index 13010a49b2fc..19bb94b44832 100644 --- a/src/Files.App/Strings/en-US/Resources.resw +++ b/src/Files.App/Strings/en-US/Resources.resw @@ -2027,6 +2027,18 @@ Compress + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Select files and folders when hovering over them From 1676208779721ecec1a3e6972119f94107fb2e79 Mon Sep 17 00:00:00 2001 From: Devin Slothower <93222657+Devin-Slothower@users.noreply.github.com> Date: Sun, 11 Aug 2024 18:18:55 -0400 Subject: [PATCH 02/25] Add resources to be translated --- src/Files.App/Strings/af/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/ar/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/be-BY/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/bg/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/ca/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/cs-CZ/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/da/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/de-DE/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/el/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/en-GB/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/es-419/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/es-ES/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/fa-IR/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/fi-FI/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/fil-PH/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/fr-FR/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/he-IL/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/hi-IN/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/hr-HR/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/hu-HU/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/id-ID/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/it-IT/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/ja-JP/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/ka/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/km-KH/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/ko-KR/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/ku-Arab/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/lt-LT/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/lv-LV/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/ms-MY/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/nb-NO/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/nl-NL/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/or-IN/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/pl-PL/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/pt-BR/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/pt-PT/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/ro-RO/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/ru-RU/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/sk-SK/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/sq-AL/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/sr-Cyrl/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/sv-SE/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/ta/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/th-TH/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/tr-TR/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/uk-UA/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/vi/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/zh-Hans/Resources.resw | 12 ++++++++++++ src/Files.App/Strings/zh-Hant/Resources.resw | 12 ++++++++++++ 49 files changed, 588 insertions(+) diff --git a/src/Files.App/Strings/af/Resources.resw b/src/Files.App/Strings/af/Resources.resw index 6d5b76b58df1..8d901f3e8c76 100644 --- a/src/Files.App/Strings/af/Resources.resw +++ b/src/Files.App/Strings/af/Resources.resw @@ -2028,6 +2028,18 @@ Compress + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Select files and folders when hovering over them diff --git a/src/Files.App/Strings/ar/Resources.resw b/src/Files.App/Strings/ar/Resources.resw index 3459e95c6884..c700834cf085 100644 --- a/src/Files.App/Strings/ar/Resources.resw +++ b/src/Files.App/Strings/ar/Resources.resw @@ -2028,6 +2028,18 @@ ضغط + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + حدد الملفات والمجلدات عند التنقل فوقها diff --git a/src/Files.App/Strings/be-BY/Resources.resw b/src/Files.App/Strings/be-BY/Resources.resw index 2a1341c56602..3a6085e66d71 100644 --- a/src/Files.App/Strings/be-BY/Resources.resw +++ b/src/Files.App/Strings/be-BY/Resources.resw @@ -2027,6 +2027,18 @@ Compress + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Select files and folders when hovering over them diff --git a/src/Files.App/Strings/bg/Resources.resw b/src/Files.App/Strings/bg/Resources.resw index 926449397669..bd02903f4f39 100644 --- a/src/Files.App/Strings/bg/Resources.resw +++ b/src/Files.App/Strings/bg/Resources.resw @@ -2027,6 +2027,18 @@ Компресиране + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Избор на файлове и папки при показалец на мишката над тях diff --git a/src/Files.App/Strings/ca/Resources.resw b/src/Files.App/Strings/ca/Resources.resw index 3f423f76843b..54a77b3416b9 100644 --- a/src/Files.App/Strings/ca/Resources.resw +++ b/src/Files.App/Strings/ca/Resources.resw @@ -2027,6 +2027,18 @@ Comprimeix + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Selecciona fitxers i carpetes quan passeu el cursor per sobre d'ells diff --git a/src/Files.App/Strings/cs-CZ/Resources.resw b/src/Files.App/Strings/cs-CZ/Resources.resw index 6e0f48776f32..a3f5c4b7be89 100644 --- a/src/Files.App/Strings/cs-CZ/Resources.resw +++ b/src/Files.App/Strings/cs-CZ/Resources.resw @@ -2027,6 +2027,18 @@ Komprimovat + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Vyberte soubory a složky při najetí na ně diff --git a/src/Files.App/Strings/da/Resources.resw b/src/Files.App/Strings/da/Resources.resw index d768b803b803..4e8db8ba097f 100644 --- a/src/Files.App/Strings/da/Resources.resw +++ b/src/Files.App/Strings/da/Resources.resw @@ -2027,6 +2027,18 @@ Komprimering + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Vælg filer og mapper, når der svæves over dem diff --git a/src/Files.App/Strings/de-DE/Resources.resw b/src/Files.App/Strings/de-DE/Resources.resw index 13f07681469b..531b2db4d860 100644 --- a/src/Files.App/Strings/de-DE/Resources.resw +++ b/src/Files.App/Strings/de-DE/Resources.resw @@ -2027,6 +2027,18 @@ Komprimieren + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Dateien und Ordner beim Überfahren auswählen diff --git a/src/Files.App/Strings/el/Resources.resw b/src/Files.App/Strings/el/Resources.resw index 18e61f33710a..99860cc8523b 100644 --- a/src/Files.App/Strings/el/Resources.resw +++ b/src/Files.App/Strings/el/Resources.resw @@ -2027,6 +2027,18 @@ Συμπίεση + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Να επιλέγονται τα αρχεία όταν το ποντίκι είναι πάνω τους diff --git a/src/Files.App/Strings/en-GB/Resources.resw b/src/Files.App/Strings/en-GB/Resources.resw index 058d2c8f5826..5a9976face69 100644 --- a/src/Files.App/Strings/en-GB/Resources.resw +++ b/src/Files.App/Strings/en-GB/Resources.resw @@ -2027,6 +2027,18 @@ Compress + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Select files and folders when hovering over them diff --git a/src/Files.App/Strings/es-419/Resources.resw b/src/Files.App/Strings/es-419/Resources.resw index bbe8fd2934e2..1d4de368a0c5 100644 --- a/src/Files.App/Strings/es-419/Resources.resw +++ b/src/Files.App/Strings/es-419/Resources.resw @@ -2027,6 +2027,18 @@ Comprimir + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Seleccionar archivos y carpetas al pasar el cursor sobre ellos diff --git a/src/Files.App/Strings/es-ES/Resources.resw b/src/Files.App/Strings/es-ES/Resources.resw index 532234300ab5..63cfeb39225b 100644 --- a/src/Files.App/Strings/es-ES/Resources.resw +++ b/src/Files.App/Strings/es-ES/Resources.resw @@ -2027,6 +2027,18 @@ Comprimir + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Seleccionar archivos y carpetas al colocar el cursor encima de ellos diff --git a/src/Files.App/Strings/fa-IR/Resources.resw b/src/Files.App/Strings/fa-IR/Resources.resw index 36be96afa20b..37ff8710cc4f 100644 --- a/src/Files.App/Strings/fa-IR/Resources.resw +++ b/src/Files.App/Strings/fa-IR/Resources.resw @@ -2027,6 +2027,18 @@ فشرده‌سازی + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + فایل‌ها و پوشه‌ها را هنگام قرار دادن ماوس روی آنها انتخاب کن diff --git a/src/Files.App/Strings/fi-FI/Resources.resw b/src/Files.App/Strings/fi-FI/Resources.resw index 316d71d2ed20..c28d23877866 100644 --- a/src/Files.App/Strings/fi-FI/Resources.resw +++ b/src/Files.App/Strings/fi-FI/Resources.resw @@ -2027,6 +2027,18 @@ Pakkaa + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Valitse tiedostot ja kansiot viemällä hiiren osoitin niiden päälle diff --git a/src/Files.App/Strings/fil-PH/Resources.resw b/src/Files.App/Strings/fil-PH/Resources.resw index e66589b36929..e2cad307e810 100644 --- a/src/Files.App/Strings/fil-PH/Resources.resw +++ b/src/Files.App/Strings/fil-PH/Resources.resw @@ -2027,6 +2027,18 @@ I-compress + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Piliin and mga files at folders kapag nadadaanan ng mouse diff --git a/src/Files.App/Strings/fr-FR/Resources.resw b/src/Files.App/Strings/fr-FR/Resources.resw index 742b2fb0fa2c..fd3753f5aeff 100644 --- a/src/Files.App/Strings/fr-FR/Resources.resw +++ b/src/Files.App/Strings/fr-FR/Resources.resw @@ -2027,6 +2027,18 @@ Compresser + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Sélectionner les fichiers et dossiers lorsqu'ils sont survolés diff --git a/src/Files.App/Strings/he-IL/Resources.resw b/src/Files.App/Strings/he-IL/Resources.resw index f3e6d40cd1ac..641fbb353533 100644 --- a/src/Files.App/Strings/he-IL/Resources.resw +++ b/src/Files.App/Strings/he-IL/Resources.resw @@ -2027,6 +2027,18 @@ Compress + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Select files and folders when hovering over them diff --git a/src/Files.App/Strings/hi-IN/Resources.resw b/src/Files.App/Strings/hi-IN/Resources.resw index cb0a54adc3ec..4eb12813fdcb 100644 --- a/src/Files.App/Strings/hi-IN/Resources.resw +++ b/src/Files.App/Strings/hi-IN/Resources.resw @@ -2027,6 +2027,18 @@ Compress + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Select files and folders when hovering over them diff --git a/src/Files.App/Strings/hr-HR/Resources.resw b/src/Files.App/Strings/hr-HR/Resources.resw index ab9d31e9dc50..3142c8275ff7 100644 --- a/src/Files.App/Strings/hr-HR/Resources.resw +++ b/src/Files.App/Strings/hr-HR/Resources.resw @@ -2027,6 +2027,18 @@ Compress + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Select files and folders when hovering over them diff --git a/src/Files.App/Strings/hu-HU/Resources.resw b/src/Files.App/Strings/hu-HU/Resources.resw index adf3730e6c81..a15ba94dfd68 100644 --- a/src/Files.App/Strings/hu-HU/Resources.resw +++ b/src/Files.App/Strings/hu-HU/Resources.resw @@ -2027,6 +2027,18 @@ Tömörítés + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Fájlok és mappák kiválasztása kattintás nélkül diff --git a/src/Files.App/Strings/id-ID/Resources.resw b/src/Files.App/Strings/id-ID/Resources.resw index e4f29252c9ac..4a5ec8e5ee16 100644 --- a/src/Files.App/Strings/id-ID/Resources.resw +++ b/src/Files.App/Strings/id-ID/Resources.resw @@ -2027,6 +2027,18 @@ Kompres + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Pilih file dan folder saat mengarahkan kursor ke atasnya diff --git a/src/Files.App/Strings/it-IT/Resources.resw b/src/Files.App/Strings/it-IT/Resources.resw index e35c0c0ffa0f..07b52c68a022 100644 --- a/src/Files.App/Strings/it-IT/Resources.resw +++ b/src/Files.App/Strings/it-IT/Resources.resw @@ -2027,6 +2027,18 @@ Comprimi + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Seleziona i file e le cartelle quando si passa con il mouse diff --git a/src/Files.App/Strings/ja-JP/Resources.resw b/src/Files.App/Strings/ja-JP/Resources.resw index 06bd8ce9421d..725b82da2fba 100644 --- a/src/Files.App/Strings/ja-JP/Resources.resw +++ b/src/Files.App/Strings/ja-JP/Resources.resw @@ -2026,6 +2026,18 @@ 圧縮 + + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive カーソルを合わせたファイルとフォルダーを選択する diff --git a/src/Files.App/Strings/ka/Resources.resw b/src/Files.App/Strings/ka/Resources.resw index b2d0c95bbcc0..b7b6262da601 100644 --- a/src/Files.App/Strings/ka/Resources.resw +++ b/src/Files.App/Strings/ka/Resources.resw @@ -2027,6 +2027,18 @@ Compress + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Select files and folders when hovering over them diff --git a/src/Files.App/Strings/km-KH/Resources.resw b/src/Files.App/Strings/km-KH/Resources.resw index 1fecfcc2ee08..a801e532b070 100644 --- a/src/Files.App/Strings/km-KH/Resources.resw +++ b/src/Files.App/Strings/km-KH/Resources.resw @@ -2027,6 +2027,18 @@ Compress + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Select files and folders when hovering over them diff --git a/src/Files.App/Strings/ko-KR/Resources.resw b/src/Files.App/Strings/ko-KR/Resources.resw index 16d8d54178a5..91db9e50d33c 100644 --- a/src/Files.App/Strings/ko-KR/Resources.resw +++ b/src/Files.App/Strings/ko-KR/Resources.resw @@ -2027,6 +2027,18 @@ 압축 + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + 파일과 폴더에 마우스를 올려 선택하기 diff --git a/src/Files.App/Strings/ku-Arab/Resources.resw b/src/Files.App/Strings/ku-Arab/Resources.resw index ae0c86da7dd1..dfb7e1ae3056 100644 --- a/src/Files.App/Strings/ku-Arab/Resources.resw +++ b/src/Files.App/Strings/ku-Arab/Resources.resw @@ -2027,6 +2027,18 @@ Compress + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Select files and folders when hovering over them diff --git a/src/Files.App/Strings/lt-LT/Resources.resw b/src/Files.App/Strings/lt-LT/Resources.resw index 12a0b48e2722..ede0ddefc856 100644 --- a/src/Files.App/Strings/lt-LT/Resources.resw +++ b/src/Files.App/Strings/lt-LT/Resources.resw @@ -2027,6 +2027,18 @@ Compress + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Select files and folders when hovering over them diff --git a/src/Files.App/Strings/lv-LV/Resources.resw b/src/Files.App/Strings/lv-LV/Resources.resw index da1b60d97e71..22fae2ae96b0 100644 --- a/src/Files.App/Strings/lv-LV/Resources.resw +++ b/src/Files.App/Strings/lv-LV/Resources.resw @@ -2027,6 +2027,18 @@ Compress + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Atzīmēt failus un direktorijas kad uzvirza peli diff --git a/src/Files.App/Strings/ms-MY/Resources.resw b/src/Files.App/Strings/ms-MY/Resources.resw index 34533612ed68..cc08ea33b578 100644 --- a/src/Files.App/Strings/ms-MY/Resources.resw +++ b/src/Files.App/Strings/ms-MY/Resources.resw @@ -2027,6 +2027,18 @@ Compress + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Select files and folders when hovering over them diff --git a/src/Files.App/Strings/nb-NO/Resources.resw b/src/Files.App/Strings/nb-NO/Resources.resw index e69e4160fef4..e311a932b5e9 100644 --- a/src/Files.App/Strings/nb-NO/Resources.resw +++ b/src/Files.App/Strings/nb-NO/Resources.resw @@ -2027,6 +2027,18 @@ Komprimer + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Velg filer og mapper ved å holde musepekeren over dem diff --git a/src/Files.App/Strings/nl-NL/Resources.resw b/src/Files.App/Strings/nl-NL/Resources.resw index 3f21f97b3e9c..686a80394c15 100644 --- a/src/Files.App/Strings/nl-NL/Resources.resw +++ b/src/Files.App/Strings/nl-NL/Resources.resw @@ -2027,6 +2027,18 @@ Comprimeren + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Selecteer bestanden en mappen wanneer je over hen beweegt diff --git a/src/Files.App/Strings/or-IN/Resources.resw b/src/Files.App/Strings/or-IN/Resources.resw index ae0c86da7dd1..dfb7e1ae3056 100644 --- a/src/Files.App/Strings/or-IN/Resources.resw +++ b/src/Files.App/Strings/or-IN/Resources.resw @@ -2027,6 +2027,18 @@ Compress + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Select files and folders when hovering over them diff --git a/src/Files.App/Strings/pl-PL/Resources.resw b/src/Files.App/Strings/pl-PL/Resources.resw index 910d6f964f75..db3c9b579985 100644 --- a/src/Files.App/Strings/pl-PL/Resources.resw +++ b/src/Files.App/Strings/pl-PL/Resources.resw @@ -2027,6 +2027,18 @@ Skompresuj + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Zaznacz pliki i foldery w trakcie trzymania kursora nad nimi diff --git a/src/Files.App/Strings/pt-BR/Resources.resw b/src/Files.App/Strings/pt-BR/Resources.resw index 4a239c8db90e..54b9c575da64 100644 --- a/src/Files.App/Strings/pt-BR/Resources.resw +++ b/src/Files.App/Strings/pt-BR/Resources.resw @@ -2027,6 +2027,18 @@ Comprimir + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Selecionar arquivos e pastas ao passar o mouse sobre elas diff --git a/src/Files.App/Strings/pt-PT/Resources.resw b/src/Files.App/Strings/pt-PT/Resources.resw index adc3cf73ae3d..2c23701ba4f5 100644 --- a/src/Files.App/Strings/pt-PT/Resources.resw +++ b/src/Files.App/Strings/pt-PT/Resources.resw @@ -2027,6 +2027,18 @@ Comprimir + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Selecionar ficheiros e pastas ao passar com o rato por cima diff --git a/src/Files.App/Strings/ro-RO/Resources.resw b/src/Files.App/Strings/ro-RO/Resources.resw index 87b85f756347..07dba61f59d6 100644 --- a/src/Files.App/Strings/ro-RO/Resources.resw +++ b/src/Files.App/Strings/ro-RO/Resources.resw @@ -2027,6 +2027,18 @@ Comprimare + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Selectați fișiere și foldere când treceți cu mouse-ul peste ele diff --git a/src/Files.App/Strings/ru-RU/Resources.resw b/src/Files.App/Strings/ru-RU/Resources.resw index 016a4c58b32a..9777e3745588 100644 --- a/src/Files.App/Strings/ru-RU/Resources.resw +++ b/src/Files.App/Strings/ru-RU/Resources.resw @@ -2027,6 +2027,18 @@ Сжать + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Выделение файлов и папок при наведении на них курсора мыши diff --git a/src/Files.App/Strings/sk-SK/Resources.resw b/src/Files.App/Strings/sk-SK/Resources.resw index 19e701511197..3f9af1054cc0 100644 --- a/src/Files.App/Strings/sk-SK/Resources.resw +++ b/src/Files.App/Strings/sk-SK/Resources.resw @@ -2029,6 +2029,18 @@ Zabaliť + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Vybrať súbory a priečinky, keď na ne umiestnite kurzor myši diff --git a/src/Files.App/Strings/sq-AL/Resources.resw b/src/Files.App/Strings/sq-AL/Resources.resw index 742036188ee8..507a74869bea 100644 --- a/src/Files.App/Strings/sq-AL/Resources.resw +++ b/src/Files.App/Strings/sq-AL/Resources.resw @@ -2027,6 +2027,18 @@ Compress + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Select files and folders when hovering over them diff --git a/src/Files.App/Strings/sr-Cyrl/Resources.resw b/src/Files.App/Strings/sr-Cyrl/Resources.resw index cc6e63059ce4..ad8da9a57acf 100644 --- a/src/Files.App/Strings/sr-Cyrl/Resources.resw +++ b/src/Files.App/Strings/sr-Cyrl/Resources.resw @@ -2027,6 +2027,18 @@ Compress + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Селектуј датотеке и фасцикле преласком миша diff --git a/src/Files.App/Strings/sv-SE/Resources.resw b/src/Files.App/Strings/sv-SE/Resources.resw index 0e9b6e66d286..c81c7b0741b5 100644 --- a/src/Files.App/Strings/sv-SE/Resources.resw +++ b/src/Files.App/Strings/sv-SE/Resources.resw @@ -2027,6 +2027,18 @@ Komprimera + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Välj filer och mappar när man hovrar över dem diff --git a/src/Files.App/Strings/ta/Resources.resw b/src/Files.App/Strings/ta/Resources.resw index 1cae8a883810..c5d149598991 100644 --- a/src/Files.App/Strings/ta/Resources.resw +++ b/src/Files.App/Strings/ta/Resources.resw @@ -2027,6 +2027,18 @@ Compress + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Select files and folders when hovering over them diff --git a/src/Files.App/Strings/th-TH/Resources.resw b/src/Files.App/Strings/th-TH/Resources.resw index bfc68a8cb2c2..6984e8dbeb90 100644 --- a/src/Files.App/Strings/th-TH/Resources.resw +++ b/src/Files.App/Strings/th-TH/Resources.resw @@ -2027,6 +2027,18 @@ บีดอัด + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Select files and folders when hovering over them diff --git a/src/Files.App/Strings/tr-TR/Resources.resw b/src/Files.App/Strings/tr-TR/Resources.resw index e27006999bcd..ce6c112e6d83 100644 --- a/src/Files.App/Strings/tr-TR/Resources.resw +++ b/src/Files.App/Strings/tr-TR/Resources.resw @@ -2027,6 +2027,18 @@ Sıkıştır + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Üzerine getirildiğinde dosyaları ve dizinleri seç diff --git a/src/Files.App/Strings/uk-UA/Resources.resw b/src/Files.App/Strings/uk-UA/Resources.resw index f3888863c486..567b13fb2443 100644 --- a/src/Files.App/Strings/uk-UA/Resources.resw +++ b/src/Files.App/Strings/uk-UA/Resources.resw @@ -2027,6 +2027,18 @@ Стиснути + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Вибрати файли та папки при наведенні на них diff --git a/src/Files.App/Strings/vi/Resources.resw b/src/Files.App/Strings/vi/Resources.resw index 462f691223f2..f91b019ee581 100644 --- a/src/Files.App/Strings/vi/Resources.resw +++ b/src/Files.App/Strings/vi/Resources.resw @@ -2027,6 +2027,18 @@ Nén + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + Chọn tệp và thư mục khi di chuột lên diff --git a/src/Files.App/Strings/zh-Hans/Resources.resw b/src/Files.App/Strings/zh-Hans/Resources.resw index a6c8af09abfe..3a52a96b0319 100644 --- a/src/Files.App/Strings/zh-Hans/Resources.resw +++ b/src/Files.App/Strings/zh-Hans/Resources.resw @@ -2027,6 +2027,18 @@ 压缩 + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + 鼠标悬停在项目上时自动选择 diff --git a/src/Files.App/Strings/zh-Hant/Resources.resw b/src/Files.App/Strings/zh-Hant/Resources.resw index 7ff6ce3a8799..5d85434f89f2 100644 --- a/src/Files.App/Strings/zh-Hant/Resources.resw +++ b/src/Files.App/Strings/zh-Hant/Resources.resw @@ -2027,6 +2027,18 @@ 壓縮 + + Flatten + + + Flatten a folder contents into the current path. + + + Flatten Single + + + Flatten Recursive + 當游標停留於檔案與資料夾上時,選取它們 From dbb54bf19147a15a2d1574b96b3497d3b5fba694 Mon Sep 17 00:00:00 2001 From: Devin Slothower <93222657+Devin-Slothower@users.noreply.github.com> Date: Sun, 11 Aug 2024 18:22:54 -0400 Subject: [PATCH 03/25] Copyright header --- src/Files.App/Actions/FileSystem/FlattenRecursiveAction.cs | 5 ++++- src/Files.App/Actions/FileSystem/FlattenSingleAction.cs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Files.App/Actions/FileSystem/FlattenRecursiveAction.cs b/src/Files.App/Actions/FileSystem/FlattenRecursiveAction.cs index ff925784291c..3068370b65e3 100644 --- a/src/Files.App/Actions/FileSystem/FlattenRecursiveAction.cs +++ b/src/Files.App/Actions/FileSystem/FlattenRecursiveAction.cs @@ -1,4 +1,7 @@ -using System.IO; +// Copyright (c) 2024 Files Community +// Licensed under the MIT License. See the LICENSE. + +using System.IO; using Windows.Storage; using Microsoft.Extensions.Logging; diff --git a/src/Files.App/Actions/FileSystem/FlattenSingleAction.cs b/src/Files.App/Actions/FileSystem/FlattenSingleAction.cs index 7cdf72645504..dd714dfb0bc7 100644 --- a/src/Files.App/Actions/FileSystem/FlattenSingleAction.cs +++ b/src/Files.App/Actions/FileSystem/FlattenSingleAction.cs @@ -1,4 +1,7 @@ -using System.IO; +// Copyright (c) 2024 Files Community +// Licensed under the MIT License. See the LICENSE. + +using System.IO; using Windows.Storage; using Microsoft.Extensions.Logging; From 386836b42baacfb74d0b3ccb0e043a2d1f3702e9 Mon Sep 17 00:00:00 2001 From: Devin <93222657+devin-slothower@users.noreply.github.com> Date: Sun, 11 Aug 2024 18:34:46 -0400 Subject: [PATCH 04/25] Delete src/Files.App/Properties/Resources.Designer.cs --- .../Properties/Resources.Designer.cs | 63 ------------------- 1 file changed, 63 deletions(-) delete mode 100644 src/Files.App/Properties/Resources.Designer.cs diff --git a/src/Files.App/Properties/Resources.Designer.cs b/src/Files.App/Properties/Resources.Designer.cs deleted file mode 100644 index 17906955ad29..000000000000 --- a/src/Files.App/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Files.App.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Files.App.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} From 99041e809d99da4545c0d19a9ccd78badb92ace4 Mon Sep 17 00:00:00 2001 From: Devin <93222657+devin-slothower@users.noreply.github.com> Date: Sun, 11 Aug 2024 18:34:54 -0400 Subject: [PATCH 05/25] Delete src/Files.App/Properties/Resources.resx --- src/Files.App/Properties/Resources.resx | 101 ------------------------ 1 file changed, 101 deletions(-) delete mode 100644 src/Files.App/Properties/Resources.resx diff --git a/src/Files.App/Properties/Resources.resx b/src/Files.App/Properties/Resources.resx deleted file mode 100644 index 4fdb1b6aff69..000000000000 --- a/src/Files.App/Properties/Resources.resx +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file From 155e20d9b00ea2136c1630b03fe1f0cbecba3ec9 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon, 12 Aug 2024 10:45:34 -0400 Subject: [PATCH 06/25] Revert changes to resource files --- src/Files.App/Strings/af/Resources.resw | 12 ------------ src/Files.App/Strings/ar/Resources.resw | 12 ------------ src/Files.App/Strings/be-BY/Resources.resw | 12 ------------ src/Files.App/Strings/bg/Resources.resw | 12 ------------ src/Files.App/Strings/ca/Resources.resw | 12 ------------ src/Files.App/Strings/cs-CZ/Resources.resw | 12 ------------ src/Files.App/Strings/da/Resources.resw | 12 ------------ src/Files.App/Strings/de-DE/Resources.resw | 12 ------------ src/Files.App/Strings/el/Resources.resw | 12 ------------ src/Files.App/Strings/en-GB/Resources.resw | 12 ------------ src/Files.App/Strings/es-419/Resources.resw | 12 ------------ src/Files.App/Strings/es-ES/Resources.resw | 12 ------------ src/Files.App/Strings/fa-IR/Resources.resw | 12 ------------ src/Files.App/Strings/fi-FI/Resources.resw | 12 ------------ src/Files.App/Strings/fil-PH/Resources.resw | 12 ------------ src/Files.App/Strings/fr-FR/Resources.resw | 12 ------------ src/Files.App/Strings/he-IL/Resources.resw | 12 ------------ src/Files.App/Strings/hi-IN/Resources.resw | 12 ------------ src/Files.App/Strings/hr-HR/Resources.resw | 12 ------------ src/Files.App/Strings/hu-HU/Resources.resw | 12 ------------ src/Files.App/Strings/id-ID/Resources.resw | 12 ------------ src/Files.App/Strings/it-IT/Resources.resw | 12 ------------ src/Files.App/Strings/ja-JP/Resources.resw | 12 ------------ src/Files.App/Strings/ka/Resources.resw | 12 ------------ src/Files.App/Strings/km-KH/Resources.resw | 12 ------------ src/Files.App/Strings/ko-KR/Resources.resw | 12 ------------ src/Files.App/Strings/ku-Arab/Resources.resw | 12 ------------ src/Files.App/Strings/lt-LT/Resources.resw | 12 ------------ src/Files.App/Strings/lv-LV/Resources.resw | 12 ------------ src/Files.App/Strings/ms-MY/Resources.resw | 12 ------------ src/Files.App/Strings/nb-NO/Resources.resw | 12 ------------ src/Files.App/Strings/nl-NL/Resources.resw | 12 ------------ src/Files.App/Strings/or-IN/Resources.resw | 12 ------------ src/Files.App/Strings/pl-PL/Resources.resw | 12 ------------ src/Files.App/Strings/pt-BR/Resources.resw | 12 ------------ src/Files.App/Strings/pt-PT/Resources.resw | 12 ------------ src/Files.App/Strings/ro-RO/Resources.resw | 12 ------------ src/Files.App/Strings/ru-RU/Resources.resw | 12 ------------ src/Files.App/Strings/sk-SK/Resources.resw | 12 ------------ src/Files.App/Strings/sq-AL/Resources.resw | 12 ------------ src/Files.App/Strings/sr-Cyrl/Resources.resw | 12 ------------ src/Files.App/Strings/sv-SE/Resources.resw | 12 ------------ src/Files.App/Strings/ta/Resources.resw | 12 ------------ src/Files.App/Strings/th-TH/Resources.resw | 12 ------------ src/Files.App/Strings/tr-TR/Resources.resw | 12 ------------ src/Files.App/Strings/uk-UA/Resources.resw | 12 ------------ src/Files.App/Strings/vi/Resources.resw | 12 ------------ src/Files.App/Strings/zh-Hans/Resources.resw | 12 ------------ src/Files.App/Strings/zh-Hant/Resources.resw | 12 ------------ 49 files changed, 588 deletions(-) diff --git a/src/Files.App/Strings/af/Resources.resw b/src/Files.App/Strings/af/Resources.resw index 8d901f3e8c76..6d5b76b58df1 100644 --- a/src/Files.App/Strings/af/Resources.resw +++ b/src/Files.App/Strings/af/Resources.resw @@ -2028,18 +2028,6 @@ Compress - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Select files and folders when hovering over them diff --git a/src/Files.App/Strings/ar/Resources.resw b/src/Files.App/Strings/ar/Resources.resw index c700834cf085..3459e95c6884 100644 --- a/src/Files.App/Strings/ar/Resources.resw +++ b/src/Files.App/Strings/ar/Resources.resw @@ -2028,18 +2028,6 @@ ضغط - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - حدد الملفات والمجلدات عند التنقل فوقها diff --git a/src/Files.App/Strings/be-BY/Resources.resw b/src/Files.App/Strings/be-BY/Resources.resw index 3a6085e66d71..2a1341c56602 100644 --- a/src/Files.App/Strings/be-BY/Resources.resw +++ b/src/Files.App/Strings/be-BY/Resources.resw @@ -2027,18 +2027,6 @@ Compress - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Select files and folders when hovering over them diff --git a/src/Files.App/Strings/bg/Resources.resw b/src/Files.App/Strings/bg/Resources.resw index bd02903f4f39..926449397669 100644 --- a/src/Files.App/Strings/bg/Resources.resw +++ b/src/Files.App/Strings/bg/Resources.resw @@ -2027,18 +2027,6 @@ Компресиране - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Избор на файлове и папки при показалец на мишката над тях diff --git a/src/Files.App/Strings/ca/Resources.resw b/src/Files.App/Strings/ca/Resources.resw index 54a77b3416b9..3f423f76843b 100644 --- a/src/Files.App/Strings/ca/Resources.resw +++ b/src/Files.App/Strings/ca/Resources.resw @@ -2027,18 +2027,6 @@ Comprimeix - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Selecciona fitxers i carpetes quan passeu el cursor per sobre d'ells diff --git a/src/Files.App/Strings/cs-CZ/Resources.resw b/src/Files.App/Strings/cs-CZ/Resources.resw index a3f5c4b7be89..6e0f48776f32 100644 --- a/src/Files.App/Strings/cs-CZ/Resources.resw +++ b/src/Files.App/Strings/cs-CZ/Resources.resw @@ -2027,18 +2027,6 @@ Komprimovat - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Vyberte soubory a složky při najetí na ně diff --git a/src/Files.App/Strings/da/Resources.resw b/src/Files.App/Strings/da/Resources.resw index 4e8db8ba097f..d768b803b803 100644 --- a/src/Files.App/Strings/da/Resources.resw +++ b/src/Files.App/Strings/da/Resources.resw @@ -2027,18 +2027,6 @@ Komprimering - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Vælg filer og mapper, når der svæves over dem diff --git a/src/Files.App/Strings/de-DE/Resources.resw b/src/Files.App/Strings/de-DE/Resources.resw index 531b2db4d860..13f07681469b 100644 --- a/src/Files.App/Strings/de-DE/Resources.resw +++ b/src/Files.App/Strings/de-DE/Resources.resw @@ -2027,18 +2027,6 @@ Komprimieren - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Dateien und Ordner beim Überfahren auswählen diff --git a/src/Files.App/Strings/el/Resources.resw b/src/Files.App/Strings/el/Resources.resw index 99860cc8523b..18e61f33710a 100644 --- a/src/Files.App/Strings/el/Resources.resw +++ b/src/Files.App/Strings/el/Resources.resw @@ -2027,18 +2027,6 @@ Συμπίεση - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Να επιλέγονται τα αρχεία όταν το ποντίκι είναι πάνω τους diff --git a/src/Files.App/Strings/en-GB/Resources.resw b/src/Files.App/Strings/en-GB/Resources.resw index 5a9976face69..058d2c8f5826 100644 --- a/src/Files.App/Strings/en-GB/Resources.resw +++ b/src/Files.App/Strings/en-GB/Resources.resw @@ -2027,18 +2027,6 @@ Compress - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Select files and folders when hovering over them diff --git a/src/Files.App/Strings/es-419/Resources.resw b/src/Files.App/Strings/es-419/Resources.resw index 1d4de368a0c5..bbe8fd2934e2 100644 --- a/src/Files.App/Strings/es-419/Resources.resw +++ b/src/Files.App/Strings/es-419/Resources.resw @@ -2027,18 +2027,6 @@ Comprimir - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Seleccionar archivos y carpetas al pasar el cursor sobre ellos diff --git a/src/Files.App/Strings/es-ES/Resources.resw b/src/Files.App/Strings/es-ES/Resources.resw index 63cfeb39225b..532234300ab5 100644 --- a/src/Files.App/Strings/es-ES/Resources.resw +++ b/src/Files.App/Strings/es-ES/Resources.resw @@ -2027,18 +2027,6 @@ Comprimir - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Seleccionar archivos y carpetas al colocar el cursor encima de ellos diff --git a/src/Files.App/Strings/fa-IR/Resources.resw b/src/Files.App/Strings/fa-IR/Resources.resw index 37ff8710cc4f..36be96afa20b 100644 --- a/src/Files.App/Strings/fa-IR/Resources.resw +++ b/src/Files.App/Strings/fa-IR/Resources.resw @@ -2027,18 +2027,6 @@ فشرده‌سازی - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - فایل‌ها و پوشه‌ها را هنگام قرار دادن ماوس روی آنها انتخاب کن diff --git a/src/Files.App/Strings/fi-FI/Resources.resw b/src/Files.App/Strings/fi-FI/Resources.resw index c28d23877866..316d71d2ed20 100644 --- a/src/Files.App/Strings/fi-FI/Resources.resw +++ b/src/Files.App/Strings/fi-FI/Resources.resw @@ -2027,18 +2027,6 @@ Pakkaa - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Valitse tiedostot ja kansiot viemällä hiiren osoitin niiden päälle diff --git a/src/Files.App/Strings/fil-PH/Resources.resw b/src/Files.App/Strings/fil-PH/Resources.resw index e2cad307e810..e66589b36929 100644 --- a/src/Files.App/Strings/fil-PH/Resources.resw +++ b/src/Files.App/Strings/fil-PH/Resources.resw @@ -2027,18 +2027,6 @@ I-compress - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Piliin and mga files at folders kapag nadadaanan ng mouse diff --git a/src/Files.App/Strings/fr-FR/Resources.resw b/src/Files.App/Strings/fr-FR/Resources.resw index fd3753f5aeff..742b2fb0fa2c 100644 --- a/src/Files.App/Strings/fr-FR/Resources.resw +++ b/src/Files.App/Strings/fr-FR/Resources.resw @@ -2027,18 +2027,6 @@ Compresser - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Sélectionner les fichiers et dossiers lorsqu'ils sont survolés diff --git a/src/Files.App/Strings/he-IL/Resources.resw b/src/Files.App/Strings/he-IL/Resources.resw index 641fbb353533..f3e6d40cd1ac 100644 --- a/src/Files.App/Strings/he-IL/Resources.resw +++ b/src/Files.App/Strings/he-IL/Resources.resw @@ -2027,18 +2027,6 @@ Compress - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Select files and folders when hovering over them diff --git a/src/Files.App/Strings/hi-IN/Resources.resw b/src/Files.App/Strings/hi-IN/Resources.resw index 4eb12813fdcb..cb0a54adc3ec 100644 --- a/src/Files.App/Strings/hi-IN/Resources.resw +++ b/src/Files.App/Strings/hi-IN/Resources.resw @@ -2027,18 +2027,6 @@ Compress - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Select files and folders when hovering over them diff --git a/src/Files.App/Strings/hr-HR/Resources.resw b/src/Files.App/Strings/hr-HR/Resources.resw index 3142c8275ff7..ab9d31e9dc50 100644 --- a/src/Files.App/Strings/hr-HR/Resources.resw +++ b/src/Files.App/Strings/hr-HR/Resources.resw @@ -2027,18 +2027,6 @@ Compress - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Select files and folders when hovering over them diff --git a/src/Files.App/Strings/hu-HU/Resources.resw b/src/Files.App/Strings/hu-HU/Resources.resw index a15ba94dfd68..adf3730e6c81 100644 --- a/src/Files.App/Strings/hu-HU/Resources.resw +++ b/src/Files.App/Strings/hu-HU/Resources.resw @@ -2027,18 +2027,6 @@ Tömörítés - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Fájlok és mappák kiválasztása kattintás nélkül diff --git a/src/Files.App/Strings/id-ID/Resources.resw b/src/Files.App/Strings/id-ID/Resources.resw index 4a5ec8e5ee16..e4f29252c9ac 100644 --- a/src/Files.App/Strings/id-ID/Resources.resw +++ b/src/Files.App/Strings/id-ID/Resources.resw @@ -2027,18 +2027,6 @@ Kompres - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Pilih file dan folder saat mengarahkan kursor ke atasnya diff --git a/src/Files.App/Strings/it-IT/Resources.resw b/src/Files.App/Strings/it-IT/Resources.resw index 07b52c68a022..e35c0c0ffa0f 100644 --- a/src/Files.App/Strings/it-IT/Resources.resw +++ b/src/Files.App/Strings/it-IT/Resources.resw @@ -2027,18 +2027,6 @@ Comprimi - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Seleziona i file e le cartelle quando si passa con il mouse diff --git a/src/Files.App/Strings/ja-JP/Resources.resw b/src/Files.App/Strings/ja-JP/Resources.resw index 725b82da2fba..06bd8ce9421d 100644 --- a/src/Files.App/Strings/ja-JP/Resources.resw +++ b/src/Files.App/Strings/ja-JP/Resources.resw @@ -2026,18 +2026,6 @@ 圧縮 - - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive カーソルを合わせたファイルとフォルダーを選択する diff --git a/src/Files.App/Strings/ka/Resources.resw b/src/Files.App/Strings/ka/Resources.resw index b7b6262da601..b2d0c95bbcc0 100644 --- a/src/Files.App/Strings/ka/Resources.resw +++ b/src/Files.App/Strings/ka/Resources.resw @@ -2027,18 +2027,6 @@ Compress - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Select files and folders when hovering over them diff --git a/src/Files.App/Strings/km-KH/Resources.resw b/src/Files.App/Strings/km-KH/Resources.resw index a801e532b070..1fecfcc2ee08 100644 --- a/src/Files.App/Strings/km-KH/Resources.resw +++ b/src/Files.App/Strings/km-KH/Resources.resw @@ -2027,18 +2027,6 @@ Compress - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Select files and folders when hovering over them diff --git a/src/Files.App/Strings/ko-KR/Resources.resw b/src/Files.App/Strings/ko-KR/Resources.resw index 91db9e50d33c..16d8d54178a5 100644 --- a/src/Files.App/Strings/ko-KR/Resources.resw +++ b/src/Files.App/Strings/ko-KR/Resources.resw @@ -2027,18 +2027,6 @@ 압축 - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - 파일과 폴더에 마우스를 올려 선택하기 diff --git a/src/Files.App/Strings/ku-Arab/Resources.resw b/src/Files.App/Strings/ku-Arab/Resources.resw index dfb7e1ae3056..ae0c86da7dd1 100644 --- a/src/Files.App/Strings/ku-Arab/Resources.resw +++ b/src/Files.App/Strings/ku-Arab/Resources.resw @@ -2027,18 +2027,6 @@ Compress - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Select files and folders when hovering over them diff --git a/src/Files.App/Strings/lt-LT/Resources.resw b/src/Files.App/Strings/lt-LT/Resources.resw index ede0ddefc856..12a0b48e2722 100644 --- a/src/Files.App/Strings/lt-LT/Resources.resw +++ b/src/Files.App/Strings/lt-LT/Resources.resw @@ -2027,18 +2027,6 @@ Compress - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Select files and folders when hovering over them diff --git a/src/Files.App/Strings/lv-LV/Resources.resw b/src/Files.App/Strings/lv-LV/Resources.resw index 22fae2ae96b0..da1b60d97e71 100644 --- a/src/Files.App/Strings/lv-LV/Resources.resw +++ b/src/Files.App/Strings/lv-LV/Resources.resw @@ -2027,18 +2027,6 @@ Compress - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Atzīmēt failus un direktorijas kad uzvirza peli diff --git a/src/Files.App/Strings/ms-MY/Resources.resw b/src/Files.App/Strings/ms-MY/Resources.resw index cc08ea33b578..34533612ed68 100644 --- a/src/Files.App/Strings/ms-MY/Resources.resw +++ b/src/Files.App/Strings/ms-MY/Resources.resw @@ -2027,18 +2027,6 @@ Compress - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Select files and folders when hovering over them diff --git a/src/Files.App/Strings/nb-NO/Resources.resw b/src/Files.App/Strings/nb-NO/Resources.resw index e311a932b5e9..e69e4160fef4 100644 --- a/src/Files.App/Strings/nb-NO/Resources.resw +++ b/src/Files.App/Strings/nb-NO/Resources.resw @@ -2027,18 +2027,6 @@ Komprimer - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Velg filer og mapper ved å holde musepekeren over dem diff --git a/src/Files.App/Strings/nl-NL/Resources.resw b/src/Files.App/Strings/nl-NL/Resources.resw index 686a80394c15..3f21f97b3e9c 100644 --- a/src/Files.App/Strings/nl-NL/Resources.resw +++ b/src/Files.App/Strings/nl-NL/Resources.resw @@ -2027,18 +2027,6 @@ Comprimeren - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Selecteer bestanden en mappen wanneer je over hen beweegt diff --git a/src/Files.App/Strings/or-IN/Resources.resw b/src/Files.App/Strings/or-IN/Resources.resw index dfb7e1ae3056..ae0c86da7dd1 100644 --- a/src/Files.App/Strings/or-IN/Resources.resw +++ b/src/Files.App/Strings/or-IN/Resources.resw @@ -2027,18 +2027,6 @@ Compress - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Select files and folders when hovering over them diff --git a/src/Files.App/Strings/pl-PL/Resources.resw b/src/Files.App/Strings/pl-PL/Resources.resw index db3c9b579985..910d6f964f75 100644 --- a/src/Files.App/Strings/pl-PL/Resources.resw +++ b/src/Files.App/Strings/pl-PL/Resources.resw @@ -2027,18 +2027,6 @@ Skompresuj - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Zaznacz pliki i foldery w trakcie trzymania kursora nad nimi diff --git a/src/Files.App/Strings/pt-BR/Resources.resw b/src/Files.App/Strings/pt-BR/Resources.resw index 54b9c575da64..4a239c8db90e 100644 --- a/src/Files.App/Strings/pt-BR/Resources.resw +++ b/src/Files.App/Strings/pt-BR/Resources.resw @@ -2027,18 +2027,6 @@ Comprimir - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Selecionar arquivos e pastas ao passar o mouse sobre elas diff --git a/src/Files.App/Strings/pt-PT/Resources.resw b/src/Files.App/Strings/pt-PT/Resources.resw index 2c23701ba4f5..adc3cf73ae3d 100644 --- a/src/Files.App/Strings/pt-PT/Resources.resw +++ b/src/Files.App/Strings/pt-PT/Resources.resw @@ -2027,18 +2027,6 @@ Comprimir - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Selecionar ficheiros e pastas ao passar com o rato por cima diff --git a/src/Files.App/Strings/ro-RO/Resources.resw b/src/Files.App/Strings/ro-RO/Resources.resw index 07dba61f59d6..87b85f756347 100644 --- a/src/Files.App/Strings/ro-RO/Resources.resw +++ b/src/Files.App/Strings/ro-RO/Resources.resw @@ -2027,18 +2027,6 @@ Comprimare - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Selectați fișiere și foldere când treceți cu mouse-ul peste ele diff --git a/src/Files.App/Strings/ru-RU/Resources.resw b/src/Files.App/Strings/ru-RU/Resources.resw index 9777e3745588..016a4c58b32a 100644 --- a/src/Files.App/Strings/ru-RU/Resources.resw +++ b/src/Files.App/Strings/ru-RU/Resources.resw @@ -2027,18 +2027,6 @@ Сжать - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Выделение файлов и папок при наведении на них курсора мыши diff --git a/src/Files.App/Strings/sk-SK/Resources.resw b/src/Files.App/Strings/sk-SK/Resources.resw index 3f9af1054cc0..19e701511197 100644 --- a/src/Files.App/Strings/sk-SK/Resources.resw +++ b/src/Files.App/Strings/sk-SK/Resources.resw @@ -2029,18 +2029,6 @@ Zabaliť - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Vybrať súbory a priečinky, keď na ne umiestnite kurzor myši diff --git a/src/Files.App/Strings/sq-AL/Resources.resw b/src/Files.App/Strings/sq-AL/Resources.resw index 507a74869bea..742036188ee8 100644 --- a/src/Files.App/Strings/sq-AL/Resources.resw +++ b/src/Files.App/Strings/sq-AL/Resources.resw @@ -2027,18 +2027,6 @@ Compress - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Select files and folders when hovering over them diff --git a/src/Files.App/Strings/sr-Cyrl/Resources.resw b/src/Files.App/Strings/sr-Cyrl/Resources.resw index ad8da9a57acf..cc6e63059ce4 100644 --- a/src/Files.App/Strings/sr-Cyrl/Resources.resw +++ b/src/Files.App/Strings/sr-Cyrl/Resources.resw @@ -2027,18 +2027,6 @@ Compress - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Селектуј датотеке и фасцикле преласком миша diff --git a/src/Files.App/Strings/sv-SE/Resources.resw b/src/Files.App/Strings/sv-SE/Resources.resw index c81c7b0741b5..0e9b6e66d286 100644 --- a/src/Files.App/Strings/sv-SE/Resources.resw +++ b/src/Files.App/Strings/sv-SE/Resources.resw @@ -2027,18 +2027,6 @@ Komprimera - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Välj filer och mappar när man hovrar över dem diff --git a/src/Files.App/Strings/ta/Resources.resw b/src/Files.App/Strings/ta/Resources.resw index c5d149598991..1cae8a883810 100644 --- a/src/Files.App/Strings/ta/Resources.resw +++ b/src/Files.App/Strings/ta/Resources.resw @@ -2027,18 +2027,6 @@ Compress - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Select files and folders when hovering over them diff --git a/src/Files.App/Strings/th-TH/Resources.resw b/src/Files.App/Strings/th-TH/Resources.resw index 6984e8dbeb90..bfc68a8cb2c2 100644 --- a/src/Files.App/Strings/th-TH/Resources.resw +++ b/src/Files.App/Strings/th-TH/Resources.resw @@ -2027,18 +2027,6 @@ บีดอัด - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Select files and folders when hovering over them diff --git a/src/Files.App/Strings/tr-TR/Resources.resw b/src/Files.App/Strings/tr-TR/Resources.resw index ce6c112e6d83..e27006999bcd 100644 --- a/src/Files.App/Strings/tr-TR/Resources.resw +++ b/src/Files.App/Strings/tr-TR/Resources.resw @@ -2027,18 +2027,6 @@ Sıkıştır - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Üzerine getirildiğinde dosyaları ve dizinleri seç diff --git a/src/Files.App/Strings/uk-UA/Resources.resw b/src/Files.App/Strings/uk-UA/Resources.resw index 567b13fb2443..f3888863c486 100644 --- a/src/Files.App/Strings/uk-UA/Resources.resw +++ b/src/Files.App/Strings/uk-UA/Resources.resw @@ -2027,18 +2027,6 @@ Стиснути - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Вибрати файли та папки при наведенні на них diff --git a/src/Files.App/Strings/vi/Resources.resw b/src/Files.App/Strings/vi/Resources.resw index f91b019ee581..462f691223f2 100644 --- a/src/Files.App/Strings/vi/Resources.resw +++ b/src/Files.App/Strings/vi/Resources.resw @@ -2027,18 +2027,6 @@ Nén - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - Chọn tệp và thư mục khi di chuột lên diff --git a/src/Files.App/Strings/zh-Hans/Resources.resw b/src/Files.App/Strings/zh-Hans/Resources.resw index 3a52a96b0319..a6c8af09abfe 100644 --- a/src/Files.App/Strings/zh-Hans/Resources.resw +++ b/src/Files.App/Strings/zh-Hans/Resources.resw @@ -2027,18 +2027,6 @@ 压缩 - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - 鼠标悬停在项目上时自动选择 diff --git a/src/Files.App/Strings/zh-Hant/Resources.resw b/src/Files.App/Strings/zh-Hant/Resources.resw index 5d85434f89f2..7ff6ce3a8799 100644 --- a/src/Files.App/Strings/zh-Hant/Resources.resw +++ b/src/Files.App/Strings/zh-Hant/Resources.resw @@ -2027,18 +2027,6 @@ 壓縮 - - Flatten - - - Flatten a folder contents into the current path. - - - Flatten Single - - - Flatten Recursive - 當游標停留於檔案與資料夾上時,選取它們 From 8e957ca5a06bc28226cf44a860fae22592c35e1f Mon Sep 17 00:00:00 2001 From: Devin Slothower <93222657+Devin-Slothower@users.noreply.github.com> Date: Mon, 12 Aug 2024 12:42:17 -0400 Subject: [PATCH 07/25] Code Review: Changed to synchronous execution --- .../FileSystem/FlattenRecursiveAction.cs | 20 +++++++++++-------- .../Actions/FileSystem/FlattenSingleAction.cs | 12 ++++++----- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/Files.App/Actions/FileSystem/FlattenRecursiveAction.cs b/src/Files.App/Actions/FileSystem/FlattenRecursiveAction.cs index 3068370b65e3..ed9d4de710bf 100644 --- a/src/Files.App/Actions/FileSystem/FlattenRecursiveAction.cs +++ b/src/Files.App/Actions/FileSystem/FlattenRecursiveAction.cs @@ -29,30 +29,32 @@ public FlattenRecursiveAction() context.PropertyChanged += Context_PropertyChanged; } - public async Task ExecuteAsync(object? parameter = null) + public Task ExecuteAsync(object? parameter = null) { if (context.ShellPage?.ShellViewModel is null) - return; + return Task.CompletedTask; var items = context.SelectedItems; if (items is null || !items.Any() || items.Any(item => !item.IsFolder)) - return; + return Task.CompletedTask; foreach (var item in items) { - await FlattenFolderAsync(item.ItemPath); + FlattenFolderAsync(item.ItemPath); } + + return Task.CompletedTask; } - private async Task FlattenFolderAsync(string folderPath) + private Task FlattenFolderAsync(string folderPath) { - var containedFolders = await Task.Run(() => Directory.GetDirectories(folderPath)); - var containedFiles = await Task.Run(() => Directory.GetFiles(folderPath)); + var containedFolders = Directory.GetDirectories(folderPath); + var containedFiles = Directory.GetFiles(folderPath); foreach (var containedFolder in containedFolders) { - await FlattenFolderAsync(containedFolder); + FlattenFolderAsync(containedFolder); var folderName = Path.GetFileName(containedFolder); var destinationPath = Path.Combine(context.ShellPage?.ShellViewModel?.CurrentFolder?.ItemPath ?? string.Empty, folderName); @@ -99,6 +101,8 @@ private async Task FlattenFolderAsync(string folderPath) App.Logger.LogWarning(ex.Message, $"Failed to delete folder '{folderPath}'."); } } + + return Task.CompletedTask; } private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e) diff --git a/src/Files.App/Actions/FileSystem/FlattenSingleAction.cs b/src/Files.App/Actions/FileSystem/FlattenSingleAction.cs index dd714dfb0bc7..21e0f1f28d0f 100644 --- a/src/Files.App/Actions/FileSystem/FlattenSingleAction.cs +++ b/src/Files.App/Actions/FileSystem/FlattenSingleAction.cs @@ -29,22 +29,22 @@ public FlattenSingleAction() context.PropertyChanged += Context_PropertyChanged; } - public async Task ExecuteAsync(object? parameter = null) + public Task ExecuteAsync(object? parameter = null) { if (context.ShellPage?.ShellViewModel is null) - return; + return Task.CompletedTask; var items = context.SelectedItems; if (items is null || !items.Any() || items.Any(item => !item.IsFolder)) - return; + return Task.CompletedTask; foreach (var item in items) { var folderPath = item.ItemPath; - var containedFolders = await Task.Run(() => Directory.GetDirectories(folderPath)); - var containedFiles = await Task.Run(() => Directory.GetFiles(folderPath)); + var containedFolders = Directory.GetDirectories(folderPath); + var containedFiles = Directory.GetFiles(folderPath); foreach (var containedFolder in containedFolders) { @@ -94,6 +94,8 @@ public async Task ExecuteAsync(object? parameter = null) } } } + + return Task.CompletedTask; } private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e) From 19378285f410c6a9ed94989afe52834c6d264fd0 Mon Sep 17 00:00:00 2001 From: Devin Slothower <93222657+Devin-Slothower@users.noreply.github.com> Date: Mon, 12 Aug 2024 19:19:17 -0400 Subject: [PATCH 08/25] Code Review: Flatten option defaulted to false --- .../Services/Settings/GeneralSettingsService.cs | 12 ++++++------ src/Files.App/Strings/en-US/Resources.resw | 3 +++ .../ViewModels/Settings/GeneralViewModel.cs | 13 +++++++++++++ src/Files.App/Views/Settings/GeneralPage.xaml | 8 ++++++++ 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/Files.App/Services/Settings/GeneralSettingsService.cs b/src/Files.App/Services/Settings/GeneralSettingsService.cs index 0fd40db81125..dfe850dc337f 100644 --- a/src/Files.App/Services/Settings/GeneralSettingsService.cs +++ b/src/Files.App/Services/Settings/GeneralSettingsService.cs @@ -239,6 +239,12 @@ public bool ShowCompressionOptions set => Set(value); } + public bool ShowFlattenOptions + { + get => Get(false); + set => Set(value); + } + public bool ShowSendToMenu { get => Get(true); @@ -297,12 +303,6 @@ public bool ShowSystemTrayIcon set => Set(value); } - public bool ShowFlattenOptions - { - get => Get(true); - set => Set(value); - } - public FileNameConflictResolveOptionType ConflictsResolveOption { get => (FileNameConflictResolveOptionType)Get((long)FileNameConflictResolveOptionType.GenerateNewName); diff --git a/src/Files.App/Strings/en-US/Resources.resw b/src/Files.App/Strings/en-US/Resources.resw index 19bb94b44832..5a5dad0275b4 100644 --- a/src/Files.App/Strings/en-US/Resources.resw +++ b/src/Files.App/Strings/en-US/Resources.resw @@ -2039,6 +2039,9 @@ Flatten Recursive + + Show flatten options + Select files and folders when hovering over them diff --git a/src/Files.App/ViewModels/Settings/GeneralViewModel.cs b/src/Files.App/ViewModels/Settings/GeneralViewModel.cs index f82c9308d9ef..6959cbc31a3f 100644 --- a/src/Files.App/ViewModels/Settings/GeneralViewModel.cs +++ b/src/Files.App/ViewModels/Settings/GeneralViewModel.cs @@ -454,6 +454,19 @@ public bool ShowCompressionOptions } } + public bool ShowFlattenOptions + { + get => UserSettingsService.GeneralSettingsService.ShowFlattenOptions; + set + { + if (value == UserSettingsService.GeneralSettingsService.ShowFlattenOptions) + return; + + UserSettingsService.GeneralSettingsService.ShowFlattenOptions = value; + OnPropertyChanged(); + } + } + public bool ShowSendToMenu { get => UserSettingsService.GeneralSettingsService.ShowSendToMenu; diff --git a/src/Files.App/Views/Settings/GeneralPage.xaml b/src/Files.App/Views/Settings/GeneralPage.xaml index 5429ca806f76..bc80e79cad8e 100644 --- a/src/Files.App/Views/Settings/GeneralPage.xaml +++ b/src/Files.App/Views/Settings/GeneralPage.xaml @@ -325,6 +325,14 @@ Style="{StaticResource RightAlignedToggleSwitchStyle}" /> + + + + + Date: Tue, 13 Aug 2024 15:25:10 -0400 Subject: [PATCH 09/25] Code Review: Flyout Icon --- .../Data/Factories/ContentPageContextFlyoutFactory.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs b/src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs index 045ccb864be5..4b5b07070ccf 100644 --- a/src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs +++ b/src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs @@ -551,10 +551,7 @@ public static List GetBaseItemMenuItems( { Text = "Flatten".GetLocalizedResource(), ShowInSearchPage = true, - ThemedIconModel = new ThemedIconModel() - { - ThemedIconStyle = "App.ThemedIcons.Folder", - }, + ThemedIconModel = new() { ThemedIconStyle = "App.ThemedIcons.Folder" }, Items = [ new ContextMenuFlyoutItemViewModelBuilder(Commands.FlattenSingle).Build(), From f0e9fd2270240a3ea9980b4844789ee509ab9ea6 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon, 26 Aug 2024 10:43:22 -0400 Subject: [PATCH 10/25] Cleanup --- .../Actions/FileSystem/FlattenAction.cs | 56 +++++++++ .../Actions/FileSystem/FlattenSingleAction.cs | 107 ------------------ ...ursiveAction.cs => FlattenToRootAction.cs} | 16 +-- .../Data/Commands/Manager/CommandCodes.cs | 6 +- .../Data/Commands/Manager/CommandManager.cs | 8 +- .../Data/Commands/Manager/ICommandManager.cs | 4 +- .../ContentPageContextFlyoutFactory.cs | 4 +- src/Files.App/Strings/en-US/Resources.resw | 19 +++- .../ViewModels/Settings/AdvancedViewModel.cs | 14 +++ .../ViewModels/Settings/GeneralViewModel.cs | 25 ++-- .../Views/Settings/AdvancedPage.xaml | 14 +++ src/Files.App/Views/Settings/GeneralPage.xaml | 5 +- 12 files changed, 134 insertions(+), 144 deletions(-) create mode 100644 src/Files.App/Actions/FileSystem/FlattenAction.cs delete mode 100644 src/Files.App/Actions/FileSystem/FlattenSingleAction.cs rename src/Files.App/Actions/FileSystem/{FlattenRecursiveAction.cs => FlattenToRootAction.cs} (81%) diff --git a/src/Files.App/Actions/FileSystem/FlattenAction.cs b/src/Files.App/Actions/FileSystem/FlattenAction.cs new file mode 100644 index 000000000000..7b36c97f11e0 --- /dev/null +++ b/src/Files.App/Actions/FileSystem/FlattenAction.cs @@ -0,0 +1,56 @@ +// Copyright (c) 2024 Files Community +// Licensed under the MIT License. See the LICENSE. + +using Microsoft.UI.Xaml.Controls; +using Windows.Foundation.Metadata; +using Windows.Storage; + +namespace Files.App.Actions +{ + internal sealed class FlattenAction : ObservableObject, IAction + { + private readonly IContentPageContext context; + private readonly IGeneralSettingsService GeneralSettingsService = Ioc.Default.GetRequiredService(); + + public string Label + => "Flatten".GetLocalizedResource(); + + public string Description + => "FlattenDescription".GetLocalizedResource(); + + public bool IsExecutable => + GeneralSettingsService.ShowFlattenOptions && + context.ShellPage is not null && + context.HasSelection && + context.SelectedItem?.PrimaryItemAttribute is StorageItemTypes.Folder; + + public FlattenAction() + { + context = Ioc.Default.GetRequiredService(); + + context.PropertyChanged += Context_PropertyChanged; + } + + public Task ExecuteAsync(object? parameter = null) + { + var optionsDialog = new ContentDialog() + { + Title = "FlattenFolderDialogTitle".GetLocalizedResource(), + Content = "FlattenFolderDialogContent".GetLocalizedResource(), + PrimaryButtonText = "OK".GetLocalizedResource(), + DefaultButton = ContentDialogButton.Primary + }; + + if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8)) + optionsDialog.XamlRoot = MainWindow.Instance.Content.XamlRoot; + + return optionsDialog.TryShowAsync(); + } + + private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e) + { + if (e.PropertyName is nameof(IContentPageContext.HasSelection)) + OnPropertyChanged(nameof(IsExecutable)); + } + } +} diff --git a/src/Files.App/Actions/FileSystem/FlattenSingleAction.cs b/src/Files.App/Actions/FileSystem/FlattenSingleAction.cs deleted file mode 100644 index 21e0f1f28d0f..000000000000 --- a/src/Files.App/Actions/FileSystem/FlattenSingleAction.cs +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) 2024 Files Community -// Licensed under the MIT License. See the LICENSE. - -using System.IO; -using Windows.Storage; -using Microsoft.Extensions.Logging; - -namespace Files.App.Actions -{ - internal sealed class FlattenSingleAction : ObservableObject, IAction - { - private readonly IContentPageContext context; - - public string Label - => "FlattenSingle".GetLocalizedResource(); - - public string Description - => "FlattenDescription".GetLocalizedResource(); - - public bool IsExecutable => - context.ShellPage is not null && - context.HasSelection && - context.SelectedItem?.PrimaryItemAttribute is StorageItemTypes.Folder; - - public FlattenSingleAction() - { - context = Ioc.Default.GetRequiredService(); - - context.PropertyChanged += Context_PropertyChanged; - } - - public Task ExecuteAsync(object? parameter = null) - { - if (context.ShellPage?.ShellViewModel is null) - return Task.CompletedTask; - - var items = context.SelectedItems; - - if (items is null || !items.Any() || items.Any(item => !item.IsFolder)) - return Task.CompletedTask; - - foreach (var item in items) - { - var folderPath = item.ItemPath; - - var containedFolders = Directory.GetDirectories(folderPath); - var containedFiles = Directory.GetFiles(folderPath); - - foreach (var containedFolder in containedFolders) - { - var folderName = Path.GetFileName(containedFolder); - var destinationPath = Path.Combine(context.ShellPage?.ShellViewModel?.CurrentFolder?.ItemPath ?? string.Empty, folderName); - - if (Directory.Exists(destinationPath)) - continue; - - try - { - Directory.Move(containedFolder, destinationPath); - } - catch (Exception ex) - { - App.Logger.LogWarning(ex.Message, $"Folder '{folderName}' already exists in the destination folder."); - } - } - - foreach (var containedFile in containedFiles) - { - var fileName = Path.GetFileName(containedFile); - var destinationPath = Path.Combine(context.ShellPage?.ShellViewModel?.CurrentFolder?.ItemPath ?? string.Empty, fileName); - - if (File.Exists(destinationPath)) - continue; - - try - { - File.Move(containedFile, destinationPath); - } - catch (Exception ex) - { - App.Logger.LogWarning(ex.Message, $"Failed to move file '{fileName}'."); - } - } - - if (Directory.GetFiles(folderPath).Length == 0 && Directory.GetDirectories(folderPath).Length == 0) - { - try - { - Directory.Delete(folderPath); - } - catch (Exception ex) - { - App.Logger.LogWarning(ex.Message, $"Failed to delete folder '{folderPath}'."); - } - } - } - - return Task.CompletedTask; - } - - private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e) - { - if (e.PropertyName is nameof(IContentPageContext.HasSelection)) - OnPropertyChanged(nameof(IsExecutable)); - } - } -} diff --git a/src/Files.App/Actions/FileSystem/FlattenRecursiveAction.cs b/src/Files.App/Actions/FileSystem/FlattenToRootAction.cs similarity index 81% rename from src/Files.App/Actions/FileSystem/FlattenRecursiveAction.cs rename to src/Files.App/Actions/FileSystem/FlattenToRootAction.cs index ed9d4de710bf..4714bfaac076 100644 --- a/src/Files.App/Actions/FileSystem/FlattenRecursiveAction.cs +++ b/src/Files.App/Actions/FileSystem/FlattenToRootAction.cs @@ -1,28 +1,30 @@ // Copyright (c) 2024 Files Community // Licensed under the MIT License. See the LICENSE. +using Microsoft.Extensions.Logging; using System.IO; using Windows.Storage; -using Microsoft.Extensions.Logging; namespace Files.App.Actions { - internal sealed class FlattenRecursiveAction : ObservableObject, IAction + internal sealed class FlattenToRootAction : ObservableObject, IAction { private readonly IContentPageContext context; + private readonly IGeneralSettingsService GeneralSettingsService = Ioc.Default.GetRequiredService(); public string Label - => "FlattenRecursive".GetLocalizedResource(); + => "FlattenToRoot".GetLocalizedResource(); public string Description - => "FlattenDescription".GetLocalizedResource(); + => "FlattenToRootDescription".GetLocalizedResource(); public bool IsExecutable => + GeneralSettingsService.ShowFlattenOptions && context.ShellPage is not null && context.HasSelection && context.SelectedItem?.PrimaryItemAttribute is StorageItemTypes.Folder; - public FlattenRecursiveAction() + public FlattenToRootAction() { context = Ioc.Default.GetRequiredService(); @@ -57,7 +59,7 @@ private Task FlattenFolderAsync(string folderPath) FlattenFolderAsync(containedFolder); var folderName = Path.GetFileName(containedFolder); - var destinationPath = Path.Combine(context.ShellPage?.ShellViewModel?.CurrentFolder?.ItemPath ?? string.Empty, folderName); + var destinationPath = Path.Combine(context?.SelectedItem?.ItemPath ?? string.Empty, folderName); if (Directory.Exists(destinationPath)) continue; @@ -75,7 +77,7 @@ private Task FlattenFolderAsync(string folderPath) foreach (var containedFile in containedFiles) { var fileName = Path.GetFileName(containedFile); - var destinationPath = Path.Combine(context.ShellPage?.ShellViewModel?.CurrentFolder?.ItemPath ?? string.Empty, fileName); + var destinationPath = Path.Combine(context?.SelectedItem?.ItemPath ?? string.Empty, fileName); if (File.Exists(destinationPath)) continue; diff --git a/src/Files.App/Data/Commands/Manager/CommandCodes.cs b/src/Files.App/Data/Commands/Manager/CommandCodes.cs index 77f887281f0f..177ff50b5820 100644 --- a/src/Files.App/Data/Commands/Manager/CommandCodes.cs +++ b/src/Files.App/Data/Commands/Manager/CommandCodes.cs @@ -97,9 +97,9 @@ public enum CommandCodes DecompressArchiveHereSmart, DecompressArchiveToChildFolder, - // Folder - FlattenSingle, - FlattenRecursive, + // Folder + FlattenToRoot, + Flatten, // Image Manipulation RotateLeft, diff --git a/src/Files.App/Data/Commands/Manager/CommandManager.cs b/src/Files.App/Data/Commands/Manager/CommandManager.cs index a546134c327a..cfee84464da9 100644 --- a/src/Files.App/Data/Commands/Manager/CommandManager.cs +++ b/src/Files.App/Data/Commands/Manager/CommandManager.cs @@ -102,8 +102,8 @@ public IRichCommand this[HotKey hotKey] public IRichCommand DecompressArchiveHere => commands[CommandCodes.DecompressArchiveHere]; public IRichCommand DecompressArchiveHereSmart => commands[CommandCodes.DecompressArchiveHereSmart]; public IRichCommand DecompressArchiveToChildFolder => commands[CommandCodes.DecompressArchiveToChildFolder]; - public IRichCommand FlattenSingle => commands[CommandCodes.FlattenSingle]; - public IRichCommand FlattenRecursive => commands[CommandCodes.FlattenRecursive]; + public IRichCommand FlattenToRoot => commands[CommandCodes.FlattenToRoot]; + public IRichCommand Flatten => commands[CommandCodes.Flatten]; public IRichCommand RotateLeft => commands[CommandCodes.RotateLeft]; public IRichCommand RotateRight => commands[CommandCodes.RotateRight]; public IRichCommand OpenItem => commands[CommandCodes.OpenItem]; @@ -293,8 +293,8 @@ public IEnumerator GetEnumerator() => [CommandCodes.DecompressArchiveHere] = new DecompressArchiveHere(), [CommandCodes.DecompressArchiveHereSmart] = new DecompressArchiveHereSmart(), [CommandCodes.DecompressArchiveToChildFolder] = new DecompressArchiveToChildFolderAction(), - [CommandCodes.FlattenSingle] = new FlattenSingleAction(), - [CommandCodes.FlattenRecursive] = new FlattenRecursiveAction(), + [CommandCodes.FlattenToRoot] = new FlattenToRootAction(), + [CommandCodes.Flatten = new FlattenAction(), [CommandCodes.RotateLeft] = new RotateLeftAction(), [CommandCodes.RotateRight] = new RotateRightAction(), [CommandCodes.OpenItem] = new OpenItemAction(), diff --git a/src/Files.App/Data/Commands/Manager/ICommandManager.cs b/src/Files.App/Data/Commands/Manager/ICommandManager.cs index 844ab093fb5b..c31ef17a4e2a 100644 --- a/src/Files.App/Data/Commands/Manager/ICommandManager.cs +++ b/src/Files.App/Data/Commands/Manager/ICommandManager.cs @@ -89,8 +89,8 @@ public interface ICommandManager : IEnumerable IRichCommand DecompressArchiveHereSmart { get; } IRichCommand DecompressArchiveToChildFolder { get; } - IRichCommand FlattenSingle { get; } - IRichCommand FlattenRecursive { get; } + IRichCommand FlattenToRoot { get; } + IRichCommand Flatten { get; } IRichCommand RotateLeft { get; } IRichCommand RotateRight { get; } diff --git a/src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs b/src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs index 4b5b07070ccf..3e2e1dabe94c 100644 --- a/src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs +++ b/src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs @@ -554,8 +554,8 @@ public static List GetBaseItemMenuItems( ThemedIconModel = new() { ThemedIconStyle = "App.ThemedIcons.Folder" }, Items = [ - new ContextMenuFlyoutItemViewModelBuilder(Commands.FlattenSingle).Build(), - new ContextMenuFlyoutItemViewModelBuilder(Commands.FlattenRecursive).Build(), + new ContextMenuFlyoutItemViewModelBuilder(Commands.FlattenToRoot).Build(), + new ContextMenuFlyoutItemViewModelBuilder(Commands.Flatten).Build(), ], IsHidden = selectedItems.Count != 1 || !selectedItems.Any(item => item?.PrimaryItemAttribute is StorageItemTypes.Folder) || !itemsSelected, ShowItem = UserSettingsService.GeneralSettingsService.ShowFlattenOptions diff --git a/src/Files.App/Strings/en-US/Resources.resw b/src/Files.App/Strings/en-US/Resources.resw index 5a5dad0275b4..e7dd7cfafb44 100644 --- a/src/Files.App/Strings/en-US/Resources.resw +++ b/src/Files.App/Strings/en-US/Resources.resw @@ -1853,6 +1853,9 @@ This option modifies the system registry and can have unexpected side effects on your device. Continue at your own risk. + + The flatten operations are permanent and not recommended. Continue at your own risk. + Create Library @@ -2031,13 +2034,19 @@ Flatten - Flatten a folder contents into the current path. + Combine all files and sub files into a single folder + + + Flatten to root + + + Move all files and sub files into the selected folder - - Flatten Single + + Flatten folder - - Flatten Recursive + + No additional options are available yet. We're still working on this feature, so please check back later!. Show flatten options diff --git a/src/Files.App/ViewModels/Settings/AdvancedViewModel.cs b/src/Files.App/ViewModels/Settings/AdvancedViewModel.cs index 992f7922a732..2de96f76ca49 100644 --- a/src/Files.App/ViewModels/Settings/AdvancedViewModel.cs +++ b/src/Files.App/ViewModels/Settings/AdvancedViewModel.cs @@ -348,6 +348,20 @@ public bool ShowSystemTrayIcon } } + // TODO remove when feature is marked as stable + public bool ShowFlattenOptions + { + get => UserSettingsService.GeneralSettingsService.ShowFlattenOptions; + set + { + if (value == UserSettingsService.GeneralSettingsService.ShowFlattenOptions) + return; + + UserSettingsService.GeneralSettingsService.ShowFlattenOptions = value; + OnPropertyChanged(); + } + } + public async Task OpenFilesOnWindowsStartupAsync() { var stateMode = await ReadState(); diff --git a/src/Files.App/ViewModels/Settings/GeneralViewModel.cs b/src/Files.App/ViewModels/Settings/GeneralViewModel.cs index 6959cbc31a3f..6713d39dd31e 100644 --- a/src/Files.App/ViewModels/Settings/GeneralViewModel.cs +++ b/src/Files.App/ViewModels/Settings/GeneralViewModel.cs @@ -454,18 +454,19 @@ public bool ShowCompressionOptions } } - public bool ShowFlattenOptions - { - get => UserSettingsService.GeneralSettingsService.ShowFlattenOptions; - set - { - if (value == UserSettingsService.GeneralSettingsService.ShowFlattenOptions) - return; - - UserSettingsService.GeneralSettingsService.ShowFlattenOptions = value; - OnPropertyChanged(); - } - } + // TODO uncomment code when feature is marked as stable + //public bool ShowFlattenOptions + //{ + // get => UserSettingsService.GeneralSettingsService.ShowFlattenOptions; + // set + // { + // if (value == UserSettingsService.GeneralSettingsService.ShowFlattenOptions) + // return; + + // UserSettingsService.GeneralSettingsService.ShowFlattenOptions = value; + // OnPropertyChanged(); + // } + //} public bool ShowSendToMenu { diff --git a/src/Files.App/Views/Settings/AdvancedPage.xaml b/src/Files.App/Views/Settings/AdvancedPage.xaml index 93cb11854161..eebca148bf40 100644 --- a/src/Files.App/Views/Settings/AdvancedPage.xaml +++ b/src/Files.App/Views/Settings/AdvancedPage.xaml @@ -189,6 +189,20 @@ + + + + + + + + diff --git a/src/Files.App/Views/Settings/GeneralPage.xaml b/src/Files.App/Views/Settings/GeneralPage.xaml index bc80e79cad8e..466711cf696d 100644 --- a/src/Files.App/Views/Settings/GeneralPage.xaml +++ b/src/Files.App/Views/Settings/GeneralPage.xaml @@ -326,12 +326,13 @@ - + + From bf9b68ac54d6bfeaf46a769adfaceff40d19d4bc Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon, 26 Aug 2024 16:45:14 -0400 Subject: [PATCH 11/25] Update CommandManager.cs --- src/Files.App/Data/Commands/Manager/CommandManager.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Files.App/Data/Commands/Manager/CommandManager.cs b/src/Files.App/Data/Commands/Manager/CommandManager.cs index cfee84464da9..5f22beff4b53 100644 --- a/src/Files.App/Data/Commands/Manager/CommandManager.cs +++ b/src/Files.App/Data/Commands/Manager/CommandManager.cs @@ -1,10 +1,10 @@ // Copyright (c) 2024 Files Community // Licensed under the MIT License. See the LICENSE. -using System.Collections.Frozen; -using System.Collections.Immutable; using Files.App.Actions; using Microsoft.Extensions.Logging; +using System.Collections.Frozen; +using System.Collections.Immutable; namespace Files.App.Data.Commands { @@ -294,7 +294,7 @@ public IEnumerator GetEnumerator() => [CommandCodes.DecompressArchiveHereSmart] = new DecompressArchiveHereSmart(), [CommandCodes.DecompressArchiveToChildFolder] = new DecompressArchiveToChildFolderAction(), [CommandCodes.FlattenToRoot] = new FlattenToRootAction(), - [CommandCodes.Flatten = new FlattenAction(), + [CommandCodes.Flatten] = new FlattenAction(), [CommandCodes.RotateLeft] = new RotateLeftAction(), [CommandCodes.RotateRight] = new RotateRightAction(), [CommandCodes.OpenItem] = new OpenItemAction(), From 4cf6ce594c5816a7fe8cd5fed5525a0d32f49424 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon, 26 Aug 2024 16:45:49 -0400 Subject: [PATCH 12/25] Update Resources.resw --- src/Files.App/Strings/en-US/Resources.resw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Files.App/Strings/en-US/Resources.resw b/src/Files.App/Strings/en-US/Resources.resw index e7dd7cfafb44..d2a3b8626c91 100644 --- a/src/Files.App/Strings/en-US/Resources.resw +++ b/src/Files.App/Strings/en-US/Resources.resw @@ -2046,7 +2046,7 @@ Flatten folder - No additional options are available yet. We're still working on this feature, so please check back later!. + Additional options are not yet available. We're still working on this feature, so please check back later!. Show flatten options From 87ec819f94c85488855bfc1490a4876bfe96cff1 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon, 26 Aug 2024 16:46:56 -0400 Subject: [PATCH 13/25] Update CommandCodes.cs --- src/Files.App/Data/Commands/Manager/CommandCodes.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Files.App/Data/Commands/Manager/CommandCodes.cs b/src/Files.App/Data/Commands/Manager/CommandCodes.cs index 177ff50b5820..3452f05f314e 100644 --- a/src/Files.App/Data/Commands/Manager/CommandCodes.cs +++ b/src/Files.App/Data/Commands/Manager/CommandCodes.cs @@ -97,7 +97,7 @@ public enum CommandCodes DecompressArchiveHereSmart, DecompressArchiveToChildFolder, - // Folder + // Folders FlattenToRoot, Flatten, From 108bf2740b2ca1acc99938e216234cf2362feacf Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon, 26 Aug 2024 16:49:42 -0400 Subject: [PATCH 14/25] Rename --- .../{FlattenAction.cs => FlattenFolderAction.cs} | 8 ++++---- src/Files.App/Data/Commands/Manager/CommandCodes.cs | 2 +- src/Files.App/Data/Commands/Manager/CommandManager.cs | 4 ++-- src/Files.App/Data/Commands/Manager/ICommandManager.cs | 2 +- .../Data/Factories/ContentPageContextFlyoutFactory.cs | 2 +- src/Files.App/Strings/en-US/Resources.resw | 5 ++++- 6 files changed, 13 insertions(+), 10 deletions(-) rename src/Files.App/Actions/FileSystem/{FlattenAction.cs => FlattenFolderAction.cs} (88%) diff --git a/src/Files.App/Actions/FileSystem/FlattenAction.cs b/src/Files.App/Actions/FileSystem/FlattenFolderAction.cs similarity index 88% rename from src/Files.App/Actions/FileSystem/FlattenAction.cs rename to src/Files.App/Actions/FileSystem/FlattenFolderAction.cs index 7b36c97f11e0..4c3136497ffc 100644 --- a/src/Files.App/Actions/FileSystem/FlattenAction.cs +++ b/src/Files.App/Actions/FileSystem/FlattenFolderAction.cs @@ -7,16 +7,16 @@ namespace Files.App.Actions { - internal sealed class FlattenAction : ObservableObject, IAction + internal sealed class FlattenFolderAction : ObservableObject, IAction { private readonly IContentPageContext context; private readonly IGeneralSettingsService GeneralSettingsService = Ioc.Default.GetRequiredService(); public string Label - => "Flatten".GetLocalizedResource(); + => "FlattenFolder".GetLocalizedResource(); public string Description - => "FlattenDescription".GetLocalizedResource(); + => "FlattenFolderDescription".GetLocalizedResource(); public bool IsExecutable => GeneralSettingsService.ShowFlattenOptions && @@ -24,7 +24,7 @@ context.ShellPage is not null && context.HasSelection && context.SelectedItem?.PrimaryItemAttribute is StorageItemTypes.Folder; - public FlattenAction() + public FlattenFolderAction() { context = Ioc.Default.GetRequiredService(); diff --git a/src/Files.App/Data/Commands/Manager/CommandCodes.cs b/src/Files.App/Data/Commands/Manager/CommandCodes.cs index 3452f05f314e..59de73990705 100644 --- a/src/Files.App/Data/Commands/Manager/CommandCodes.cs +++ b/src/Files.App/Data/Commands/Manager/CommandCodes.cs @@ -99,7 +99,7 @@ public enum CommandCodes // Folders FlattenToRoot, - Flatten, + FlattenFolder, // Image Manipulation RotateLeft, diff --git a/src/Files.App/Data/Commands/Manager/CommandManager.cs b/src/Files.App/Data/Commands/Manager/CommandManager.cs index 5f22beff4b53..be4d5901962f 100644 --- a/src/Files.App/Data/Commands/Manager/CommandManager.cs +++ b/src/Files.App/Data/Commands/Manager/CommandManager.cs @@ -103,7 +103,7 @@ public IRichCommand this[HotKey hotKey] public IRichCommand DecompressArchiveHereSmart => commands[CommandCodes.DecompressArchiveHereSmart]; public IRichCommand DecompressArchiveToChildFolder => commands[CommandCodes.DecompressArchiveToChildFolder]; public IRichCommand FlattenToRoot => commands[CommandCodes.FlattenToRoot]; - public IRichCommand Flatten => commands[CommandCodes.Flatten]; + public IRichCommand FlattenFolder => commands[CommandCodes.FlattenFolder]; public IRichCommand RotateLeft => commands[CommandCodes.RotateLeft]; public IRichCommand RotateRight => commands[CommandCodes.RotateRight]; public IRichCommand OpenItem => commands[CommandCodes.OpenItem]; @@ -294,7 +294,7 @@ public IEnumerator GetEnumerator() => [CommandCodes.DecompressArchiveHereSmart] = new DecompressArchiveHereSmart(), [CommandCodes.DecompressArchiveToChildFolder] = new DecompressArchiveToChildFolderAction(), [CommandCodes.FlattenToRoot] = new FlattenToRootAction(), - [CommandCodes.Flatten] = new FlattenAction(), + [CommandCodes.FlattenFolder] = new FlattenFolderAction(), [CommandCodes.RotateLeft] = new RotateLeftAction(), [CommandCodes.RotateRight] = new RotateRightAction(), [CommandCodes.OpenItem] = new OpenItemAction(), diff --git a/src/Files.App/Data/Commands/Manager/ICommandManager.cs b/src/Files.App/Data/Commands/Manager/ICommandManager.cs index c31ef17a4e2a..1664bb7115a0 100644 --- a/src/Files.App/Data/Commands/Manager/ICommandManager.cs +++ b/src/Files.App/Data/Commands/Manager/ICommandManager.cs @@ -90,7 +90,7 @@ public interface ICommandManager : IEnumerable IRichCommand DecompressArchiveToChildFolder { get; } IRichCommand FlattenToRoot { get; } - IRichCommand Flatten { get; } + IRichCommand FlattenFolder { get; } IRichCommand RotateLeft { get; } IRichCommand RotateRight { get; } diff --git a/src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs b/src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs index 3e2e1dabe94c..1d4f23f6ca1b 100644 --- a/src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs +++ b/src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs @@ -555,7 +555,7 @@ public static List GetBaseItemMenuItems( Items = [ new ContextMenuFlyoutItemViewModelBuilder(Commands.FlattenToRoot).Build(), - new ContextMenuFlyoutItemViewModelBuilder(Commands.Flatten).Build(), + new ContextMenuFlyoutItemViewModelBuilder(Commands.FlattenFolder).Build(), ], IsHidden = selectedItems.Count != 1 || !selectedItems.Any(item => item?.PrimaryItemAttribute is StorageItemTypes.Folder) || !itemsSelected, ShowItem = UserSettingsService.GeneralSettingsService.ShowFlattenOptions diff --git a/src/Files.App/Strings/en-US/Resources.resw b/src/Files.App/Strings/en-US/Resources.resw index d2a3b8626c91..38310486d00e 100644 --- a/src/Files.App/Strings/en-US/Resources.resw +++ b/src/Files.App/Strings/en-US/Resources.resw @@ -2033,7 +2033,10 @@ Flatten - + + Flatten folder + + Combine all files and sub files into a single folder From a63a797fc6ade9cb426861b8cc77430c2b9b98d3 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon, 26 Aug 2024 16:50:45 -0400 Subject: [PATCH 15/25] Update Resources.resw --- src/Files.App/Strings/en-US/Resources.resw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Files.App/Strings/en-US/Resources.resw b/src/Files.App/Strings/en-US/Resources.resw index 38310486d00e..559f7cb03e32 100644 --- a/src/Files.App/Strings/en-US/Resources.resw +++ b/src/Files.App/Strings/en-US/Resources.resw @@ -2049,7 +2049,7 @@ Flatten folder - Additional options are not yet available. We're still working on this feature, so please check back later!. + Additional options are not yet available. We're still working on this feature, so please check back later! Show flatten options From f6d5b54932178763fa519b86463929c6c9d17707 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon, 26 Aug 2024 17:08:10 -0400 Subject: [PATCH 16/25] Update src/Files.App/Actions/FileSystem/FlattenToRootAction.cs Co-authored-by: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> --- src/Files.App/Actions/FileSystem/FlattenToRootAction.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Files.App/Actions/FileSystem/FlattenToRootAction.cs b/src/Files.App/Actions/FileSystem/FlattenToRootAction.cs index 4714bfaac076..5226447bdce0 100644 --- a/src/Files.App/Actions/FileSystem/FlattenToRootAction.cs +++ b/src/Files.App/Actions/FileSystem/FlattenToRootAction.cs @@ -42,9 +42,7 @@ public Task ExecuteAsync(object? parameter = null) return Task.CompletedTask; foreach (var item in items) - { FlattenFolderAsync(item.ItemPath); - } return Task.CompletedTask; } From 76b73a24f21dcb5711be8ce5ec1a8ef73ea07e1e Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon, 26 Aug 2024 20:05:24 -0400 Subject: [PATCH 17/25] Update IsExecutable --- .../Actions/FileSystem/FlattenFolderAction.cs | 14 +++++++++++++- .../Actions/FileSystem/FlattenToRootAction.cs | 14 +++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/Files.App/Actions/FileSystem/FlattenFolderAction.cs b/src/Files.App/Actions/FileSystem/FlattenFolderAction.cs index 4c3136497ffc..3b70a679d1ee 100644 --- a/src/Files.App/Actions/FileSystem/FlattenFolderAction.cs +++ b/src/Files.App/Actions/FileSystem/FlattenFolderAction.cs @@ -29,6 +29,7 @@ public FlattenFolderAction() context = Ioc.Default.GetRequiredService(); context.PropertyChanged += Context_PropertyChanged; + GeneralSettingsService.PropertyChanged += GeneralSettingsService_PropertyChanged; } public Task ExecuteAsync(object? parameter = null) @@ -49,7 +50,18 @@ public Task ExecuteAsync(object? parameter = null) private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e) { - if (e.PropertyName is nameof(IContentPageContext.HasSelection)) + switch (e.PropertyName) + { + case nameof(IContentPageContext.HasSelection): + case nameof(IContentPageContext.SelectedItem): + OnPropertyChanged(nameof(IsExecutable)); + break; + } + } + + private void GeneralSettingsService_PropertyChanged(object? sender, PropertyChangedEventArgs e) + { + if (e.PropertyName is nameof(IGeneralSettingsService.ShowFlattenOptions)) OnPropertyChanged(nameof(IsExecutable)); } } diff --git a/src/Files.App/Actions/FileSystem/FlattenToRootAction.cs b/src/Files.App/Actions/FileSystem/FlattenToRootAction.cs index 5226447bdce0..648e78f68aaa 100644 --- a/src/Files.App/Actions/FileSystem/FlattenToRootAction.cs +++ b/src/Files.App/Actions/FileSystem/FlattenToRootAction.cs @@ -29,6 +29,7 @@ public FlattenToRootAction() context = Ioc.Default.GetRequiredService(); context.PropertyChanged += Context_PropertyChanged; + GeneralSettingsService.PropertyChanged += GeneralSettingsService_PropertyChanged; } public Task ExecuteAsync(object? parameter = null) @@ -107,7 +108,18 @@ private Task FlattenFolderAsync(string folderPath) private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e) { - if (e.PropertyName is nameof(IContentPageContext.HasSelection)) + switch (e.PropertyName) + { + case nameof(IContentPageContext.HasSelection): + case nameof(IContentPageContext.SelectedItem): + OnPropertyChanged(nameof(IsExecutable)); + break; + } + } + + private void GeneralSettingsService_PropertyChanged(object? sender, PropertyChangedEventArgs e) + { + if (e.PropertyName is nameof(IGeneralSettingsService.ShowFlattenOptions)) OnPropertyChanged(nameof(IsExecutable)); } } From 136dfa867eeefec5ad70ba2afabb2e56c3b9d04f Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon, 26 Aug 2024 21:13:19 -0400 Subject: [PATCH 18/25] Merge actions --- .../Actions/FileSystem/FlattenFolderAction.cs | 68 ------------------- .../Actions/FileSystem/FlattenToRootAction.cs | 34 +++++++--- .../Data/Commands/Manager/CommandCodes.cs | 1 - .../Data/Commands/Manager/CommandManager.cs | 2 - .../Data/Commands/Manager/ICommandManager.cs | 1 - .../ContentPageContextFlyoutFactory.cs | 16 +---- src/Files.App/Strings/en-US/Resources.resw | 6 -- 7 files changed, 26 insertions(+), 102 deletions(-) delete mode 100644 src/Files.App/Actions/FileSystem/FlattenFolderAction.cs diff --git a/src/Files.App/Actions/FileSystem/FlattenFolderAction.cs b/src/Files.App/Actions/FileSystem/FlattenFolderAction.cs deleted file mode 100644 index 3b70a679d1ee..000000000000 --- a/src/Files.App/Actions/FileSystem/FlattenFolderAction.cs +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) 2024 Files Community -// Licensed under the MIT License. See the LICENSE. - -using Microsoft.UI.Xaml.Controls; -using Windows.Foundation.Metadata; -using Windows.Storage; - -namespace Files.App.Actions -{ - internal sealed class FlattenFolderAction : ObservableObject, IAction - { - private readonly IContentPageContext context; - private readonly IGeneralSettingsService GeneralSettingsService = Ioc.Default.GetRequiredService(); - - public string Label - => "FlattenFolder".GetLocalizedResource(); - - public string Description - => "FlattenFolderDescription".GetLocalizedResource(); - - public bool IsExecutable => - GeneralSettingsService.ShowFlattenOptions && - context.ShellPage is not null && - context.HasSelection && - context.SelectedItem?.PrimaryItemAttribute is StorageItemTypes.Folder; - - public FlattenFolderAction() - { - context = Ioc.Default.GetRequiredService(); - - context.PropertyChanged += Context_PropertyChanged; - GeneralSettingsService.PropertyChanged += GeneralSettingsService_PropertyChanged; - } - - public Task ExecuteAsync(object? parameter = null) - { - var optionsDialog = new ContentDialog() - { - Title = "FlattenFolderDialogTitle".GetLocalizedResource(), - Content = "FlattenFolderDialogContent".GetLocalizedResource(), - PrimaryButtonText = "OK".GetLocalizedResource(), - DefaultButton = ContentDialogButton.Primary - }; - - if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8)) - optionsDialog.XamlRoot = MainWindow.Instance.Content.XamlRoot; - - return optionsDialog.TryShowAsync(); - } - - private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e) - { - switch (e.PropertyName) - { - case nameof(IContentPageContext.HasSelection): - case nameof(IContentPageContext.SelectedItem): - OnPropertyChanged(nameof(IsExecutable)); - break; - } - } - - private void GeneralSettingsService_PropertyChanged(object? sender, PropertyChangedEventArgs e) - { - if (e.PropertyName is nameof(IGeneralSettingsService.ShowFlattenOptions)) - OnPropertyChanged(nameof(IsExecutable)); - } - } -} diff --git a/src/Files.App/Actions/FileSystem/FlattenToRootAction.cs b/src/Files.App/Actions/FileSystem/FlattenToRootAction.cs index 648e78f68aaa..4c6caae1daba 100644 --- a/src/Files.App/Actions/FileSystem/FlattenToRootAction.cs +++ b/src/Files.App/Actions/FileSystem/FlattenToRootAction.cs @@ -4,6 +4,9 @@ using Microsoft.Extensions.Logging; using System.IO; using Windows.Storage; +using Microsoft.UI.Xaml.Controls; +using Windows.Foundation.Metadata; +using Files.Shared.Helpers; namespace Files.App.Actions { @@ -18,11 +21,14 @@ public string Label public string Description => "FlattenToRootDescription".GetLocalizedResource(); + public RichGlyph Glyph + => new(themedIconStyle: "App.ThemedIcons.Folder"); + public bool IsExecutable => GeneralSettingsService.ShowFlattenOptions && context.ShellPage is not null && context.HasSelection && - context.SelectedItem?.PrimaryItemAttribute is StorageItemTypes.Folder; + context.SelectedItems.All(x => x.PrimaryItemAttribute == StorageItemTypes.Folder); public FlattenToRootAction() { @@ -32,20 +38,28 @@ public FlattenToRootAction() GeneralSettingsService.PropertyChanged += GeneralSettingsService_PropertyChanged; } - public Task ExecuteAsync(object? parameter = null) + public async Task ExecuteAsync(object? parameter = null) { - if (context.ShellPage?.ShellViewModel is null) - return Task.CompletedTask; + if (context.SelectedItems is null) + return; - var items = context.SelectedItems; + var optionsDialog = new ContentDialog() + { + Title = "FlattenFolderDialogTitle".GetLocalizedResource(), + Content = "FlattenFolderDialogContent".GetLocalizedResource(), + PrimaryButtonText = "Flatten".GetLocalizedResource(), + SecondaryButtonText = "Cancel".GetLocalizedResource(), + DefaultButton = ContentDialogButton.Primary + }; - if (items is null || !items.Any() || items.Any(item => !item.IsFolder)) - return Task.CompletedTask; + if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8)) + optionsDialog.XamlRoot = MainWindow.Instance.Content.XamlRoot; - foreach (var item in items) - FlattenFolderAsync(item.ItemPath); + var result = await optionsDialog.TryShowAsync(); + if (result != ContentDialogResult.Primary) + return; - return Task.CompletedTask; + await Task.WhenAll(context.SelectedItems.Select(item => FlattenFolderAsync(item.ItemPath))); } private Task FlattenFolderAsync(string folderPath) diff --git a/src/Files.App/Data/Commands/Manager/CommandCodes.cs b/src/Files.App/Data/Commands/Manager/CommandCodes.cs index 59de73990705..385fa040068d 100644 --- a/src/Files.App/Data/Commands/Manager/CommandCodes.cs +++ b/src/Files.App/Data/Commands/Manager/CommandCodes.cs @@ -99,7 +99,6 @@ public enum CommandCodes // Folders FlattenToRoot, - FlattenFolder, // Image Manipulation RotateLeft, diff --git a/src/Files.App/Data/Commands/Manager/CommandManager.cs b/src/Files.App/Data/Commands/Manager/CommandManager.cs index be4d5901962f..02cb9786de0e 100644 --- a/src/Files.App/Data/Commands/Manager/CommandManager.cs +++ b/src/Files.App/Data/Commands/Manager/CommandManager.cs @@ -103,7 +103,6 @@ public IRichCommand this[HotKey hotKey] public IRichCommand DecompressArchiveHereSmart => commands[CommandCodes.DecompressArchiveHereSmart]; public IRichCommand DecompressArchiveToChildFolder => commands[CommandCodes.DecompressArchiveToChildFolder]; public IRichCommand FlattenToRoot => commands[CommandCodes.FlattenToRoot]; - public IRichCommand FlattenFolder => commands[CommandCodes.FlattenFolder]; public IRichCommand RotateLeft => commands[CommandCodes.RotateLeft]; public IRichCommand RotateRight => commands[CommandCodes.RotateRight]; public IRichCommand OpenItem => commands[CommandCodes.OpenItem]; @@ -294,7 +293,6 @@ public IEnumerator GetEnumerator() => [CommandCodes.DecompressArchiveHereSmart] = new DecompressArchiveHereSmart(), [CommandCodes.DecompressArchiveToChildFolder] = new DecompressArchiveToChildFolderAction(), [CommandCodes.FlattenToRoot] = new FlattenToRootAction(), - [CommandCodes.FlattenFolder] = new FlattenFolderAction(), [CommandCodes.RotateLeft] = new RotateLeftAction(), [CommandCodes.RotateRight] = new RotateRightAction(), [CommandCodes.OpenItem] = new OpenItemAction(), diff --git a/src/Files.App/Data/Commands/Manager/ICommandManager.cs b/src/Files.App/Data/Commands/Manager/ICommandManager.cs index 1664bb7115a0..4973e94615a2 100644 --- a/src/Files.App/Data/Commands/Manager/ICommandManager.cs +++ b/src/Files.App/Data/Commands/Manager/ICommandManager.cs @@ -90,7 +90,6 @@ public interface ICommandManager : IEnumerable IRichCommand DecompressArchiveToChildFolder { get; } IRichCommand FlattenToRoot { get; } - IRichCommand FlattenFolder { get; } IRichCommand RotateLeft { get; } IRichCommand RotateRight { get; } diff --git a/src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs b/src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs index 1d4f23f6ca1b..44ca8fc02241 100644 --- a/src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs +++ b/src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs @@ -547,19 +547,7 @@ public static List GetBaseItemMenuItems( ], ShowItem = UserSettingsService.GeneralSettingsService.ShowCompressionOptions && StorageArchiveService.CanDecompress(selectedItems) }, - new ContextMenuFlyoutItemViewModel() - { - Text = "Flatten".GetLocalizedResource(), - ShowInSearchPage = true, - ThemedIconModel = new() { ThemedIconStyle = "App.ThemedIcons.Folder" }, - Items = - [ - new ContextMenuFlyoutItemViewModelBuilder(Commands.FlattenToRoot).Build(), - new ContextMenuFlyoutItemViewModelBuilder(Commands.FlattenFolder).Build(), - ], - IsHidden = selectedItems.Count != 1 || !selectedItems.Any(item => item?.PrimaryItemAttribute is StorageItemTypes.Folder) || !itemsSelected, - ShowItem = UserSettingsService.GeneralSettingsService.ShowFlattenOptions - }, + new ContextMenuFlyoutItemViewModelBuilder(Commands.FlattenToRoot).Build(), new ContextMenuFlyoutItemViewModel() { Text = "SendTo".GetLocalizedResource(), @@ -600,7 +588,7 @@ public static List GetBaseItemMenuItems( ShowItem = isDriveRoot, IsEnabled = false }, - new ContextMenuFlyoutItemViewModelBuilder(Commands.EditInNotepad).Build(), + new ContextMenuFlyoutItemViewModelBuilder(Commands.EditInNotepad).Build(), new ContextMenuFlyoutItemViewModel() { ItemType = ContextMenuFlyoutItemType.Separator, diff --git a/src/Files.App/Strings/en-US/Resources.resw b/src/Files.App/Strings/en-US/Resources.resw index 559f7cb03e32..00966952fad3 100644 --- a/src/Files.App/Strings/en-US/Resources.resw +++ b/src/Files.App/Strings/en-US/Resources.resw @@ -2033,12 +2033,6 @@ Flatten - - Flatten folder - - - Combine all files and sub files into a single folder - Flatten to root From 182b1b4f80abf05cd2db3a4ebb54418036779b61 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon, 26 Aug 2024 21:15:57 -0400 Subject: [PATCH 19/25] Update FlattenToRootAction.cs --- .../Actions/FileSystem/FlattenToRootAction.cs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Files.App/Actions/FileSystem/FlattenToRootAction.cs b/src/Files.App/Actions/FileSystem/FlattenToRootAction.cs index 4c6caae1daba..1fde9549fd32 100644 --- a/src/Files.App/Actions/FileSystem/FlattenToRootAction.cs +++ b/src/Files.App/Actions/FileSystem/FlattenToRootAction.cs @@ -59,17 +59,18 @@ public async Task ExecuteAsync(object? parameter = null) if (result != ContentDialogResult.Primary) return; - await Task.WhenAll(context.SelectedItems.Select(item => FlattenFolderAsync(item.ItemPath))); + foreach (var item in context.SelectedItems) + FlattenFolder(item.ItemPath); } - private Task FlattenFolderAsync(string folderPath) + private void FlattenFolder(string path) { - var containedFolders = Directory.GetDirectories(folderPath); - var containedFiles = Directory.GetFiles(folderPath); + var containedFolders = Directory.GetDirectories(path); + var containedFiles = Directory.GetFiles(path); foreach (var containedFolder in containedFolders) { - FlattenFolderAsync(containedFolder); + FlattenFolder(containedFolder); var folderName = Path.GetFileName(containedFolder); var destinationPath = Path.Combine(context?.SelectedItem?.ItemPath ?? string.Empty, folderName); @@ -105,19 +106,17 @@ private Task FlattenFolderAsync(string folderPath) } } - if (Directory.GetFiles(folderPath).Length == 0 && Directory.GetDirectories(folderPath).Length == 0) + if (Directory.GetFiles(path).Length == 0 && Directory.GetDirectories(path).Length == 0) { try { - Directory.Delete(folderPath); + Directory.Delete(path); } catch (Exception ex) { - App.Logger.LogWarning(ex.Message, $"Failed to delete folder '{folderPath}'."); + App.Logger.LogWarning(ex.Message, $"Failed to delete folder '{path}'."); } } - - return Task.CompletedTask; } private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e) From 8598d64c94852274642459953406e43c9d3a3b91 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon, 26 Aug 2024 21:21:14 -0400 Subject: [PATCH 20/25] Update Resources.resw --- src/Files.App/Strings/en-US/Resources.resw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Files.App/Strings/en-US/Resources.resw b/src/Files.App/Strings/en-US/Resources.resw index 00966952fad3..f59c1fd929a1 100644 --- a/src/Files.App/Strings/en-US/Resources.resw +++ b/src/Files.App/Strings/en-US/Resources.resw @@ -2043,7 +2043,7 @@ Flatten folder - Additional options are not yet available. We're still working on this feature, so please check back later! + Flattening a folder will move all contents from its subfolders to the selected location. This operation is permanent and cannot be undone. By using this experimental feature, you acknowledge the risk and agree not to hold the Files team responsible for any data loss. Show flatten options From 9c35da24f3d40499108550bc086d898dbc0bf945 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon, 26 Aug 2024 21:24:16 -0400 Subject: [PATCH 21/25] Update FlattenToRootAction.cs --- src/Files.App/Actions/FileSystem/FlattenToRootAction.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Files.App/Actions/FileSystem/FlattenToRootAction.cs b/src/Files.App/Actions/FileSystem/FlattenToRootAction.cs index 1fde9549fd32..4b9d17126ea4 100644 --- a/src/Files.App/Actions/FileSystem/FlattenToRootAction.cs +++ b/src/Files.App/Actions/FileSystem/FlattenToRootAction.cs @@ -28,7 +28,9 @@ public RichGlyph Glyph GeneralSettingsService.ShowFlattenOptions && context.ShellPage is not null && context.HasSelection && - context.SelectedItems.All(x => x.PrimaryItemAttribute == StorageItemTypes.Folder); + context.SelectedItems.Count is 1 && + context.SelectedItem is not null && + context.SelectedItem.PrimaryItemAttribute is StorageItemTypes.Folder; public FlattenToRootAction() { @@ -40,7 +42,7 @@ public FlattenToRootAction() public async Task ExecuteAsync(object? parameter = null) { - if (context.SelectedItems is null) + if (context.SelectedItem is null) return; var optionsDialog = new ContentDialog() @@ -59,8 +61,7 @@ public async Task ExecuteAsync(object? parameter = null) if (result != ContentDialogResult.Primary) return; - foreach (var item in context.SelectedItems) - FlattenFolder(item.ItemPath); + FlattenFolder(context.SelectedItem.ItemPath); } private void FlattenFolder(string path) From 819473dde3d2ef01983794b1eaedbb65ed8b839b Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon, 26 Aug 2024 21:28:18 -0400 Subject: [PATCH 22/25] Update Resources.resw --- src/Files.App/Strings/en-US/Resources.resw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Files.App/Strings/en-US/Resources.resw b/src/Files.App/Strings/en-US/Resources.resw index f59c1fd929a1..88223635bcf3 100644 --- a/src/Files.App/Strings/en-US/Resources.resw +++ b/src/Files.App/Strings/en-US/Resources.resw @@ -2037,7 +2037,7 @@ Flatten to root - Move all files and sub files into the selected folder + Move all contents from subfolders into the selected location Flatten folder From e0d7ec643a7dc9ab1d0626581146a89a477d3c3e Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon, 26 Aug 2024 21:33:19 -0400 Subject: [PATCH 23/25] Strings --- .../{FlattenToRootAction.cs => FlattenFolderAction.cs} | 10 +++++----- src/Files.App/Data/Commands/Manager/CommandCodes.cs | 2 +- src/Files.App/Data/Commands/Manager/CommandManager.cs | 4 ++-- src/Files.App/Data/Commands/Manager/ICommandManager.cs | 2 +- .../Data/Factories/ContentPageContextFlyoutFactory.cs | 2 +- src/Files.App/Strings/en-US/Resources.resw | 10 ++-------- 6 files changed, 12 insertions(+), 18 deletions(-) rename src/Files.App/Actions/FileSystem/{FlattenToRootAction.cs => FlattenFolderAction.cs} (93%) diff --git a/src/Files.App/Actions/FileSystem/FlattenToRootAction.cs b/src/Files.App/Actions/FileSystem/FlattenFolderAction.cs similarity index 93% rename from src/Files.App/Actions/FileSystem/FlattenToRootAction.cs rename to src/Files.App/Actions/FileSystem/FlattenFolderAction.cs index 4b9d17126ea4..418bbd23f897 100644 --- a/src/Files.App/Actions/FileSystem/FlattenToRootAction.cs +++ b/src/Files.App/Actions/FileSystem/FlattenFolderAction.cs @@ -10,16 +10,16 @@ namespace Files.App.Actions { - internal sealed class FlattenToRootAction : ObservableObject, IAction + internal sealed class FlattenFolderAction : ObservableObject, IAction { private readonly IContentPageContext context; private readonly IGeneralSettingsService GeneralSettingsService = Ioc.Default.GetRequiredService(); public string Label - => "FlattenToRoot".GetLocalizedResource(); + => "FlattenFolder".GetLocalizedResource(); public string Description - => "FlattenToRootDescription".GetLocalizedResource(); + => "FlattenFolderDescription".GetLocalizedResource(); public RichGlyph Glyph => new(themedIconStyle: "App.ThemedIcons.Folder"); @@ -32,7 +32,7 @@ context.SelectedItems.Count is 1 && context.SelectedItem is not null && context.SelectedItem.PrimaryItemAttribute is StorageItemTypes.Folder; - public FlattenToRootAction() + public FlattenFolderAction() { context = Ioc.Default.GetRequiredService(); @@ -47,7 +47,7 @@ public async Task ExecuteAsync(object? parameter = null) var optionsDialog = new ContentDialog() { - Title = "FlattenFolderDialogTitle".GetLocalizedResource(), + Title = "FlattenFolder".GetLocalizedResource(), Content = "FlattenFolderDialogContent".GetLocalizedResource(), PrimaryButtonText = "Flatten".GetLocalizedResource(), SecondaryButtonText = "Cancel".GetLocalizedResource(), diff --git a/src/Files.App/Data/Commands/Manager/CommandCodes.cs b/src/Files.App/Data/Commands/Manager/CommandCodes.cs index 385fa040068d..c8f2e691ab79 100644 --- a/src/Files.App/Data/Commands/Manager/CommandCodes.cs +++ b/src/Files.App/Data/Commands/Manager/CommandCodes.cs @@ -98,7 +98,7 @@ public enum CommandCodes DecompressArchiveToChildFolder, // Folders - FlattenToRoot, + FlattenFolder, // Image Manipulation RotateLeft, diff --git a/src/Files.App/Data/Commands/Manager/CommandManager.cs b/src/Files.App/Data/Commands/Manager/CommandManager.cs index 02cb9786de0e..368034d80b38 100644 --- a/src/Files.App/Data/Commands/Manager/CommandManager.cs +++ b/src/Files.App/Data/Commands/Manager/CommandManager.cs @@ -102,7 +102,7 @@ public IRichCommand this[HotKey hotKey] public IRichCommand DecompressArchiveHere => commands[CommandCodes.DecompressArchiveHere]; public IRichCommand DecompressArchiveHereSmart => commands[CommandCodes.DecompressArchiveHereSmart]; public IRichCommand DecompressArchiveToChildFolder => commands[CommandCodes.DecompressArchiveToChildFolder]; - public IRichCommand FlattenToRoot => commands[CommandCodes.FlattenToRoot]; + public IRichCommand FlattenFolder => commands[CommandCodes.FlattenFolder]; public IRichCommand RotateLeft => commands[CommandCodes.RotateLeft]; public IRichCommand RotateRight => commands[CommandCodes.RotateRight]; public IRichCommand OpenItem => commands[CommandCodes.OpenItem]; @@ -292,7 +292,7 @@ public IEnumerator GetEnumerator() => [CommandCodes.DecompressArchiveHere] = new DecompressArchiveHere(), [CommandCodes.DecompressArchiveHereSmart] = new DecompressArchiveHereSmart(), [CommandCodes.DecompressArchiveToChildFolder] = new DecompressArchiveToChildFolderAction(), - [CommandCodes.FlattenToRoot] = new FlattenToRootAction(), + [CommandCodes.FlattenFolder] = new FlattenFolderAction(), [CommandCodes.RotateLeft] = new RotateLeftAction(), [CommandCodes.RotateRight] = new RotateRightAction(), [CommandCodes.OpenItem] = new OpenItemAction(), diff --git a/src/Files.App/Data/Commands/Manager/ICommandManager.cs b/src/Files.App/Data/Commands/Manager/ICommandManager.cs index 4973e94615a2..e48fe8fb887c 100644 --- a/src/Files.App/Data/Commands/Manager/ICommandManager.cs +++ b/src/Files.App/Data/Commands/Manager/ICommandManager.cs @@ -89,7 +89,7 @@ public interface ICommandManager : IEnumerable IRichCommand DecompressArchiveHereSmart { get; } IRichCommand DecompressArchiveToChildFolder { get; } - IRichCommand FlattenToRoot { get; } + IRichCommand FlattenFolder { get; } IRichCommand RotateLeft { get; } IRichCommand RotateRight { get; } diff --git a/src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs b/src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs index 44ca8fc02241..0893d461205f 100644 --- a/src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs +++ b/src/Files.App/Data/Factories/ContentPageContextFlyoutFactory.cs @@ -547,7 +547,7 @@ public static List GetBaseItemMenuItems( ], ShowItem = UserSettingsService.GeneralSettingsService.ShowCompressionOptions && StorageArchiveService.CanDecompress(selectedItems) }, - new ContextMenuFlyoutItemViewModelBuilder(Commands.FlattenToRoot).Build(), + new ContextMenuFlyoutItemViewModelBuilder(Commands.FlattenFolder).Build(), new ContextMenuFlyoutItemViewModel() { Text = "SendTo".GetLocalizedResource(), diff --git a/src/Files.App/Strings/en-US/Resources.resw b/src/Files.App/Strings/en-US/Resources.resw index 88223635bcf3..17bfc83ed354 100644 --- a/src/Files.App/Strings/en-US/Resources.resw +++ b/src/Files.App/Strings/en-US/Resources.resw @@ -2030,16 +2030,10 @@ Compress - - Flatten - - - Flatten to root - - + Move all contents from subfolders into the selected location - + Flatten folder From 52f55d825974cf4ae8c6265e731fd2e6ff5c9882 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon, 26 Aug 2024 21:33:33 -0400 Subject: [PATCH 24/25] Update FlattenFolderAction.cs --- src/Files.App/Actions/FileSystem/FlattenFolderAction.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Files.App/Actions/FileSystem/FlattenFolderAction.cs b/src/Files.App/Actions/FileSystem/FlattenFolderAction.cs index 418bbd23f897..b670ed7a2ffb 100644 --- a/src/Files.App/Actions/FileSystem/FlattenFolderAction.cs +++ b/src/Files.App/Actions/FileSystem/FlattenFolderAction.cs @@ -2,11 +2,10 @@ // Licensed under the MIT License. See the LICENSE. using Microsoft.Extensions.Logging; -using System.IO; -using Windows.Storage; using Microsoft.UI.Xaml.Controls; +using System.IO; using Windows.Foundation.Metadata; -using Files.Shared.Helpers; +using Windows.Storage; namespace Files.App.Actions { From 96d691256ee9d00cc8617aa9994cc9ffedb85b2e Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon, 26 Aug 2024 21:36:18 -0400 Subject: [PATCH 25/25] Update Resources.resw --- src/Files.App/Strings/en-US/Resources.resw | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Files.App/Strings/en-US/Resources.resw b/src/Files.App/Strings/en-US/Resources.resw index 17bfc83ed354..a09de26bc3a3 100644 --- a/src/Files.App/Strings/en-US/Resources.resw +++ b/src/Files.App/Strings/en-US/Resources.resw @@ -2036,6 +2036,9 @@ Flatten folder + + Flatten + Flattening a folder will move all contents from its subfolders to the selected location. This operation is permanent and cannot be undone. By using this experimental feature, you acknowledge the risk and agree not to hold the Files team responsible for any data loss.