From 6c00418f75d856683f55fa44dea1e34422aae786 Mon Sep 17 00:00:00 2001
From: Yair Aichenbaum <39923744+yaichenbaum@users.noreply.github.com>
Date: Tue, 14 Apr 2020 15:36:39 -0400
Subject: [PATCH] v0.7.6 (#600)
---
.devbots/needs-review.yml | 3 +
Files.Launcher/Files.Launcher.csproj | 2 +-
Files.Launcher/Program.cs | 14 +-
Files.Launcher/app.config | 2 +-
Files.Package/Package.appxmanifest | 107 ++--
Files/App.xaml.cs | 14 +-
Files/BaseLayout.cs | 103 +++-
Files/Dialogs/AddItemDialog.xaml.cs | 12 +-
Files/Dialogs/ConsentDialog.xaml | 4 +-
Files/Dialogs/RenameDialog.xaml | 4 +-
Files/Files.csproj | 8 +-
Files/Filesystem/Drives.cs | 5 +-
Files/Helpers/NaturalStringComparer.cs | 54 ++
Files/Interacts/Interaction.cs | 256 ++++----
Files/LocationsList.cs | 14 +-
Files/MultilingualResources/Files.de-DE.xlf | 174 +++++-
Files/MultilingualResources/Files.es-ES.xlf | 290 ++++++---
Files/MultilingualResources/Files.fr-FR.xlf | 170 ++++-
Files/MultilingualResources/Files.nl-NL.xlf | 170 ++++-
Files/MultilingualResources/Files.pl-PL.xlf | 168 ++++-
Files/MultilingualResources/Files.ru-RU.xlf | 403 +++++++-----
Files/MultilingualResources/Files.tr-TR.xlf | 582 +++++++++++++++++
Files/MultilingualResources/Files.uk-UA.xlf | 583 ++++++++++++++++++
Files/MultilingualResources/Files.zh-Hans.xlf | 228 +++++--
Files/Navigation/NavigationActions.cs | 4 +-
Files/Properties.xaml | 122 ++--
Files/Properties.xaml.cs | 14 +
Files/ResourceController.cs | 14 +
Files/Strings/de-DE/Resources.resw | 119 +++-
Files/Strings/en-US/Resources.resw | 119 +++-
Files/Strings/es-ES/Resources.resw | 304 ++++++++-
Files/Strings/fr-FR/Resources.resw | 3 -
Files/Strings/nl-NL/Resources.resw | 3 -
Files/Strings/pl-PL/Resources.resw | 3 -
Files/Strings/ru-RU/Resources.resw | 531 ++++++++--------
Files/Strings/tr-TR/Resources.resw | 327 ++++++++++
Files/Strings/uk-UA/Resources.resw | 408 ++++++++++++
Files/Strings/zh-Hans/Resources.resw | 204 +++++-
.../LayoutModes/GenericFileBrowser.xaml | 33 +-
.../LayoutModes/GenericFileBrowser.xaml.cs | 79 ++-
.../UserControls/LayoutModes/PhotoAlbum.xaml | 6 +
.../LayoutModes/PhotoAlbum.xaml.cs | 52 +-
Files/UserControls/ModernSidebar.xaml.cs | 17 +-
.../ModernNavigationToolbar.xaml | 14 +
.../ModernNavigationToolbar.xaml.cs | 27 +-
Files/UserControls/StatusBarControl.xaml | 4 +
Files/UserControls/StatusBarControl.xaml.cs | 1 +
Files/UserControls/YourHome.xaml.cs | 18 +-
Files/View Models/ItemViewModel.cs | 69 ++-
Files/View Models/SettingsViewModel.cs | 51 +-
Files/Views/InstanceTabsView.xaml.cs | 81 +--
Files/Views/Pages/ModernShellPage.xaml.cs | 29 +-
Files/Views/Pages/Settings.xaml | 42 +-
Files/Views/Pages/Settings.xaml.cs | 37 +-
Files/Views/SettingsPages/About.xaml | 14 +-
Files/Views/SettingsPages/Appearance.xaml | 5 +-
Files/Views/SettingsPages/Appearance.xaml.cs | 42 +-
.../Views/SettingsPages/FilesAndFolders.xaml | 1 +
Files/Views/SettingsPages/Flags.xaml | 1 +
Files/Views/SettingsPages/OnStartup.xaml | 1 +
Files/Views/SettingsPages/Preferences.xaml | 5 +-
.../Views/SettingsPages/StartPageWidgets.xaml | 79 ++-
azure-pipelines-build-test.yml | 12 +
63 files changed, 5179 insertions(+), 1086 deletions(-)
create mode 100644 .devbots/needs-review.yml
create mode 100644 Files/Helpers/NaturalStringComparer.cs
create mode 100644 Files/MultilingualResources/Files.tr-TR.xlf
create mode 100644 Files/MultilingualResources/Files.uk-UA.xlf
create mode 100644 Files/ResourceController.cs
create mode 100644 Files/Strings/tr-TR/Resources.resw
create mode 100644 Files/Strings/uk-UA/Resources.resw
diff --git a/.devbots/needs-review.yml b/.devbots/needs-review.yml
new file mode 100644
index 000000000000..7f54cccdce75
--- /dev/null
+++ b/.devbots/needs-review.yml
@@ -0,0 +1,3 @@
+enabled: true
+label: "needs-review"
+delay: 30
diff --git a/Files.Launcher/Files.Launcher.csproj b/Files.Launcher/Files.Launcher.csproj
index 553144604d7c..2e5b36bb0fc1 100644
--- a/Files.Launcher/Files.Launcher.csproj
+++ b/Files.Launcher/Files.Launcher.csproj
@@ -8,7 +8,7 @@
WinExe
ProcessLauncher
ProcessLauncher
- v4.6.1
+ v4.7.2
512
true
true
diff --git a/Files.Launcher/Program.cs b/Files.Launcher/Program.cs
index 8ae7e1b36fbe..f84b2822730e 100644
--- a/Files.Launcher/Program.cs
+++ b/Files.Launcher/Program.cs
@@ -18,13 +18,13 @@ static void Main(string[] args)
if (arguments.Equals("StartupTasks"))
{
// Detect User Paths
- ApplicationData.Current.LocalSettings.Values["DetectedDesktopLocation"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "Desktop", null);
- ApplicationData.Current.LocalSettings.Values["DetectedDownloadsLocation"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "{374DE290-123F-4565-9164-39C4925E467B}", null);
- ApplicationData.Current.LocalSettings.Values["DetectedDocumentsLocation"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "Personal", null);
- ApplicationData.Current.LocalSettings.Values["DetectedPicturesLocation"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "My Pictures", null);
- ApplicationData.Current.LocalSettings.Values["DetectedMusicLocation"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "My Music", null);
- ApplicationData.Current.LocalSettings.Values["DetectedVideosLocation"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "My Video", null);
- ApplicationData.Current.LocalSettings.Values["DetectedOneDriveLocation"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\OneDrive", "UserFolder", null);
+ ApplicationData.Current.LocalSettings.Values["DesktopPath"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "Desktop", null);
+ ApplicationData.Current.LocalSettings.Values["DownloadsPath"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "{374DE290-123F-4565-9164-39C4925E467B}", null);
+ ApplicationData.Current.LocalSettings.Values["DocumentsPath"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "Personal", null);
+ ApplicationData.Current.LocalSettings.Values["PicturesPath"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "My Pictures", null);
+ ApplicationData.Current.LocalSettings.Values["MusicPath"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "My Music", null);
+ ApplicationData.Current.LocalSettings.Values["VideosPath"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "My Video", null);
+ ApplicationData.Current.LocalSettings.Values["OneDrivePath"] = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\OneDrive", "UserFolder", null);
// Check QuickLook Availability
QuickLook.CheckQuickLookAvailability(localSettings);
diff --git a/Files.Launcher/app.config b/Files.Launcher/app.config
index 3dbff35f484e..312bb3f26fc8 100644
--- a/Files.Launcher/app.config
+++ b/Files.Launcher/app.config
@@ -1,3 +1,3 @@
-
+
diff --git a/Files.Package/Package.appxmanifest b/Files.Package/Package.appxmanifest
index 2ae2f7ab03f5..a89c4924a919 100644
--- a/Files.Package/Package.appxmanifest
+++ b/Files.Package/Package.appxmanifest
@@ -1,56 +1,57 @@
-
-
- Files UWP - Preview
- Yair A
- Assets\StoreLogo.png
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ Files UWP - Preview
+ Yair A
+ Assets\StoreLogo.png
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Files/App.xaml.cs b/Files/App.xaml.cs
index 220e73517240..57792b209268 100644
--- a/Files/App.xaml.cs
+++ b/Files/App.xaml.cs
@@ -54,6 +54,7 @@ public static IShellPage CurrentInstance
public static ObservableCollection linuxDistroItems = new ObservableCollection();
public static SettingsViewModel AppSettings { get; set; }
public static InteractionViewModel InteractionViewModel { get; set; }
+ public static SelectedItemPropertiesViewModel SelectedItemPropertiesViewModel { get; set; }
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
@@ -80,6 +81,7 @@ public App()
AppSettings = new SettingsViewModel();
InteractionViewModel = new InteractionViewModel();
+ SelectedItemPropertiesViewModel = new SelectedItemPropertiesViewModel();
}
private void RegisterUncaughtExceptionLogger()
@@ -163,18 +165,6 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
//start tracking app usage
SystemInformation.TrackAppUse(e);
- if (SystemInformation.IsAppUpdated)
- {
- var dialog = new ContentDialog()
- {
- Title = "What's new in v0.7.5",
- Content = "• Fixed a crash that would sometimes occur when right clicking on a file or folder.\n• Fixed an issue where the status bar wouldn't hide on the new tab page.\n• Fixed an issue where clicking on the quick access item for home wouldn't navigate to the home page.\n• Fixed a bug that prevented users from right clicking on the navigation bar.",
- PrimaryButtonText = "Lets go!"
- };
-
- dialog.ShowAsync();
- }
-
Logger.Info("App launched");
bool canEnablePrelaunch = Windows.Foundation.Metadata.ApiInformation.IsMethodPresent("Windows.ApplicationModel.Core.CoreApplication", "EnablePrelaunch");
diff --git a/Files/BaseLayout.cs b/Files/BaseLayout.cs
index 5dc045c8b920..fada4a3c756a 100644
--- a/Files/BaseLayout.cs
+++ b/Files/BaseLayout.cs
@@ -8,6 +8,7 @@
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
+using Windows.ApplicationModel.DataTransfer;
using Windows.Storage;
using Windows.UI.Core;
using Windows.UI.Xaml;
@@ -73,6 +74,7 @@ internal set
{
IsItemSelected = true;
}
+ SetSelectedItemsOnUi(value);
NotifyPropertyChanged("SelectedItems");
}
}
@@ -98,6 +100,7 @@ internal set
{
IsItemSelected = true;
}
+ SetSelectedItemOnUi(value);
NotifyPropertyChanged("SelectedItem");
}
}
@@ -119,6 +122,12 @@ public BaseLayout()
}
}
+ protected abstract void SetSelectedItemOnUi(ListedItem selectedItem);
+
+ protected abstract void SetSelectedItemsOnUi(List selectedItems);
+
+ protected abstract ListedItem GetItemFromElement(object element);
+
private void AppSettings_LayoutModeChangeRequested(object sender, EventArgs e)
{
if (App.CurrentInstance.ContentPage != null)
@@ -144,7 +153,7 @@ private void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
- protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
+ protected override async void OnNavigatedTo(NavigationEventArgs eventArgs)
{
base.OnNavigatedTo(eventArgs);
// Add item jumping handler
@@ -171,9 +180,9 @@ protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
App.CurrentInstance.NavigationToolbar.CanNavigateToParent = true;
}
- App.CurrentInstance.ViewModel.AddItemsToCollectionAsync(App.CurrentInstance.ViewModel.WorkingDirectory);
- App.Clipboard_ContentChanged(null, null);
+ await App.CurrentInstance.ViewModel.RefreshItems();
+ App.Clipboard_ContentChanged(null, null);
App.CurrentInstance.NavigationToolbar.PathControlDisplayText = parameters;
}
@@ -273,5 +282,93 @@ protected virtual void Page_CharacterReceived(CoreWindow sender, CharacterReceiv
char letterPressed = Convert.ToChar(args.KeyCode);
App.CurrentInstance.InteractionOperations.PushJumpChar(letterPressed);
}
+
+ protected async void List_DragOver(object sender, DragEventArgs e)
+ {
+ if (e.DataView.Contains(StandardDataFormats.StorageItems))
+ {
+ IReadOnlyList draggedItems = await e.DataView.GetStorageItemsAsync();
+ // As long as one file doesn't already belong to this folder
+ if (draggedItems.Any(draggedItem => !Directory.GetParent(draggedItem.Path).FullName.Equals(App.CurrentInstance.ViewModel.WorkingDirectory, StringComparison.OrdinalIgnoreCase)))
+ {
+ e.AcceptedOperation = DataPackageOperation.Copy;
+ e.Handled = true;
+ }
+ else
+ {
+ e.AcceptedOperation = DataPackageOperation.None;
+ }
+ }
+ }
+
+ protected async void List_Drop(object sender, DragEventArgs e)
+ {
+ if (e.DataView.Contains(StandardDataFormats.StorageItems))
+ {
+ await AssociatedInteractions.PasteItems(e.DataView, App.CurrentInstance.ViewModel.WorkingDirectory, e.AcceptedOperation);
+ e.Handled = true;
+ }
+ }
+
+ protected async void Item_DragStarting(object sender, DragStartingEventArgs e)
+ {
+ List selectedStorageItems = new List();
+ foreach (ListedItem item in App.CurrentInstance.ContentPage.SelectedItems)
+ {
+ if (item.PrimaryItemAttribute == StorageItemTypes.File)
+ selectedStorageItems.Add(await StorageFile.GetFileFromPathAsync(item.ItemPath));
+ else if (item.PrimaryItemAttribute == StorageItemTypes.Folder)
+ selectedStorageItems.Add(await StorageFolder.GetFolderFromPathAsync(item.ItemPath));
+ }
+
+ e.Data.SetStorageItems(selectedStorageItems);
+ e.DragUI.SetContentFromDataPackage();
+ }
+
+ protected async void Item_DragOver(object sender, DragEventArgs e)
+ {
+ ListedItem item = GetItemFromElement(sender);
+ if (e.DataView.Contains(StandardDataFormats.StorageItems))
+ {
+ e.Handled = true;
+ IReadOnlyList draggedItems = await e.DataView.GetStorageItemsAsync();
+ // Items from the same parent folder as this folder are dragged into this folder, so we move the items instead of copy
+ if (draggedItems.Any(draggedItem => Directory.GetParent(draggedItem.Path).FullName == Directory.GetParent(item.ItemPath).FullName))
+ {
+ e.AcceptedOperation = DataPackageOperation.Move;
+ }
+ else
+ {
+ e.AcceptedOperation = DataPackageOperation.Copy;
+ }
+ }
+ }
+
+ protected async void Item_Drop(object sender, DragEventArgs e)
+ {
+ e.Handled = true;
+ ListedItem rowItem = GetItemFromElement(sender);
+ await App.CurrentInstance.InteractionOperations.PasteItems(e.DataView, rowItem.ItemPath, e.AcceptedOperation);
+ }
+
+ protected void InitializeDrag(UIElement element)
+ {
+ ListedItem item = GetItemFromElement(element);
+ if(item != null)
+ {
+ element.AllowDrop = false;
+ element.DragStarting -= Item_DragStarting;
+ element.DragStarting += Item_DragStarting;
+ element.DragOver -= Item_DragOver;
+ element.Drop -= Item_Drop;
+ if (item.PrimaryItemAttribute == StorageItemTypes.Folder)
+ {
+ element.AllowDrop = true;
+ element.DragOver += Item_DragOver;
+ element.Drop += Item_Drop;
+ }
+ }
+ }
+
}
}
diff --git a/Files/Dialogs/AddItemDialog.xaml.cs b/Files/Dialogs/AddItemDialog.xaml.cs
index 014acc24fc3c..d8778a2c6dec 100644
--- a/Files/Dialogs/AddItemDialog.xaml.cs
+++ b/Files/Dialogs/AddItemDialog.xaml.cs
@@ -69,9 +69,9 @@ public static async void CreateFile(AddItemType fileType)
}
else
{
- folder = await folderToCreateItem.CreateFolderAsync("New Folder", CreationCollisionOption.GenerateUniqueName);
+ folder = await folderToCreateItem.CreateFolderAsync(ResourceController.GetTranslation("NewFolder"), CreationCollisionOption.GenerateUniqueName);
}
- TabInstance.ViewModel.AddFileOrFolder(new ListedItem(folder.FolderRelativeId) { ItemName = folder.DisplayName, ItemDateModifiedReal = DateTimeOffset.Now, LoadUnknownTypeGlyph = false, LoadFolderGlyph = true, LoadFileIcon = false, ItemType = "Folder", FileImage = null, ItemPath = folder.Path });
+ TabInstance.ViewModel.AddFileOrFolder(new ListedItem(folder.FolderRelativeId) { PrimaryItemAttribute = StorageItemTypes.Folder, ItemName = folder.DisplayName, ItemDateModifiedReal = DateTimeOffset.Now, LoadUnknownTypeGlyph = false, LoadFolderGlyph = true, LoadFileIcon = false, ItemType = "Folder", FileImage = null, ItemPath = folder.Path });
}
else if (fileType == AddItemType.TextDocument)
{
@@ -82,9 +82,9 @@ public static async void CreateFile(AddItemType fileType)
}
else
{
- item = await folderToCreateItem.CreateFileAsync("New Text Document" + ".txt", CreationCollisionOption.GenerateUniqueName);
+ item = await folderToCreateItem.CreateFileAsync(ResourceController.GetTranslation("NewTextDocument") + ".txt", CreationCollisionOption.GenerateUniqueName);
}
- TabInstance.ViewModel.AddFileOrFolder(new ListedItem(item.FolderRelativeId) { ItemName = item.DisplayName, ItemDateModifiedReal = DateTimeOffset.Now, LoadUnknownTypeGlyph = true, LoadFolderGlyph = false, LoadFileIcon = false, ItemType = item.DisplayType, FileImage = null, ItemPath = item.Path, FileExtension = item.FileType });
+ TabInstance.ViewModel.AddFileOrFolder(new ListedItem(item.FolderRelativeId) { PrimaryItemAttribute = StorageItemTypes.File, ItemName = item.DisplayName, ItemDateModifiedReal = DateTimeOffset.Now, LoadUnknownTypeGlyph = true, LoadFolderGlyph = false, LoadFileIcon = false, ItemType = item.DisplayType, FileImage = null, ItemPath = item.Path, FileExtension = item.FileType });
}
else if (fileType == AddItemType.BitmapImage)
{
@@ -95,9 +95,9 @@ public static async void CreateFile(AddItemType fileType)
}
else
{
- item = await folderToCreateItem.CreateFileAsync("New Bitmap Image" + ".bmp", CreationCollisionOption.GenerateUniqueName);
+ item = await folderToCreateItem.CreateFileAsync(ResourceController.GetTranslation("NewBitmapImage") + ".bmp", CreationCollisionOption.GenerateUniqueName);
}
- TabInstance.ViewModel.AddFileOrFolder(new ListedItem(item.FolderRelativeId) { ItemName = item.DisplayName, ItemDateModifiedReal = DateTimeOffset.Now, LoadUnknownTypeGlyph = true, LoadFolderGlyph = false, LoadFileIcon = false, ItemType = item.DisplayType, FileImage = null, ItemPath = item.Path, FileExtension = item.FileType });
+ TabInstance.ViewModel.AddFileOrFolder(new ListedItem(item.FolderRelativeId) { PrimaryItemAttribute = StorageItemTypes.File, ItemName = item.DisplayName, ItemDateModifiedReal = DateTimeOffset.Now, LoadUnknownTypeGlyph = true, LoadFolderGlyph = false, LoadFileIcon = false, ItemType = item.DisplayType, FileImage = null, ItemPath = item.Path, FileExtension = item.FileType });
}
}
}
diff --git a/Files/Dialogs/ConsentDialog.xaml b/Files/Dialogs/ConsentDialog.xaml
index 6ccca39eb56c..cfda7a5389f9 100644
--- a/Files/Dialogs/ConsentDialog.xaml
+++ b/Files/Dialogs/ConsentDialog.xaml
@@ -7,9 +7,9 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:Windows10version1903="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 8)"
- CornerRadius="4" Grid.RowSpan="4" DefaultButton="Primary" PrimaryButtonClick="PermissionDialog_PrimaryButtonClick" PrimaryButtonText="Grant Permission" x:Name="PermissionDialog" Title="Welcome to Files">
+ CornerRadius="4" Grid.RowSpan="4" DefaultButton="Primary" PrimaryButtonClick="PermissionDialog_PrimaryButtonClick" PrimaryButtonText="Grant Permission" x:Name="PermissionDialog" Title="Welcome to Files" x:Uid="WelcomeDialog">
-
+
\ No newline at end of file
diff --git a/Files/Dialogs/RenameDialog.xaml b/Files/Dialogs/RenameDialog.xaml
index 553e2938563a..2b3bf298e3f6 100644
--- a/Files/Dialogs/RenameDialog.xaml
+++ b/Files/Dialogs/RenameDialog.xaml
@@ -7,9 +7,9 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:Windows10version1903="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 8)"
- CornerRadius="4" Grid.RowSpan="4" DefaultButton="Primary" Title="Enter an item name" BorderThickness="0" SecondaryButtonClick="NameDialog_SecondaryButtonClick" PrimaryButtonClick="NameDialog_PrimaryButtonClick" x:Name="NameDialog" PrimaryButtonText="Set Name" SecondaryButtonText="Cancel">
+ CornerRadius="4" Grid.RowSpan="4" DefaultButton="Primary" Title="Enter an item name" BorderThickness="0" SecondaryButtonClick="NameDialog_SecondaryButtonClick" PrimaryButtonClick="NameDialog_PrimaryButtonClick" x:Name="NameDialog" PrimaryButtonText="Set Name" SecondaryButtonText="Cancel" x:Uid="RenameDialog">
-
+
diff --git a/Files/Files.csproj b/Files/Files.csproj
index 6c49066bfd18..824a48fd5311 100644
--- a/Files/Files.csproj
+++ b/Files/Files.csproj
@@ -150,6 +150,8 @@
ConfirmDeleteDialog.xaml
+
+
ModernNavigationToolbar.xaml
@@ -268,7 +270,6 @@
PreserveNewest
-
Always
@@ -331,6 +332,8 @@
+
+
@@ -515,6 +518,9 @@
+
+
+
diff --git a/Files/Filesystem/Drives.cs b/Files/Filesystem/Drives.cs
index 0cae41835eeb..40044c8f8f09 100644
--- a/Files/Filesystem/Drives.cs
+++ b/Files/Filesystem/Drives.cs
@@ -14,6 +14,7 @@
using Windows.UI.Core;
using Windows.UI.Xaml;
using NLog;
+using Windows.ApplicationModel.Resources;
namespace Files.Filesystem
{
@@ -58,9 +59,9 @@ private async void DeviceWatcher_EnumerationCompleted(DeviceWatcher sender, obje
{
await CoreApplication.MainView.Dispatcher.RunAsync(CoreDispatcherPriority.Low, () =>
{
- if (App.sideBarItems.FirstOrDefault(x => x is HeaderTextItem && x.Text == "Drives") == null)
+ if (App.sideBarItems.FirstOrDefault(x => x is HeaderTextItem && x.Text == ResourceController.GetTranslation("SidebarDrives")) == null)
{
- App.sideBarItems.Add(new HeaderTextItem() { Text = "Drives" });
+ App.sideBarItems.Add(new HeaderTextItem() { Text = ResourceController.GetTranslation("SidebarDrives") });
}
foreach (DriveItem drive in Drives)
{
diff --git a/Files/Helpers/NaturalStringComparer.cs b/Files/Helpers/NaturalStringComparer.cs
new file mode 100644
index 000000000000..d7d0215a64d5
--- /dev/null
+++ b/Files/Helpers/NaturalStringComparer.cs
@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace Files.Helpers
+{
+ internal static class SafeNativeMethods
+ {
+ public static readonly Int32 NORM_IGNORECASE = 0x00000001;
+ public static readonly Int32 NORM_IGNORENONSPACE = 0x00000002;
+ public static readonly Int32 NORM_IGNORESYMBOLS = 0x00000004;
+ public static readonly Int32 LINGUISTIC_IGNORECASE = 0x00000010;
+ public static readonly Int32 LINGUISTIC_IGNOREDIACRITIC = 0x00000020;
+ public static readonly Int32 NORM_IGNOREKANATYPE = 0x00010000;
+ public static readonly Int32 NORM_IGNOREWIDTH = 0x00020000;
+ public static readonly Int32 NORM_LINGUISTIC_CASING = 0x08000000;
+ public static readonly Int32 SORT_STRINGSORT = 0x00001000;
+ public static readonly Int32 SORT_DIGITSASNUMBERS = 0x00000008;
+
+ public static readonly String LOCALE_NAME_USER_DEFAULT = null;
+ public static readonly String LOCALE_NAME_INVARIANT = String.Empty;
+ public static readonly String LOCALE_NAME_SYSTEM_DEFAULT = "!sys-default-locale";
+
+ [DllImport("api-ms-win-core-string-l1-1-0 .dll", CharSet = CharSet.Unicode)]
+ public static extern Int32 CompareStringEx(
+ String localeName,
+ Int32 flags,
+ String str1,
+ Int32 count1,
+ String str2,
+ Int32 count2,
+ IntPtr versionInformation,
+ IntPtr reserved,
+ Int32 param
+ );
+ }
+
+ public class NaturalStringComparer : IComparer