diff --git a/Files.Launcher/DragDropForm.cs b/Files.Launcher/DragDropForm.cs index a9b1fe759aea..081c4d1852c9 100644 --- a/Files.Launcher/DragDropForm.cs +++ b/Files.Launcher/DragDropForm.cs @@ -2,9 +2,6 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace FilesFullTrust @@ -45,7 +42,8 @@ public DragDropForm(string dropPath, string dropText, System.Threading.Cancellat this.Size = new System.Drawing.Size(lpRect.Width, lpRect.Height); this.Location = new System.Drawing.Point(lpRect.Location.X, lpRect.Location.Y); - token.Register(() => { + token.Register(() => + { if (this.IsHandleCreated) { // If another window is created, close this one @@ -127,4 +125,4 @@ protected override CreateParams CreateParams } } } -} +} \ No newline at end of file diff --git a/Files.Launcher/Program.cs b/Files.Launcher/Program.cs index 0664b5f9c75c..23c861db3470 100644 --- a/Files.Launcher/Program.cs +++ b/Files.Launcher/Program.cs @@ -462,9 +462,13 @@ await Win32API.StartSTATask(() => } using var shi = new ShellItem(fileToDeletePath); op.QueueDeleteOperation(shi); + op.PostDeleteItem += async (s, e) => + { + await args.Request.SendResponseAsync(new ValueSet() { + { "Success", e.Result.Succeeded } }); + }; op.PerformOperations(); } - //ShellFileOperations.Delete(fileToDeletePath, ShellFileOperations.OperationFlags.AllowUndo | ShellFileOperations.OperationFlags.NoUI); break; case "ParseLink": diff --git a/Files.Package/Files.Package.wapproj b/Files.Package/Files.Package.wapproj index 8c601af6c80e..5c1dfd98b981 100644 --- a/Files.Package/Files.Package.wapproj +++ b/Files.Package/Files.Package.wapproj @@ -54,6 +54,8 @@ x86|x64|arm|arm64 False True + Scale|DXFeatureLevel + Language=en-US;de-DE;es-ES;fr-FR;he-IL;hi-IN;hu-HU;it-IT;ja-JP;nl-NL;or-IN;pl-PL;pt-BR;ru-RU;ta;tr-TR;uk-UA;zh-Hans;zh-Hant StoreUpload 0 ..\Files\Files.csproj @@ -142,8 +144,6 @@ - - \ No newline at end of file diff --git a/Files.Package/Package.appxmanifest b/Files.Package/Package.appxmanifest index 765d819cb53c..a3558edd496c 100644 --- a/Files.Package/Package.appxmanifest +++ b/Files.Package/Package.appxmanifest @@ -9,7 +9,7 @@ xmlns:uap4="http://schemas.microsoft.com/appx/manifest/uap/windows10/4" xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5" IgnorableNamespaces="uap uap5 mp rescap desktop4 desktop"> - + Files - Dev Yair A diff --git a/Files.Package/priconfig.default.xml b/Files.Package/priconfig.default.xml deleted file mode 100644 index 980fc1a84224..000000000000 --- a/Files.Package/priconfig.default.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Files.Package/priconfig.packaging.xml b/Files.Package/priconfig.packaging.xml deleted file mode 100644 index a8b3b89f6e65..000000000000 --- a/Files.Package/priconfig.packaging.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/Files/BaseLayout.cs b/Files/BaseLayout.cs index fba410d6d789..d60364888570 100644 --- a/Files/BaseLayout.cs +++ b/Files/BaseLayout.cs @@ -1,4 +1,5 @@ using Files.Common; +using Files.DataModels; using Files.Filesystem; using Files.Helpers; using Files.UserControls; @@ -9,9 +10,9 @@ using Microsoft.Toolkit.Uwp.UI.Extensions; using Newtonsoft.Json; using System; +using System.Collections; using System.Collections.Generic; using System.ComponentModel; -using System.Diagnostics; using System.IO; using System.Linq; using System.Runtime.CompilerServices; @@ -136,6 +137,8 @@ internal set public ListedItem SelectedItem { get; private set; } + private List cachedNewContextMenuEntries { get; set; } + public BaseLayout() { SelectedItemsPropertiesViewModel = new SelectedItemsPropertiesViewModel(this); @@ -151,9 +154,19 @@ public BaseLayout() } } + public abstract void FocusFileList(); + public abstract void SelectAllItems(); - public abstract void InvertSelection(); + public virtual void InvertSelection() + { + List newSelectedItems = GetAllItems() + .Cast() + .Except(SelectedItems) + .ToList(); + + SetSelectedItemsOnUi(newSelectedItems); + } public abstract void ClearSelection(); @@ -161,13 +174,29 @@ public BaseLayout() public abstract void ScrollIntoView(ListedItem item); - public abstract int GetSelectedIndex(); + protected abstract void AddSelectedItem(ListedItem item); + + protected abstract IEnumerable GetAllItems(); - public abstract void SetSelectedItemOnUi(ListedItem selectedItem); + public virtual void SetSelectedItemOnUi(ListedItem selectedItem) + { + ClearSelection(); + AddSelectedItem(selectedItem); + } - public abstract void SetSelectedItemsOnUi(List selectedItems); + public virtual void SetSelectedItemsOnUi(List selectedItems) + { + ClearSelection(); + AddSelectedItemsOnUi(selectedItems); + } - public abstract void AddSelectedItemsOnUi(List selectedItems); + public virtual void AddSelectedItemsOnUi(List selectedItems) + { + foreach (ListedItem selectedItem in selectedItems) + { + AddSelectedItem(selectedItem); + } + } private void ClearShellContextMenus(MenuFlyout menuFlyout) { @@ -176,6 +205,7 @@ private void ClearShellContextMenus(MenuFlyout menuFlyout) { menuFlyout.Items.RemoveAt(menuFlyout.Items.IndexOf(contextMenuItems[i])); } + if (menuFlyout.Items[0] is MenuFlyoutSeparator flyoutSeperator) { menuFlyout.Items.RemoveAt(menuFlyout.Items.IndexOf(flyoutSeperator)); @@ -219,9 +249,31 @@ public virtual void SetShellContextmenu(MenuFlyout menuFlyout, bool shiftPressed public abstract void StartRenameItem(); - public abstract void ResetItemOpacity(); + public virtual void ResetItemOpacity() + { + IEnumerable items = GetAllItems(); + if (items == null) + { + return; + } + + foreach (ListedItem listedItem in items) + { + if (listedItem.IsHiddenItem) + { + listedItem.Opacity = 0.4; + } + else + { + listedItem.Opacity = 1; + } + } + } - public abstract void SetItemOpacity(ListedItem item); + public virtual void SetItemOpacity(ListedItem item) + { + item.Opacity = 0.4; + } protected abstract ListedItem GetItemFromElement(object element); @@ -301,6 +353,10 @@ protected override async void OnNavigatedTo(NavigationEventArgs eventArgs) ParentShellPageInstance.InstanceViewModel.IsPageTypeNotHome = true; // show controls that were hidden on the home page ParentShellPageInstance.Clipboard_ContentChanged(null, null); + + cachedNewContextMenuEntries = await RegistryHelper.GetNewContextMenuEntries(); + + FocusFileList(); // Set focus on layout specific file list control } protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) @@ -314,10 +370,17 @@ protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) private void UnloadMenuFlyoutItemByName(string nameToUnload) { - var menuItem = this.FindName(nameToUnload) as DependencyObject; - if (menuItem != null) // Prevent crash if the MenuFlyoutItem is missing + if (FindName(nameToUnload) is MenuFlyoutItemBase menuItem) // Prevent crash if the MenuFlyoutItem is missing + { + menuItem.Visibility = Visibility.Collapsed; + } + } + + private void LoadMenuFlyoutItemByName(string nameToUnload) + { + if (FindName(nameToUnload) is MenuFlyoutItemBase menuItem) // Prevent crash if the MenuFlyoutItem is missing { - (menuItem as MenuFlyoutItemBase).Visibility = Visibility.Collapsed; + menuItem.Visibility = Visibility.Visible; } } @@ -451,6 +514,48 @@ public void RightClickContextMenu_Opening(object sender, object e) ClearSelection(); var shiftPressed = Window.Current.CoreWindow.GetKeyState(VirtualKey.Shift).HasFlag(CoreVirtualKeyStates.Down); SetShellContextmenu(BaseLayoutContextFlyout, shiftPressed, false); + var newItemMenu = (MenuFlyoutSubItem)BaseLayoutContextFlyout.Items.SingleOrDefault(x => x.Name == "NewEmptySpace"); + if (newItemMenu == null || cachedNewContextMenuEntries == null) + { + return; + } + if (!newItemMenu.Items.Any(x => (x.Tag as string) == "CreateNewFile")) + { + var separatorIndex = newItemMenu.Items.IndexOf(newItemMenu.Items.Single(x => x.Name == "NewMenuFileFolderSeparator")); + foreach (var newEntry in Enumerable.Reverse(cachedNewContextMenuEntries)) + { + MenuFlyoutItem menuLayoutItem; + if (newEntry.Icon != null) + { + var image = new BitmapImage(); +#pragma warning disable CS4014 + image.SetSourceAsync(newEntry.Icon); +#pragma warning restore CS4014 + menuLayoutItem = new MenuFlyoutItemWithImage() + { + Text = newEntry.Name, + BitmapIcon = image, + Tag = "CreateNewFile" + }; + } + else + { + menuLayoutItem = new MenuFlyoutItem() + { + Text = newEntry.Name, + Icon = new FontIcon() + { + FontFamily = App.Current.Resources["FluentUIGlyphs"] as Windows.UI.Xaml.Media.FontFamily, + Glyph = "\xea00" + }, + Tag = "CreateNewFile" + }; + } + menuLayoutItem.Command = ParentShellPageInstance.InteractionOperations.CreateNewFile; + menuLayoutItem.CommandParameter = newEntry; + newItemMenu.Items.Insert(separatorIndex + 1, menuLayoutItem); + } + } } public void RightClickItemContextMenu_Opening(object sender, object e) @@ -485,7 +590,7 @@ public void RightClickItemContextMenu_Opening(object sender, object e) { if (SelectedItem.IsShortcutItem) { - (this.FindName("OpenItem") as MenuFlyoutItemBase).Visibility = Visibility.Visible; + LoadMenuFlyoutItemByName("OpenItem"); UnloadMenuFlyoutItemByName("OpenItemWithAppPicker"); UnloadMenuFlyoutItemByName("RunAsAdmin"); UnloadMenuFlyoutItemByName("RunAsAnotherUser"); @@ -497,42 +602,42 @@ public void RightClickItemContextMenu_Opening(object sender, object e) UnloadMenuFlyoutItemByName("OpenItemWithAppPicker"); UnloadMenuFlyoutItemByName("RunAsAdmin"); UnloadMenuFlyoutItemByName("RunAsAnotherUser"); - (this.FindName("CreateShortcut") as MenuFlyoutItemBase).Visibility = Visibility.Visible; + LoadMenuFlyoutItemByName("CreateShortcut"); } else if (SelectedItem.FileExtension.Equals(".exe", StringComparison.OrdinalIgnoreCase) || SelectedItem.FileExtension.Equals(".bat", StringComparison.OrdinalIgnoreCase)) { - (this.FindName("OpenItem") as MenuFlyoutItemBase).Visibility = Visibility.Visible; + LoadMenuFlyoutItemByName("OpenItem"); UnloadMenuFlyoutItemByName("OpenItemWithAppPicker"); - (this.FindName("RunAsAdmin") as MenuFlyoutItemBase).Visibility = Visibility.Visible; - (this.FindName("RunAsAnotherUser") as MenuFlyoutItemBase).Visibility = Visibility.Visible; - (this.FindName("CreateShortcut") as MenuFlyoutItemBase).Visibility = Visibility.Visible; + LoadMenuFlyoutItemByName("RunAsAdmin"); + LoadMenuFlyoutItemByName("RunAsAnotherUser"); + LoadMenuFlyoutItemByName("CreateShortcut"); } else if (SelectedItem.FileExtension.Equals(".msi", StringComparison.OrdinalIgnoreCase)) { UnloadMenuFlyoutItemByName("OpenItem"); UnloadMenuFlyoutItemByName("OpenItemWithAppPicker"); UnloadMenuFlyoutItemByName("RunAsAdmin"); - (this.FindName("RunAsAnotherUser") as MenuFlyoutItemBase).Visibility = Visibility.Visible; - (this.FindName("CreateShortcut") as MenuFlyoutItemBase).Visibility = Visibility.Visible; + LoadMenuFlyoutItemByName("RunAsAnotherUser"); + LoadMenuFlyoutItemByName("CreateShortcut"); } else if (SelectedItem.FileExtension.Equals(".appx", StringComparison.OrdinalIgnoreCase) || SelectedItem.FileExtension.Equals(".msix", StringComparison.OrdinalIgnoreCase) || SelectedItem.FileExtension.Equals(".appxbundle", StringComparison.OrdinalIgnoreCase) || SelectedItem.FileExtension.Equals(".msixbundle", StringComparison.OrdinalIgnoreCase)) { - (this.FindName("OpenItemWithAppPicker") as MenuFlyoutItemBase).Visibility = Visibility.Visible; + LoadMenuFlyoutItemByName("OpenItemWithAppPicker"); UnloadMenuFlyoutItemByName("RunAsAdmin"); UnloadMenuFlyoutItemByName("RunAsAnotherUser"); - (this.FindName("CreateShortcut") as MenuFlyoutItemBase).Visibility = Visibility.Visible; + LoadMenuFlyoutItemByName("CreateShortcut"); } else { - (this.FindName("OpenItem") as MenuFlyoutItemBase).Visibility = Visibility.Visible; - (this.FindName("OpenItemWithAppPicker") as MenuFlyoutItemBase).Visibility = Visibility.Visible; + LoadMenuFlyoutItemByName("OpenItem"); + LoadMenuFlyoutItemByName("OpenItemWithAppPicker"); UnloadMenuFlyoutItemByName("RunAsAdmin"); UnloadMenuFlyoutItemByName("RunAsAnotherUser"); - (this.FindName("CreateShortcut") as MenuFlyoutItemBase).Visibility = Visibility.Visible; + LoadMenuFlyoutItemByName("CreateShortcut"); } } } @@ -555,23 +660,20 @@ public void RightClickItemContextMenu_Opening(object sender, object e) } else if (SelectedItems.Count == 1) { - (this.FindName("SidebarPinItem") as MenuFlyoutItemBase).Visibility = Visibility.Visible; - (this.FindName("CreateShortcut") as MenuFlyoutItemBase).Visibility = Visibility.Visible; - (this.FindName("OpenItem") as MenuFlyoutItemBase).Visibility = Visibility.Visible; + LoadMenuFlyoutItemByName("SidebarPinItem"); + LoadMenuFlyoutItemByName("CreateShortcut"); + LoadMenuFlyoutItemByName("OpenItem"); } else { - (this.FindName("SidebarPinItem") as MenuFlyoutItemBase).Visibility = Visibility.Visible; + LoadMenuFlyoutItemByName("SidebarPinItem"); UnloadMenuFlyoutItemByName("CreateShortcut"); } if (SelectedItems.Count <= 5 && SelectedItems.Count > 0) { - (this.FindName("OpenInNewTab") as MenuFlyoutItemBase).Visibility = Visibility.Visible; - (this.FindName("OpenInNewWindowItem") as MenuFlyoutItemBase).Visibility = Visibility.Visible; - //this.FindName("SidebarPinItem"); - //this.FindName("OpenInNewTab"); - //this.FindName("OpenInNewWindowItem"); + LoadMenuFlyoutItemByName("OpenInNewTab"); + LoadMenuFlyoutItemByName("OpenInNewWindowItem"); } else if (SelectedItems.Count > 5) { diff --git a/Files/Constants.cs b/Files/Constants.cs index 5ada351f36e3..dea0723db8f0 100644 --- a/Files/Constants.cs +++ b/Files/Constants.cs @@ -18,8 +18,8 @@ public static class GridViewBrowser } public static class GenericFileBrowser - { + { } } } -} +} \ No newline at end of file diff --git a/Files/Controllers/TerminalController.cs b/Files/Controllers/TerminalController.cs index 91493a8a605f..dffe859b6d18 100644 --- a/Files/Controllers/TerminalController.cs +++ b/Files/Controllers/TerminalController.cs @@ -1,4 +1,5 @@ using Files.DataModels; +using Files.Filesystem; using Newtonsoft.Json; using System; using System.IO; @@ -11,9 +12,7 @@ public class TerminalController : IJson { private string defaultTerminalPath = "ms-appx:///Assets/terminal/terminal.json"; - private StorageFile JsonFile { get; set; } - - private StorageFolder Folder { get; set; } + private string folderPath => Path.Combine(ApplicationData.Current.LocalFolder.Path, "settings"); public TerminalFileModel Model { get; set; } @@ -26,45 +25,69 @@ public TerminalController() private async Task LoadAsync() { - Folder = await ApplicationData.Current.LocalFolder.CreateFolderAsync("settings", CreationCollisionOption.OpenIfExists); - try + StorageFolder Folder = await FilesystemTasks.Wrap(() => ApplicationData.Current.LocalFolder.CreateFolderAsync("settings", CreationCollisionOption.OpenIfExists).AsTask()); + if (Folder == null) { - JsonFile = await Folder.GetFileAsync(JsonFileName); + Model = await GetDefaultTerminalFileModel(); + return; } - catch (FileNotFoundException) - { - var defaultFile = StorageFile.GetFileFromApplicationUriAsync(new Uri(defaultTerminalPath)); - JsonFile = await Folder.CreateFileAsync(JsonFileName); - await FileIO.WriteBufferAsync(JsonFile, await FileIO.ReadBufferAsync(await defaultFile)); + var JsonFile = await FilesystemTasks.Wrap(() => Folder.GetFileAsync(JsonFileName).AsTask()); + if (!JsonFile) + { + if (JsonFile == FilesystemErrorCode.ERROR_NOTFOUND) + { + Model = await GetDefaultTerminalFileModel(); + SaveModel(); + return; + } + else + { + Model = await GetDefaultTerminalFileModel(); + return; + } } - var content = await FileIO.ReadTextAsync(JsonFile); - try { + var content = await FileIO.ReadTextAsync(JsonFile.Result); Model = JsonConvert.DeserializeObject(content); if (Model == null) { - Model = new TerminalFileModel(); throw new JsonParsingNullException(JsonFileName); } } catch (JsonParsingNullException) { - var defaultFile = StorageFile.GetFileFromApplicationUriAsync(new Uri(defaultTerminalPath)); - - JsonFile = await Folder.CreateFileAsync(JsonFileName, CreationCollisionOption.ReplaceExisting); - await FileIO.WriteBufferAsync(JsonFile, await FileIO.ReadBufferAsync(await defaultFile)); - var defaultContent = await FileIO.ReadTextAsync(JsonFile); - Model = JsonConvert.DeserializeObject(defaultContent); + Model = await GetDefaultTerminalFileModel(); + SaveModel(); } catch (Exception) { - var defaultFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri(defaultTerminalPath)); - JsonFile = null; + Model = await GetDefaultTerminalFileModel(); + } + } + + private async Task GetDefaultTerminalFileModel() + { + try + { + StorageFile defaultFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri(defaultTerminalPath)); var defaultContent = await FileIO.ReadTextAsync(defaultFile); - Model = JsonConvert.DeserializeObject(defaultContent); + return JsonConvert.DeserializeObject(defaultContent); + } + catch + { + var model = new TerminalFileModel(); + model.Terminals.Add(new Terminal() + { + Name = "CMD", + Path = "cmd.exe", + Arguments = "", + Icon = "" + }); + model.ResetToDefaultTerminal(); + return model; } } @@ -102,16 +125,17 @@ public async Task GetInstalledTerminalsAsync() public void SaveModel() { - if (JsonFile == null) + try { - return; + using (var file = File.CreateText(Path.Combine(folderPath, JsonFileName))) + { + JsonSerializer serializer = new JsonSerializer(); + serializer.Formatting = Formatting.Indented; + serializer.Serialize(file, Model); + } } - - using (var file = File.CreateText(Folder.Path + Path.DirectorySeparatorChar + JsonFileName)) + catch { - JsonSerializer serializer = new JsonSerializer(); - serializer.Formatting = Formatting.Indented; - serializer.Serialize(file, Model); } } } diff --git a/Files/DataModels/ShellNewEntry.cs b/Files/DataModels/ShellNewEntry.cs new file mode 100644 index 000000000000..04bcef94d850 --- /dev/null +++ b/Files/DataModels/ShellNewEntry.cs @@ -0,0 +1,55 @@ +using Files.Filesystem; +using System; +using System.IO; +using System.Threading.Tasks; +using Windows.Storage; +using Windows.Storage.FileProperties; + +namespace Files.DataModels +{ + public class ShellNewEntry + { + public string Extension { get; set; } + public string Name { get; set; } + public string Command { get; set; } + public StorageItemThumbnail Icon { get; set; } + public byte[] Data { get; set; } + public string Template { get; set; } + + public async Task> Create(string filePath, IShellPage associatedInstance) + { + var parentFolder = await associatedInstance.FilesystemViewModel.GetFolderFromPathAsync(Path.GetDirectoryName(filePath)); + if (parentFolder) + { + return await Create(parentFolder, Path.GetFileName(filePath)); + } + return new FilesystemResult(null, parentFolder.ErrorCode); + } + + public async Task> Create(StorageFolder parentFolder, string fileName) + { + FilesystemResult createdFile = null; + if (!fileName.EndsWith(this.Extension)) + { + fileName += this.Extension; + } + if (Template == null) + { + createdFile = await FilesystemTasks.Wrap(() => parentFolder.CreateFileAsync(fileName, CreationCollisionOption.GenerateUniqueName).AsTask()); + } + else + { + createdFile = await FilesystemTasks.Wrap(() => StorageFile.GetFileFromPathAsync(Template).AsTask()) + .OnSuccess(t => t.CopyAsync(parentFolder, fileName, NameCollisionOption.GenerateUniqueName).AsTask()); + } + if (createdFile) + { + if (this.Data != null) + { + await FileIO.WriteBytesAsync(createdFile.Result, this.Data); + } + } + return createdFile; + } + } +} diff --git a/Files/Dialogs/AddItemDialog.xaml b/Files/Dialogs/AddItemDialog.xaml index 934ce02781c5..3aa976f33aaa 100644 --- a/Files/Dialogs/AddItemDialog.xaml +++ b/Files/Dialogs/AddItemDialog.xaml @@ -17,42 +17,59 @@ RequestedTheme="{x:Bind local2:ThemeHelper.RootTheme}" mc:Ignorable="d"> - + + + + + - - - - - - - - + + + + + + + + + + - - - - + Source="{x:Bind Icon}" + Stretch="Uniform" /> + + + + - - - - - + + + + + - - + + \ No newline at end of file diff --git a/Files/Dialogs/AddItemDialog.xaml.cs b/Files/Dialogs/AddItemDialog.xaml.cs index 1fa69e0b4699..8fd1b5bac861 100644 --- a/Files/Dialogs/AddItemDialog.xaml.cs +++ b/Files/Dialogs/AddItemDialog.xaml.cs @@ -1,12 +1,16 @@ -using Microsoft.Toolkit.Uwp.Extensions; -using System.Collections.Generic; +using Files.DataModels; +using Files.Helpers; +using Microsoft.Toolkit.Uwp.Extensions; +using System; +using System.Collections.ObjectModel; using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Media.Imaging; namespace Files.Dialogs { public sealed partial class AddItemDialog : ContentDialog { - public AddItemType ResultType { get; private set; } = AddItemType.Cancel; + public AddItemResult ResultType { get; private set; } = new AddItemResult() { ItemType = AddItemType.Cancel }; public AddItemDialog() { @@ -14,9 +18,9 @@ public AddItemDialog() AddItemsToList(); } - public List AddItemsList = new List(); + public ObservableCollection AddItemsList = new ObservableCollection(); - public void AddItemsToList() + public async void AddItemsToList() { AddItemsList.Clear(); @@ -24,26 +28,48 @@ public void AddItemsToList() { Header = "AddDialogListFolderHeader".GetLocalized(), SubHeader = "AddDialogListFolderSubHeader".GetLocalized(), - Icon = "\xE838", + Glyph = "\xE838", IsItemEnabled = true, - ItemType = AddItemType.Folder + ItemType = new AddItemResult() { ItemType = AddItemType.Folder } }); - AddItemsList.Add(new AddListItem + var itemTypes = await RegistryHelper.GetNewContextMenuEntries(); + + foreach (var itemType in itemTypes) { - Header = "AddDialogListTextFileHeader".GetLocalized(), - SubHeader = "AddDialogListTextFileSubHeader".GetLocalized(), - Icon = "\xE8A5", - IsItemEnabled = true, - ItemType = AddItemType.TextDocument - }); + BitmapImage image = null; + if (itemType.Icon != null) + { + image = new BitmapImage(); + await image.SetSourceAsync(itemType.Icon); + } + + AddItemsList.Add(new AddListItem + { + Header = itemType.Name, + SubHeader = itemType.Extension, + Glyph = itemType.Icon != null ? null : "\xE8A5", + Icon = image, + IsItemEnabled = true, + ItemType = new AddItemResult() + { + ItemType = AddItemType.File, + ItemInfo = itemType + } + }); + } + AddItemsList.Add(new AddListItem { - Header = "AddDialogListBitmapHeader".GetLocalized(), - SubHeader = "AddDialogListBitmapSubHeader".GetLocalized(), - Icon = "\xEB9F", + Header = "AddDialogListFileHeader".GetLocalized(), + SubHeader = "AddDialogListFileSubHeader".GetLocalized(), + Glyph = "\xE8A5", IsItemEnabled = true, - ItemType = AddItemType.BitmapImage + ItemType = new AddItemResult() + { + ItemType = AddItemType.File, + ItemInfo = new ShellNewEntry() + } }); } @@ -56,19 +82,24 @@ private void ListView_ItemClick(object sender, ItemClickEventArgs e) public enum AddItemType { - Folder = 0, - TextDocument = 1, - BitmapImage = 2, - CompressedArchive = 3, - Cancel = 4 + Folder, + File, + Cancel + } + + public class AddItemResult + { + public AddItemType ItemType { get; set; } + public ShellNewEntry ItemInfo { get; set; } } public class AddListItem { public string Header { get; set; } public string SubHeader { get; set; } - public string Icon { get; set; } + public string Glyph { get; set; } + public BitmapImage Icon { get; set; } public bool IsItemEnabled { get; set; } - public AddItemType ItemType { get; set; } + public AddItemResult ItemType { get; set; } } } \ No newline at end of file diff --git a/Files/Dialogs/ConfirmDeleteDialog.xaml.cs b/Files/Dialogs/ConfirmDeleteDialog.xaml.cs index 9e365259fcac..6a1c65ddec50 100644 --- a/Files/Dialogs/ConfirmDeleteDialog.xaml.cs +++ b/Files/Dialogs/ConfirmDeleteDialog.xaml.cs @@ -1,6 +1,5 @@ using Files.View_Models; using Microsoft.Toolkit.Uwp.Extensions; -using Windows.Storage; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; diff --git a/Files/Dialogs/PropertiesDialog.xaml b/Files/Dialogs/PropertiesDialog.xaml index 9f89b3b83e8d..e3eb66ac187e 100644 --- a/Files/Dialogs/PropertiesDialog.xaml +++ b/Files/Dialogs/PropertiesDialog.xaml @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/Files/Dialogs/PropertySaveError.xaml.cs b/Files/Dialogs/PropertySaveError.xaml.cs index 7c7afaeea8f4..f9727a01e862 100644 --- a/Files/Dialogs/PropertySaveError.xaml.cs +++ b/Files/Dialogs/PropertySaveError.xaml.cs @@ -1,17 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices.WindowsRuntime; -using Windows.Foundation; -using Windows.Foundation.Collections; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Controls.Primitives; -using Windows.UI.Xaml.Data; -using Windows.UI.Xaml.Input; -using Windows.UI.Xaml.Media; -using Windows.UI.Xaml.Navigation; +using Windows.UI.Xaml.Controls; // The Content Dialog item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 @@ -34,4 +21,4 @@ private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDia { } } -} +} \ No newline at end of file diff --git a/Files/Dialogs/RenameDialog.xaml.cs b/Files/Dialogs/RenameDialog.xaml.cs index 95cc6ad27839..7460bb8dc877 100644 --- a/Files/Dialogs/RenameDialog.xaml.cs +++ b/Files/Dialogs/RenameDialog.xaml.cs @@ -1,5 +1,4 @@ using Files.Filesystem; -using Files.Interacts; using Windows.System; using Windows.UI.Xaml.Controls; diff --git a/Files/Enums/FileOperationType.cs b/Files/Enums/FileOperationType.cs index db0bbd4cdc4d..d19856a77653 100644 --- a/Files/Enums/FileOperationType.cs +++ b/Files/Enums/FileOperationType.cs @@ -48,4 +48,4 @@ public enum FileOperationType : byte /// Delete = 8 } -} +} \ No newline at end of file diff --git a/Files/Enums/ReturnResult.cs b/Files/Enums/ReturnResult.cs index 478e613e6422..587caf560721 100644 --- a/Files/Enums/ReturnResult.cs +++ b/Files/Enums/ReturnResult.cs @@ -53,4 +53,4 @@ public enum ReturnResult : byte /// Cancelled = 8, } -} +} \ No newline at end of file diff --git a/Files/Enums/SidebarOpacity.cs b/Files/Enums/SidebarOpacity.cs index c9559165b82e..1b1426bee001 100644 --- a/Files/Enums/SidebarOpacity.cs +++ b/Files/Enums/SidebarOpacity.cs @@ -3,6 +3,6 @@ public enum SidebarOpacity { Opaque = 0, - AcrylicEnabled = 1 + IsAcrylicDisabled = 1 } } \ No newline at end of file diff --git a/Files/Extensions/EnumerableExtensions.cs b/Files/Extensions/EnumerableExtensions.cs index d39536401455..bdccefbde391 100644 --- a/Files/Extensions/EnumerableExtensions.cs +++ b/Files/Extensions/EnumerableExtensions.cs @@ -13,4 +13,4 @@ internal static class EnumerableExtensions internal static IEnumerable CreateEnumerable(this T item) => new List() { item }; } -} +} \ No newline at end of file diff --git a/Files/Extensions/LinqExtensions.cs b/Files/Extensions/LinqExtensions.cs index b718d5b195cf..b8c2c9d152d7 100644 --- a/Files/Extensions/LinqExtensions.cs +++ b/Files/Extensions/LinqExtensions.cs @@ -17,4 +17,4 @@ internal static void ForEach(this IEnumerable collection, Action action action(value); } } -} +} \ No newline at end of file diff --git a/Files/Files.csproj b/Files/Files.csproj index 73f9227a7149..f70217da4722 100644 --- a/Files/Files.csproj +++ b/Files/Files.csproj @@ -10,6 +10,8 @@ Files Files en-US + Scale|DXFeatureLevel + Language=en-US;de-DE;es-ES;fr-FR;he-IL;hi-IN;hu-HU;it-IT;ja-JP;nl-NL;or-IN;pl-PL;pt-BR;ru-RU;ta;tr-TR;uk-UA;zh-Hans;zh-Hant UAP 10.0.19041.0 10.0.17763.0 @@ -164,6 +166,8 @@ + + @@ -178,6 +182,7 @@ RestartDialog.xaml + @@ -199,7 +204,6 @@ - @@ -218,7 +222,6 @@ - diff --git a/Files/Filesystem/DriveItem.cs b/Files/Filesystem/DriveItem.cs index 19f2b099feaa..b5c85c637ba4 100644 --- a/Files/Filesystem/DriveItem.cs +++ b/Files/Filesystem/DriveItem.cs @@ -109,16 +109,19 @@ public async Task UpdatePropertiesAsync() var properties = await Root.Properties.RetrievePropertiesAsync(new[] { "System.FreeSpace", "System.Capacity" }) .AsTask().WithTimeoutAsync(TimeSpan.FromSeconds(5)); - MaxSpace = ByteSize.FromBytes((ulong)properties["System.Capacity"]); - FreeSpace = ByteSize.FromBytes((ulong)properties["System.FreeSpace"]); - SpaceUsed = MaxSpace - FreeSpace; - - SpaceText = string.Format( - "DriveFreeSpaceAndCapacity".GetLocalized(), - FreeSpace.ToBinaryString().ConvertSizeAbbreviation(), - MaxSpace.ToBinaryString().ConvertSizeAbbreviation()); + if (properties["System.Capacity"] != null && properties["System.FreeSpace"] != null) + { + MaxSpace = ByteSize.FromBytes((ulong)properties["System.Capacity"]); + FreeSpace = ByteSize.FromBytes((ulong)properties["System.FreeSpace"]); + SpaceUsed = MaxSpace - FreeSpace; + + SpaceText = string.Format( + "DriveFreeSpaceAndCapacity".GetLocalized(), + FreeSpace.ToBinaryString().ConvertSizeAbbreviation(), + MaxSpace.ToBinaryString().ConvertSizeAbbreviation()); + } } - catch (NullReferenceException) + catch (Exception) { SpaceText = "DriveCapacityUnknown".GetLocalized(); SpaceUsed = ByteSize.FromBytes(0); diff --git a/Files/Filesystem/Drives.cs b/Files/Filesystem/Drives.cs index 9ab50d9fe3ff..af59ab17f117 100644 --- a/Files/Filesystem/Drives.cs +++ b/Files/Filesystem/Drives.cs @@ -87,7 +87,7 @@ private async void DeviceWatcher_EnumerationCompleted(DeviceWatcher sender, obje { try { - await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Low, () => + await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { if (MainPage.SideBarItems.FirstOrDefault(x => x is HeaderTextItem && x.Text == "SidebarDrives".GetLocalized()) == null) { @@ -127,7 +127,7 @@ await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPrio private async void MainView_Activated(CoreApplicationView sender, Windows.ApplicationModel.Activation.IActivatedEventArgs args) { - await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Low, () => + await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { if (MainPage.SideBarItems.FirstOrDefault(x => x is HeaderTextItem && x.Text == "SidebarDrives".GetLocalized()) == null) { diff --git a/Files/Filesystem/FilesystemOperations/FilesystemItemType.cs b/Files/Filesystem/FilesystemOperations/FilesystemItemType.cs index 7d935bb4b6ed..722012b831e3 100644 --- a/Files/Filesystem/FilesystemOperations/FilesystemItemType.cs +++ b/Files/Filesystem/FilesystemOperations/FilesystemItemType.cs @@ -20,4 +20,4 @@ public enum FilesystemItemType : byte [Obsolete("The symlink has no use for now here.")] Symlink = 2 } -} +} \ No newline at end of file diff --git a/Files/Filesystem/FilesystemOperations/FilesystemOperations.cs b/Files/Filesystem/FilesystemOperations/FilesystemOperations.cs index 9145e015a08e..1a5017422912 100644 --- a/Files/Filesystem/FilesystemOperations/FilesystemOperations.cs +++ b/Files/Filesystem/FilesystemOperations/FilesystemOperations.cs @@ -32,7 +32,7 @@ public class FilesystemOperations : IFilesystemOperations private RecycleBinHelpers recycleBinHelpers; - #endregion + #endregion Private Members #region Constructor @@ -42,11 +42,11 @@ public FilesystemOperations(IShellPage associatedInstance) recycleBinHelpers = new RecycleBinHelpers(this.associatedInstance); } - #endregion + #endregion Constructor #region IFilesystemOperations - public async Task CreateAsync(PathWithType source, IProgress errorCode, CancellationToken cancellationToken) + public async Task CreateAsync(IStorageItemWithPath source, IProgress errorCode, CancellationToken cancellationToken) { try { @@ -54,15 +54,23 @@ public async Task CreateAsync(PathWithType source, IProgress CopyAsync(IStorageItem source, IProgress errorCode, CancellationToken cancellationToken) { - return await CopyAsync(new PathWithType(source.Path, - source.IsOfType(StorageItemTypes.File) ? FilesystemItemType.File : FilesystemItemType.Directory), + return await CopyAsync(source.FromStorageItem(), destination, progress, errorCode, cancellationToken); } - public async Task CopyAsync(PathWithType source, + public async Task CopyAsync(IStorageItemWithPath source, string destination, IProgress progress, IProgress errorCode, @@ -122,13 +129,13 @@ await DialogDisplayHelper.ShowDialogAsync( } IStorageItem copiedItem = null; - long itemSize = await FilesystemHelpers.GetItemSize(await source.Path.ToStorageItem()); + long itemSize = await FilesystemHelpers.GetItemSize(await source.ToStorageItem(associatedInstance)); bool reportProgress = false; // TODO: The default value is false if (source.ItemType == FilesystemItemType.Directory) { - if (string.IsNullOrWhiteSpace(source.Path) || - Path.GetDirectoryName(destination).IsSubPathOf(source.Path)) // We check if user tried to copy anything above the source.ItemPath + if (!string.IsNullOrWhiteSpace(source.Path) && + Path.GetDirectoryName(destination).IsSubPathOf(source.Path)) // We check if user tried to copy anything above the source.ItemPath { ImpossibleActionResponseTypes responseType = ImpossibleActionResponseTypes.Abort; @@ -169,21 +176,21 @@ await DialogDisplayHelper.ShowDialogAsync( progress?.Report((float)(itemSize * 100.0f / itemSize)); } - FilesystemResult fsSourceFolderResult = await associatedInstance.FilesystemViewModel.GetFolderFromPathAsync(Path.GetDirectoryName(source.Path)); - FilesystemResult fsDestinationFolderResult = await associatedInstance.FilesystemViewModel.GetFolderFromPathAsync(Path.GetDirectoryName(destination)); + StorageFolder fsSourceFolder = (StorageFolder)await source.ToStorageItem(associatedInstance); + StorageFolder fsDestinationFolder = (StorageFolder)await associatedInstance.FilesystemViewModel.GetFolderFromPathAsync(Path.GetDirectoryName(destination)); - if (fsSourceFolderResult && fsDestinationFolderResult) + if (fsSourceFolder != null && fsDestinationFolder != null) { FilesystemResult fsCopyResult = await FilesystemTasks.Wrap(async () => { - return await FilesystemHelpers.CloneDirectoryAsync(fsSourceFolderResult.Result, fsDestinationFolderResult.Result, Path.GetFileName(source.Path)); + return await FilesystemHelpers.CloneDirectoryAsync(fsSourceFolder, fsDestinationFolder, fsSourceFolder.Name); }) .OnSuccess(t => { if (associatedInstance.FilesystemViewModel.CheckFolderForHiddenAttribute(source.Path)) { - // The source folder was hidden, apply hidden attribute to destination - NativeFileOperationsHelper.SetFileAttribute(t.Path, FileAttributes.Hidden); + // The source folder was hidden, apply hidden attribute to destination + NativeFileOperationsHelper.SetFileAttribute(t.Path, FileAttributes.Hidden); } copiedItem = t; }); @@ -201,7 +208,7 @@ await DialogDisplayHelper.ShowDialogAsync( if (fsResult) { - StorageFile file = (StorageFile)await source.Path.ToStorageItem(); + StorageFile file = (StorageFile)await source.ToStorageItem(associatedInstance); FilesystemResult fsResultCopy = new FilesystemResult(null, FilesystemErrorCode.ERROR_GENERIC); @@ -209,7 +216,7 @@ await DialogDisplayHelper.ShowDialogAsync( { fsResultCopy = await FilesystemTasks.Wrap(() => { - return file.CopyAsync(fsResult.Result, Path.GetFileName(source.Path), NameCollisionOption.GenerateUniqueName).AsTask(); + return file.CopyAsync(fsResult.Result, Path.GetFileName(file.Name), NameCollisionOption.GenerateUniqueName).AsTask(); }); } @@ -222,7 +229,7 @@ await DialogDisplayHelper.ShowDialogAsync( // Try again with CopyFileFromApp if (NativeFileOperationsHelper.CopyFileFromApp(source.Path, destination, true)) { - copiedItem = await source.Path.ToStorageItem(); // Dangerous - the provided item may be different than output result! + copiedItem = await source.ToStorageItem(associatedInstance); // Dangerous - the provided item may be different than output result! } else { @@ -253,9 +260,7 @@ await DialogDisplayHelper.ShowDialogAsync( progress?.Report(100.0f); - var pathWithType = new PathWithType( - copiedItem != null ? (!string.IsNullOrWhiteSpace(copiedItem.Path) ? copiedItem.Path : destination) : destination, - source.ItemType); + var pathWithType = copiedItem.FromStorageItem(destination, source.ItemType); return new StorageHistory(FileOperationType.Copy, source, pathWithType); } @@ -266,15 +271,14 @@ public async Task MoveAsync(IStorageItem source, IProgress errorCode, CancellationToken cancellationToken) { - return await MoveAsync(new PathWithType(source.Path, - source.IsOfType(StorageItemTypes.File) ? FilesystemItemType.File : FilesystemItemType.Directory), + return await MoveAsync(source.FromStorageItem(), destination, progress, errorCode, cancellationToken); } - public async Task MoveAsync(PathWithType source, + public async Task MoveAsync(IStorageItemWithPath source, string destination, IProgress progress, IProgress errorCode, @@ -303,15 +307,14 @@ public async Task DeleteAsync(IStorageItem source, bool permanently, CancellationToken cancellationToken) { - return await DeleteAsync(new PathWithType(source.Path, - source.IsOfType(StorageItemTypes.File) ? FilesystemItemType.File : FilesystemItemType.Directory), + return await DeleteAsync(source.FromStorageItem(), progress, errorCode, permanently, cancellationToken); } - public async Task DeleteAsync(PathWithType source, + public async Task DeleteAsync(IStorageItemWithPath source, IProgress progress, IProgress errorCode, bool permanently, @@ -342,14 +345,15 @@ public async Task DeleteAsync(PathWithType source, // Try again with fulltrust process if (associatedInstance.FilesystemViewModel.Connection != null) { - AppServiceResponse response = await associatedInstance.FilesystemViewModel.Connection.SendMessageAsync(new ValueSet() + AppServiceResponse response = await associatedInstance.FilesystemViewModel.Connection.SendMessageAsync(new ValueSet() { { "Arguments", "FileOperation" }, { "fileop", "DeleteItem" }, { "filepath", source.Path }, { "permanently", permanently } }); - fsResult = (FilesystemResult)(response.Status == AppServiceResponseStatus.Success); + fsResult = (FilesystemResult)(response.Status == AppServiceResponseStatus.Success + && response.Message.Get("Success", false)); } } else if (fsResult == FilesystemErrorCode.ERROR_INUSE) @@ -391,7 +395,7 @@ await associatedInstance.FilesystemViewModel.GetFileFromPathAsync(iFilePath) // Get newest file ShellFileItem item = nameMatchItems.Where((item) => item.RecycleDate != null).OrderBy((item) => item.RecycleDate).FirstOrDefault(); - return new StorageHistory(FileOperationType.Recycle, source, new PathWithType(item?.RecyclePath, source.ItemType)); + return new StorageHistory(FileOperationType.Recycle, source, StorageItemHelpers.FromPathAndType(item?.RecyclePath, source.ItemType)); } return new StorageHistory(FileOperationType.Delete, source, null); @@ -426,7 +430,7 @@ public async Task RenameAsync(IStorageItem source, await source.RenameAsync(newName, collision); errorCode?.Report(FilesystemErrorCode.ERROR_SUCCESS); - return new StorageHistory(FileOperationType.Rename, new PathWithType(originalSource, itemType), new PathWithType(source.Path, itemType)); + return new StorageHistory(FileOperationType.Rename, StorageItemHelpers.FromPathAndType(originalSource, itemType), source.FromStorageItem()); } catch (Exception e) { @@ -438,7 +442,7 @@ public async Task RenameAsync(IStorageItem source, return null; } - public async Task RenameAsync(PathWithType source, + public async Task RenameAsync(IStorageItemWithPath source, string newName, NameCollisionOption collision, IProgress errorCode, @@ -456,11 +460,11 @@ public async Task RenameAsync(PathWithType source, { try { - IStorageItem itemToRename = await source.Path.ToStorageItem(); + IStorageItem itemToRename = await source.ToStorageItem(associatedInstance); await itemToRename.RenameAsync(newName, collision); errorCode?.Report(FilesystemErrorCode.ERROR_SUCCESS); - return new StorageHistory(FileOperationType.Rename, source, new PathWithType(itemToRename.Path, source.ItemType)); + return new StorageHistory(FileOperationType.Rename, source, itemToRename.FromStorageItem()); } catch (Exception e) { @@ -472,7 +476,7 @@ public async Task RenameAsync(PathWithType source, return null; } - public async Task RestoreFromTrashAsync(PathWithType source, + public async Task RestoreFromTrashAsync(IStorageItemWithPath source, string destination, IProgress progress, IProgress errorCode, @@ -485,11 +489,11 @@ public async Task RestoreFromTrashAsync(PathWithType source, { FilesystemResult sourceFolder = await associatedInstance.FilesystemViewModel.GetFolderFromPathAsync(source.Path); FilesystemResult destinationFolder = await associatedInstance.FilesystemViewModel.GetFolderFromPathAsync(Path.GetDirectoryName(destination)); - + fsResult = sourceFolder.ErrorCode | destinationFolder.ErrorCode; errorCode?.Report(fsResult); - if (sourceFolder && destinationFolder) + if (fsResult) { fsResult = await FilesystemTasks.Wrap(() => { @@ -509,7 +513,7 @@ public async Task RestoreFromTrashAsync(PathWithType source, fsResult = sourceFile.ErrorCode | destinationFolder.ErrorCode; errorCode?.Report(fsResult); - if (sourceFile && destinationFolder) + if (fsResult) { fsResult = await FilesystemTasks.Wrap(() => { @@ -518,13 +522,21 @@ public async Task RestoreFromTrashAsync(PathWithType source, NameCollisionOption.GenerateUniqueName).AsTask(); }); } + else if (fsResult == FilesystemErrorCode.ERROR_UNAUTHORIZED) + { + // Try again with MoveFileFromApp + fsResult = (FilesystemResult)NativeFileOperationsHelper.MoveFileFromApp(source.Path, destination); + } errorCode?.Report(fsResult); } - // Recycle bin also stores a file starting with $I for each item - string iFilePath = Path.Combine(Path.GetDirectoryName(source.Path), Path.GetFileName(source.Path).Replace("$R", "$I")); - await associatedInstance.FilesystemViewModel.GetFileFromPathAsync(iFilePath) - .OnSuccess(iFile => iFile.DeleteAsync().AsTask()); + if (fsResult) + { + // Recycle bin also stores a file starting with $I for each item + string iFilePath = Path.Combine(Path.GetDirectoryName(source.Path), Path.GetFileName(source.Path).Replace("$R", "$I")); + await associatedInstance.FilesystemViewModel.GetFileFromPathAsync(iFilePath) + .OnSuccess(iFile => iFile.DeleteAsync().AsTask()); + } errorCode?.Report(fsResult); if (fsResult != FilesystemErrorCode.ERROR_SUCCESS) @@ -543,10 +555,10 @@ await associatedInstance.FilesystemViewModel.GetFileFromPathAsync(iFilePath) } } - return new StorageHistory(FileOperationType.Restore, source, new PathWithType(destination, source.ItemType)); + return new StorageHistory(FileOperationType.Restore, source, StorageItemHelpers.FromPathAndType(destination, source.ItemType)); } - #endregion + #endregion IFilesystemOperations #region IDisposable @@ -559,6 +571,6 @@ public void Dispose() associatedInstance = null; } - #endregion + #endregion IDisposable } -} +} \ No newline at end of file diff --git a/Files/Filesystem/FilesystemOperations/Helpers/FilesystemHelpers.cs b/Files/Filesystem/FilesystemOperations/Helpers/FilesystemHelpers.cs index 289fb9b998c3..7240785d7953 100644 --- a/Files/Filesystem/FilesystemOperations/Helpers/FilesystemHelpers.cs +++ b/Files/Filesystem/FilesystemOperations/Helpers/FilesystemHelpers.cs @@ -1,4 +1,5 @@ using Files.Dialogs; +using Files.Enums; using Files.Filesystem.FilesystemHistory; using Files.Helpers; using Files.UserControls; @@ -7,14 +8,13 @@ using System.Diagnostics; using System.IO; using System.Linq; +using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using Windows.ApplicationModel.DataTransfer; using Windows.Storage; -using System.Text.RegularExpressions; -using FileAttributes = System.IO.FileAttributes; using static Files.Helpers.NativeFindStorageItemHelper; -using Files.Enums; +using FileAttributes = System.IO.FileAttributes; namespace Files.Filesystem { @@ -43,9 +43,9 @@ public class FilesystemHelpers : IFilesystemHelpers "LPT6", "LPT7", "LPT8", "LPT9" }; - #endregion + #endregion Helpers Members - #endregion + #endregion Private Members #region Constructor @@ -57,13 +57,13 @@ public FilesystemHelpers(IShellPage associatedInstance, CancellationToken cancel recycleBinHelpers = new RecycleBinHelpers(this.associatedInstance); } - #endregion + #endregion Constructor #region IFilesystemHelpers #region Create - public async Task CreateAsync(PathWithType source, bool registerHistory) + public async Task CreateAsync(IStorageItemWithPath source, bool registerHistory) { FilesystemErrorCode returnCode = FilesystemErrorCode.ERROR_INPROGRESS; Progress errorCode = new Progress(); @@ -79,14 +79,14 @@ public async Task CreateAsync(PathWithType source, bool registerHi return returnCode.ToStatus(); } - #endregion + #endregion Create #region Delete - public async Task DeleteItemsAsync(IEnumerable source, bool showDialog, bool permanently, bool registerHistory) + public async Task DeleteItemsAsync(IEnumerable source, bool showDialog, bool permanently, bool registerHistory) { bool deleteFromRecycleBin = false; - foreach (PathWithType item in source) + foreach (IStorageItemWithPath item in source) { if (await recycleBinHelpers.IsRecycleBinItem(item.Path)) { @@ -140,7 +140,7 @@ public async Task DeleteItemsAsync(IEnumerable sourc var rawStorageHistory = new List(); bool originalPermanently = permanently; - foreach (PathWithType item in source) + foreach (IStorageItemWithPath item in source) { if (await recycleBinHelpers.IsRecycleBinItem(item.Path)) { @@ -175,7 +175,7 @@ public async Task DeleteItemsAsync(IEnumerable sourc return returnStatus; } - public async Task DeleteItemAsync(PathWithType source, bool showDialog, bool permanently, bool registerHistory) + public async Task DeleteItemAsync(IStorageItemWithPath source, bool showDialog, bool permanently, bool registerHistory) { PostedStatusBanner banner; bool deleteFromRecycleBin = await recycleBinHelpers.IsRecycleBinItem(source.Path); @@ -397,9 +397,9 @@ public async Task DeleteItemAsync(IStorageItem source, bool showDi return returnStatus; } - #endregion + #endregion Delete - public async Task RestoreFromTrashAsync(PathWithType source, string destination, bool registerHistory) + public async Task RestoreFromTrashAsync(IStorageItemWithPath source, string destination, bool registerHistory) { FilesystemErrorCode returnCode = FilesystemErrorCode.ERROR_INPROGRESS; Progress errorCode = new Progress(); @@ -422,18 +422,26 @@ public async Task PerformOperationTypeAsync(DataPackageOperation o { try { - switch (operation) + if (operation.HasFlag(DataPackageOperation.Copy)) { - case DataPackageOperation.Copy: - return await CopyItemsFromClipboard(packageView, destination, registerHistory); - - case DataPackageOperation.Move: - return await MoveItemsFromClipboard(packageView, destination, registerHistory); - - case DataPackageOperation.None: // Other - return await CopyItemsFromClipboard(packageView, destination, registerHistory); - - default: return default; + return await CopyItemsFromClipboard(packageView, destination, registerHistory); + } + else if (operation.HasFlag(DataPackageOperation.Move)) + { + return await MoveItemsFromClipboard(packageView, destination, registerHistory); + } + else if (operation.HasFlag(DataPackageOperation.Link)) + { + // TODO: Support link creation + return default; + } + else if (operation.HasFlag(DataPackageOperation.None)) + { + return await CopyItemsFromClipboard(packageView, destination, registerHistory); + } + else + { + return default; } } finally @@ -446,15 +454,15 @@ public async Task PerformOperationTypeAsync(DataPackageOperation o public async Task CopyItemsAsync(IEnumerable source, IEnumerable destination, bool registerHistory) { - return await CopyItemsAsync(source.Select((item) => new PathWithType(item.Path, item.IsOfType(StorageItemTypes.File) ? FilesystemItemType.File : FilesystemItemType.Directory)).ToList(), destination, registerHistory); + return await CopyItemsAsync(source.Select((item) => item.FromStorageItem()).ToList(), destination, registerHistory); } public async Task CopyItemAsync(IStorageItem source, string destination, bool registerHistory) { - return await CopyItemAsync(new PathWithType(source.Path, source.IsOfType(StorageItemTypes.File) ? FilesystemItemType.File : FilesystemItemType.Directory), destination, registerHistory); + return await CopyItemAsync(source.FromStorageItem(), destination, registerHistory); } - public async Task CopyItemsAsync(IEnumerable source, IEnumerable destination, bool registerHistory) + public async Task CopyItemsAsync(IEnumerable source, IEnumerable destination, bool registerHistory) { PostedStatusBanner banner = associatedInstance.BottomStatusStripControl.OngoingTasksControl.PostBanner( string.Empty, @@ -512,7 +520,7 @@ public async Task CopyItemsAsync(IEnumerable source, return returnStatus; } - public async Task CopyItemAsync(PathWithType source, string destination, bool registerHistory) + public async Task CopyItemAsync(IStorageItemWithPath source, string destination, bool registerHistory) { PostedStatusBanner banner = associatedInstance.BottomStatusStripControl.OngoingTasksControl.PostBanner( string.Empty, @@ -565,7 +573,7 @@ public async Task CopyItemsFromClipboard(DataPackageView packageVi { source = await packageView.GetStorageItemsAsync(); } - catch (Exception ex) when ((uint)ex.HResult == 0x80040064) + catch (Exception ex) when ((uint)ex.HResult == 0x80040064 || (uint)ex.HResult == 0x8004006A) { return ReturnResult.UnknownException; } @@ -582,21 +590,21 @@ public async Task CopyItemsFromClipboard(DataPackageView packageVi return returnStatus; } - #endregion + #endregion Copy #region Move public async Task MoveItemsAsync(IEnumerable source, IEnumerable destination, bool registerHistory) { - return await MoveItemsAsync(source.Select((item) => new PathWithType(item.Path, item.IsOfType(StorageItemTypes.File) ? FilesystemItemType.File : FilesystemItemType.Directory)).ToList(), destination, registerHistory); + return await MoveItemsAsync(source.Select((item) => item.FromStorageItem()).ToList(), destination, registerHistory); } public async Task MoveItemAsync(IStorageItem source, string destination, bool registerHistory) { - return await MoveItemAsync(new PathWithType(source.Path, source.IsOfType(StorageItemTypes.File) ? FilesystemItemType.File : FilesystemItemType.Directory), destination, registerHistory); + return await MoveItemAsync(source.FromStorageItem(), destination, registerHistory); } - public async Task MoveItemsAsync(IEnumerable source, IEnumerable destination, bool registerHistory) + public async Task MoveItemsAsync(IEnumerable source, IEnumerable destination, bool registerHistory) { PostedStatusBanner banner = associatedInstance.BottomStatusStripControl.OngoingTasksControl.PostBanner( string.Empty, @@ -654,7 +662,7 @@ public async Task MoveItemsAsync(IEnumerable source, return returnStatus; } - public async Task MoveItemAsync(PathWithType source, string destination, bool registerHistory) + public async Task MoveItemAsync(IStorageItemWithPath source, string destination, bool registerHistory) { PostedStatusBanner banner = associatedInstance.BottomStatusStripControl.OngoingTasksControl.PostBanner( string.Empty, @@ -724,7 +732,7 @@ public async Task MoveItemsFromClipboard(DataPackageView packageVi return returnStatus; } - #endregion + #endregion Move #region Rename @@ -744,7 +752,7 @@ public async Task RenameAsync(IStorageItem source, string newName, return returnCode.ToStatus(); } - public async Task RenameAsync(PathWithType source, string newName, NameCollisionOption collision, bool registerHistory) + public async Task RenameAsync(IStorageItemWithPath source, string newName, NameCollisionOption collision, bool registerHistory) { FilesystemErrorCode returnCode = FilesystemErrorCode.ERROR_INPROGRESS; Progress errorCode = new Progress(); @@ -760,9 +768,9 @@ public async Task RenameAsync(PathWithType source, string newName, return returnCode.ToStatus(); } - #endregion + #endregion Rename - #endregion + #endregion IFilesystemHelpers #region Public Helpers @@ -933,7 +941,7 @@ public static bool ContainsRestrictedFileName(string input) return false; } - #endregion + #endregion Public Helpers #region IDisposable @@ -948,6 +956,6 @@ public void Dispose() recycleBinHelpers = null; } - #endregion + #endregion IDisposable } -} +} \ No newline at end of file diff --git a/Files/Filesystem/FilesystemOperations/Helpers/IFilesystemHelpers.cs b/Files/Filesystem/FilesystemOperations/Helpers/IFilesystemHelpers.cs index 63ccd001941d..f0a36ebdb3e7 100644 --- a/Files/Filesystem/FilesystemOperations/Helpers/IFilesystemHelpers.cs +++ b/Files/Filesystem/FilesystemOperations/Helpers/IFilesystemHelpers.cs @@ -1,10 +1,10 @@ -using System; +using Files.Enums; +using Files.Filesystem.FilesystemHistory; +using System; using System.Collections.Generic; using System.Threading.Tasks; using Windows.ApplicationModel.DataTransfer; using Windows.Storage; -using Files.Filesystem.FilesystemHistory; -using Files.Enums; namespace Files.Filesystem { @@ -16,7 +16,7 @@ public interface IFilesystemHelpers : IDisposable /// FullPath to the item /// Determines whether is saved /// of performed operation - Task CreateAsync(PathWithType source, bool registerHistory); + Task CreateAsync(IStorageItemWithPath source, bool registerHistory); #region Delete @@ -48,7 +48,7 @@ public interface IFilesystemHelpers : IDisposable /// Determines whether is be deleted permanently /// Determines whether is saved /// of performed operation - Task DeleteItemsAsync(IEnumerable source, bool showDialog, bool permanently, bool registerHistory); + Task DeleteItemsAsync(IEnumerable source, bool showDialog, bool permanently, bool registerHistory); /// /// Deletes provided @@ -58,9 +58,9 @@ public interface IFilesystemHelpers : IDisposable /// Determines whether is be deleted permanently /// Determines whether is saved /// of performed operation - Task DeleteItemAsync(PathWithType source, bool showDialog, bool permanently, bool registerHistory); + Task DeleteItemAsync(IStorageItemWithPath source, bool showDialog, bool permanently, bool registerHistory); - #endregion + #endregion Delete /// /// Restores from the RecycleBin to fullPath @@ -69,7 +69,7 @@ public interface IFilesystemHelpers : IDisposable /// The destination fullPath to restore to /// Determines whether is saved /// of performed operation - Task RestoreFromTrashAsync(PathWithType source, string destination, bool registerHistory); + Task RestoreFromTrashAsync(IStorageItemWithPath source, string destination, bool registerHistory); /// /// Performs relevant operation based on @@ -113,7 +113,7 @@ public interface IFilesystemHelpers : IDisposable /// The destination fullPath /// Determines whether is saved /// of performed operation - Task CopyItemsAsync(IEnumerable source, IEnumerable destination, bool registerHistory); + Task CopyItemsAsync(IEnumerable source, IEnumerable destination, bool registerHistory); /// /// Copies to fullPath @@ -122,7 +122,7 @@ public interface IFilesystemHelpers : IDisposable /// The destination fullPath /// Determines whether is saved /// of performed operation - Task CopyItemAsync(PathWithType source, string destination, bool registerHistory); + Task CopyItemAsync(IStorageItemWithPath source, string destination, bool registerHistory); /// /// Copies items from clipboard to fullPath @@ -138,7 +138,7 @@ public interface IFilesystemHelpers : IDisposable /// of performed operation Task CopyItemsFromClipboard(DataPackageView packageView, string destination, bool registerHistory); - #endregion + #endregion Copy #region Move @@ -167,7 +167,7 @@ public interface IFilesystemHelpers : IDisposable /// The destination fullPath /// Determines whether is saved /// of performed operation - Task MoveItemsAsync(IEnumerable source, IEnumerable destination, bool registerHistory); + Task MoveItemsAsync(IEnumerable source, IEnumerable destination, bool registerHistory); /// /// Moves to fullPath @@ -176,7 +176,7 @@ public interface IFilesystemHelpers : IDisposable /// The destination fullPath /// Determines whether is saved /// of performed operation - Task MoveItemAsync(PathWithType source, string destination, bool registerHistory); + Task MoveItemAsync(IStorageItemWithPath source, string destination, bool registerHistory); /// /// Moves items from clipboard to fullPath @@ -192,7 +192,7 @@ public interface IFilesystemHelpers : IDisposable /// of performed operation Task MoveItemsFromClipboard(DataPackageView packageView, string destination, bool registerHistory); - #endregion + #endregion Move /// /// Renames with @@ -212,6 +212,6 @@ public interface IFilesystemHelpers : IDisposable /// Determines what to do if item already exists /// Determines whether is saved /// of performed operation - Task RenameAsync(PathWithType source, string newName, NameCollisionOption collision, bool registerHistory); + Task RenameAsync(IStorageItemWithPath source, string newName, NameCollisionOption collision, bool registerHistory); } } \ No newline at end of file diff --git a/Files/Filesystem/FilesystemOperations/IFilesystemOperations.cs b/Files/Filesystem/FilesystemOperations/IFilesystemOperations.cs index a1351978db4c..22a24fde0c3b 100644 --- a/Files/Filesystem/FilesystemOperations/IFilesystemOperations.cs +++ b/Files/Filesystem/FilesystemOperations/IFilesystemOperations.cs @@ -1,8 +1,8 @@ -using System; +using Files.Filesystem.FilesystemHistory; +using System; using System.Threading; using System.Threading.Tasks; using Windows.Storage; -using Files.Filesystem.FilesystemHistory; namespace Files.Filesystem { @@ -28,7 +28,7 @@ public interface IFilesystemOperations : IDisposable ///
/// Destination: null /// - Task CreateAsync(PathWithType source, IProgress errorCode, CancellationToken cancellationToken); + Task CreateAsync(IStorageItemWithPath source, IProgress errorCode, CancellationToken cancellationToken); /// /// Copies to fullPath @@ -64,7 +64,7 @@ Task CopyAsync(IStorageItem source, ///
/// Destination: The item fullPath (as ) the was copied /// - Task CopyAsync(PathWithType source, + Task CopyAsync(IStorageItemWithPath source, string destination, IProgress progress, IProgress errorCode, @@ -104,7 +104,7 @@ Task MoveAsync(IStorageItem source, ///
/// Destination: The item fullPath (as ) the was moved /// - Task MoveAsync(PathWithType source, + Task MoveAsync(IStorageItemWithPath source, string destination, IProgress progress, IProgress errorCode, @@ -153,7 +153,7 @@ Task DeleteAsync(IStorageItem source, ///
/// If was false, returns path to recycled item /// - Task DeleteAsync(PathWithType source, + Task DeleteAsync(IStorageItemWithPath source, IProgress progress, IProgress errorCode, bool permanently, @@ -193,7 +193,7 @@ Task RenameAsync(IStorageItem source, ///
/// Destination: The renamed item fullPath (as ) /// - Task RenameAsync(PathWithType source, + Task RenameAsync(IStorageItemWithPath source, string newName, NameCollisionOption collision, IProgress errorCode, @@ -213,7 +213,7 @@ Task RenameAsync(PathWithType source, ///
/// Destination: The item fullPath (as ) the has been restored /// - Task RestoreFromTrashAsync(PathWithType source, + Task RestoreFromTrashAsync(IStorageItemWithPath source, string destination, IProgress progress, IProgress errorCode, diff --git a/Files/Filesystem/FilesystemOperations/PathWithType.cs b/Files/Filesystem/FilesystemOperations/PathWithType.cs deleted file mode 100644 index edeb4553143d..000000000000 --- a/Files/Filesystem/FilesystemOperations/PathWithType.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using Windows.Storage; - -namespace Files.Filesystem -{ - public class PathWithType : IDisposable - { - #region Public Properties - - public string Path { get; private set; } - - public FilesystemItemType ItemType { get; private set; } - - #endregion - - #region Constructor - - public PathWithType(string path, FilesystemItemType itemType) - { - Path = path; - ItemType = itemType; - } - - #endregion - - #region Operators - - public static explicit operator string(PathWithType pathWithType) => pathWithType.Path; - - public static explicit operator FilesystemItemType(PathWithType pathWithType) => pathWithType.ItemType; - - public static explicit operator PathWithType(StorageFile storageFile) - { - return new PathWithType(storageFile.Path, storageFile.IsOfType(StorageItemTypes.File) ? FilesystemItemType.File : FilesystemItemType.Directory); - } - - public static explicit operator PathWithType(StorageFolder storageFolder) - { - return new PathWithType(storageFolder.Path, storageFolder.IsOfType(StorageItemTypes.File) ? FilesystemItemType.File : FilesystemItemType.Directory); - } - - #endregion - - #region Override - - public override string ToString() - { - return Path; - } - - #endregion - - #region IDisposable - - public void Dispose() - { - Path ??= string.Empty; - - Path = null; - } - - #endregion - } -} diff --git a/Files/Filesystem/ListedItem.cs b/Files/Filesystem/ListedItem.cs index 1cb0f6f551f9..85cbf36a47e5 100644 --- a/Files/Filesystem/ListedItem.cs +++ b/Files/Filesystem/ListedItem.cs @@ -1,12 +1,8 @@ -using ByteSizeLib; -using Files.Enums; -using Files.Helpers; using Files.Enums; using Files.Filesystem.Cloud; using Microsoft.Toolkit.Mvvm.ComponentModel; using Microsoft.Toolkit.Uwp.Extensions; using System; -using System.Diagnostics; using Windows.Storage; using Windows.UI.Xaml.Media.Imaging; diff --git a/Files/Filesystem/Search/FolderSearch.cs b/Files/Filesystem/Search/FolderSearch.cs index 30cb8df204c0..3f4f749ac2b0 100644 --- a/Files/Filesystem/Search/FolderSearch.cs +++ b/Files/Filesystem/Search/FolderSearch.cs @@ -1,20 +1,18 @@ -using System; +using Files.Common; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.Linq; -using System.Text; +using System.IO; using System.Threading.Tasks; using Windows.Storage; using Windows.Storage.Search; using Windows.UI.Xaml.Media.Imaging; -using Files.Common; using static Files.Helpers.NativeFindStorageItemHelper; -using System.IO; using FileAttributes = System.IO.FileAttributes; namespace Files.Filesystem.Search { - class FolderSearch + internal class FolderSearch { public static async Task> SearchForUserQueryTextAsync(string userText, string WorkingDirectory, int maxItemCount = 10) { @@ -23,7 +21,7 @@ public static async Task> SearchForUserQueryTex { FolderDepth = FolderDepth.Deep, IndexerOption = IndexerOption.OnlyUseIndexerAndOptimizeForIndexedProperties, - UserSearchFilter = string.IsNullOrWhiteSpace(userText)? null : userText, + UserSearchFilter = string.IsNullOrWhiteSpace(userText) ? null : userText, }; options.SortOrder.Add(new SortEntry() { @@ -88,7 +86,6 @@ public static async Task> SearchForUserQueryTex ItemPropertiesInitialized = true }); } - } } if (maxItemCount != 10) @@ -120,9 +117,9 @@ await Task.Run(() => var hasNextFile = false; do { - if (((FileAttributes)findData.dwFileAttributes & FileAttributes.System) != FileAttributes.System) + var itemPath = Path.Combine(WorkingDirectory, findData.cFileName); + if (((FileAttributes)findData.dwFileAttributes & FileAttributes.System) != FileAttributes.System || !App.AppSettings.AreSystemItemsHidden) { - var itemPath = Path.Combine(WorkingDirectory, findData.cFileName); if (((FileAttributes)findData.dwFileAttributes & FileAttributes.Hidden) == FileAttributes.Hidden) { if (((FileAttributes)findData.dwFileAttributes & FileAttributes.Directory) != FileAttributes.Directory) @@ -170,4 +167,4 @@ await Task.Run(() => return returnedItems; } } -} +} \ No newline at end of file diff --git a/Files/Filesystem/StorageFileHelpers/FilesystemResult.cs b/Files/Filesystem/StorageFileHelpers/FilesystemResult.cs index aff43cc401d6..5774d8985286 100644 --- a/Files/Filesystem/StorageFileHelpers/FilesystemResult.cs +++ b/Files/Filesystem/StorageFileHelpers/FilesystemResult.cs @@ -128,14 +128,14 @@ public async static Task Wrap(Func wrapped) } } - public async static Task> OnSuccess(this Task> wrapped, Func> func) + public async static Task> OnSuccess(this Task> wrapped, Func> func) { var res = await wrapped; if (res) { return await Wrap(() => func(res.Result)); } - return res; + return new FilesystemResult(default, res.ErrorCode); } public async static Task OnSuccess(this Task> wrapped, Func func) diff --git a/Files/Filesystem/StorageFileHelpers/IStorageItemWithPath.cs b/Files/Filesystem/StorageFileHelpers/IStorageItemWithPath.cs index c48a8d3aca7b..46e508639700 100644 --- a/Files/Filesystem/StorageFileHelpers/IStorageItemWithPath.cs +++ b/Files/Filesystem/StorageFileHelpers/IStorageItemWithPath.cs @@ -3,9 +3,10 @@ namespace Files.Filesystem { public interface IStorageItemWithPath // TODO: Maybe use here : IStorageItem instead of declaring a variable, - // and keep the Path property for it to override IStorageItem.Path ? + // and keep the Path property for it to override IStorageItem.Path ? { public string Path { get; set; } public IStorageItem Item { get; set; } + public FilesystemItemType ItemType { get; } } } \ No newline at end of file diff --git a/Files/Filesystem/StorageFileHelpers/StorageFileWithPath.cs b/Files/Filesystem/StorageFileHelpers/StorageFileWithPath.cs index 7f337bce201c..f5397dc1efb3 100644 --- a/Files/Filesystem/StorageFileHelpers/StorageFileWithPath.cs +++ b/Files/Filesystem/StorageFileHelpers/StorageFileWithPath.cs @@ -18,6 +18,7 @@ public StorageFile File public string Path { get; set; } public IStorageItem Item { get; set; } + public FilesystemItemType ItemType => FilesystemItemType.File; public StorageFileWithPath(StorageFile file) { diff --git a/Files/Filesystem/StorageFileHelpers/StorageFolderWithPath.cs b/Files/Filesystem/StorageFileHelpers/StorageFolderWithPath.cs index 256a25bb0602..63174d5fe842 100644 --- a/Files/Filesystem/StorageFileHelpers/StorageFolderWithPath.cs +++ b/Files/Filesystem/StorageFileHelpers/StorageFolderWithPath.cs @@ -18,6 +18,7 @@ public StorageFolder Folder public string Path { get; set; } public IStorageItem Item { get; set; } + public FilesystemItemType ItemType => FilesystemItemType.Directory; public StorageFolderWithPath(StorageFolder folder) { diff --git a/Files/Filesystem/StorageHistory/Helpers/StorageHistoryHelpers.cs b/Files/Filesystem/StorageHistory/Helpers/StorageHistoryHelpers.cs index e8e260a9524d..3dcdc714eeea 100644 --- a/Files/Filesystem/StorageHistory/Helpers/StorageHistoryHelpers.cs +++ b/Files/Filesystem/StorageHistory/Helpers/StorageHistoryHelpers.cs @@ -1,5 +1,4 @@ using Files.Enums; -using Files.Helpers; using System; using System.Threading.Tasks; @@ -11,7 +10,7 @@ public class StorageHistoryHelpers : IDisposable private IStorageHistoryOperations storageHistoryOperations; - #endregion + #endregion Private Members #region Constructor @@ -20,7 +19,7 @@ public StorageHistoryHelpers(IStorageHistoryOperations storageHistoryOperations) this.storageHistoryOperations = storageHistoryOperations; } - #endregion + #endregion Constructor #region Undo, Redo @@ -70,7 +69,7 @@ public async Task TryRedo() return ReturnResult.Cancelled; } - #endregion + #endregion Undo, Redo #region IDisposable @@ -81,6 +80,6 @@ public void Dispose() storageHistoryOperations = null; } - #endregion + #endregion IDisposable } -} +} \ No newline at end of file diff --git a/Files/Filesystem/StorageHistory/IStorageHistory.cs b/Files/Filesystem/StorageHistory/IStorageHistory.cs index 918119e148d5..5ccbb1bd8246 100644 --- a/Files/Filesystem/StorageHistory/IStorageHistory.cs +++ b/Files/Filesystem/StorageHistory/IStorageHistory.cs @@ -19,7 +19,7 @@ public interface IStorageHistory : IDisposable ///
/// May contain more that one item ///
- IEnumerable Source { get; } + IEnumerable Source { get; } /// /// Destination file/folder @@ -29,16 +29,16 @@ public interface IStorageHistory : IDisposable ///
/// May contain more that one item ///
- IEnumerable Destination { get; } + IEnumerable Destination { get; } #region Modify void Modify(IStorageHistory newHistory); - void Modify(FileOperationType operationType, IEnumerable source, IEnumerable destination); + void Modify(FileOperationType operationType, IEnumerable source, IEnumerable destination); - void Modify(FileOperationType operationType, PathWithType source, PathWithType destination); + void Modify(FileOperationType operationType, IStorageItemWithPath source, IStorageItemWithPath destination); - #endregion + #endregion Modify } -} +} \ No newline at end of file diff --git a/Files/Filesystem/StorageHistory/IStorageHistoryOperations.cs b/Files/Filesystem/StorageHistory/IStorageHistoryOperations.cs index c4db3c19c1a6..270460674d39 100644 --- a/Files/Filesystem/StorageHistory/IStorageHistoryOperations.cs +++ b/Files/Filesystem/StorageHistory/IStorageHistoryOperations.cs @@ -20,4 +20,4 @@ public interface IStorageHistoryOperations : IDisposable /// Task Redo(IStorageHistory history); } -} +} \ No newline at end of file diff --git a/Files/Filesystem/StorageHistory/StorageHistory.cs b/Files/Filesystem/StorageHistory/StorageHistory.cs index 6f98c50d3379..458687d2050c 100644 --- a/Files/Filesystem/StorageHistory/StorageHistory.cs +++ b/Files/Filesystem/StorageHistory/StorageHistory.cs @@ -10,29 +10,29 @@ public class StorageHistory : IStorageHistory public FileOperationType OperationType { get; private set; } - public IEnumerable Source { get; private set; } + public IEnumerable Source { get; private set; } - public IEnumerable Destination { get; private set; } + public IEnumerable Destination { get; private set; } - #endregion + #endregion Public Properties #region Constructor - public StorageHistory(FileOperationType operationType, IEnumerable source, IEnumerable destination) + public StorageHistory(FileOperationType operationType, IEnumerable source, IEnumerable destination) { OperationType = operationType; Source = source; Destination = destination; } - public StorageHistory(FileOperationType operationType, PathWithType source, PathWithType destination) + public StorageHistory(FileOperationType operationType, IStorageItemWithPath source, IStorageItemWithPath destination) { OperationType = operationType; Source = source.CreateEnumerable(); Destination = destination.CreateEnumerable(); } - #endregion + #endregion Constructor #region Modify @@ -43,33 +43,30 @@ public void Modify(IStorageHistory newHistory) Destination = newHistory.Destination; } - public void Modify(FileOperationType operationType, IEnumerable source, IEnumerable destination) + public void Modify(FileOperationType operationType, IEnumerable source, IEnumerable destination) { OperationType = operationType; Source = source; Destination = destination; } - public void Modify(FileOperationType operationType, PathWithType source, PathWithType destination) + public void Modify(FileOperationType operationType, IStorageItemWithPath source, IStorageItemWithPath destination) { OperationType = operationType; Source = source.CreateEnumerable(); Destination = destination.CreateEnumerable(); } - #endregion + #endregion Modify #region IDisposable public void Dispose() { - Source?.ForEach((item) => item?.Dispose()); - Destination?.ForEach((item) => item?.Dispose()); - Source = null; Destination = null; } - #endregion + #endregion IDisposable } -} +} \ No newline at end of file diff --git a/Files/Filesystem/StorageHistory/StorageHistoryOperations.cs b/Files/Filesystem/StorageHistory/StorageHistoryOperations.cs index 6611e0ad3c3e..b65439abe293 100644 --- a/Files/Filesystem/StorageHistory/StorageHistoryOperations.cs +++ b/Files/Filesystem/StorageHistory/StorageHistoryOperations.cs @@ -1,4 +1,6 @@ -using System; +using Files.Enums; +using Files.Helpers; +using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; @@ -6,8 +8,6 @@ using System.Threading; using System.Threading.Tasks; using Windows.Storage; -using Files.Helpers; -using Files.Enums; namespace Files.Filesystem.FilesystemHistory { @@ -23,7 +23,7 @@ public class StorageHistoryOperations : IStorageHistoryOperations private readonly CancellationToken cancellationToken; - #endregion + #endregion Private Members #region Constructor @@ -35,7 +35,7 @@ public StorageHistoryOperations(IShellPage associatedInstance, CancellationToken filesystemHelpers = new FilesystemHelpers(associatedInstance, cancellationToken); } - #endregion + #endregion Constructor #region IStorageHistoryOperations @@ -130,13 +130,20 @@ await filesystemOperations.RenameAsync( cancellationToken)); } - IStorageHistory newHistory = new StorageHistory( - FileOperationType.Recycle, - rawStorageHistory.SelectMany((item) => item?.Source).ToList(), - rawStorageHistory.SelectMany((item) => item?.Destination).ToList()); + if (rawStorageHistory.TrueForAll((item) => item != null)) + { + IStorageHistory newHistory = new StorageHistory( + FileOperationType.Recycle, + rawStorageHistory.SelectMany((item) => item?.Source).ToList(), + rawStorageHistory.SelectMany((item) => item?.Destination).ToList()); - // We need to change the recycled item paths (since IDs are different) - for Undo() to work - App.HistoryWrapper.ModifyCurrentHistory(newHistory); + // We need to change the recycled item paths (since IDs are different) - for Undo() to work + App.HistoryWrapper.ModifyCurrentHistory(newHistory); + } + else + { + App.HistoryWrapper.RemoveHistory(history, true); + } break; } @@ -263,7 +270,7 @@ await filesystemOperations.RenameAsync( if (returnStatus == ReturnResult.IntegrityCheckFailed) // Not found, corrupted { - App.HistoryWrapper.RemoveHistory(history); + App.HistoryWrapper.RemoveHistory(history, false); } break; @@ -289,13 +296,20 @@ await filesystemOperations.RenameAsync( cancellationToken)); } - IStorageHistory newHistory = new StorageHistory( - FileOperationType.Restore, - rawStorageHistory.SelectMany((item) => item?.Destination).ToList(), - rawStorageHistory.SelectMany((item) => item?.Source).ToList()); + if (rawStorageHistory.TrueForAll((item) => item != null)) + { + IStorageHistory newHistory = new StorageHistory( + FileOperationType.Restore, + rawStorageHistory.SelectMany((item) => item?.Destination).ToList(), + rawStorageHistory.SelectMany((item) => item?.Source).ToList()); - // We need to change the recycled item paths (since IDs are different) - for Redo() to work - App.HistoryWrapper.ModifyCurrentHistory(newHistory); + // We need to change the recycled item paths (since IDs are different) - for Redo() to work + App.HistoryWrapper.ModifyCurrentHistory(newHistory); + } + else + { + App.HistoryWrapper.RemoveHistory(history, false); + } break; } @@ -312,18 +326,19 @@ await filesystemOperations.RenameAsync( return returnStatus; } - #endregion + #endregion IStorageHistoryOperations #region Private Helpers + // history.Destination is null with CreateNew private bool IsHistoryNull(IStorageHistory history) => !(history.Source.ToList().TrueForAll((item) => item != null && !string.IsNullOrWhiteSpace(item.Path)) - && history.Destination.ToList().TrueForAll((item) => item != null && !string.IsNullOrWhiteSpace(item.Path))); + && (history.Destination == null || history.Destination.ToList().TrueForAll((item) => item != null && !string.IsNullOrWhiteSpace(item.Path)))); - private bool IsHistoryNull(IEnumerable source) => + private bool IsHistoryNull(IEnumerable source) => !(source.ToList().TrueForAll((item) => item != null && !string.IsNullOrWhiteSpace(item.Path))); - #endregion + #endregion Private Helpers #region IDisposable @@ -338,6 +353,6 @@ public void Dispose() filesystemHelpers = null; } - #endregion + #endregion IDisposable } -} +} \ No newline at end of file diff --git a/Files/Filesystem/StorageHistory/StorageHistoryWrapper.cs b/Files/Filesystem/StorageHistory/StorageHistoryWrapper.cs index ad5e710332be..92e0911c2c04 100644 --- a/Files/Filesystem/StorageHistory/StorageHistoryWrapper.cs +++ b/Files/Filesystem/StorageHistory/StorageHistoryWrapper.cs @@ -12,17 +12,17 @@ public class StorageHistoryWrapper : IDisposable private int storageHistoryIndex; - #endregion + #endregion Private Members #region Constructor public StorageHistoryWrapper() { this.storageHistory = new List(); - this.storageHistoryIndex = 0; + this.storageHistoryIndex = -1; } - #endregion + #endregion Constructor #region Helpers @@ -30,32 +30,41 @@ public void AddHistory(IStorageHistory history) { if (history != null) { - this.storageHistory?.Add(history); - - if (this.storageHistory?.Count > 1) + this.storageHistoryIndex++; + this.storageHistory.Insert(this.storageHistoryIndex, history); + // If a history item is added also remove all the redo operations after it + for (var idx = this.storageHistory.Count - 1; idx > this.storageHistoryIndex; idx--) { - this.storageHistoryIndex++; + this.storageHistory.RemoveAt(idx); } } } - public void RemoveHistory(IStorageHistory history) + public void RemoveHistory(IStorageHistory history, bool decreaseIndex) { if (history != null) { - this.storageHistory?.Remove(history); - this.storageHistoryIndex--; + // If a history item is invalid also remove all the redo operations after it + for (var idx = this.storageHistory.Count - 1; idx > this.storageHistoryIndex; idx--) + { + this.storageHistory.RemoveAt(idx); + } + if (decreaseIndex) + { + this.storageHistoryIndex--; + } + this.storageHistory.Remove(history); } } public void ModifyCurrentHistory(IStorageHistory newHistory) { - this.storageHistory?[this.storageHistoryIndex].Modify(newHistory); + this.storageHistory[this.storageHistoryIndex].Modify(newHistory); } public IStorageHistory GetCurrentHistory() { - return this.storageHistory?.ElementAt(this.storageHistoryIndex); + return this.storageHistory.ElementAt(this.storageHistoryIndex); } public void IncreaseIndex() @@ -74,18 +83,17 @@ public bool CanUndo() => public bool CanRedo() => (this.storageHistoryIndex + 1) < this.storageHistory.Count; - #endregion + #endregion Helpers #region IDisposable public void Dispose() { storageHistory?.ForEach((item) => item?.Dispose()); - storageHistory?.ForEach((item) => item = null); storageHistory = null; } - #endregion + #endregion IDisposable } -} +} \ No newline at end of file diff --git a/Files/Helpers/AppUpdater.cs b/Files/Helpers/AppUpdater.cs new file mode 100644 index 000000000000..b4fc8b505283 --- /dev/null +++ b/Files/Helpers/AppUpdater.cs @@ -0,0 +1,84 @@ +using Microsoft.Toolkit.Uwp.Extensions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Windows.Services.Store; +using Windows.UI.Xaml.Controls; + +namespace Files.Helpers +{ + internal class AppUpdater + { + private StoreContext context = null; + private IReadOnlyList UpdateList = null; + + public AppUpdater() + { + context = StoreContext.GetDefault(); + } + + public async void CheckForUpdatesAsync(bool mandantoryOnly = true) + { + try + { + if (context == null) + { + context = StoreContext.GetDefault(); + } + + UpdateList = await context.GetAppAndOptionalStorePackageUpdatesAsync(); + + if (mandantoryOnly) + { + UpdateList = (IReadOnlyList)UpdateList.Where(e => e.Mandatory); + } + + if (UpdateList.Count > 0) + { + if (await DownloadUpdatesConsent()) + { + DownloadUpdates(); + } + } + } + catch (Exception) + { + } + } + + private async Task DownloadUpdatesConsent() + { + ContentDialog dialog = new ContentDialog + { + Title = "ConsentDialogTitle".GetLocalized(), + Content = "ConsentDialogContent".GetLocalized(), + CloseButtonText = "ConsentDialogCloseButtonText".GetLocalized(), + PrimaryButtonText = "ConsentDialogPrimaryButtonText".GetLocalized() + }; + ContentDialogResult result = await dialog.ShowAsync(); + + if (result == ContentDialogResult.Primary) + { + return true; + } + return false; + } + + private IAsyncResult DownloadUpdates() + { + if (UpdateList == null || UpdateList.Count < 1) + { + return null; + } + + if (context == null) + { + context = StoreContext.GetDefault(); + } + + IAsyncResult downloadOperation = (IAsyncResult)context.RequestDownloadAndInstallStorePackageUpdatesAsync(UpdateList); + return downloadOperation; + } + } +} \ No newline at end of file diff --git a/Files/Helpers/ArrayHelpers.cs b/Files/Helpers/ArrayHelpers.cs deleted file mode 100644 index a7905c942a6b..000000000000 --- a/Files/Helpers/ArrayHelpers.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Files.Helpers -{ - public class ArrayHelpers - { - public static int FitBounds(int index, int length) => - index == 0 ? index : (index >= length ? length - 1 : (index < 0 ? 0 : index)); - } -} diff --git a/Files/Helpers/Convert/ErrorCodeConverter.cs b/Files/Helpers/Convert/ErrorCodeConverter.cs index 17f66fd3a731..e66cc26688e8 100644 --- a/Files/Helpers/Convert/ErrorCodeConverter.cs +++ b/Files/Helpers/Convert/ErrorCodeConverter.cs @@ -39,9 +39,9 @@ public static ReturnResult ToStatus(this FilesystemErrorCode errorCode) case FilesystemErrorCode.ERROR_INPROGRESS: return ReturnResult.InProgress; - default: + default: return default; } } } -} +} \ No newline at end of file diff --git a/Files/Helpers/PostBannerHelpers.cs b/Files/Helpers/PostBannerHelpers.cs index 11d33566363f..d9236e9d2d9e 100644 --- a/Files/Helpers/PostBannerHelpers.cs +++ b/Files/Helpers/PostBannerHelpers.cs @@ -64,4 +64,4 @@ public static void PostBanner_Delete(ReturnResult status, FileOperationType oper } } } -} +} \ No newline at end of file diff --git a/Files/Helpers/RecycleBinHelpers.cs b/Files/Helpers/RecycleBinHelpers.cs index 61d47a55b56a..1d66cdae4d63 100644 --- a/Files/Helpers/RecycleBinHelpers.cs +++ b/Files/Helpers/RecycleBinHelpers.cs @@ -18,7 +18,7 @@ public class RecycleBinHelpers : IDisposable private AppServiceConnection Connection => associatedInstance?.ServiceConnection; - #endregion + #endregion Private Members public RecycleBinHelpers(IShellPage associatedInstance) { @@ -81,6 +81,6 @@ public void Dispose() associatedInstance = null; } - #endregion + #endregion IDisposable } -} +} \ No newline at end of file diff --git a/Files/Helpers/RegistryHelper.cs b/Files/Helpers/RegistryHelper.cs new file mode 100644 index 000000000000..3e16b59f321a --- /dev/null +++ b/Files/Helpers/RegistryHelper.cs @@ -0,0 +1,132 @@ +using Files.DataModels; +using Files.Filesystem; +using Microsoft.Win32; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Security; +using System.Text; +using System.Threading.Tasks; +using Windows.Storage; + +namespace Files.Helpers +{ + public static class RegistryHelper + { + public static async Task> GetNewContextMenuEntries() + { + var newMenuItems = new List(); + foreach (var keyName in Registry.ClassesRoot.GetSubKeyNames() + .Where(x => x.StartsWith(".") && !new string[] { ".library-ms", ".url", ".lnk" }.Contains(x))) + { + using var key = Registry.ClassesRoot.OpenSubKeySafe(keyName); + if (key != null) + { + var ret = await GetShellNewRegistryEntries(key, key); + if (ret != null) + { + newMenuItems.Add(ret); + } + } + } + return newMenuItems; + } + + public static async Task GetNewContextMenuEntryForType(string extension) + { + if (string.IsNullOrEmpty(extension)) return null; + using var key = Registry.ClassesRoot.OpenSubKeySafe(extension); + return key != null ? await GetShellNewRegistryEntries(key, key) : null; + } + + private static async Task GetShellNewRegistryEntries(RegistryKey current, RegistryKey root) + { + foreach (var keyName in current.GetSubKeyNames()) + { + using var key = current.OpenSubKeySafe(keyName); + if (key == null) + { + continue; + } + if (keyName == "ShellNew") + { + return await ParseShellNewRegistryEntry(key, root); + } + else + { + var ret = await GetShellNewRegistryEntries(key, root); + if (ret != null) + { + return ret; + } + } + } + return null; + } + + private static async Task ParseShellNewRegistryEntry(RegistryKey key, RegistryKey root) + { + if (!key.GetValueNames().Contains("NullFile") && + !key.GetValueNames().Contains("ItemName") && + !key.GetValueNames().Contains("FileName")) + { + return null; + } + + var extension = root.Name.Substring(root.Name.LastIndexOf('\\') + 1); + var fileName = (string)key.GetValue("FileName"); + if (!string.IsNullOrEmpty(fileName) && Path.GetExtension(fileName) != extension) + { + return null; + } + + byte[] data = null; + var dataObj = key.GetValue("Data"); + if (dataObj != null) + { + switch (key.GetValueKind("Data")) + { + case RegistryValueKind.Binary: + data = (byte[])dataObj; + break; + case RegistryValueKind.String: + data = UTF8Encoding.UTF8.GetBytes((string)dataObj); + break; + } + } + + var sampleFile = await FilesystemTasks.Wrap(() => ApplicationData.Current.LocalFolder.CreateFolderAsync("extensions", CreationCollisionOption.OpenIfExists).AsTask()) + .OnSuccess(t => t.CreateFileAsync("file" + extension, CreationCollisionOption.OpenIfExists).AsTask()); + + var displayType = sampleFile ? sampleFile.Result.DisplayType : string.Format("{0} {1}", "file", extension); + var thumbnail = sampleFile ? await sampleFile.Result.GetThumbnailAsync(Windows.Storage.FileProperties.ThumbnailMode.ListView, 24, Windows.Storage.FileProperties.ThumbnailOptions.UseCurrentScale) : null; + + var entry = new ShellNewEntry() + { + Extension = extension, + Template = fileName, + Name = displayType, + Command = (string)key.GetValue("Command"), + //Name = (string)key.GetValue("ItemName"), + //IconPath = (string)key.GetValue("IconPath"), + Icon = thumbnail, + Data = data + }; + + return entry; + } + + private static RegistryKey OpenSubKeySafe(this RegistryKey root, string keyName) + { + try + { + return root.OpenSubKey(keyName); + } + catch (SecurityException) + { + return null; + } + } + } +} diff --git a/Files/Helpers/StorageItemHelpers.cs b/Files/Helpers/StorageItemHelpers.cs index 0cb1030612ac..110b5ba197ca 100644 --- a/Files/Helpers/StorageItemHelpers.cs +++ b/Files/Helpers/StorageItemHelpers.cs @@ -1,5 +1,4 @@ using Files.Filesystem; -using System; using System.Collections.Generic; using System.IO; using System.Threading.Tasks; @@ -12,146 +11,47 @@ namespace Files.Helpers ///
public static class StorageItemHelpers { - // TODO: If the TODO of IStorageItemWithPath is implemented, change return type to IStorageItem - public static async Task ToStorageItem(this string path, StorageFolderWithPath parentFolder = null) + public static async Task ToStorageItem(this IStorageItemWithPath item, IShellPage associatedInstance = null) { - FilesystemResult fsRootFolderResult = await FilesystemTasks.Wrap(async () => + if (item.Item != null) { - return (StorageFolderWithPath)await Path.GetPathRoot(path).ToStorageItemWithPath(); - }); - - FilesystemResult fsFileResult = await FilesystemTasks.Wrap(() => - { - return StorageFileExtensions.DangerousGetFileFromPathAsync(path, fsRootFolderResult.Result, parentFolder); - }); - - if (fsFileResult) - { - if (!string.IsNullOrWhiteSpace(fsFileResult.Result.Path)) - { - return fsFileResult.Result; - } - else - { - FilesystemResult fsFileWithPathResult = await FilesystemTasks.Wrap(() => - { - return StorageFileExtensions.DangerousGetFileWithPathFromPathAsync(path, fsRootFolderResult); - }); - - if (fsFileWithPathResult) - { - return null; /* fsFileWithPathResult.Result */ // Could be done if IStorageItemWithPath implemented IStorageItem - } - } - } - - FilesystemResult fsFolderResult = await FilesystemTasks.Wrap(() => StorageFileExtensions.DangerousGetFolderFromPathAsync(path)); - - if (fsFolderResult) - { - if (!string.IsNullOrWhiteSpace(fsFolderResult.Result.Path)) - { - return fsFolderResult.Result; - } - else - { - FilesystemResult fsFolderWithPathResult = await FilesystemTasks.Wrap(() => - { - return StorageFileExtensions.DangerousGetFolderWithPathFromPathAsync(path, fsRootFolderResult); - }); - - if (fsFolderWithPathResult) - { - return null; /* fsFolderWithPathResult.Result; */ // Could be done if IStorageItemWithPath implemented IStorageItem - } - } - } - - return null; - } - - public static async Task ToStorageItemWithPath(this string path, StorageFolderWithPath parentFolder = null) - { - StorageFolderWithPath rootFolder = await FilesystemTasks.Wrap(() => DrivesManager.GetRootFromPathAsync(path)); - - FilesystemResult fsFileWithPathResult = await FilesystemTasks.Wrap(() => - { - return StorageFileExtensions.DangerousGetFileWithPathFromPathAsync(path, rootFolder, parentFolder); - }); - - if (fsFileWithPathResult) - { - return fsFileWithPathResult.Result; + return item.Item; } - - FilesystemResult fsFolderWithPathResult = await FilesystemTasks.Wrap(() => - { - return StorageFileExtensions.DangerousGetFolderWithPathFromPathAsync(path, rootFolder); - }); - - if (fsFolderWithPathResult) + if (!string.IsNullOrEmpty(item.Path)) { - return fsFolderWithPathResult.Result; + return (item.ItemType == FilesystemItemType.File) ? + (associatedInstance != null ? + (IStorageItem)(StorageFile)await associatedInstance.FilesystemViewModel.GetFileFromPathAsync(item.Path) : + (IStorageItem)(StorageFile)await FilesystemTasks.Wrap(() => StorageFileExtensions.DangerousGetFileFromPathAsync(item.Path))) : + (associatedInstance != null ? + (IStorageItem)(StorageFolder)await associatedInstance.FilesystemViewModel.GetFolderFromPathAsync(item.Path) : + (IStorageItem)(StorageFolder)await FilesystemTasks.Wrap(() => StorageFileExtensions.DangerousGetFolderFromPathAsync(item.Path))); } - return null; } - public static async Task IsOfType(this string path, StorageItemTypes type) + public static IStorageItemWithPath FromPathAndType(string customPath, FilesystemItemType? itemType) { - IStorageItem item = await path.ToStorageItem() is IStorageItem storageItem ? storageItem : null; - return item?.IsOfType(type); + return (itemType == FilesystemItemType.File) ? + (IStorageItemWithPath)new StorageFileWithPath(null, customPath) : + (IStorageItemWithPath)new StorageFolderWithPath(null, customPath); } - public static async Task> ToStorageItemWithPathCollection(this IEnumerable listedItems, - StorageFolderWithPath parentFolder = null) + public static IStorageItemWithPath FromStorageItem(this IStorageItem item, string customPath = null, FilesystemItemType? itemType = null) { - List output = new List(); - - foreach (ListedItem item in listedItems) + if (item == null) { - output.Add(await item.ItemPath.ToStorageItemWithPath(parentFolder)); + return FromPathAndType(customPath, itemType); } - - return output; - } - - public static async Task> ToStorageItemWithPathCollection(this IEnumerable paths, - StorageFolderWithPath parentFolder = null) - { - List output = new List(); - - foreach (string path in paths) - { - output.Add(await path.ToStorageItemWithPath(parentFolder)); - } - - return output; - } - - public static async Task> ToStorageItemCollection(this IEnumerable paths, StorageFolderWithPath parentFolder = null) - { - List output = new List(); - - foreach (string path in paths) + else if (item.IsOfType(StorageItemTypes.File)) { - output.Add(await path.ToStorageItem(parentFolder)); + return new StorageFileWithPath(item as StorageFile, string.IsNullOrEmpty(item.Path) ? customPath : item.Path); } - - return output; - } - - public static async Task> ToStorageItemCollection(this IEnumerable listedItems, - StorageFolderWithPath parentFolder = null) - { - List output = new List(); - - foreach (ListedItem item in listedItems) + else if (item.IsOfType(StorageItemTypes.Folder)) { - output.Add(await item.ItemPath.ToStorageItem(parentFolder)); + return new StorageFolderWithPath(item as StorageFolder, string.IsNullOrEmpty(item.Path) ? customPath : item.Path); } - - return output; + return null; } } -} +} \ No newline at end of file diff --git a/Files/INavigationToolbar.cs b/Files/INavigationToolbar.cs index 354841387873..debb70d9f4b2 100644 --- a/Files/INavigationToolbar.cs +++ b/Files/INavigationToolbar.cs @@ -42,6 +42,7 @@ public interface INavigationToolbar public event EventHandler UpRequested; public event EventHandler RefreshRequested; + public void ClearSearchBoxQueryText(bool collapseSearchReigon = false); } diff --git a/Files/Interacts/Interaction.cs b/Files/Interacts/Interaction.cs index 54ee764f8ec3..4f73ae735cbb 100644 --- a/Files/Interacts/Interaction.cs +++ b/Files/Interacts/Interaction.cs @@ -1,3 +1,4 @@ +using Files.DataModels; using Files.Dialogs; using Files.Enums; using Files.Filesystem; @@ -531,18 +532,18 @@ private async void OpenSelectedItems(bool displayApplicationPicker) //Unfortunately this is unsupported | Remarks: https://docs.microsoft.com/en-us/uwp/api/windows.storage.search.queryoptions.sortorder?view=winrt-19041 //case Enums.SortOption.Size: - //sortEntry.PropertyName = "System.TotalFileSize"; - //queryOptions.SortOrder.Clear(); - //queryOptions.SortOrder.Add(sortEntry); - //break; + //sortEntry.PropertyName = "System.TotalFileSize"; + //queryOptions.SortOrder.Clear(); + //queryOptions.SortOrder.Add(sortEntry); + //break; //Unfortunately this is unsupported | Remarks: https://docs.microsoft.com/en-us/uwp/api/windows.storage.search.queryoptions.sortorder?view=winrt-19041 //case Enums.SortOption.FileType: - //sortEntry.PropertyName = "System.FileExtension"; - //queryOptions.SortOrder.Clear(); - //queryOptions.SortOrder.Add(sortEntry); - //break; + //sortEntry.PropertyName = "System.FileExtension"; + //queryOptions.SortOrder.Clear(); + //queryOptions.SortOrder.Add(sortEntry); + //break; //Handle unsupported default: @@ -806,7 +807,7 @@ public async void CreateShortcutFromItem_Click(object sender, RoutedEventArgs e) public async void DeleteItem_Click(object sender, RoutedEventArgs e) { await FilesystemHelpers.DeleteItemsAsync( - AssociatedInstance.ContentPage.SelectedItems.Select((item) => new PathWithType( + AssociatedInstance.ContentPage.SelectedItems.Select((item) => StorageItemHelpers.FromPathAndType( item.ItemPath, item.PrimaryItemAttribute == StorageItemTypes.File ? FilesystemItemType.File : FilesystemItemType.Directory)).ToList(), true, false, true); @@ -928,7 +929,7 @@ public async void RestoreItem_Click(object sender, RoutedEventArgs e) foreach (ListedItem listedItem in AssociatedInstance.ContentPage.SelectedItems) { FilesystemItemType itemType = (listedItem as RecycleBinItem).PrimaryItemAttribute == StorageItemTypes.Folder ? FilesystemItemType.Directory : FilesystemItemType.File; - await FilesystemHelpers.RestoreFromTrashAsync(new PathWithType( + await FilesystemHelpers.RestoreFromTrashAsync(StorageItemHelpers.FromPathAndType( (listedItem as RecycleBinItem).ItemPath, itemType), (listedItem as RecycleBinItem).ItemOriginalPath, true); } @@ -1156,7 +1157,7 @@ public async Task PasteItemAsync() AssociatedInstance.FilesystemViewModel.IsFolderEmptyTextDisplayed = false; } - public async void CreateFileFromDialogResultType(AddItemType itemType) + public async void CreateFileFromDialogResultType(AddItemType itemType, ShellNewEntry itemInfo) { string currentPath = null; if (AssociatedInstance.ContentPage != null) @@ -1174,7 +1175,7 @@ public async void CreateFileFromDialogResultType(AddItemType itemType) // Create file based on dialog result string userInput = renameDialog.storedRenameInput; - var folderRes = await AssociatedInstance.FilesystemViewModel.GetFolderFromPathAsync(currentPath); + var folderRes = await AssociatedInstance.FilesystemViewModel.GetFolderWithPathFromPathAsync(currentPath); FilesystemResult created = folderRes; if (folderRes) { @@ -1185,27 +1186,17 @@ public async void CreateFileFromDialogResultType(AddItemType itemType) created = await FilesystemTasks.Wrap(async () => { return await FilesystemHelpers.CreateAsync( - new PathWithType(Path.Combine(folderRes.Result.Path, userInput), FilesystemItemType.Directory), + StorageItemHelpers.FromPathAndType(Path.Combine(folderRes.Result.Path, userInput), FilesystemItemType.Directory), true); }); break; - case AddItemType.TextDocument: - userInput = !string.IsNullOrWhiteSpace(userInput) ? userInput : "NewTextDocument".GetLocalized(); + case AddItemType.File: + userInput = !string.IsNullOrWhiteSpace(userInput) ? userInput : itemInfo?.Name ?? "NewFile".GetLocalized(); created = await FilesystemTasks.Wrap(async () => { return await FilesystemHelpers.CreateAsync( - new PathWithType(Path.Combine(folderRes.Result.Path, userInput + ".txt"), FilesystemItemType.File), - true); - }); - break; - - case AddItemType.BitmapImage: - userInput = !string.IsNullOrWhiteSpace(userInput) ? userInput : "NewBitmapImage".GetLocalized(); - created = await FilesystemTasks.Wrap(async () => - { - return await FilesystemHelpers.CreateAsync( - new PathWithType(Path.Combine(folderRes.Result.Path, userInput + ".bmp"), FilesystemItemType.File), + StorageItemHelpers.FromPathAndType(Path.Combine(folderRes.Result.Path, userInput + itemInfo?.Extension), FilesystemItemType.File), true); }); break; @@ -1218,22 +1209,16 @@ public async void CreateFileFromDialogResultType(AddItemType itemType) } public RelayCommand CreateNewFolder => new RelayCommand(() => NewFolder()); - public RelayCommand CreateNewTextDocument => new RelayCommand(() => NewTextDocument()); - public RelayCommand CreateNewBitmapImage => new RelayCommand(() => NewBitmapImage()); + public RelayCommand CreateNewFile => new RelayCommand((itemType) => NewFile(itemType)); private void NewFolder() { - CreateFileFromDialogResultType(AddItemType.Folder); - } - - private void NewTextDocument() - { - CreateFileFromDialogResultType(AddItemType.TextDocument); + CreateFileFromDialogResultType(AddItemType.Folder, null); } - private void NewBitmapImage() + private void NewFile(ShellNewEntry itemType) { - CreateFileFromDialogResultType(AddItemType.BitmapImage); + CreateFileFromDialogResultType(AddItemType.File, itemType); } public RelayCommand SelectAllContentPageItems => new RelayCommand(() => SelectAllItems()); @@ -1389,4 +1374,4 @@ await DialogDisplayHelper.ShowDialogAsync( } } } -} +} \ No newline at end of file diff --git a/Files/MultilingualResources/Files.de-DE.xlf b/Files/MultilingualResources/Files.de-DE.xlf index 0b588adf575b..29cf9b0bfc06 100644 --- a/Files/MultilingualResources/Files.de-DE.xlf +++ b/Files/MultilingualResources/Files.de-DE.xlf @@ -226,14 +226,6 @@ Folder Ordner - - Bitmap Image - Bitmap Bild - - - Text Document - Textdatei - Properties Eigenschaften @@ -330,8 +322,8 @@ Text Document Textdokument - - List View + + Details View Details @@ -410,14 +402,6 @@ New Folder Neuer Ordner - - New Text Document - Neues Textdokument - - - New Bitmap Image - Neues Bitmap Bild - This folder is empty. Dieser Ordner ist leer. @@ -1171,14 +1155,6 @@ Cancel Abbrechen - - Bitmap Image - Bitmapbild - - - Creates an empty bitmap image file - Erstelt ein leeres Bitmapbild - Folder Ordner @@ -1187,14 +1163,6 @@ Creates an empty folder Erstellt einen leeren Ordner - - Text Document - Textdokument - - - Creates an empty text file - Erstellt ein leeres Textdokument - Layout mode Layoutmodus @@ -1899,10 +1867,70 @@ Search results Search results + + See who contributed to Files + See who contributed to Files + + + Find out what's new in Files + Find out what's new in Files + + + Send the developers an issue report with more information + Send the developers an issue report with more information + + + Support us on PayPal + Support us on PayPal + List and sort directories alongside files List and sort directories alongside files + + Details + Details + + + No + No + + + Do you want to download and install the latest version of Files? + Do you want to download and install the latest version of Files? + + + Yes + Yes + + + Updates Available + Updates Available + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + File + File + + + File + File + + + Creates an empty file + Creates an empty file + + + New File + New File + diff --git a/Files/MultilingualResources/Files.es-ES.xlf b/Files/MultilingualResources/Files.es-ES.xlf index 1fa32f400501..bc5569f345a0 100644 --- a/Files/MultilingualResources/Files.es-ES.xlf +++ b/Files/MultilingualResources/Files.es-ES.xlf @@ -226,14 +226,6 @@ Folder Carpeta - - Bitmap Image - Imagen Bitmap - - - Text Document - Documento de Texto - Properties Propiedades @@ -330,8 +322,8 @@ Text Document Documento de Texto - - List View + + Details View Detalles @@ -410,14 +402,6 @@ New Folder Nueva Carpeta - - New Text Document - Nuevo Documento de Texto - - - New Bitmap Image - Nueva Imagen Bitmap - This folder is empty. Esta carpeta está vacía. @@ -1170,14 +1154,6 @@ Cancel Cancelar - - Bitmap Image - Imagen de mapa de bits - - - Creates an empty bitmap image file - Crea un archivo de imagen de mapa de bits vacío - Folder Carpeta @@ -1186,14 +1162,6 @@ Creates an empty folder Crea una carpeta vacía - - Text Document - Documento de texto - - - Creates an empty text file - Crea un archivo de texto vacío. - Layout mode Modo de vista @@ -1336,7 +1304,7 @@ Drives - Dispositivos y Unidades + Dispositivos y unidades Show library cards on the home page @@ -1432,7 +1400,7 @@ Search - Search + Búsqueda Read-only @@ -1852,55 +1820,115 @@ sRGB - sRGB + sRGB Unspecified - Unspecified + Sin especificar Check the status of file operations here - Check the status of file operations here + Verifique el estado de las operaciones de archivo aquí Status Center - Status Center + Centro de actividades License - License + Licencia License - License + Licencia Website - Website + Sitio web Website - Website + Sitio web Learn more about date formats - Learn more about date formats + Mas información acerca de formatos de fecha Drop here - Drop here + Soltar aquí Search results in - Search results in + Resultados de búsqueda en Search results - Search results + Resultados de búsqueda + + + See who contributed to Files + Ver quiénes contribuyen a Files + + + Find out what's new in Files + Ver las novedades de esta versión + + + Send the developers an issue report with more information + Envíe a los desarrolladores un reporte de problemas con más información. + + + Support us on PayPal + Apóyanos en PayPal List and sort directories alongside files - List and sort directories alongside files + Listar y ordenar directorios junto con archivos + + + Details + Detalles + + + No + No + + + Do you want to download and install the latest version of Files? + Do you want to download and install the latest version of Files? + + + Yes + Yes + + + Updates Available + Updates Available + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + File + File + + + File + File + + + Creates an empty file + Creates an empty file + + + New File + New File diff --git a/Files/MultilingualResources/Files.fr-FR.xlf b/Files/MultilingualResources/Files.fr-FR.xlf index 5b760d58bc34..63905f54e8a1 100644 --- a/Files/MultilingualResources/Files.fr-FR.xlf +++ b/Files/MultilingualResources/Files.fr-FR.xlf @@ -226,14 +226,6 @@ Folder Dossier - - Bitmap Image - Image bitmap - - - Text Document - Document texte - Properties Propriétés @@ -330,8 +322,8 @@ Text Document Document texte - - List View + + Details View Vue liste @@ -434,14 +426,6 @@ New Folder Nouveau dossier - - New Text Document - Nouveau document texte - - - New Bitmap Image - Nouvelle image bitmap - This folder is empty. Ce dossier est vide. @@ -1170,14 +1154,6 @@ Cancel Annuler - - Bitmap Image - Image bitmap - - - Creates an empty bitmap image file - Crée une image bitmap vide - Folder Dossier @@ -1186,14 +1162,6 @@ Creates an empty folder Crée un dossier vide - - Text Document - Document texte - - - Creates an empty text file - Crée un fichier texte vide - Layout mode Disposition @@ -1528,7 +1496,7 @@ Altitude - Altitude + Altitude Camera Manufacturer @@ -1568,7 +1536,7 @@ Format - Format + Format Sample Rate @@ -1616,7 +1584,7 @@ Duration - Duration + Durée Frame Count @@ -1652,7 +1620,7 @@ Producer - Producer + Producteur Promotion Url @@ -1748,7 +1716,7 @@ Version - Version + Version Video @@ -1836,7 +1804,7 @@ Some properties may contain personal information. - Some properties may contain personal information. + Certaines propriétés peuvent contenir des informations personnelles. Clear @@ -1864,23 +1832,23 @@ License - License + Licence License - License + Licence Website - Website + Site web Website - Website + Site web Learn more about date formats - Learn more about date formats + En savoir plus sur les formats de date Drop here @@ -1898,10 +1866,70 @@ Search results Search results + + See who contributed to Files + See who contributed to Files + + + Find out what's new in Files + Find out what's new in Files + + + Send the developers an issue report with more information + Send the developers an issue report with more information + + + Support us on PayPal + Support us on PayPal + List and sort directories alongside files List and sort directories alongside files + + Details + Details + + + No + No + + + Do you want to download and install the latest version of Files? + Do you want to download and install the latest version of Files? + + + Yes + Yes + + + Updates Available + Updates Available + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + File + File + + + File + File + + + Creates an empty file + Creates an empty file + + + New File + New File + diff --git a/Files/MultilingualResources/Files.he-IL.xlf b/Files/MultilingualResources/Files.he-IL.xlf index ac2ba64e4b4d..9c6570358717 100644 --- a/Files/MultilingualResources/Files.he-IL.xlf +++ b/Files/MultilingualResources/Files.he-IL.xlf @@ -134,8 +134,8 @@ Clear Selection נקה בחירה - - List View + + Details View תצוגת רשימה @@ -354,14 +354,6 @@ Folder תיקיה - - Bitmap Image - תמונת מפת סיביות - - - Text Document - מסמך טקסט - Properties מאפיינים @@ -482,14 +474,6 @@ New Folder תיקיה חדשה - - New Text Document - ‏‏‫מסמך טקסט ‫חדש - - - New Bitmap Image - ‏‏‫תמונת מפת ‫סיביות ‫חדשה - This folder is empty. ‏‏תיקיה זו ריקה. @@ -1170,14 +1154,6 @@ Cancel ביטול - - Bitmap Image - תמונת מפת סיביות - - - Creates an empty bitmap image file - Creates an empty bitmap image file - Folder תיקיה @@ -1186,14 +1162,6 @@ Creates an empty folder Creates an empty folder - - Text Document - מסמך טקסט - - - Creates an empty text file - Creates an empty text file - Layout mode מצב פריסה @@ -1898,10 +1866,70 @@ Search results Search results + + See who contributed to Files + See who contributed to Files + + + Find out what's new in Files + Find out what's new in Files + + + Send the developers an issue report with more information + Send the developers an issue report with more information + + + Support us on PayPal + Support us on PayPal + List and sort directories alongside files List and sort directories alongside files + + Details + Details + + + No + No + + + Do you want to download and install the latest version of Files? + Do you want to download and install the latest version of Files? + + + Yes + Yes + + + Updates Available + Updates Available + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + File + File + + + File + File + + + Creates an empty file + Creates an empty file + + + New File + New File + diff --git a/Files/MultilingualResources/Files.hi-IN.xlf b/Files/MultilingualResources/Files.hi-IN.xlf index 8d51764e6d64..83673e527987 100644 --- a/Files/MultilingualResources/Files.hi-IN.xlf +++ b/Files/MultilingualResources/Files.hi-IN.xlf @@ -135,8 +135,8 @@ Clear Selection चयन खाली करें - - List View + + Details View सूची व्यू @@ -359,14 +359,6 @@ Folder फ़ोल्डर - - Bitmap Image - बिटमैप चित्र - - - Text Document - लेख दस्तावेज़ - Properties गुण @@ -491,14 +483,6 @@ New Folder नया फ़ोल्डर - - New Text Document - नया लिखित दस्तावेज़ - - - New Bitmap Image - नई बिटमैप छवि - This folder is empty. यह फोल्डर खाली है। @@ -1180,14 +1164,6 @@ Cancel रद्द करें - - Bitmap Image - बिटमैप छवि - - - Creates an empty bitmap image file - Creates an empty bitmap image file - Folder फ़ोल्डर @@ -1196,14 +1172,6 @@ Creates an empty folder Creates an empty folder - - Text Document - पाठ दस्तावेज़ - - - Creates an empty text file - Creates an empty text file - Layout mode Layout mode @@ -1908,10 +1876,70 @@ Search results Search results + + See who contributed to Files + See who contributed to Files + + + Find out what's new in Files + Find out what's new in Files + + + Send the developers an issue report with more information + Send the developers an issue report with more information + + + Support us on PayPal + Support us on PayPal + List and sort directories alongside files List and sort directories alongside files + + Details + Details + + + No + No + + + Do you want to download and install the latest version of Files? + Do you want to download and install the latest version of Files? + + + Yes + Yes + + + Updates Available + Updates Available + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + File + File + + + File + File + + + Creates an empty file + Creates an empty file + + + New File + New File + diff --git a/Files/MultilingualResources/Files.hu-HU.xlf b/Files/MultilingualResources/Files.hu-HU.xlf index 2ccbf45f018e..e321ee43da71 100644 --- a/Files/MultilingualResources/Files.hu-HU.xlf +++ b/Files/MultilingualResources/Files.hu-HU.xlf @@ -134,8 +134,8 @@ Clear Selection Kijelölés megszűntetése - - List View + + Details View Részletek @@ -370,14 +370,6 @@ Folder Mappa - - Bitmap Image - Bitmap Kép - - - Text Document - Szöveges Dokumentum - Properties Tulajdonságok @@ -498,14 +490,6 @@ New Folder Új Mappa - - New Text Document - Új Szöveges Dokumentum - - - New Bitmap Image - Új Bitmap Kép - This folder is empty. Üres mappa. @@ -1202,14 +1186,6 @@ Choose a type for this new item below Válasszon fájltípust az alábbiak közűl - - Bitmap Image - Bitmap Kép - - - Creates an empty bitmap image file - Új bitmap kép készítése - Folder Mappa @@ -1218,14 +1194,6 @@ Creates an empty folder Új mappa készítése - - Text Document - Szöveges Dokumentum - - - Creates an empty text file - Új szöveges dokumentum készítése - Layout mode Elrendezés @@ -1432,7 +1400,7 @@ Search - Search + Keresés Read-only @@ -1696,7 +1664,7 @@ Contributor - Contributor + Közreműködő Last Author @@ -1884,23 +1852,83 @@ Learn more about date formats - Tudj meg többet a dátumokról + Tudjon meg többet a dátumokról Drop here - Drop here + Másolás ide Search results in - Search results in + Keresés eredménye a következőben: Search results - Search results + Keresési eredmények + + + See who contributed to Files + Közreműködők + + + Find out what's new in Files + Újdonságok a Files-ban + + + Send the developers an issue report with more information + Visszajelzés küldése a fejlesztőknek + + + Support us on PayPal + Támogatás PayPal-on List and sort directories alongside files - List and sort directories alongside files + Mappák rendszerezése a fájlokkal + + + Details + Részletek + + + No + Nem + + + Do you want to download and install the latest version of Files? + Szeretné letőlteni és telepíteni a legújabb Files verziót? + + + Yes + Igen + + + Updates Available + Frissítés elérhető + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + File + File + + + File + File + + + Creates an empty file + Creates an empty file + + + New File + New File diff --git a/Files/MultilingualResources/Files.it-IT.xlf b/Files/MultilingualResources/Files.it-IT.xlf index e325772186df..6fb8e738c517 100644 --- a/Files/MultilingualResources/Files.it-IT.xlf +++ b/Files/MultilingualResources/Files.it-IT.xlf @@ -126,8 +126,8 @@ Clear Selection Deseleziona tutto - - List View + + Details View Dettagli @@ -327,14 +327,6 @@ Folder Cartella - - Bitmap Image - Immagine bitmap - - - Text Document - Documento di testo - Properties Proprietà @@ -451,14 +443,6 @@ New Folder Nuova cartella - - New Text Document - Nuovo documento di testo - - - New Bitmap Image - Nuova immagine bitmap - This folder is empty. Questa cartella è vuota @@ -1171,14 +1155,6 @@ Cancel Annulla - - Bitmap Image - Immagine bitmap - - - Creates an empty bitmap image file - Crea un file immagine bitmap vuoto - Folder Cartella @@ -1187,14 +1163,6 @@ Creates an empty folder Crea una cartella vuota - - Text Document - Documento di testo - - - Creates an empty text file - Crea un file di testo vuoto - Layout mode Modalità di visualizzazione @@ -1325,7 +1293,7 @@ Status center - Status center + Stato delle operazioni Open items with a single click @@ -1421,471 +1389,471 @@ Duplicate tab - Duplicate tab + Duplica scheda Move tab to new window - Move tab to new window + Muovi scheda in una nuova finestra New tab - New tab + Nuova scheda Search - Search + Cerca Read-only - Read-only + Sola lettura Hidden - Hidden + Nascosto Rating Text - Rating Text + Classificazione Item Folder Path Display - Item Folder Path Display + Percorso della cartella Item Type Text - Item Type Text + Tipo di file Title - Title + Titolo Subject - Subject + Soggetto Comment - Comment + Commento Copyright - Copyright + Copyright Date Created - Date Created + Data creazione Date Modified - Date Modified + Ultima modifica Bit Depth - Bit Depth + Profondità in bit Dimensions - Dimensions + Dimensioni Horizontal Resolution - Horizontal Resolution + Risolutione orizzontale Vertical Resolution - Vertical Resolution + Risolutione verticale Compression Text - Compression Text + Compressione Horizontal Size - Horizontal Size + Larghezza Vertical Size - Vertical Size + Altezza Latitude - Latitude + Latitudine Latitude Decimal - Latitude Decimal + Latitudine Decimale Latitude Ref - Latitude Ref + Latitudine Ref Longitude - Longitude + Longitudine Longitude Decimal - Longitude Decimal + Longitudine Decimale Longitude Ref - Longitude Ref + Longitudine Ref Altitude - Altitude + Altitudine Camera Manufacturer - Camera Manufacturer + Produttore telecamera Camera Model - Camera Model + Modello telecamera Exposure Time - Exposure Time + Tempo di esposizione Focal Length - Focal Length + Lunghezza focale Aperture - Aperture + Apertura Date Taken - Date Taken + Data acquisizione Channel Count - Channel Count + Numero canali Encoding Bitrate - Encoding Bitrate + Velocità in bit Compression - Compression + Compressione Format - Format + Formato Sample Rate - Sample Rate + Velocità dati Display Artist - Display Artist + Artisti partecipanti Album Artist - Album Artist + Artista dell'album Album Title - Album Title + Titolo dell'album Artist - Artist + Artista Beats Per Minute - Beats Per Minute + Battute al minuto Composer - Composer + Compositore Conductor - Conductor + Conduttori Disc Number - Disc Number + Numero disco Genre - Genre + Genere Track Number - Track Number + Numbero traccia Duration - Duration + Durata Frame Count - Frame Count + Numero di frame Protection Type - Protection Type + Tipo di protezione Author Url - Author Url + Url autore Content Distributor - Content Distributor + Provider di contenuti Date Released - Date Released + Data Rilascio Series Name - Series Name + Serie Season Number - Season Number + Stagione Episode Number - Episode Number + Episodio Producer - Producer + Produttore Promotion Url - Promotion Url + Url di promozione Provider Style - Provider Style + Stile di musica Publisher - Publisher + Editore Thumbnail Large Path - Thumbnail Large Path + Percorso anteprima grande Thumbnail Large Uri - Thumbnail Large Uri + Url anteprima grande Thumbnail Small Path - Thumbnail Small Path + Percorso anteprima piccola Thumbnail Small Uri - Thumbnail Small Uri + Url anteprima piccola User Web Url - User Web Url + Url utente Writer - Writer + Scrittore Year - Year + Anno Core - Core + Principale Image - Image + Immagine Photo - Photo + Foto GPS - GPS + GPS Media - Media + Media Audio - Audio + Audio Music - Music + Musica Address - Address + Indirizzo Color Space - Color Space + Spazio colore People Names - People Names + Nomi di persona Contributor - Contributor + Collaboratori Last Author - Last Author + Ultimo Autore Revision Number - Revision Number + Revisione Numero Version - Version + Versione Video - Video + Video Date Saved - Date Saved + Data Salvataggio Date Printed - Date Printed + Data Stampa Total Editing Time - Total Editing Time + Tempo di modifica totale Template - Template + Modello Word Count - Word Count + Numero Parole Character Count - Character Count + Numero Caratteri Line Count - Line Count + Numero Linee Paragraph Count - Paragraph Count + Numero Paragrafi Page Count - Page Count + Numero Pagine Slide Count - Slide Count + Numero Slide Frame Rate - Frame Rate + Frequenza fotogrammi Frame Width - Frame Width + Larghezza fotogrammi Frame Height - Frame Height + Altezza fotogrammi Orientation - Orientation + Orientamento Document - Document + Documento Error - Error + Errore Retry - Retry + Riprova Close anyway - Close anyway + Chiudi comunque Cancel - Cancel + Annulla There was an issue saving some properties. - There was an issue saving some properties. + C'è stato un problema salvando alcune proprietà. Some properties may contain personal information. - Some properties may contain personal information. + Alcune proprietà potrebbero contenere informazioni personali. Clear - Clear + Cancella Clear All Properties - Clear All Properties + Cancella tutte le proprietà sRGB - sRGB + sRGB Unspecified - Unspecified + Non specificato Check the status of file operations here - Check the status of file operations here + Controlla qui lo stato delle operazioni sui file Status Center - Status Center + Stato delle operazioni License - License + Licenza License - License + Licenza Website - Website + Sito web Website - Website + Sito web Learn more about date formats - Learn more about date formats + Più informazioni sul formato data Drop here @@ -1893,15 +1861,75 @@ Search results in - Search results in + Cerca risultati in Search results - Search results + Risultati ricerca + + + See who contributed to Files + Vedi chi ha contribuito a Files + + + Find out what's new in Files + Scopri le novità in Files + + + Send the developers an issue report with more information + Invia agli sviluppatori un rapporto sul problema + + + Support us on PayPal + Supportaci su PayPal List and sort directories alongside files - List and sort directories alongside files + Ordina le cartelle insieme ai file + + + Details + Dettagli + + + No + No + + + Do you want to download and install the latest version of Files? + Vuoi scaricare e installare l'ultima versione di Files? + + + Yes + + + + Updates Available + Aggiornamenti disponibili + + + Hide protected operating system files (Recommended) + Nascondi i file protetti di sistema (consigliato) + + + Hide protected operating system files (Recommended) + Nascondi i file protetti di sistema (consigliato) + + + File + File + + + File + File + + + Creates an empty file + Crea un file vuoto + + + New File + Nuovo File diff --git a/Files/MultilingualResources/Files.ja-JP.xlf b/Files/MultilingualResources/Files.ja-JP.xlf index b77af7e79807..9725e6838ca0 100644 --- a/Files/MultilingualResources/Files.ja-JP.xlf +++ b/Files/MultilingualResources/Files.ja-JP.xlf @@ -134,8 +134,8 @@ Clear Selection 選択をクリア - - List View + + Details View 詳細 @@ -346,14 +346,6 @@ Folder フォルダ - - Bitmap Image - ビットマップ - - - Text Document - テキスト文書 - Properties プロパティ @@ -474,14 +466,6 @@ New Folder 新しいフォルダ - - New Text Document - 新しいテキスト文書 - - - New Bitmap Image - 新しいビットマップ - This folder is empty. フォルダは空です。 @@ -1170,14 +1154,6 @@ Cancel キャンセル - - Bitmap Image - ビットマップ イメージ - - - Creates an empty bitmap image file - 空のビットマップ画像ファイルを作成します - Folder フォルダー @@ -1186,14 +1162,6 @@ Creates an empty folder 空のフォルダを作成します - - Text Document - テキスト ドキュメント - - - Creates an empty text file - 空のテキスト ファイルを作成します。 - Layout mode レイアウト モード @@ -1898,10 +1866,70 @@ Search results Search results + + See who contributed to Files + See who contributed to Files + + + Find out what's new in Files + Find out what's new in Files + + + Send the developers an issue report with more information + Send the developers an issue report with more information + + + Support us on PayPal + Support us on PayPal + List and sort directories alongside files List and sort directories alongside files + + Details + Details + + + No + No + + + Do you want to download and install the latest version of Files? + Do you want to download and install the latest version of Files? + + + Yes + Yes + + + Updates Available + Updates Available + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + File + File + + + File + File + + + Creates an empty file + Creates an empty file + + + New File + New File + diff --git a/Files/MultilingualResources/Files.nl-NL.xlf b/Files/MultilingualResources/Files.nl-NL.xlf index ccbef3a7f5bb..683039c34b0d 100644 --- a/Files/MultilingualResources/Files.nl-NL.xlf +++ b/Files/MultilingualResources/Files.nl-NL.xlf @@ -229,14 +229,6 @@ Folder Map - - Bitmap Image - Bitmapafbeelding - - - Text Document - Tekstdocument - Properties Eigenschappen @@ -335,8 +327,8 @@ Text Document Tekstdocument - - List View + + Details View Lijstweergave @@ -418,14 +410,6 @@ New Folder Nieuwe map - - New Text Document - Nieuw tekstdocument - - - New Bitmap Image - Nieuwe bitmapafbeelding - This folder is empty. Deze map is leeg. @@ -1182,14 +1166,6 @@ Cancel Annuleren - - Bitmap Image - Bitmapafbeelding - - - Creates an empty bitmap image file - Creates an empty bitmap image file - Folder Map @@ -1198,14 +1174,6 @@ Creates an empty folder Creates an empty folder - - Text Document - Tekstdocument - - - Creates an empty text file - Creates an empty text file - Layout mode Lay-outmodus @@ -1910,10 +1878,70 @@ Search results Search results + + See who contributed to Files + See who contributed to Files + + + Find out what's new in Files + Find out what's new in Files + + + Send the developers an issue report with more information + Send the developers an issue report with more information + + + Support us on PayPal + Support us on PayPal + List and sort directories alongside files List and sort directories alongside files + + Details + Details + + + No + No + + + Do you want to download and install the latest version of Files? + Do you want to download and install the latest version of Files? + + + Yes + Yes + + + Updates Available + Updates Available + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + File + File + + + File + File + + + Creates an empty file + Creates an empty file + + + New File + New File + diff --git a/Files/MultilingualResources/Files.or-IN.xlf b/Files/MultilingualResources/Files.or-IN.xlf index c6971bb65147..962adef4c4ff 100644 --- a/Files/MultilingualResources/Files.or-IN.xlf +++ b/Files/MultilingualResources/Files.or-IN.xlf @@ -135,8 +135,8 @@ Clear Selection ଚୟନ ସଫା କରନ୍ତୁ - - List View + + Details View ତାଲିକା ଭ୍ୟୁ @@ -359,14 +359,6 @@ Folder ଫୋଲ୍ଡର - - Bitmap Image - ବିଟମ୍ୟାପ୍ ପ୍ରତିଛବି - - - Text Document - ପାଠ୍ୟ ଦସ୍ତାବେଜ - Properties ଗୁଣଧର୍ମ @@ -491,14 +483,6 @@ New Folder ନୂତନ ଫୋଲ୍ଡର - - New Text Document - ନୂତନ ପାଠ୍ୟ ଦସ୍ତାବେଜ - - - New Bitmap Image - ନୂତନ ବିଟମ୍ୟାପ୍ ପ୍ରତିଛବି - This folder is empty. ଏହି ଫୋଲ୍ଡରଟି ଖାଲି ଅଛି | @@ -1180,14 +1164,6 @@ Cancel ବାତିଲ୍ - - Bitmap Image - ବିଟ୍‌ମ୍ୟାପ୍ ପ୍ରତିଛବି - - - Creates an empty bitmap image file - Creates an empty bitmap image file - Folder ଫୋଲ୍ଡର: @@ -1196,14 +1172,6 @@ Creates an empty folder Creates an empty folder - - Text Document - ପାଠ ଡକ୍ୟୁମେଣ୍ଟ୍ - - - Creates an empty text file - Creates an empty text file - Layout mode Layout mode @@ -1908,10 +1876,70 @@ Search results Search results + + See who contributed to Files + See who contributed to Files + + + Find out what's new in Files + Find out what's new in Files + + + Send the developers an issue report with more information + Send the developers an issue report with more information + + + Support us on PayPal + Support us on PayPal + List and sort directories alongside files List and sort directories alongside files + + Details + Details + + + No + No + + + Do you want to download and install the latest version of Files? + Do you want to download and install the latest version of Files? + + + Yes + Yes + + + Updates Available + Updates Available + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + File + File + + + File + File + + + Creates an empty file + Creates an empty file + + + New File + New File + diff --git a/Files/MultilingualResources/Files.pl-PL.xlf b/Files/MultilingualResources/Files.pl-PL.xlf index df2918dd313f..1c35ecd96356 100644 --- a/Files/MultilingualResources/Files.pl-PL.xlf +++ b/Files/MultilingualResources/Files.pl-PL.xlf @@ -36,7 +36,7 @@ Files you've previously accessed will show up here - Tutaj pojawią się ostatnio otwierane przez Ciebie pliki i foldery + Tutaj pojawią się ostatnio otwierane przez Ciebie pliki i foldery Please verify the translation’s accuracy as the source string was updated after it was translated. @@ -65,12 +65,12 @@ Send the developers an issue report with detailed information - Wyślij raport o zaistniałym problemie + Wyślij raport o zaistniałym problemie Please verify the translation’s accuracy as the source string was updated after it was translated. Third Party Licenses - Licencje firm trzecich + Licencje firm trzecich Please verify the translation’s accuracy as the source string was updated after it was translated. @@ -99,7 +99,7 @@ On Startup - Po uruchomienu + Po uruchomieniu Preferences @@ -107,7 +107,7 @@ Continue where you left off - Kontynuuj poprzednią sejsę + Przywróć poprzednią sesję Open a new tab @@ -229,14 +229,6 @@ Folder Folder - - Bitmap Image - Obraz - mapa bitowa - - - Text Document - Dokument tekstowy - Properties Właściwości @@ -287,7 +279,7 @@ QuickLook - QuickLook + Szybki podgląd Please verify the translation’s accuracy as the source string was updated after it was translated. @@ -296,7 +288,7 @@ Copy location - Kopiuj ścieżkę + Kopiuj ścieżkę Please verify the translation’s accuracy as the source string was updated after it was translated. @@ -335,8 +327,8 @@ Text Document Dokument tekstowy - - List View + + Details View Widok listy @@ -365,12 +357,12 @@ To get started, you'll need to grant us permission to display your files. This will open a Settings page where you can grant us this permission. You'll need to reopen the app once you've completed this step. - Przed rozpoczęciem, będziesz musiał przyznać uprawnień do odczytu plików. Otworzy to kartę z ustawieniami gdzie będziesz mógł przyznać te uprawnienie. Wymagany restart aplikacji po wprowadzonych zmianach. + Przed rozpoczęciem, będziesz musiał przyznać uprawnienia do odczytu plików. Otworzymy dla Ciebie kartę z ustawieniami gdzie będziesz mógł przyznać te uprawnienia. Będzie wymagany restart aplikacji po wprowadzeniu zmian. Please verify the translation’s accuracy as the source string was updated after it was translated. File folder - Folder plików + Folder Enter an item name @@ -378,7 +370,7 @@ Enter an item name - Wprowadź nazwę elementu bez rozszerzenia + Wprowadź nazwę pliku Please verify the translation’s accuracy as the source string was updated after it was translated. @@ -417,14 +409,6 @@ New Folder Nowy folder - - New Text Document - Nowy dokument tekstowy - - - New Bitmap Image - Nowy obraz mapy bitowej - This folder is empty. Ten folder jest pusty. @@ -611,7 +595,7 @@ Layout mode - Tryb układu + Układu Selection options @@ -891,7 +875,7 @@ When launching an item from the jumplist - Podczas uruchamiania przypiętego folderu + Podczas uruchamiania przypiętego folderu Please verify the translation’s accuracy as the source string was updated after it was translated. @@ -928,28 +912,28 @@ The destination folder is the same as the source folder. - Folder docelowy jest taki sam jak folder źródłowy. + Folder docelowy jest taki sam jak folder źródłowy. Please verify the translation’s accuracy as the source string was updated after it was translated. Copy to {0} - Kopiuj do programu {0} + Kopiuj do {0} Create shortcut - Utwórz skrót + Utwórz skrót Open file location - Otwórz lokalizację pliku + Otwórz lokalizację pliku Arguments: - Argumenty: + Argumenty: Destination: - Cel: + Cel: Shortcut type: @@ -957,15 +941,15 @@ Working directory: - Katalog roboczy + Katalog roboczy Application - Aplikacja + Aplikacja File - Plik + Plik Folder @@ -973,19 +957,19 @@ Web link - Link sieci Web + Link Url General - Ogólne + Ogólne Shortcut - Skrót + Skrót Shortcut - Skrót + Skrót Internet shortcut @@ -997,11 +981,11 @@ Open file location - Otwórz lokalizację pliku + Otwórz lokalizację pliku Unknown - Nieznany + Nieznany Open log location @@ -1013,15 +997,15 @@ Something went wrong! - Wystąpił problem + Wystąpił problem Report this issue - Zgłoś ten problem + Zgłoś ten problem Contributors - Współautorzy + Współautorzy See who contributed to Files @@ -1029,7 +1013,7 @@ Release Notes - Informacje o wersji + Informacje o wersji Find out what's new in Files @@ -1045,7 +1029,7 @@ Version: - Wersja: + Wersja: There's nothing to share right now... @@ -1073,7 +1057,7 @@ Item no longer exists - Element już nie istnieje + Element już nie istnieje The name specified was invalid. Please check the desired item name and try again. @@ -1093,15 +1077,15 @@ More - Więcej + Więcej Cancel - Anuluj + Anuluj Are you sure you want to delete this item? - Czy na pewno chcesz usunąć ten element? + Czy na pewno chcesz usunąć ten element? Are you sure you want to delete these {0} items? @@ -1117,7 +1101,7 @@ Horizontal - W poziomie + W poziomie Always hides the vertical multitasking flyout from the navigation toolbar, and shows the traditional horizontal tabstrip on the app window. This is suited for users who need to keep track of every open app instance at all times. @@ -1125,11 +1109,11 @@ Multitasking - Obsługa wielu zadań + Obsługa wielu zadań Vertical - Pionowo + Pionowo Collapses the horizontal list of app instances into a vertical flyout on the navigation toolbar, designed for users who want a clean app interface with on-demand access to a multitasking experience. @@ -1137,31 +1121,31 @@ Multitasking - Obsługa wielu zadań + Obsługa wielu zadań Set as - Ustaw jako + Ustaw jako Copy location - Kopiuj lokalizację + Kopiuj lokalizację Add tab - Dodaj kartę + Dodaj kartę Open tabs - Otwórz karty + Otwórz karty No - Nie + Nie Yes - Tak + Tak The application needs to be restarted in order to apply the language setting, would you like to restart the app? @@ -1177,15 +1161,7 @@ Cancel - Anuluj - - - Bitmap Image - Obraz - mapa bitowa - - - Creates an empty bitmap image file - Tworzy pusty plik obrazu bitmapowego + Anuluj Folder @@ -1195,17 +1171,9 @@ Creates an empty folder Tworzy pusty folder - - Text Document - Dokument tekstowy - - - Creates an empty text file - Tworzy pusty plik tekstowy - Layout mode - Tryb układu + Układ Navigate backwards @@ -1213,7 +1181,7 @@ Navigate forward - Nawiguj do przodu + Nawiguj do przodu Refresh the directory @@ -1907,10 +1875,70 @@ Search results Search results + + See who contributed to Files + See who contributed to Files + + + Find out what's new in Files + Find out what's new in Files + + + Send the developers an issue report with more information + Send the developers an issue report with more information + + + Support us on PayPal + Support us on PayPal + List and sort directories alongside files List and sort directories alongside files + + Details + Details + + + No + No + + + Do you want to download and install the latest version of Files? + Do you want to download and install the latest version of Files? + + + Yes + Yes + + + Updates Available + Updates Available + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + File + File + + + File + File + + + Creates an empty file + Creates an empty file + + + New File + New File + diff --git a/Files/MultilingualResources/Files.pt-BR.xlf b/Files/MultilingualResources/Files.pt-BR.xlf index 7dea4b537b68..117b79d91223 100644 --- a/Files/MultilingualResources/Files.pt-BR.xlf +++ b/Files/MultilingualResources/Files.pt-BR.xlf @@ -134,8 +134,8 @@ Clear Selection Limpar Seleção - - List View + + Details View Lista @@ -354,14 +354,6 @@ Folder Pasta - - Bitmap Image - Imagem de Bitmap - - - Text Document - Documento de Texto - Properties Propriedades @@ -482,14 +474,6 @@ New Folder Nova pasta - - New Text Document - Novo Documento de Texto - - - New Bitmap Image - Nova Imagem de Bitmap - This folder is empty. Esta pasta está vazia. @@ -1170,14 +1154,6 @@ Cancel Cancelar - - Bitmap Image - Imagem de Bitmap - - - Creates an empty bitmap image file - Criar um arquivo de imagem bitmap vazio - Folder Pasta @@ -1186,14 +1162,6 @@ Creates an empty folder Cria uma pasta vazia - - Text Document - Documento de Texto - - - Creates an empty text file - Cria um arquivo de texto vazio - Layout mode Modo de layout @@ -1898,10 +1866,70 @@ Search results Search results + + See who contributed to Files + See who contributed to Files + + + Find out what's new in Files + Find out what's new in Files + + + Send the developers an issue report with more information + Send the developers an issue report with more information + + + Support us on PayPal + Support us on PayPal + List and sort directories alongside files List and sort directories alongside files + + Details + Details + + + No + No + + + Do you want to download and install the latest version of Files? + Do you want to download and install the latest version of Files? + + + Yes + Yes + + + Updates Available + Updates Available + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + File + File + + + File + File + + + Creates an empty file + Creates an empty file + + + New File + New File + diff --git a/Files/MultilingualResources/Files.ru-RU.xlf b/Files/MultilingualResources/Files.ru-RU.xlf index ac1143953833..c5bc0cb94cef 100644 --- a/Files/MultilingualResources/Files.ru-RU.xlf +++ b/Files/MultilingualResources/Files.ru-RU.xlf @@ -250,14 +250,6 @@ Folder Папку - - Bitmap Image - Изображение - - - Text Document - Текстовый документ - Properties Свойства @@ -346,8 +338,8 @@ Clear Selection Очистить выделение - - List View + + Details View Таблица @@ -410,14 +402,6 @@ New Folder Новая папка - - New Text Document - Новый текстовый документ - - - New Bitmap Image - Рисунок - This folder is empty. Эта папка пуста. @@ -1170,14 +1154,6 @@ Cancel Отмена - - Bitmap Image - Изображение - - - Creates an empty bitmap image file - Создает пустой файл изображения - Folder Папка @@ -1186,14 +1162,6 @@ Creates an empty folder Создает пустую папку - - Text Document - Текстовый документ - - - Creates an empty text file - Создает пустой текстовый документ. - Layout mode Вид значков @@ -1898,10 +1866,70 @@ Search results Search results + + See who contributed to Files + See who contributed to Files + + + Find out what's new in Files + Find out what's new in Files + + + Send the developers an issue report with more information + Send the developers an issue report with more information + + + Support us on PayPal + Support us on PayPal + List and sort directories alongside files List and sort directories alongside files + + Details + Details + + + No + No + + + Do you want to download and install the latest version of Files? + Do you want to download and install the latest version of Files? + + + Yes + Yes + + + Updates Available + Updates Available + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + File + File + + + File + File + + + Creates an empty file + Creates an empty file + + + New File + New File + diff --git a/Files/MultilingualResources/Files.ta.xlf b/Files/MultilingualResources/Files.ta.xlf index ec4bf1aafd6d..d80c8f1d4a1c 100644 --- a/Files/MultilingualResources/Files.ta.xlf +++ b/Files/MultilingualResources/Files.ta.xlf @@ -134,8 +134,8 @@ Clear Selection தேர்வை அழி - - List View + + Details View பட்டியல் காட்சி @@ -348,14 +348,6 @@ Folder கோப்புறை - - Bitmap Image - பிட் வரைபடப் படிமம் - - - Text Document - உரை ஆவணம் - Properties பண்புகள் @@ -476,14 +468,6 @@ New Folder புதியக் கோப்புறை - - New Text Document - புதிய உரை ஆவணம் - - - New Bitmap Image - புதிய பிட் வரைபடப் படிமம் - This folder is empty. இந்தக் கோப்புறை வெறுமையாக உள்ளது @@ -1174,14 +1158,6 @@ Cancel இரத்து - - Bitmap Image - பிட் வரைபடப் படிமம் - - - Creates an empty bitmap image file - ஒரு வெறுமை பிட் வரைபடப் படிம கோப்பை உருவாக்கும் - Folder கோப்புறை @@ -1190,14 +1166,6 @@ Creates an empty folder ஒரு வெறுமை கோப்புறையை உருவாக்கும் - - Text Document - உரை ஆவணம் - - - Creates an empty text file - ஒரு வெறுமை உரை ஆவணத்தை உருவாக்கும் - Layout mode தளவமைப்பு முறை @@ -1903,10 +1871,70 @@ Search results Search results + + See who contributed to Files + See who contributed to Files + + + Find out what's new in Files + Find out what's new in Files + + + Send the developers an issue report with more information + Send the developers an issue report with more information + + + Support us on PayPal + Support us on PayPal + List and sort directories alongside files List and sort directories alongside files + + Details + Details + + + No + No + + + Do you want to download and install the latest version of Files? + Do you want to download and install the latest version of Files? + + + Yes + Yes + + + Updates Available + Updates Available + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + File + File + + + File + File + + + Creates an empty file + Creates an empty file + + + New File + New File + diff --git a/Files/MultilingualResources/Files.tr-TR.xlf b/Files/MultilingualResources/Files.tr-TR.xlf index 3ff93b0e2340..2c629c301fcc 100644 --- a/Files/MultilingualResources/Files.tr-TR.xlf +++ b/Files/MultilingualResources/Files.tr-TR.xlf @@ -231,14 +231,6 @@ Folder Dosya - - Bitmap Image - Bit Eşlem Resmi - - - Text Document - Metin Belgesi - Properties Özellikler @@ -337,8 +329,8 @@ Text Document Metin Belgesi - - List View + + Details View Liste Görünümü @@ -417,14 +409,6 @@ New Folder Yeni Klasör - - New Text Document - Yeni Metin Belgesi - - - New Bitmap Image - Yeni Bit Eşlem Resmi - This folder is empty. Bu klasör boş. @@ -1177,14 +1161,6 @@ Cancel İptal - - Bitmap Image - Bit Eşlem Resmi - - - Creates an empty bitmap image file - Creates an empty bitmap image file - Folder Klasör @@ -1193,14 +1169,6 @@ Creates an empty folder Creates an empty folder - - Text Document - Metin Belgesi - - - Creates an empty text file - Boş bir metin dosyası oluşturur. - Layout mode Düzen modu @@ -1905,10 +1873,70 @@ Search results Search results + + See who contributed to Files + See who contributed to Files + + + Find out what's new in Files + Find out what's new in Files + + + Send the developers an issue report with more information + Send the developers an issue report with more information + + + Support us on PayPal + Support us on PayPal + List and sort directories alongside files List and sort directories alongside files + + Details + Details + + + No + No + + + Do you want to download and install the latest version of Files? + Do you want to download and install the latest version of Files? + + + Yes + Yes + + + Updates Available + Updates Available + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + File + File + + + File + File + + + Creates an empty file + Creates an empty file + + + New File + New File + diff --git a/Files/MultilingualResources/Files.uk-UA.xlf b/Files/MultilingualResources/Files.uk-UA.xlf index 6175c615c1b6..cb1d917bb94e 100644 --- a/Files/MultilingualResources/Files.uk-UA.xlf +++ b/Files/MultilingualResources/Files.uk-UA.xlf @@ -98,8 +98,8 @@ Clear Selection Очистити виділення - - List View + + Details View Список @@ -290,14 +290,6 @@ Folder Папку - - Bitmap Image - Зображення - - - Text Document - Текстовий документ - Properties Властивості @@ -410,14 +402,6 @@ New Folder Нова папка - - New Text Document - Новий текстовий документ - - - New Bitmap Image - Новий точковий рисунок - This folder is empty. Ця папка порожня. @@ -1170,14 +1154,6 @@ Cancel Скасувати - - Bitmap Image - Зображення - - - Creates an empty bitmap image file - Створює порожній файл зображення - Folder Папка @@ -1186,14 +1162,6 @@ Creates an empty folder Створює порожню папку - - Text Document - Текстовий документ - - - Creates an empty text file - Створює порожній текстовий файл - Layout mode Вид піктограм @@ -1898,10 +1866,70 @@ Search results Search results + + See who contributed to Files + See who contributed to Files + + + Find out what's new in Files + Find out what's new in Files + + + Send the developers an issue report with more information + Send the developers an issue report with more information + + + Support us on PayPal + Support us on PayPal + List and sort directories alongside files List and sort directories alongside files + + Details + Details + + + No + No + + + Do you want to download and install the latest version of Files? + Do you want to download and install the latest version of Files? + + + Yes + Yes + + + Updates Available + Updates Available + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + File + File + + + File + File + + + Creates an empty file + Creates an empty file + + + New File + New File + diff --git a/Files/MultilingualResources/Files.zh-Hans.xlf b/Files/MultilingualResources/Files.zh-Hans.xlf index 1b8340110c6d..bd9a1454e38c 100644 --- a/Files/MultilingualResources/Files.zh-Hans.xlf +++ b/Files/MultilingualResources/Files.zh-Hans.xlf @@ -227,14 +227,6 @@ Folder 文件夹 - - Bitmap Image - 位图 - - - Text Document - 文本文档 - Properties 属性 @@ -332,8 +324,8 @@ Text Document 文本文档 - - List View + + Details View 列表 @@ -412,14 +404,6 @@ New Folder 新建 文件夹 - - New Text Document - 新建 文本文档 - - - New Bitmap Image - 新建位图 - This folder is empty. 该文件夹为空。 @@ -1175,14 +1159,6 @@ Cancel 取消 - - Bitmap Image - 位图 - - - Creates an empty bitmap image file - 创建新位图文件 - Folder 文件夹 @@ -1191,14 +1167,6 @@ Creates an empty folder 创建一个空文件夹 - - Text Document - 文本文档 - - - Creates an empty text file - 创建一个空文本文件 - Layout mode 布局模式 @@ -1903,10 +1871,70 @@ Search results Search results + + See who contributed to Files + See who contributed to Files + + + Find out what's new in Files + Find out what's new in Files + + + Send the developers an issue report with more information + Send the developers an issue report with more information + + + Support us on PayPal + Support us on PayPal + List and sort directories alongside files List and sort directories alongside files + + Details + Details + + + No + No + + + Do you want to download and install the latest version of Files? + Do you want to download and install the latest version of Files? + + + Yes + Yes + + + Updates Available + Updates Available + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + File + File + + + File + File + + + Creates an empty file + Creates an empty file + + + New File + New File + diff --git a/Files/MultilingualResources/Files.zh-Hant.xlf b/Files/MultilingualResources/Files.zh-Hant.xlf index 04938254ca8f..376403ee5e63 100644 --- a/Files/MultilingualResources/Files.zh-Hant.xlf +++ b/Files/MultilingualResources/Files.zh-Hant.xlf @@ -230,14 +230,6 @@ Folder 資料夾 - - Bitmap Image - Bitmap 點陣圖 - - - Text Document - 文字文件 - Properties 內容 @@ -335,8 +327,8 @@ Text Document 文字文件 - - List View + + Details View 列表 @@ -418,14 +410,6 @@ New Folder 新增資料夾 - - New Text Document - 新增文字文件 - - - New Bitmap Image - 新增 Bitmap 點陣圖 - This folder is empty. 該資料夾為空。 @@ -1223,14 +1207,6 @@ Choose a type for this new item below Choose a type for this new item below - - Bitmap Image - Bitmap Image - - - Creates an empty bitmap image file - Creates an empty bitmap image file - Folder Folder @@ -1239,14 +1215,6 @@ Creates an empty folder Creates an empty folder - - Text Document - Text Document - - - Creates an empty text file - Creates an empty text file - Layout mode Layout mode @@ -1907,10 +1875,70 @@ Search results Search results + + See who contributed to Files + See who contributed to Files + + + Find out what's new in Files + Find out what's new in Files + + + Send the developers an issue report with more information + Send the developers an issue report with more information + + + Support us on PayPal + Support us on PayPal + List and sort directories alongside files List and sort directories alongside files + + Details + Details + + + No + No + + + Do you want to download and install the latest version of Files? + Do you want to download and install the latest version of Files? + + + Yes + Yes + + + Updates Available + Updates Available + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + Hide protected operating system files (Recommended) + Hide protected operating system files (Recommended) + + + File + File + + + File + File + + + Creates an empty file + Creates an empty file + + + New File + New File + diff --git a/Files/ResourceDictionaries/CustomDataGridStyle.xaml b/Files/ResourceDictionaries/CustomDataGridStyle.xaml index 03c1b77c22f5..a7c02baf3b60 100644 --- a/Files/ResourceDictionaries/CustomDataGridStyle.xaml +++ b/Files/ResourceDictionaries/CustomDataGridStyle.xaml @@ -1,12 +1,15 @@  - - - + + + 00:00:00.40 @@ -15,19 +18,123 @@ 00:00:02 00:00:00.1 00:00:00.5 - - + + - + \ No newline at end of file diff --git a/Files/ResourceDictionaries/PropertiesStyles.xaml b/Files/ResourceDictionaries/PropertiesStyles.xaml index 9cfb99fac753..8a1ca9f6e13e 100644 --- a/Files/ResourceDictionaries/PropertiesStyles.xaml +++ b/Files/ResourceDictionaries/PropertiesStyles.xaml @@ -65,4 +65,4 @@ - + \ No newline at end of file diff --git a/Files/Strings/de-DE/Resources.resw b/Files/Strings/de-DE/Resources.resw index 328d0c19891d..d7c47e87abe3 100644 --- a/Files/Strings/de-DE/Resources.resw +++ b/Files/Strings/de-DE/Resources.resw @@ -177,12 +177,6 @@ Ordner - - Bitmap Bild - - - Textdatei - Eigenschaften @@ -255,7 +249,7 @@ Textdokument - + Details @@ -315,12 +309,6 @@ Neuer Ordner - - Neues Textdokument - - - Neues Bitmap Bild - Dieser Ordner ist leer. @@ -885,24 +873,12 @@ Abbrechen - - Bitmapbild - - - Erstelt ein leeres Bitmapbild - Ordner Erstellt einen leeren Ordner - - Textdokument - - - Erstellt ein leeres Textdokument - Layoutmodus diff --git a/Files/Strings/en-US/Resources.resw b/Files/Strings/en-US/Resources.resw index befa893bc1d6..0f739129ec0b 100644 --- a/Files/Strings/en-US/Resources.resw +++ b/Files/Strings/en-US/Resources.resw @@ -213,8 +213,8 @@ Clear Selection - - List View + + Details View Modified: @@ -396,11 +396,8 @@ Folder - - Bitmap Image - - - Text Document + + File Properties @@ -492,11 +489,8 @@ New Folder - - New Text Document - - - New Bitmap Image + + New File This folder is empty. @@ -1026,11 +1020,11 @@ Choose a type for this new item below - - Bitmap Image + + File - - Creates an empty bitmap image file + + Creates an empty file Folder @@ -1038,12 +1032,6 @@ Creates an empty folder - - Text Document - - - Creates an empty text file - Layout mode @@ -1536,7 +1524,40 @@ Search results + + See who contributed to Files + + + Find out what's new in Files + + + Send the developers an issue report with more information + + + Support us on PayPal + List and sort directories alongside files + + Details + + + No + + + Do you want to download and install the latest version of Files? + + + Yes + + + Updates Available + + + Hide protected operating system files (Recommended) + + + Hide protected operating system files (Recommended) + \ No newline at end of file diff --git a/Files/Strings/es-ES/Resources.resw b/Files/Strings/es-ES/Resources.resw index 41cb77008301..f63994ecc9f8 100644 --- a/Files/Strings/es-ES/Resources.resw +++ b/Files/Strings/es-ES/Resources.resw @@ -177,12 +177,6 @@ Carpeta - - Imagen Bitmap - - - Documento de Texto - Propiedades @@ -255,7 +249,7 @@ Documento de Texto - + Detalles @@ -315,12 +309,6 @@ Nueva Carpeta - - Nuevo Documento de Texto - - - Nueva Imagen Bitmap - Esta carpeta está vacía. @@ -864,24 +852,12 @@ Cancelar - - Imagen de mapa de bits - - - Crea un archivo de imagen de mapa de bits vacío - Carpeta Crea una carpeta vacía - - Documento de texto - - - Crea un archivo de texto vacío. - Modo de vista @@ -988,7 +964,7 @@ Mover aquí - Dispositivos y Unidades + Dispositivos y unidades Mostrar bibliotecas en la página de inicio @@ -1059,6 +1035,9 @@ Nueva pestaña + + Búsqueda + Solo lectura @@ -1359,4 +1338,58 @@ Quitar todas las propiedades + + sRGB + + + Sin especificar + + + Verifique el estado de las operaciones de archivo aquí + + + Centro de actividades + + + Licencia + + + Licencia + + + Sitio web + + + Sitio web + + + Mas información acerca de formatos de fecha + + + Soltar aquí + + + Resultados de búsqueda en + + + Resultados de búsqueda + + + Ver quiénes contribuyen a Files + + + Ver las novedades de esta versión + + + Envíe a los desarrolladores un reporte de problemas con más información. + + + Apóyanos en PayPal + + + Listar y ordenar directorios junto con archivos + + + Detalles + \ No newline at end of file diff --git a/Files/Strings/fr-FR/Resources.resw b/Files/Strings/fr-FR/Resources.resw index ad1abd445201..ef5d893aea3a 100644 --- a/Files/Strings/fr-FR/Resources.resw +++ b/Files/Strings/fr-FR/Resources.resw @@ -177,12 +177,6 @@ Dossier - - Image bitmap - - - Document texte - Propriétés @@ -255,7 +249,7 @@ Document texte - + Vue liste @@ -333,12 +327,6 @@ Nouveau dossier - - Nouveau document texte - - - Nouvelle image bitmap - Ce dossier est vide. @@ -885,24 +873,12 @@ Annuler - - Image bitmap - - - Crée une image bitmap vide - Dossier Crée un dossier vide - - Document texte - - - Crée un fichier texte vide - Disposition @@ -1098,6 +1074,9 @@ Longitude + + Altitude + Marque d'appareil @@ -1113,15 +1092,27 @@ Ouverture + + Format + Artiste Genre + + Durée + + + Producteur + Année + + Version + Vidéo @@ -1140,6 +1131,9 @@ Annuler + + Certaines propriétés peuvent contenir des informations personnelles. + Supprimer les propriétés @@ -1149,4 +1143,19 @@ Non spécifié + + Licence + + + Licence + + + Site web + + + Site web + + + En savoir plus sur les formats de date + \ No newline at end of file diff --git a/Files/Strings/he-IL/Resources.resw b/Files/Strings/he-IL/Resources.resw index 395da6f88199..747e10a13a61 100644 --- a/Files/Strings/he-IL/Resources.resw +++ b/Files/Strings/he-IL/Resources.resw @@ -102,7 +102,7 @@ נקה בחירה - + תצוגת רשימה @@ -216,12 +216,6 @@ תיקיה - - תמונת מפת סיביות - - - מסמך טקסט - מאפיינים @@ -294,12 +288,6 @@ תיקיה חדשה - - ‏‏‫מסמך טקסט ‫חדש - - - ‏‏‫תמונת מפת ‫סיביות ‫חדשה - ‏‏תיקיה זו ריקה. @@ -600,15 +588,9 @@ ביטול - - תמונת מפת סיביות - תיקיה - - מסמך טקסט - מצב פריסה diff --git a/Files/Strings/hi-IN/Resources.resw b/Files/Strings/hi-IN/Resources.resw index e36f3ed1c553..ad3edb3290f9 100644 --- a/Files/Strings/hi-IN/Resources.resw +++ b/Files/Strings/hi-IN/Resources.resw @@ -108,7 +108,7 @@ चयन खाली करें - + सूची व्यू @@ -273,12 +273,6 @@ फ़ोल्डर - - बिटमैप चित्र - - - लेख दस्तावेज़ - गुण @@ -369,12 +363,6 @@ नया फ़ोल्डर - - नया लिखित दस्तावेज़ - - - नई बिटमैप छवि - यह फोल्डर खाली है। @@ -807,15 +795,9 @@ रद्द करें - - बिटमैप छवि - फ़ोल्डर - - पाठ दस्तावेज़ - आगे नेविगेट करें diff --git a/Files/Strings/hu-HU/Resources.resw b/Files/Strings/hu-HU/Resources.resw index add7f628e63d..c2360f43351f 100644 --- a/Files/Strings/hu-HU/Resources.resw +++ b/Files/Strings/hu-HU/Resources.resw @@ -108,7 +108,7 @@ Kijelölés megszűntetése - + Részletek @@ -285,12 +285,6 @@ Mappa - - Bitmap Kép - - - Szöveges Dokumentum - Tulajdonságok @@ -381,12 +375,6 @@ Új Mappa - - Új Szöveges Dokumentum - - - Új Bitmap Kép - Üres mappa. @@ -909,24 +897,12 @@ Válasszon fájltípust az alábbiak közűl - - Bitmap Kép - - - Új bitmap kép készítése - Mappa Új mappa készítése - - Szöveges Dokumentum - - - Új szöveges dokumentum készítése - Elrendezés @@ -1080,6 +1056,9 @@ Új lap + + Keresés + Csak olvasható @@ -1221,6 +1200,9 @@ Év + + Közreműködő + Felülvizsgálat száma @@ -1351,6 +1333,45 @@ Weboldal - Tudj meg többet a dátumokról + Tudjon meg többet a dátumokról + + + Másolás ide + + + Keresés eredménye a következőben: + + + Keresési eredmények + + + Közreműködők + + + Újdonságok a Files-ban + + + Visszajelzés küldése a fejlesztőknek + + + Támogatás PayPal-on + + + Mappák rendszerezése a fájlokkal + + + Részletek + + + Nem + + + Szeretné letőlteni és telepíteni a legújabb Files verziót? + + + Igen + + + Frissítés elérhető \ No newline at end of file diff --git a/Files/Strings/it-IT/Resources.resw b/Files/Strings/it-IT/Resources.resw index 92457f579524..75204223ed56 100644 --- a/Files/Strings/it-IT/Resources.resw +++ b/Files/Strings/it-IT/Resources.resw @@ -102,7 +102,7 @@ Deseleziona tutto - + Dettagli @@ -252,12 +252,6 @@ Cartella - - Immagine bitmap - - - Documento di testo - Proprietà @@ -345,12 +339,6 @@ Nuova cartella - - Nuovo documento di testo - - - Nuova immagine bitmap - Questa cartella è vuota @@ -885,24 +873,12 @@ Annulla - - Immagine bitmap - - - Crea un file immagine bitmap vuoto - Cartella Crea una cartella vuota - - Documento di testo - - - Crea un file di testo vuoto - Modalità di visualizzazione @@ -999,6 +975,9 @@ Opzioni selezione + + Stato delle operazioni + Apri elementi con un solo click @@ -1068,7 +1047,412 @@ Espelli + + Duplica scheda + + + Muovi scheda in una nuova finestra + + + Nuova scheda + + + Cerca + + + Sola lettura + + + Nascosto + + + Classificazione + + + Percorso della cartella + + + Tipo di file + + + Titolo + + + Soggetto + + + Commento + + + Copyright + + + Data creazione + + + Ultima modifica + + + Profondità in bit + + + Dimensioni + + + Risolutione orizzontale + + + Risolutione verticale + + + Compressione + + + Larghezza + + + Altezza + + + Latitudine + + + Latitudine Decimale + + + Latitudine Ref + + + Longitudine + + + Longitudine Decimale + + + Longitudine Ref + + + Altitudine + + + Produttore telecamera + + + Modello telecamera + + + Tempo di esposizione + + + Lunghezza focale + + + Apertura + + + Data acquisizione + + + Numero canali + + + Velocità in bit + + + Compressione + + + Formato + + + Velocità dati + + + Artisti partecipanti + + + Artista dell'album + + + Titolo dell'album + + + Artista + + + Battute al minuto + + + Compositore + + + Conduttori + + + Numero disco + + + Genere + + + Numbero traccia + + + Durata + + + Numero di frame + + + Tipo di protezione + + + Url autore + + + Provider di contenuti + + + Data Rilascio + + + Serie + + + Stagione + + + Episodio + + + Produttore + + + Url di promozione + + + Stile di musica + + + Editore + + + Percorso anteprima grande + + + Url anteprima grande + + + Percorso anteprima piccola + + + Url anteprima piccola + + + Url utente + + + Scrittore + + + Anno + + + Principale + + + Immagine + + + Foto + + + GPS + + + Media + + + Audio + + + Musica + + + Indirizzo + + + Spazio colore + + + Nomi di persona + + + Collaboratori + + + Ultimo Autore + + + Revisione Numero + + + Versione + + + Video + + + Data Salvataggio + + + Data Stampa + + + Tempo di modifica totale + + + Modello + + + Numero Parole + + + Numero Caratteri + + + Numero Linee + + + Numero Paragrafi + + + Numero Pagine + + + Numero Slide + + + Frequenza fotogrammi + + + Larghezza fotogrammi + + + Altezza fotogrammi + + + Orientamento + + + Documento + + + Errore + + + Riprova + + + Chiudi comunque + + + Annulla + + + C'è stato un problema salvando alcune proprietà. + + + Alcune proprietà potrebbero contenere informazioni personali. + + + Cancella + + + Cancella tutte le proprietà + + + sRGB + + + Non specificato + + + Controlla qui lo stato delle operazioni sui file + + + Stato delle operazioni + + + Licenza + + + Licenza + + + Sito web + + + Sito web + + + Più informazioni sul formato data + Rilascia qui + + Cerca risultati in + + + Risultati ricerca + + + Vedi chi ha contribuito a Files + + + Scopri le novità in Files + + + Invia agli sviluppatori un rapporto sul problema + + + Supportaci su PayPal + + + Ordina le cartelle insieme ai file + + + Dettagli + + + No + + + Vuoi scaricare e installare l'ultima versione di Files? + + + + + + Aggiornamenti disponibili + + + Nascondi i file protetti di sistema (consigliato) + + + Nascondi i file protetti di sistema (consigliato) + + + File + + + File + + + Crea un file vuoto + + + Nuovo File + \ No newline at end of file diff --git a/Files/Strings/ja-JP/Resources.resw b/Files/Strings/ja-JP/Resources.resw index 9da59e3089ba..47055cfcbba7 100644 --- a/Files/Strings/ja-JP/Resources.resw +++ b/Files/Strings/ja-JP/Resources.resw @@ -108,7 +108,7 @@ 選択をクリア - + 詳細 @@ -267,12 +267,6 @@ フォルダ - - ビットマップ - - - テキスト文書 - プロパティ @@ -363,12 +357,6 @@ 新しいフォルダ - - 新しいテキスト文書 - - - 新しいビットマップ - フォルダは空です。 @@ -885,24 +873,12 @@ キャンセル - - ビットマップ イメージ - - - 空のビットマップ画像ファイルを作成します - フォルダー 空のフォルダを作成します - - テキスト ドキュメント - - - 空のテキスト ファイルを作成します。 - レイアウト モード diff --git a/Files/Strings/nl-NL/Resources.resw b/Files/Strings/nl-NL/Resources.resw index 6f4bd185f3b4..428c5445d2c4 100644 --- a/Files/Strings/nl-NL/Resources.resw +++ b/Files/Strings/nl-NL/Resources.resw @@ -177,12 +177,6 @@ Map - - Bitmapafbeelding - - - Tekstdocument - Eigenschappen @@ -255,7 +249,7 @@ Tekstdocument - + Lijstweergave @@ -315,12 +309,6 @@ Nieuwe map - - Nieuw tekstdocument - - - Nieuwe bitmapafbeelding - Deze map is leeg. @@ -840,15 +828,9 @@ Annuleren - - Bitmapafbeelding - Map - - Tekstdocument - Lay-outmodus diff --git a/Files/Strings/or-IN/Resources.resw b/Files/Strings/or-IN/Resources.resw index 81d79e79df17..976155d0f5cc 100644 --- a/Files/Strings/or-IN/Resources.resw +++ b/Files/Strings/or-IN/Resources.resw @@ -108,7 +108,7 @@ ଚୟନ ସଫା କରନ୍ତୁ - + ତାଲିକା ଭ୍ୟୁ @@ -273,12 +273,6 @@ ଫୋଲ୍ଡର - - ବିଟମ୍ୟାପ୍ ପ୍ରତିଛବି - - - ପାଠ୍ୟ ଦସ୍ତାବେଜ - ଗୁଣଧର୍ମ @@ -369,12 +363,6 @@ ନୂତନ ଫୋଲ୍ଡର - - ନୂତନ ପାଠ୍ୟ ଦସ୍ତାବେଜ - - - ନୂତନ ବିଟମ୍ୟାପ୍ ପ୍ରତିଛବି - ଏହି ଫୋଲ୍ଡରଟି ଖାଲି ଅଛି | @@ -795,15 +783,9 @@ ବାତିଲ୍ - - ବିଟ୍‌ମ୍ୟାପ୍ ପ୍ରତିଛବି - ଫୋଲ୍ଡର: - - ପାଠ ଡକ୍ୟୁମେଣ୍ଟ୍ - ଅଗ୍ରଗାମୀ ନେଭିଗେଟ୍ କରନ୍ତୁ diff --git a/Files/Strings/pl-PL/Resources.resw b/Files/Strings/pl-PL/Resources.resw index 0900a4d3a622..48ccac4ca607 100644 --- a/Files/Strings/pl-PL/Resources.resw +++ b/Files/Strings/pl-PL/Resources.resw @@ -79,13 +79,13 @@ Pliki i foldery - Po uruchomienu + Po uruchomieniu Opcje - Kontynuuj poprzednią sejsę + Przywróć poprzednią sesję Otwórz nową kartę @@ -177,12 +177,6 @@ Folder - - Obraz - mapa bitowa - - - Dokument tekstowy - Właściwości @@ -220,7 +214,7 @@ Właściwości - QuickLook + Szybki podgląd Nowe okno @@ -255,7 +249,7 @@ Dokument tekstowy - + Widok listy @@ -277,16 +271,16 @@ Udziel uprawnienia - Przed rozpoczęciem, będziesz musiał przyznać uprawnień do odczytu plików. Otworzy to kartę z ustawieniami gdzie będziesz mógł przyznać te uprawnienie. Wymagany restart aplikacji po wprowadzonych zmianach. + Przed rozpoczęciem, będziesz musiał przyznać uprawnienia do odczytu plików. Otworzymy dla Ciebie kartę z ustawieniami gdzie będziesz mógł przyznać te uprawnienia. Będzie wymagany restart aplikacji po wprowadzeniu zmian. - Folder plików + Folder Wprowadź nazwę elementu - Wprowadź nazwę elementu bez rozszerzenia + Wprowadź nazwę pliku Ustaw nazwę @@ -315,12 +309,6 @@ Nowy folder - - Nowy dokument tekstowy - - - Nowy obraz mapy bitowej - Ten folder jest pusty. @@ -460,7 +448,7 @@ Czy usunąłeś ten folder? - Tryb układu + Układu Opcje zaznaczeń @@ -700,7 +688,7 @@ Folder docelowy jest taki sam jak folder źródłowy. - Kopiuj do programu {0} + Kopiuj do {0} Utwórz skrót @@ -727,7 +715,7 @@ Folder - Link sieci Web + Link Url Ogólne @@ -882,26 +870,14 @@ Anuluj - - Obraz - mapa bitowa - - - Tworzy pusty plik obrazu bitmapowego - Folder Tworzy pusty folder - - Dokument tekstowy - - - Tworzy pusty plik tekstowy - - Tryb układu + Układ Nawiguj do tyłu diff --git a/Files/Strings/pt-BR/Resources.resw b/Files/Strings/pt-BR/Resources.resw index e5fc217e9d49..ecfe53de236e 100644 --- a/Files/Strings/pt-BR/Resources.resw +++ b/Files/Strings/pt-BR/Resources.resw @@ -108,7 +108,7 @@ Limpar Seleção - + Lista @@ -273,12 +273,6 @@ Pasta - - Imagem de Bitmap - - - Documento de Texto - Propriedades @@ -369,12 +363,6 @@ Nova pasta - - Novo Documento de Texto - - - Nova Imagem de Bitmap - Esta pasta está vazia. @@ -885,24 +873,12 @@ Cancelar - - Imagem de Bitmap - - - Criar um arquivo de imagem bitmap vazio - Pasta Cria uma pasta vazia - - Documento de Texto - - - Cria um arquivo de texto vazio - Modo de layout diff --git a/Files/Strings/ru-RU/Resources.resw b/Files/Strings/ru-RU/Resources.resw index 06f40a2932d7..9e7b2e390261 100644 --- a/Files/Strings/ru-RU/Resources.resw +++ b/Files/Strings/ru-RU/Resources.resw @@ -195,12 +195,6 @@ Папку - - Изображение - - - Текстовый документ - Свойства @@ -264,7 +258,7 @@ Очистить выделение - + Таблица @@ -312,12 +306,6 @@ Новая папка - - Новый текстовый документ - - - Рисунок - Эта папка пуста. @@ -882,24 +870,12 @@ Отмена - - Изображение - - - Создает пустой файл изображения - Папка Создает пустую папку - - Текстовый документ - - - Создает пустой текстовый документ. - Вид значков diff --git a/Files/Strings/ta/Resources.resw b/Files/Strings/ta/Resources.resw index 58e544b32795..d257a81c767a 100644 --- a/Files/Strings/ta/Resources.resw +++ b/Files/Strings/ta/Resources.resw @@ -108,7 +108,7 @@ தேர்வை அழி - + பட்டியல் காட்சி @@ -264,12 +264,6 @@ கோப்புறை - - பிட் வரைபடப் படிமம் - - - உரை ஆவணம் - பண்புகள் @@ -357,12 +351,6 @@ புதியக் கோப்புறை - - புதிய உரை ஆவணம் - - - புதிய பிட் வரைபடப் படிமம் - இந்தக் கோப்புறை வெறுமையாக உள்ளது @@ -856,24 +844,12 @@ இரத்து - - பிட் வரைபடப் படிமம் - - - ஒரு வெறுமை பிட் வரைபடப் படிம கோப்பை உருவாக்கும் - கோப்புறை ஒரு வெறுமை கோப்புறையை உருவாக்கும் - - உரை ஆவணம் - - - ஒரு வெறுமை உரை ஆவணத்தை உருவாக்கும் - தளவமைப்பு முறை diff --git a/Files/Strings/tr-TR/Resources.resw b/Files/Strings/tr-TR/Resources.resw index 65416290db45..5456fbf44d0c 100644 --- a/Files/Strings/tr-TR/Resources.resw +++ b/Files/Strings/tr-TR/Resources.resw @@ -177,12 +177,6 @@ Dosya - - Bit Eşlem Resmi - - - Metin Belgesi - Özellikler @@ -255,7 +249,7 @@ Metin Belgesi - + Liste Görünümü @@ -303,12 +297,6 @@ Yeni Klasör - - Yeni Metin Belgesi - - - Yeni Bit Eşlem Resmi - Bu klasör boş. @@ -666,18 +654,9 @@ İptal - - Bit Eşlem Resmi - Klasör - - Metin Belgesi - - - Boş bir metin dosyası oluşturur. - Düzen modu diff --git a/Files/Strings/uk-UA/Resources.resw b/Files/Strings/uk-UA/Resources.resw index ba3ef4a9bb7f..60a8c31f61f5 100644 --- a/Files/Strings/uk-UA/Resources.resw +++ b/Files/Strings/uk-UA/Resources.resw @@ -81,7 +81,7 @@ Очистити виділення - + Список @@ -225,12 +225,6 @@ Папку - - Зображення - - - Текстовий документ - Властивості @@ -312,12 +306,6 @@ Нова папка - - Новий текстовий документ - - - Новий точковий рисунок - Ця папка порожня. @@ -882,24 +870,12 @@ Скасувати - - Зображення - - - Створює порожній файл зображення - Папка Створює порожню папку - - Текстовий документ - - - Створює порожній текстовий файл - Вид піктограм diff --git a/Files/Strings/zh-Hans/Resources.resw b/Files/Strings/zh-Hans/Resources.resw index 7e76742e88e2..492795adabdb 100644 --- a/Files/Strings/zh-Hans/Resources.resw +++ b/Files/Strings/zh-Hans/Resources.resw @@ -177,12 +177,6 @@ 文件夹 - - 位图 - - - 文本文档 - 属性 @@ -255,7 +249,7 @@ 文本文档 - + 列表 @@ -315,12 +309,6 @@ 新建 文件夹 - - 新建 文本文档 - - - 新建位图 - 该文件夹为空。 @@ -885,24 +873,12 @@ 取消 - - 位图 - - - 创建新位图文件 - 文件夹 创建一个空文件夹 - - 文本文档 - - - 创建一个空文本文件 - 布局模式 diff --git a/Files/Strings/zh-Hant/Resources.resw b/Files/Strings/zh-Hant/Resources.resw index 0284a702f626..d55b2039148a 100644 --- a/Files/Strings/zh-Hant/Resources.resw +++ b/Files/Strings/zh-Hant/Resources.resw @@ -177,12 +177,6 @@ 資料夾 - - Bitmap 點陣圖 - - - 文字文件 - 內容 @@ -255,7 +249,7 @@ 文字文件 - + 列表 @@ -315,12 +309,6 @@ 新增資料夾 - - 新增文字文件 - - - 新增 Bitmap 點陣圖 - 該資料夾為空。 diff --git a/Files/UserControls/MultitaskingControl/HorizontalMultitaskingControl.xaml b/Files/UserControls/MultitaskingControl/HorizontalMultitaskingControl.xaml index c76f2a147606..fae0aa2f6da5 100644 --- a/Files/UserControls/MultitaskingControl/HorizontalMultitaskingControl.xaml +++ b/Files/UserControls/MultitaskingControl/HorizontalMultitaskingControl.xaml @@ -771,7 +771,7 @@ - + - + + Text="File"> - - - - - - + diff --git a/Files/UserControls/NavigationToolbar.xaml.cs b/Files/UserControls/NavigationToolbar.xaml.cs index dae3dfe3f4ec..d50ad5310a6e 100644 --- a/Files/UserControls/NavigationToolbar.xaml.cs +++ b/Files/UserControls/NavigationToolbar.xaml.cs @@ -1,4 +1,6 @@ -using Files.Filesystem; +using Files.DataModels; +using Files.Filesystem; +using Files.Helpers; using Files.Interacts; using Files.View_Models; using Files.Views; @@ -12,7 +14,6 @@ using System.IO; using System.Linq; using System.Runtime.CompilerServices; -using System.Threading; using System.Threading.Tasks; using System.Windows.Input; using Windows.ApplicationModel.DataTransfer; @@ -23,6 +24,7 @@ using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls.Primitives; using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media.Imaging; using static Files.UserControls.INavigationToolbar; namespace Files.UserControls @@ -115,7 +117,7 @@ public bool IsCreateButtonEnabledInPage typeof(NavigationToolbar), new PropertyMetadata(null) ); - + public static readonly DependencyProperty CanCopyPathInPageProperty = DependencyProperty.Register( "CanCopyPathInPage", typeof(bool), @@ -134,6 +136,7 @@ public bool CanCreateFileInPage SetValue(CanCreateFileInPageProperty, value); } } + public bool CanCopyPathInPage { get @@ -165,41 +168,22 @@ public bool CanOpenTerminalInPage } } - public static readonly DependencyProperty NewDocumentInvokedCommandProperty = DependencyProperty.Register( - "NewDocumentInvokedCommand", - typeof(ICommand), - typeof(NavigationToolbar), - new PropertyMetadata(null) - ); - - public ICommand NewDocumentInvokedCommand - { - get - { - return (ICommand)GetValue(NewDocumentInvokedCommandProperty); - } - set - { - SetValue(NewDocumentInvokedCommandProperty, value); - } - } - - public static readonly DependencyProperty NewImageInvokedCommandProperty = DependencyProperty.Register( - "NewImageInvokedCommand", + public static readonly DependencyProperty NewFileInvokedCommandProperty = DependencyProperty.Register( + "NewFileInvokedCommand", typeof(ICommand), typeof(NavigationToolbar), new PropertyMetadata(null) ); - public ICommand NewImageInvokedCommand + public ICommand NewFileInvokedCommand { get { - return (ICommand)GetValue(NewImageInvokedCommandProperty); + return (ICommand)GetValue(NewFileInvokedCommandProperty); } set { - SetValue(NewImageInvokedCommandProperty, value); + SetValue(NewFileInvokedCommandProperty, value); } } @@ -319,9 +303,17 @@ public ICommand OpenInTerminalInvokedCommand public SettingsViewModel AppSettings => App.AppSettings; + private List cachedNewContextMenuEntries { get; set; } + public NavigationToolbar() { this.InitializeComponent(); + this.Loading += NavigationToolbar_Loading; + } + + private async void NavigationToolbar_Loading(FrameworkElement sender, object args) + { + cachedNewContextMenuEntries = await RegistryHelper.GetNewContextMenuEntries(); } private bool manualEntryBoxLoaded = false; @@ -363,6 +355,7 @@ public bool ClickablePathLoaded public string PathText { get; set; } private bool _IsSearchReigonVisible = false; + public bool IsSearchReigonVisible { get @@ -817,5 +810,52 @@ public void ClearSearchBoxQueryText(bool collapseSearchReigon = false) IsSearchReigonVisible = false; } } + + private void NavMoreButtonFlyout_Opening(object sender, object e) + { + var newItemMenu = (MenuFlyoutSubItem)(sender as MenuFlyout).Items.SingleOrDefault(x => x.Name == "NewEmptySpace"); + if (newItemMenu == null || cachedNewContextMenuEntries == null) + { + return; + } + if (!newItemMenu.Items.Any(x => (x.Tag as string) == "CreateNewFile")) + { + var separatorIndex = newItemMenu.Items.IndexOf(newItemMenu.Items.Single(x => x.Name == "NewMenuFileFolderSeparator")); + foreach (var newEntry in Enumerable.Reverse(cachedNewContextMenuEntries)) + { + MenuFlyoutItem menuLayoutItem; + if (newEntry.Icon != null) + { + BitmapImage image = null; + image = new BitmapImage(); +#pragma warning disable CS4014 + image.SetSourceAsync(newEntry.Icon); +#pragma warning restore CS4014 + menuLayoutItem = new MenuFlyoutItemWithImage() + { + Text = newEntry.Name, + BitmapIcon = image, + Tag = "CreateNewFile" + }; + } + else + { + menuLayoutItem = new MenuFlyoutItem() + { + Text = newEntry.Name, + Icon = new FontIcon() + { + FontFamily = App.Current.Resources["FluentUIGlyphs"] as Windows.UI.Xaml.Media.FontFamily, + Glyph = "\xea00" + }, + Tag = "CreateNewFile" + }; + } + menuLayoutItem.Command = NewFileInvokedCommand; + menuLayoutItem.CommandParameter = newEntry; + newItemMenu.Items.Insert(separatorIndex + 1, menuLayoutItem); + } + } + } } } \ No newline at end of file diff --git a/Files/UserControls/SidebarControl.xaml b/Files/UserControls/SidebarControl.xaml index 4eb2d7b8aadd..9b7e892c103d 100644 --- a/Files/UserControls/SidebarControl.xaml +++ b/Files/UserControls/SidebarControl.xaml @@ -20,7 +20,7 @@ diff --git a/Files/UserControls/SidebarControl.xaml.cs b/Files/UserControls/SidebarControl.xaml.cs index 14bfc5392f72..28882b33672d 100644 --- a/Files/UserControls/SidebarControl.xaml.cs +++ b/Files/UserControls/SidebarControl.xaml.cs @@ -10,7 +10,6 @@ using System.Runtime.CompilerServices; using System.Windows.Input; using Windows.ApplicationModel.DataTransfer; -using Windows.Foundation.Collections; using Windows.Storage; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; diff --git a/Files/UserControls/StatusBarControl.xaml b/Files/UserControls/StatusBarControl.xaml index e190ef110b03..370a77e810b6 100644 --- a/Files/UserControls/StatusBarControl.xaml +++ b/Files/UserControls/StatusBarControl.xaml @@ -146,9 +146,9 @@ + x:Uid="StatusBarControlDetailsView" + Command="{x:Bind AppSettings.ToggleLayoutModeDetailsView}" + Text="Details View"> diff --git a/Files/UserControls/StatusCenter.xaml.cs b/Files/UserControls/StatusCenter.xaml.cs index bb906f591904..d94c17797a09 100644 --- a/Files/UserControls/StatusCenter.xaml.cs +++ b/Files/UserControls/StatusCenter.xaml.cs @@ -123,7 +123,7 @@ public class StatusBanner : ObservableObject private string fullTitle; - #endregion + #endregion Private Members #region Public Properties @@ -154,7 +154,7 @@ public string FullTitle set => SetProperty(ref fullTitle, value); } - #endregion + #endregion Public Properties public StatusBanner(string message, string title, uint progress, ReturnResult status, FileOperationType operation) { diff --git a/Files/UserControls/Widgets/DrivesWidget.xaml b/Files/UserControls/Widgets/DrivesWidget.xaml index 5970422e76cd..c07a3b8b533a 100644 --- a/Files/UserControls/Widgets/DrivesWidget.xaml +++ b/Files/UserControls/Widgets/DrivesWidget.xaml @@ -136,7 +136,10 @@ FontWeight="Medium" Text="{x:Bind Text, Mode=OneWay}" TextWrapping="NoWrap" /> - + var hasNextFile = false; do { - if (((FileAttributes)findData.dwFileAttributes & FileAttributes.System) != FileAttributes.System) + var itemPath = Path.Combine(path, findData.cFileName); + if (((FileAttributes)findData.dwFileAttributes & FileAttributes.System) != FileAttributes.System || !AppSettings.AreSystemItemsHidden) { - var itemPath = Path.Combine(path, findData.cFileName); if (((FileAttributes)findData.dwFileAttributes & FileAttributes.Hidden) != FileAttributes.Hidden || AppSettings.AreHiddenItemsVisible) { if (((FileAttributes)findData.dwFileAttributes & FileAttributes.Directory) != FileAttributes.Directory) @@ -1202,6 +1214,10 @@ public bool CheckFolderAccessWithWin32(string path) public bool CheckFolderForHiddenAttribute(string path) { + if (string.IsNullOrEmpty(path)) + { + return false; + } FINDEX_INFO_LEVELS findInfoLevel = FINDEX_INFO_LEVELS.FindExInfoBasic; int additionalFlags = FIND_FIRST_EX_LARGE_FETCH; IntPtr hFileTsk = FindFirstFileExFromApp(path + "\\*.*", findInfoLevel, out WIN32_FIND_DATA findDataTsk, FINDEX_SEARCH_OPS.FindExSearchNameMatch, IntPtr.Zero, diff --git a/Files/View Models/Properties/FileProperty.cs b/Files/View Models/Properties/FileProperty.cs index db0bb3305cf4..b86c27afb4fc 100644 --- a/Files/View Models/Properties/FileProperty.cs +++ b/Files/View Models/Properties/FileProperty.cs @@ -23,10 +23,12 @@ public string Name { get => NameResource.GetLocalized(); } + /// /// The name of the string resource for the property name /// public string NameResource { get; set; } + /// /// The name of the section to display /// @@ -34,14 +36,17 @@ public string Section { get => SectionResource.GetLocalized(); } + /// /// The name of the string resource for the section name /// public string SectionResource { get; set; } + /// /// The identifier of the property to get, eg System.Media.Duration /// public string Property { get; set; } + /// /// The value of the property /// @@ -82,6 +87,7 @@ public IValueConverter Converter { get => GetConverter(); } + public bool IsReadOnly { get; set; } = true; /// @@ -224,7 +230,7 @@ private string ConvertToString() /// Converts a string from a text block back to it's original type /// /// The input string - /// + /// private object ConvertBack(string value) { if (Converter != null && value != null) @@ -284,4 +290,4 @@ public async static Task> RetrieveAndInitializePropertiesAsyn { "FormatDuration", input => new TimeSpan(Convert.ToInt64(input)).ToString("mm':'ss")}, }; } -} +} \ No newline at end of file diff --git a/Files/View Models/Properties/FilePropertySection.cs b/Files/View Models/Properties/FilePropertySection.cs index 18963ea91c01..a30754135260 100644 --- a/Files/View Models/Properties/FilePropertySection.cs +++ b/Files/View Models/Properties/FilePropertySection.cs @@ -16,4 +16,4 @@ public FilePropertySection(IEnumerable items) : base(items) public string Key { get; set; } } -} +} \ No newline at end of file diff --git a/Files/View Models/Properties/FolderProperties.cs b/Files/View Models/Properties/FolderProperties.cs index b25a466774b5..05d33cfc89fb 100644 --- a/Files/View Models/Properties/FolderProperties.cs +++ b/Files/View Models/Properties/FolderProperties.cs @@ -94,20 +94,10 @@ public async override void GetSpecialProperties() } } - var parentDirectory = AppInstance.FilesystemViewModel.CurrentFolder; - - StorageFolder storageFolder = null; + StorageFolder storageFolder; try { - var isItemSelected = await CoreApplication.MainView.ExecuteOnUIThreadAsync(() => AppInstance?.ContentPage?.IsItemSelected ?? true); - if (isItemSelected) - { - storageFolder = await AppInstance.FilesystemViewModel.GetFolderFromPathAsync((Item as ShortcutItem)?.TargetPath ?? Item.ItemPath); - } - else if (!parentDirectory.ItemPath.StartsWith(App.AppSettings.RecycleBinPath)) - { - storageFolder = await AppInstance.FilesystemViewModel.GetFolderFromPathAsync(parentDirectory.ItemPath); - } + storageFolder = await AppInstance.FilesystemViewModel.GetFolderFromPathAsync((Item as ShortcutItem)?.TargetPath ?? Item.ItemPath); } catch (Exception ex) { @@ -124,7 +114,7 @@ public async override void GetSpecialProperties() GetOtherProperties(storageFolder.Properties); GetFolderSize(storageFolder, TokenSource.Token); } - else if (parentDirectory.ItemPath.StartsWith(App.AppSettings.RecycleBinPath)) + else if (Item.ItemPath.Equals(App.AppSettings.RecycleBinPath, StringComparison.OrdinalIgnoreCase)) { // GetFolderFromPathAsync cannot access recyclebin folder if (AppInstance.FilesystemViewModel.Connection != null) diff --git a/Files/View Models/SelectedItemsPropertiesViewModel.cs b/Files/View Models/SelectedItemsPropertiesViewModel.cs index 68ad108eb9b6..4c7c864d1e82 100644 --- a/Files/View Models/SelectedItemsPropertiesViewModel.cs +++ b/Files/View Models/SelectedItemsPropertiesViewModel.cs @@ -640,6 +640,7 @@ public Uri FolderIconSource } private ObservableCollection propertySections = new ObservableCollection(); + public ObservableCollection PropertySections { get => propertySections; @@ -674,4 +675,4 @@ public bool IsHidden set => SetProperty(ref isHidden, value); } } -} +} \ No newline at end of file diff --git a/Files/View Models/SettingsViewModel.cs b/Files/View Models/SettingsViewModel.cs index 09f7f1addaaf..1255fa516a58 100644 --- a/Files/View Models/SettingsViewModel.cs +++ b/Files/View Models/SettingsViewModel.cs @@ -41,7 +41,6 @@ public SettingsViewModel() { _roamingSettings = ApplicationData.Current.RoamingSettings; - DetectAcrylicPreference(); DetectDateTimeFormat(); PinSidebarLocationItems(); DetectRecycleBinPreference(); @@ -58,7 +57,7 @@ public SettingsViewModel() Analytics.TrackEvent("PinRecycleBinToSideBar " + PinRecycleBinToSideBar.ToString()); Analytics.TrackEvent("ShowFileExtensions " + ShowFileExtensions.ToString()); Analytics.TrackEvent("ShowConfirmDeleteDialog " + ShowConfirmDeleteDialog.ToString()); - Analytics.TrackEvent("AcrylicSidebar " + AcrylicEnabled.ToString()); + Analytics.TrackEvent("IsAcrylicDisabled " + IsAcrylicDisabled.ToString()); Analytics.TrackEvent("ShowFileOwner " + ShowFileOwner.ToString()); Analytics.TrackEvent("IsHorizontalTabStripEnabled " + IsHorizontalTabStripEnabled.ToString()); Analytics.TrackEvent("IsVerticalTabFlyoutEnabled " + IsVerticalTabFlyoutEnabled.ToString()); @@ -296,6 +295,24 @@ public bool ShowDrivesWidget set => Set(value); } + public bool ShowDateColumn + { + get => Get(true); + set => Set(value); + } + + public bool ShowTypeColumn + { + get => Get(true); + set => Set(value); + } + + public bool ShowSizeColumn + { + get => Get(true); + set => Set(value); + } + // Any distinguishable path here is fine // Currently is the command to open the folder from cmd ("cmd /c start Shell:RecycleBinFolder") public string RecycleBinPath { get; set; } = @"Shell:RecycleBinFolder"; @@ -437,7 +454,7 @@ public bool OpenNewTabPageOnStartup get => Get(true); set => Set(value); } - + public bool ShowStatusCenterTeachingTip { get => Get(true); @@ -479,35 +496,23 @@ public bool AreHiddenItemsVisible get => Get(false); set => Set(value); } - - public bool ListAndSortDirectoriesAlongsideFiles + + public bool AreSystemItemsHidden { - get => Get(false); + get => Get(true); set => Set(value); } - private void DetectAcrylicPreference() + public bool ListAndSortDirectoriesAlongsideFiles { - if (localSettings.Values["AcrylicEnabled"] == null) - { - localSettings.Values["AcrylicEnabled"] = true; - } - AcrylicEnabled = (bool)localSettings.Values["AcrylicEnabled"]; + get => Get(false); + set => Set(value); } - private bool _AcrylicEnabled = true; - - public bool AcrylicEnabled + public bool IsAcrylicDisabled { - get => _AcrylicEnabled; - set - { - if (value != _AcrylicEnabled) - { - SetProperty(ref _AcrylicEnabled, value); - localSettings.Values["AcrylicEnabled"] = value; - } - } + get => Get(true); + set => Set(value); } public bool ShowAllContextMenuItems @@ -533,7 +538,7 @@ public bool ShowCopyLocationOption public int LayoutMode { - get => Get(0); // List View + get => Get(0); // Details View set => Set(value); } @@ -597,9 +602,9 @@ public Type GetLayoutType() LayoutModeChangeRequested?.Invoke(this, EventArgs.Empty); }); - public RelayCommand ToggleLayoutModeListView => new RelayCommand(() => + public RelayCommand ToggleLayoutModeDetailsView => new RelayCommand(() => { - LayoutMode = 0; // List View + LayoutMode = 0; // Details View LayoutModeChangeRequested?.Invoke(this, EventArgs.Empty); }); @@ -748,10 +753,11 @@ public TValue Get(TValue defaultValue, [CallerMemberName] string propert Set(tValue, propertyName); // Put the corrected value in settings. return tValue; } - return tValue; } + _roamingSettings.Values[propertyName] = defaultValue; + return defaultValue; } diff --git a/Files/Views/LayoutModes/GenericFileBrowser.xaml b/Files/Views/LayoutModes/GenericFileBrowser.xaml index 307f3d5aed9e..e48af030f3a9 100644 --- a/Files/Views/LayoutModes/GenericFileBrowser.xaml +++ b/Files/Views/LayoutModes/GenericFileBrowser.xaml @@ -27,9 +27,9 @@ + x:Key="BoolToVisibilityConverter" + FalseValue="Collapsed" + TrueValue="Visible" /> + x:Uid="StatusBarControlDetailsView" + Command="{x:Bind AppSettings.ToggleLayoutModeDetailsView}" + Text="Details View"> @@ -194,23 +194,14 @@ - - - - - - + + Text="File"> @@ -703,22 +694,18 @@ - - - - - - - - - - + + + @@ -870,7 +857,8 @@ FontSize="12" Header="Date modified" IsReadOnly="True" - Tag="Date"> + Tag="Date" + Visibility="{x:Bind AppSettings.ShowDateColumn, Mode=OneWay}">