From 360516970aeab3cfa43f4bf9a1a218bc0110da4e Mon Sep 17 00:00:00 2001 From: Winston de Jong <59544401+winston-de@users.noreply.github.com> Date: Wed, 16 Dec 2020 06:16:30 -0800 Subject: [PATCH 01/27] Fixed an issue where opening the properties window would crash the app (#2612) --- Files/Views/Pages/Properties.xaml | 39 +++++++++++++++------------- Files/Views/Pages/Properties.xaml.cs | 2 +- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/Files/Views/Pages/Properties.xaml b/Files/Views/Pages/Properties.xaml index 3cbe9397c8b9..993d3ceb56b6 100644 --- a/Files/Views/Pages/Properties.xaml +++ b/Files/Views/Pages/Properties.xaml @@ -31,7 +31,7 @@ VerticalAlignment="Center" Text="Properties" /> - + SelectedItem="{x:Bind TabGeneral}"> - - + - + - - - + + - + - - + + - - + - - - - - + + + + + + + diff --git a/Files/Views/Pages/Properties.xaml.cs b/Files/Views/Pages/Properties.xaml.cs index ac0f198bc729..d34d5406b580 100644 --- a/Files/Views/Pages/Properties.xaml.cs +++ b/Files/Views/Pages/Properties.xaml.cs @@ -225,7 +225,7 @@ private async void Page_KeyDown(object sender, KeyRoutedEventArgs e) } } - private void NavigationView_SelectionChanged(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewSelectionChangedEventArgs args) + private void NavigationView_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args) { var navParam = new PropertyNavParam() { From 8dc6c3970790a03c8b6ba01d410f7d7dcac656fd Mon Sep 17 00:00:00 2001 From: Yair Aichenbaum <39923744+yaichenbaum@users.noreply.github.com> Date: Wed, 16 Dec 2020 13:02:23 -0500 Subject: [PATCH 02/27] Fixed a couple of screen reader issues (#2602) --- Files/MultilingualResources/Files.de-DE.xlf | 16 ++++++++++++++++ Files/MultilingualResources/Files.es-ES.xlf | 16 ++++++++++++++++ Files/MultilingualResources/Files.fr-FR.xlf | 16 ++++++++++++++++ Files/MultilingualResources/Files.he-IL.xlf | 16 ++++++++++++++++ Files/MultilingualResources/Files.hi-IN.xlf | 16 ++++++++++++++++ Files/MultilingualResources/Files.hu-HU.xlf | 16 ++++++++++++++++ Files/MultilingualResources/Files.it-IT.xlf | 16 ++++++++++++++++ Files/MultilingualResources/Files.ja-JP.xlf | 16 ++++++++++++++++ Files/MultilingualResources/Files.nl-NL.xlf | 16 ++++++++++++++++ Files/MultilingualResources/Files.or-IN.xlf | 16 ++++++++++++++++ Files/MultilingualResources/Files.pl-PL.xlf | 16 ++++++++++++++++ Files/MultilingualResources/Files.pt-BR.xlf | 16 ++++++++++++++++ Files/MultilingualResources/Files.ru-RU.xlf | 16 ++++++++++++++++ Files/MultilingualResources/Files.ta.xlf | 16 ++++++++++++++++ Files/MultilingualResources/Files.tr-TR.xlf | 16 ++++++++++++++++ Files/MultilingualResources/Files.uk-UA.xlf | 16 ++++++++++++++++ Files/MultilingualResources/Files.zh-Hans.xlf | 16 ++++++++++++++++ Files/MultilingualResources/Files.zh-Hant.xlf | 16 ++++++++++++++++ Files/Strings/en-US/Resources.resw | 12 ++++++++++++ Files/UserControls/Widgets/DrivesWidget.xaml | 5 ++++- Files/Views/SettingsPages/About.xaml | 8 ++++++++ 21 files changed, 312 insertions(+), 1 deletion(-) diff --git a/Files/MultilingualResources/Files.de-DE.xlf b/Files/MultilingualResources/Files.de-DE.xlf index 0b588adf575b..305a97128527 100644 --- a/Files/MultilingualResources/Files.de-DE.xlf +++ b/Files/MultilingualResources/Files.de-DE.xlf @@ -1899,6 +1899,22 @@ 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 diff --git a/Files/MultilingualResources/Files.es-ES.xlf b/Files/MultilingualResources/Files.es-ES.xlf index 1fa32f400501..9faf284dcf36 100644 --- a/Files/MultilingualResources/Files.es-ES.xlf +++ b/Files/MultilingualResources/Files.es-ES.xlf @@ -1898,6 +1898,22 @@ 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 diff --git a/Files/MultilingualResources/Files.fr-FR.xlf b/Files/MultilingualResources/Files.fr-FR.xlf index 5b760d58bc34..4412fe8a1023 100644 --- a/Files/MultilingualResources/Files.fr-FR.xlf +++ b/Files/MultilingualResources/Files.fr-FR.xlf @@ -1898,6 +1898,22 @@ 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 diff --git a/Files/MultilingualResources/Files.he-IL.xlf b/Files/MultilingualResources/Files.he-IL.xlf index ac2ba64e4b4d..7ffeadf7fbcc 100644 --- a/Files/MultilingualResources/Files.he-IL.xlf +++ b/Files/MultilingualResources/Files.he-IL.xlf @@ -1898,6 +1898,22 @@ 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 diff --git a/Files/MultilingualResources/Files.hi-IN.xlf b/Files/MultilingualResources/Files.hi-IN.xlf index 8d51764e6d64..5e45a8a7401a 100644 --- a/Files/MultilingualResources/Files.hi-IN.xlf +++ b/Files/MultilingualResources/Files.hi-IN.xlf @@ -1908,6 +1908,22 @@ 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 diff --git a/Files/MultilingualResources/Files.hu-HU.xlf b/Files/MultilingualResources/Files.hu-HU.xlf index 2ccbf45f018e..7cd1f67517a4 100644 --- a/Files/MultilingualResources/Files.hu-HU.xlf +++ b/Files/MultilingualResources/Files.hu-HU.xlf @@ -1898,6 +1898,22 @@ 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 diff --git a/Files/MultilingualResources/Files.it-IT.xlf b/Files/MultilingualResources/Files.it-IT.xlf index e325772186df..01df2c8f739f 100644 --- a/Files/MultilingualResources/Files.it-IT.xlf +++ b/Files/MultilingualResources/Files.it-IT.xlf @@ -1899,6 +1899,22 @@ 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 diff --git a/Files/MultilingualResources/Files.ja-JP.xlf b/Files/MultilingualResources/Files.ja-JP.xlf index b77af7e79807..1acebeb8ce6a 100644 --- a/Files/MultilingualResources/Files.ja-JP.xlf +++ b/Files/MultilingualResources/Files.ja-JP.xlf @@ -1898,6 +1898,22 @@ 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 diff --git a/Files/MultilingualResources/Files.nl-NL.xlf b/Files/MultilingualResources/Files.nl-NL.xlf index ccbef3a7f5bb..9f201d9b62a1 100644 --- a/Files/MultilingualResources/Files.nl-NL.xlf +++ b/Files/MultilingualResources/Files.nl-NL.xlf @@ -1910,6 +1910,22 @@ 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 diff --git a/Files/MultilingualResources/Files.or-IN.xlf b/Files/MultilingualResources/Files.or-IN.xlf index c6971bb65147..4a3f64d0ed04 100644 --- a/Files/MultilingualResources/Files.or-IN.xlf +++ b/Files/MultilingualResources/Files.or-IN.xlf @@ -1908,6 +1908,22 @@ 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 diff --git a/Files/MultilingualResources/Files.pl-PL.xlf b/Files/MultilingualResources/Files.pl-PL.xlf index df2918dd313f..8880333d1927 100644 --- a/Files/MultilingualResources/Files.pl-PL.xlf +++ b/Files/MultilingualResources/Files.pl-PL.xlf @@ -1907,6 +1907,22 @@ 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 diff --git a/Files/MultilingualResources/Files.pt-BR.xlf b/Files/MultilingualResources/Files.pt-BR.xlf index 7dea4b537b68..7257d27a5d53 100644 --- a/Files/MultilingualResources/Files.pt-BR.xlf +++ b/Files/MultilingualResources/Files.pt-BR.xlf @@ -1898,6 +1898,22 @@ 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 diff --git a/Files/MultilingualResources/Files.ru-RU.xlf b/Files/MultilingualResources/Files.ru-RU.xlf index ac1143953833..d12b16b1d32a 100644 --- a/Files/MultilingualResources/Files.ru-RU.xlf +++ b/Files/MultilingualResources/Files.ru-RU.xlf @@ -1898,6 +1898,22 @@ 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 diff --git a/Files/MultilingualResources/Files.ta.xlf b/Files/MultilingualResources/Files.ta.xlf index ec4bf1aafd6d..aa18a6e1ebb6 100644 --- a/Files/MultilingualResources/Files.ta.xlf +++ b/Files/MultilingualResources/Files.ta.xlf @@ -1903,6 +1903,22 @@ 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 diff --git a/Files/MultilingualResources/Files.tr-TR.xlf b/Files/MultilingualResources/Files.tr-TR.xlf index 3ff93b0e2340..35e27d1afe54 100644 --- a/Files/MultilingualResources/Files.tr-TR.xlf +++ b/Files/MultilingualResources/Files.tr-TR.xlf @@ -1905,6 +1905,22 @@ 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 diff --git a/Files/MultilingualResources/Files.uk-UA.xlf b/Files/MultilingualResources/Files.uk-UA.xlf index 6175c615c1b6..476945779c4a 100644 --- a/Files/MultilingualResources/Files.uk-UA.xlf +++ b/Files/MultilingualResources/Files.uk-UA.xlf @@ -1898,6 +1898,22 @@ 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 diff --git a/Files/MultilingualResources/Files.zh-Hans.xlf b/Files/MultilingualResources/Files.zh-Hans.xlf index 1b8340110c6d..3dd62051b07a 100644 --- a/Files/MultilingualResources/Files.zh-Hans.xlf +++ b/Files/MultilingualResources/Files.zh-Hans.xlf @@ -1903,6 +1903,22 @@ 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 diff --git a/Files/MultilingualResources/Files.zh-Hant.xlf b/Files/MultilingualResources/Files.zh-Hant.xlf index 04938254ca8f..db0de9c41222 100644 --- a/Files/MultilingualResources/Files.zh-Hant.xlf +++ b/Files/MultilingualResources/Files.zh-Hant.xlf @@ -1907,6 +1907,22 @@ 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 diff --git a/Files/Strings/en-US/Resources.resw b/Files/Strings/en-US/Resources.resw index befa893bc1d6..4d03ca12668d 100644 --- a/Files/Strings/en-US/Resources.resw +++ b/Files/Strings/en-US/Resources.resw @@ -1536,6 +1536,18 @@ 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 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" /> - + Date: Wed, 16 Dec 2020 19:17:07 +0100 Subject: [PATCH 03/27] =?UTF-8?q?=F0=9F=93=93=20Updated=20HUN=20(#2613)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Files/MultilingualResources/Files.hu-HU.xlf | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Files/MultilingualResources/Files.hu-HU.xlf b/Files/MultilingualResources/Files.hu-HU.xlf index 7cd1f67517a4..34ba95dd4184 100644 --- a/Files/MultilingualResources/Files.hu-HU.xlf +++ b/Files/MultilingualResources/Files.hu-HU.xlf @@ -1432,7 +1432,7 @@ Search - Search + Keresés Read-only @@ -1884,19 +1884,19 @@ 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 @@ -1916,9 +1916,9 @@ List and sort directories alongside files - List and sort directories alongside files + Mappák rendszerezése a fájlokkal - \ No newline at end of file + From 77de7764b4bd1852192bfd98fc51f3352e804cb5 Mon Sep 17 00:00:00 2001 From: Yair Aichenbaum <39923744+yaichenbaum@users.noreply.github.com> Date: Wed, 16 Dec 2020 14:20:14 -0500 Subject: [PATCH 04/27] Renamed list view to details view (#2617) --- Files/MultilingualResources/Files.de-DE.xlf | 4 ++-- Files/MultilingualResources/Files.es-ES.xlf | 4 ++-- Files/MultilingualResources/Files.fr-FR.xlf | 4 ++-- Files/MultilingualResources/Files.he-IL.xlf | 4 ++-- Files/MultilingualResources/Files.hi-IN.xlf | 4 ++-- Files/MultilingualResources/Files.hu-HU.xlf | 4 ++-- Files/MultilingualResources/Files.it-IT.xlf | 4 ++-- Files/MultilingualResources/Files.ja-JP.xlf | 4 ++-- Files/MultilingualResources/Files.nl-NL.xlf | 4 ++-- Files/MultilingualResources/Files.or-IN.xlf | 4 ++-- Files/MultilingualResources/Files.pl-PL.xlf | 4 ++-- Files/MultilingualResources/Files.pt-BR.xlf | 4 ++-- Files/MultilingualResources/Files.ru-RU.xlf | 4 ++-- Files/MultilingualResources/Files.ta.xlf | 4 ++-- Files/MultilingualResources/Files.tr-TR.xlf | 4 ++-- Files/MultilingualResources/Files.uk-UA.xlf | 4 ++-- Files/MultilingualResources/Files.zh-Hans.xlf | 4 ++-- Files/MultilingualResources/Files.zh-Hant.xlf | 4 ++-- Files/Strings/de-DE/Resources.resw | 2 +- Files/Strings/en-US/Resources.resw | 4 ++-- Files/Strings/es-ES/Resources.resw | 2 +- Files/Strings/fr-FR/Resources.resw | 2 +- Files/Strings/he-IL/Resources.resw | 2 +- Files/Strings/hi-IN/Resources.resw | 2 +- Files/Strings/hu-HU/Resources.resw | 2 +- Files/Strings/it-IT/Resources.resw | 2 +- Files/Strings/ja-JP/Resources.resw | 2 +- Files/Strings/nl-NL/Resources.resw | 2 +- Files/Strings/or-IN/Resources.resw | 2 +- Files/Strings/pl-PL/Resources.resw | 2 +- Files/Strings/pt-BR/Resources.resw | 2 +- Files/Strings/ru-RU/Resources.resw | 2 +- Files/Strings/ta/Resources.resw | 2 +- Files/Strings/tr-TR/Resources.resw | 2 +- Files/Strings/uk-UA/Resources.resw | 2 +- Files/Strings/zh-Hans/Resources.resw | 2 +- Files/Strings/zh-Hant/Resources.resw | 2 +- Files/UserControls/StatusBarControl.xaml | 6 +++--- Files/View Models/SettingsViewModel.cs | 6 +++--- Files/Views/LayoutModes/GenericFileBrowser.xaml | 6 +++--- Files/Views/LayoutModes/GridViewBrowser.xaml | 6 +++--- 41 files changed, 68 insertions(+), 68 deletions(-) diff --git a/Files/MultilingualResources/Files.de-DE.xlf b/Files/MultilingualResources/Files.de-DE.xlf index 305a97128527..688be4b86fa6 100644 --- a/Files/MultilingualResources/Files.de-DE.xlf +++ b/Files/MultilingualResources/Files.de-DE.xlf @@ -330,8 +330,8 @@ Text Document Textdokument - - List View + + Details View Details diff --git a/Files/MultilingualResources/Files.es-ES.xlf b/Files/MultilingualResources/Files.es-ES.xlf index 9faf284dcf36..7ba5deb6f500 100644 --- a/Files/MultilingualResources/Files.es-ES.xlf +++ b/Files/MultilingualResources/Files.es-ES.xlf @@ -330,8 +330,8 @@ Text Document Documento de Texto - - List View + + Details View Detalles diff --git a/Files/MultilingualResources/Files.fr-FR.xlf b/Files/MultilingualResources/Files.fr-FR.xlf index 4412fe8a1023..5afdcb83624b 100644 --- a/Files/MultilingualResources/Files.fr-FR.xlf +++ b/Files/MultilingualResources/Files.fr-FR.xlf @@ -330,8 +330,8 @@ Text Document Document texte - - List View + + Details View Vue liste diff --git a/Files/MultilingualResources/Files.he-IL.xlf b/Files/MultilingualResources/Files.he-IL.xlf index 7ffeadf7fbcc..fa41053d2e57 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 תצוגת רשימה diff --git a/Files/MultilingualResources/Files.hi-IN.xlf b/Files/MultilingualResources/Files.hi-IN.xlf index 5e45a8a7401a..e65fac759274 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 सूची व्यू diff --git a/Files/MultilingualResources/Files.hu-HU.xlf b/Files/MultilingualResources/Files.hu-HU.xlf index 34ba95dd4184..be6e57d85a7f 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 diff --git a/Files/MultilingualResources/Files.it-IT.xlf b/Files/MultilingualResources/Files.it-IT.xlf index 01df2c8f739f..f4af6f2bb39d 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 diff --git a/Files/MultilingualResources/Files.ja-JP.xlf b/Files/MultilingualResources/Files.ja-JP.xlf index 1acebeb8ce6a..d1cbd51c1239 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 詳細 diff --git a/Files/MultilingualResources/Files.nl-NL.xlf b/Files/MultilingualResources/Files.nl-NL.xlf index 9f201d9b62a1..fd7bd91128e8 100644 --- a/Files/MultilingualResources/Files.nl-NL.xlf +++ b/Files/MultilingualResources/Files.nl-NL.xlf @@ -335,8 +335,8 @@ Text Document Tekstdocument - - List View + + Details View Lijstweergave diff --git a/Files/MultilingualResources/Files.or-IN.xlf b/Files/MultilingualResources/Files.or-IN.xlf index 4a3f64d0ed04..296401b19803 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 ତାଲିକା ଭ୍ୟୁ diff --git a/Files/MultilingualResources/Files.pl-PL.xlf b/Files/MultilingualResources/Files.pl-PL.xlf index 8880333d1927..05e52c030364 100644 --- a/Files/MultilingualResources/Files.pl-PL.xlf +++ b/Files/MultilingualResources/Files.pl-PL.xlf @@ -335,8 +335,8 @@ Text Document Dokument tekstowy - - List View + + Details View Widok listy diff --git a/Files/MultilingualResources/Files.pt-BR.xlf b/Files/MultilingualResources/Files.pt-BR.xlf index 7257d27a5d53..d858c9002b10 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 diff --git a/Files/MultilingualResources/Files.ru-RU.xlf b/Files/MultilingualResources/Files.ru-RU.xlf index d12b16b1d32a..03a3aa70693f 100644 --- a/Files/MultilingualResources/Files.ru-RU.xlf +++ b/Files/MultilingualResources/Files.ru-RU.xlf @@ -346,8 +346,8 @@ Clear Selection Очистить выделение - - List View + + Details View Таблица diff --git a/Files/MultilingualResources/Files.ta.xlf b/Files/MultilingualResources/Files.ta.xlf index aa18a6e1ebb6..4e674fc44b7e 100644 --- a/Files/MultilingualResources/Files.ta.xlf +++ b/Files/MultilingualResources/Files.ta.xlf @@ -134,8 +134,8 @@ Clear Selection தேர்வை அழி - - List View + + Details View பட்டியல் காட்சி diff --git a/Files/MultilingualResources/Files.tr-TR.xlf b/Files/MultilingualResources/Files.tr-TR.xlf index 35e27d1afe54..a22c3c986dd4 100644 --- a/Files/MultilingualResources/Files.tr-TR.xlf +++ b/Files/MultilingualResources/Files.tr-TR.xlf @@ -337,8 +337,8 @@ Text Document Metin Belgesi - - List View + + Details View Liste Görünümü diff --git a/Files/MultilingualResources/Files.uk-UA.xlf b/Files/MultilingualResources/Files.uk-UA.xlf index 476945779c4a..d1c0e7bf38ea 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 Список diff --git a/Files/MultilingualResources/Files.zh-Hans.xlf b/Files/MultilingualResources/Files.zh-Hans.xlf index 3dd62051b07a..1aa5b6eb95d3 100644 --- a/Files/MultilingualResources/Files.zh-Hans.xlf +++ b/Files/MultilingualResources/Files.zh-Hans.xlf @@ -332,8 +332,8 @@ Text Document 文本文档 - - List View + + Details View 列表 diff --git a/Files/MultilingualResources/Files.zh-Hant.xlf b/Files/MultilingualResources/Files.zh-Hant.xlf index db0de9c41222..bdfd2278ccbb 100644 --- a/Files/MultilingualResources/Files.zh-Hant.xlf +++ b/Files/MultilingualResources/Files.zh-Hant.xlf @@ -335,8 +335,8 @@ Text Document 文字文件 - - List View + + Details View 列表 diff --git a/Files/Strings/de-DE/Resources.resw b/Files/Strings/de-DE/Resources.resw index 328d0c19891d..b57495f1badc 100644 --- a/Files/Strings/de-DE/Resources.resw +++ b/Files/Strings/de-DE/Resources.resw @@ -255,7 +255,7 @@ Textdokument - + Details diff --git a/Files/Strings/en-US/Resources.resw b/Files/Strings/en-US/Resources.resw index 4d03ca12668d..9505a6d7d424 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: diff --git a/Files/Strings/es-ES/Resources.resw b/Files/Strings/es-ES/Resources.resw index 41cb77008301..b6365513a8ef 100644 --- a/Files/Strings/es-ES/Resources.resw +++ b/Files/Strings/es-ES/Resources.resw @@ -255,7 +255,7 @@ Documento de Texto - + Detalles diff --git a/Files/Strings/fr-FR/Resources.resw b/Files/Strings/fr-FR/Resources.resw index ad1abd445201..23b63db5ba8d 100644 --- a/Files/Strings/fr-FR/Resources.resw +++ b/Files/Strings/fr-FR/Resources.resw @@ -255,7 +255,7 @@ Document texte - + Vue liste diff --git a/Files/Strings/he-IL/Resources.resw b/Files/Strings/he-IL/Resources.resw index 395da6f88199..9b308b7b4fbd 100644 --- a/Files/Strings/he-IL/Resources.resw +++ b/Files/Strings/he-IL/Resources.resw @@ -102,7 +102,7 @@ נקה בחירה - + תצוגת רשימה diff --git a/Files/Strings/hi-IN/Resources.resw b/Files/Strings/hi-IN/Resources.resw index e36f3ed1c553..7cd438ba5488 100644 --- a/Files/Strings/hi-IN/Resources.resw +++ b/Files/Strings/hi-IN/Resources.resw @@ -108,7 +108,7 @@ चयन खाली करें - + सूची व्यू diff --git a/Files/Strings/hu-HU/Resources.resw b/Files/Strings/hu-HU/Resources.resw index add7f628e63d..9f0e978103f8 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 diff --git a/Files/Strings/it-IT/Resources.resw b/Files/Strings/it-IT/Resources.resw index 92457f579524..54f3a9eb90da 100644 --- a/Files/Strings/it-IT/Resources.resw +++ b/Files/Strings/it-IT/Resources.resw @@ -102,7 +102,7 @@ Deseleziona tutto - + Dettagli diff --git a/Files/Strings/ja-JP/Resources.resw b/Files/Strings/ja-JP/Resources.resw index 9da59e3089ba..417be2ecf3d1 100644 --- a/Files/Strings/ja-JP/Resources.resw +++ b/Files/Strings/ja-JP/Resources.resw @@ -108,7 +108,7 @@ 選択をクリア - + 詳細 diff --git a/Files/Strings/nl-NL/Resources.resw b/Files/Strings/nl-NL/Resources.resw index 6f4bd185f3b4..f932b4bac2e8 100644 --- a/Files/Strings/nl-NL/Resources.resw +++ b/Files/Strings/nl-NL/Resources.resw @@ -255,7 +255,7 @@ Tekstdocument - + Lijstweergave diff --git a/Files/Strings/or-IN/Resources.resw b/Files/Strings/or-IN/Resources.resw index 81d79e79df17..dfce556a093e 100644 --- a/Files/Strings/or-IN/Resources.resw +++ b/Files/Strings/or-IN/Resources.resw @@ -108,7 +108,7 @@ ଚୟନ ସଫା କରନ୍ତୁ - + ତାଲିକା ଭ୍ୟୁ diff --git a/Files/Strings/pl-PL/Resources.resw b/Files/Strings/pl-PL/Resources.resw index 0900a4d3a622..ce4bf014f1a5 100644 --- a/Files/Strings/pl-PL/Resources.resw +++ b/Files/Strings/pl-PL/Resources.resw @@ -255,7 +255,7 @@ Dokument tekstowy - + Widok listy diff --git a/Files/Strings/pt-BR/Resources.resw b/Files/Strings/pt-BR/Resources.resw index e5fc217e9d49..faf5f8fddf83 100644 --- a/Files/Strings/pt-BR/Resources.resw +++ b/Files/Strings/pt-BR/Resources.resw @@ -108,7 +108,7 @@ Limpar Seleção - + Lista diff --git a/Files/Strings/ru-RU/Resources.resw b/Files/Strings/ru-RU/Resources.resw index 06f40a2932d7..8cacabd32b48 100644 --- a/Files/Strings/ru-RU/Resources.resw +++ b/Files/Strings/ru-RU/Resources.resw @@ -264,7 +264,7 @@ Очистить выделение - + Таблица diff --git a/Files/Strings/ta/Resources.resw b/Files/Strings/ta/Resources.resw index 58e544b32795..f90f2b18cfe5 100644 --- a/Files/Strings/ta/Resources.resw +++ b/Files/Strings/ta/Resources.resw @@ -108,7 +108,7 @@ தேர்வை அழி - + பட்டியல் காட்சி diff --git a/Files/Strings/tr-TR/Resources.resw b/Files/Strings/tr-TR/Resources.resw index 65416290db45..8bdee799a900 100644 --- a/Files/Strings/tr-TR/Resources.resw +++ b/Files/Strings/tr-TR/Resources.resw @@ -255,7 +255,7 @@ Metin Belgesi - + Liste Görünümü diff --git a/Files/Strings/uk-UA/Resources.resw b/Files/Strings/uk-UA/Resources.resw index ba3ef4a9bb7f..066d4b79092b 100644 --- a/Files/Strings/uk-UA/Resources.resw +++ b/Files/Strings/uk-UA/Resources.resw @@ -81,7 +81,7 @@ Очистити виділення - + Список diff --git a/Files/Strings/zh-Hans/Resources.resw b/Files/Strings/zh-Hans/Resources.resw index 7e76742e88e2..5f554a8f8734 100644 --- a/Files/Strings/zh-Hans/Resources.resw +++ b/Files/Strings/zh-Hans/Resources.resw @@ -255,7 +255,7 @@ 文本文档 - + 列表 diff --git a/Files/Strings/zh-Hant/Resources.resw b/Files/Strings/zh-Hant/Resources.resw index 0284a702f626..132b14a1cccd 100644 --- a/Files/Strings/zh-Hant/Resources.resw +++ b/Files/Strings/zh-Hant/Resources.resw @@ -255,7 +255,7 @@ 文字文件 - + 列表 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/View Models/SettingsViewModel.cs b/Files/View Models/SettingsViewModel.cs index 09f7f1addaaf..ffd49c94e6a1 100644 --- a/Files/View Models/SettingsViewModel.cs +++ b/Files/View Models/SettingsViewModel.cs @@ -533,7 +533,7 @@ public bool ShowCopyLocationOption public int LayoutMode { - get => Get(0); // List View + get => Get(0); // Details View set => Set(value); } @@ -597,9 +597,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); }); diff --git a/Files/Views/LayoutModes/GenericFileBrowser.xaml b/Files/Views/LayoutModes/GenericFileBrowser.xaml index 307f3d5aed9e..166fc64c3880 100644 --- a/Files/Views/LayoutModes/GenericFileBrowser.xaml +++ b/Files/Views/LayoutModes/GenericFileBrowser.xaml @@ -123,9 +123,9 @@ + x:Uid="StatusBarControlDetailsView" + Command="{x:Bind AppSettings.ToggleLayoutModeDetailsView}" + Text="Details View"> diff --git a/Files/Views/LayoutModes/GridViewBrowser.xaml b/Files/Views/LayoutModes/GridViewBrowser.xaml index f454c1d81bc7..86953b451691 100644 --- a/Files/Views/LayoutModes/GridViewBrowser.xaml +++ b/Files/Views/LayoutModes/GridViewBrowser.xaml @@ -99,9 +99,9 @@ + x:Uid="StatusBarControlDetailsView" + Command="{x:Bind AppSettings.ToggleLayoutModeDetailsView}" + Text="Details View"> From 64cb32409c2a4c0823d0f78a36e7b86644d108e3 Mon Sep 17 00:00:00 2001 From: Luke Blevins Date: Wed, 16 Dec 2020 14:31:40 -0500 Subject: [PATCH 05/27] Increaseed CoreDispatcherPriority of adding drive sidebar items to "Normal" (#2615) --- Files/Filesystem/Drives.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) { From 27a3aecd3877e8fa075d76b8b930e7055df4d0ee Mon Sep 17 00:00:00 2001 From: Marco Gavelli Date: Wed, 16 Dec 2020 21:09:58 +0100 Subject: [PATCH 06/27] Updated it-IT (#2618) --- Files/MultilingualResources/Files.de-DE.xlf | 4 + Files/MultilingualResources/Files.es-ES.xlf | 4 + Files/MultilingualResources/Files.fr-FR.xlf | 4 + Files/MultilingualResources/Files.he-IL.xlf | 4 + Files/MultilingualResources/Files.hi-IN.xlf | 4 + Files/MultilingualResources/Files.hu-HU.xlf | 4 + Files/MultilingualResources/Files.it-IT.xlf | 254 ++++++------ Files/MultilingualResources/Files.ja-JP.xlf | 4 + Files/MultilingualResources/Files.nl-NL.xlf | 4 + Files/MultilingualResources/Files.or-IN.xlf | 4 + Files/MultilingualResources/Files.pl-PL.xlf | 4 + Files/MultilingualResources/Files.pt-BR.xlf | 4 + Files/MultilingualResources/Files.ru-RU.xlf | 4 + Files/MultilingualResources/Files.ta.xlf | 4 + Files/MultilingualResources/Files.tr-TR.xlf | 4 + Files/MultilingualResources/Files.uk-UA.xlf | 4 + Files/MultilingualResources/Files.zh-Hans.xlf | 4 + Files/MultilingualResources/Files.zh-Hant.xlf | 4 + Files/Strings/en-US/Resources.resw | 3 + Files/Strings/it-IT/Resources.resw | 378 ++++++++++++++++++ Files/Views/Pages/Properties.xaml | 2 +- 21 files changed, 579 insertions(+), 126 deletions(-) diff --git a/Files/MultilingualResources/Files.de-DE.xlf b/Files/MultilingualResources/Files.de-DE.xlf index 688be4b86fa6..48dc53d204b1 100644 --- a/Files/MultilingualResources/Files.de-DE.xlf +++ b/Files/MultilingualResources/Files.de-DE.xlf @@ -1919,6 +1919,10 @@ List and sort directories alongside files List and sort directories alongside files + + Details + Details + diff --git a/Files/MultilingualResources/Files.es-ES.xlf b/Files/MultilingualResources/Files.es-ES.xlf index 7ba5deb6f500..b31ea80d4c2d 100644 --- a/Files/MultilingualResources/Files.es-ES.xlf +++ b/Files/MultilingualResources/Files.es-ES.xlf @@ -1918,6 +1918,10 @@ List and sort directories alongside files List and sort directories alongside files + + Details + Details + diff --git a/Files/MultilingualResources/Files.fr-FR.xlf b/Files/MultilingualResources/Files.fr-FR.xlf index 5afdcb83624b..8339759b2a13 100644 --- a/Files/MultilingualResources/Files.fr-FR.xlf +++ b/Files/MultilingualResources/Files.fr-FR.xlf @@ -1918,6 +1918,10 @@ List and sort directories alongside files List and sort directories alongside files + + Details + Details + diff --git a/Files/MultilingualResources/Files.he-IL.xlf b/Files/MultilingualResources/Files.he-IL.xlf index fa41053d2e57..e7a9ae8d8b96 100644 --- a/Files/MultilingualResources/Files.he-IL.xlf +++ b/Files/MultilingualResources/Files.he-IL.xlf @@ -1918,6 +1918,10 @@ List and sort directories alongside files List and sort directories alongside files + + Details + Details + diff --git a/Files/MultilingualResources/Files.hi-IN.xlf b/Files/MultilingualResources/Files.hi-IN.xlf index e65fac759274..0c5d4bd9fa87 100644 --- a/Files/MultilingualResources/Files.hi-IN.xlf +++ b/Files/MultilingualResources/Files.hi-IN.xlf @@ -1928,6 +1928,10 @@ List and sort directories alongside files List and sort directories alongside files + + Details + Details + diff --git a/Files/MultilingualResources/Files.hu-HU.xlf b/Files/MultilingualResources/Files.hu-HU.xlf index be6e57d85a7f..c03e0a712c9a 100644 --- a/Files/MultilingualResources/Files.hu-HU.xlf +++ b/Files/MultilingualResources/Files.hu-HU.xlf @@ -1918,6 +1918,10 @@ List and sort directories alongside files Mappák rendszerezése a fájlokkal + + Details + Details + diff --git a/Files/MultilingualResources/Files.it-IT.xlf b/Files/MultilingualResources/Files.it-IT.xlf index f4af6f2bb39d..f3e1b2c32b4f 100644 --- a/Files/MultilingualResources/Files.it-IT.xlf +++ b/Files/MultilingualResources/Files.it-IT.xlf @@ -1325,7 +1325,7 @@ Status center - Status center + Stato delle operazioni Open items with a single click @@ -1421,471 +1421,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,31 +1893,35 @@ Search results in - Search results in + Cerca risultati in Search results - Search results + Risultati ricerca See who contributed to Files - See who contributed to Files + Vedi chi ha contribuito a Files Find out what's new in Files - Find out what's new in Files + Scopri le novità in Files Send the developers an issue report with more information - Send the developers an issue report with more information + Invia agli sviluppatori un rapporto sul problema Support us on PayPal - 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 diff --git a/Files/MultilingualResources/Files.ja-JP.xlf b/Files/MultilingualResources/Files.ja-JP.xlf index d1cbd51c1239..7b251a6949b6 100644 --- a/Files/MultilingualResources/Files.ja-JP.xlf +++ b/Files/MultilingualResources/Files.ja-JP.xlf @@ -1918,6 +1918,10 @@ List and sort directories alongside files List and sort directories alongside files + + Details + Details + diff --git a/Files/MultilingualResources/Files.nl-NL.xlf b/Files/MultilingualResources/Files.nl-NL.xlf index fd7bd91128e8..d86d45228a16 100644 --- a/Files/MultilingualResources/Files.nl-NL.xlf +++ b/Files/MultilingualResources/Files.nl-NL.xlf @@ -1930,6 +1930,10 @@ List and sort directories alongside files List and sort directories alongside files + + Details + Details + diff --git a/Files/MultilingualResources/Files.or-IN.xlf b/Files/MultilingualResources/Files.or-IN.xlf index 296401b19803..c5f99650863d 100644 --- a/Files/MultilingualResources/Files.or-IN.xlf +++ b/Files/MultilingualResources/Files.or-IN.xlf @@ -1928,6 +1928,10 @@ List and sort directories alongside files List and sort directories alongside files + + Details + Details + diff --git a/Files/MultilingualResources/Files.pl-PL.xlf b/Files/MultilingualResources/Files.pl-PL.xlf index 05e52c030364..2cb7f714e99c 100644 --- a/Files/MultilingualResources/Files.pl-PL.xlf +++ b/Files/MultilingualResources/Files.pl-PL.xlf @@ -1927,6 +1927,10 @@ List and sort directories alongside files List and sort directories alongside files + + Details + Details + diff --git a/Files/MultilingualResources/Files.pt-BR.xlf b/Files/MultilingualResources/Files.pt-BR.xlf index d858c9002b10..3856dd35f862 100644 --- a/Files/MultilingualResources/Files.pt-BR.xlf +++ b/Files/MultilingualResources/Files.pt-BR.xlf @@ -1918,6 +1918,10 @@ List and sort directories alongside files List and sort directories alongside files + + Details + Details + diff --git a/Files/MultilingualResources/Files.ru-RU.xlf b/Files/MultilingualResources/Files.ru-RU.xlf index 03a3aa70693f..e6fb26791382 100644 --- a/Files/MultilingualResources/Files.ru-RU.xlf +++ b/Files/MultilingualResources/Files.ru-RU.xlf @@ -1918,6 +1918,10 @@ List and sort directories alongside files List and sort directories alongside files + + Details + Details + diff --git a/Files/MultilingualResources/Files.ta.xlf b/Files/MultilingualResources/Files.ta.xlf index 4e674fc44b7e..253b9f66d790 100644 --- a/Files/MultilingualResources/Files.ta.xlf +++ b/Files/MultilingualResources/Files.ta.xlf @@ -1923,6 +1923,10 @@ List and sort directories alongside files List and sort directories alongside files + + Details + Details + diff --git a/Files/MultilingualResources/Files.tr-TR.xlf b/Files/MultilingualResources/Files.tr-TR.xlf index a22c3c986dd4..5ed79daf889a 100644 --- a/Files/MultilingualResources/Files.tr-TR.xlf +++ b/Files/MultilingualResources/Files.tr-TR.xlf @@ -1925,6 +1925,10 @@ List and sort directories alongside files List and sort directories alongside files + + Details + Details + diff --git a/Files/MultilingualResources/Files.uk-UA.xlf b/Files/MultilingualResources/Files.uk-UA.xlf index d1c0e7bf38ea..e9df0a59e968 100644 --- a/Files/MultilingualResources/Files.uk-UA.xlf +++ b/Files/MultilingualResources/Files.uk-UA.xlf @@ -1918,6 +1918,10 @@ List and sort directories alongside files List and sort directories alongside files + + Details + Details + diff --git a/Files/MultilingualResources/Files.zh-Hans.xlf b/Files/MultilingualResources/Files.zh-Hans.xlf index 1aa5b6eb95d3..24f02e3c78b8 100644 --- a/Files/MultilingualResources/Files.zh-Hans.xlf +++ b/Files/MultilingualResources/Files.zh-Hans.xlf @@ -1923,6 +1923,10 @@ List and sort directories alongside files List and sort directories alongside files + + Details + Details + diff --git a/Files/MultilingualResources/Files.zh-Hant.xlf b/Files/MultilingualResources/Files.zh-Hant.xlf index bdfd2278ccbb..c7d6d42d0d81 100644 --- a/Files/MultilingualResources/Files.zh-Hant.xlf +++ b/Files/MultilingualResources/Files.zh-Hant.xlf @@ -1927,6 +1927,10 @@ List and sort directories alongside files List and sort directories alongside files + + Details + Details + diff --git a/Files/Strings/en-US/Resources.resw b/Files/Strings/en-US/Resources.resw index 9505a6d7d424..3ca24be1a5ae 100644 --- a/Files/Strings/en-US/Resources.resw +++ b/Files/Strings/en-US/Resources.resw @@ -1551,4 +1551,7 @@ List and sort directories alongside files + + Details + \ No newline at end of file diff --git a/Files/Strings/it-IT/Resources.resw b/Files/Strings/it-IT/Resources.resw index 54f3a9eb90da..9f5934cd883c 100644 --- a/Files/Strings/it-IT/Resources.resw +++ b/Files/Strings/it-IT/Resources.resw @@ -999,6 +999,9 @@ Opzioni selezione + + Stato delle operazioni + Apri elementi con un solo click @@ -1068,7 +1071,382 @@ 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 newline at end of file diff --git a/Files/Views/Pages/Properties.xaml b/Files/Views/Pages/Properties.xaml index 993d3ceb56b6..bfff3085bc7d 100644 --- a/Files/Views/Pages/Properties.xaml +++ b/Files/Views/Pages/Properties.xaml @@ -68,7 +68,7 @@ From 94ca1d7e7b68e6ff35b9d2e8e60ee479d95b8f2e Mon Sep 17 00:00:00 2001 From: d2dyno1 <53011783+d2dyno1@users.noreply.github.com> Date: Wed, 16 Dec 2020 21:40:13 +0100 Subject: [PATCH 07/27] A small fix for very annoying Exception (#2619) --- Files/Filesystem/DriveItem.cs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) 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); From e6dd11fa76c75cefcfabd5daee6d7ddeadfea931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camille=20Olli=C3=A9?= Date: Wed, 16 Dec 2020 22:39:14 +0100 Subject: [PATCH 08/27] Updated fr-FR (#2579) --- Files/MultilingualResources/Files.fr-FR.xlf | 26 ++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Files/MultilingualResources/Files.fr-FR.xlf b/Files/MultilingualResources/Files.fr-FR.xlf index 8339759b2a13..e7a885b48fef 100644 --- a/Files/MultilingualResources/Files.fr-FR.xlf +++ b/Files/MultilingualResources/Files.fr-FR.xlf @@ -1,4 +1,4 @@ - +
@@ -1528,7 +1528,7 @@ Altitude - Altitude + Altitude Camera Manufacturer @@ -1568,7 +1568,7 @@ Format - Format + Format Sample Rate @@ -1616,7 +1616,7 @@ Duration - Duration + Durée Frame Count @@ -1652,7 +1652,7 @@ Producer - Producer + Producteur Promotion Url @@ -1748,7 +1748,7 @@ Version - Version + Version Video @@ -1836,7 +1836,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 +1864,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 @@ -1925,4 +1925,4 @@ - \ No newline at end of file + From 08d2295daf46327d3cd051967f3ebdaaebaf45d8 Mon Sep 17 00:00:00 2001 From: Richard Date: Wed, 16 Dec 2020 18:39:27 -0300 Subject: [PATCH 09/27] Translation update [es-ES] (#2620) --- Files/MultilingualResources/Files.es-ES.xlf | 40 +++++++------- Files/MultilingualResources/Files.hu-HU.xlf | 2 +- Files/Strings/es-ES/Resources.resw | 59 ++++++++++++++++++++- Files/Strings/hu-HU/Resources.resw | 17 +++++- 4 files changed, 95 insertions(+), 23 deletions(-) diff --git a/Files/MultilingualResources/Files.es-ES.xlf b/Files/MultilingualResources/Files.es-ES.xlf index b31ea80d4c2d..b51c55f3eeb0 100644 --- a/Files/MultilingualResources/Files.es-ES.xlf +++ b/Files/MultilingualResources/Files.es-ES.xlf @@ -1336,7 +1336,7 @@ Drives - Dispositivos y Unidades + Dispositivos y unidades Show library cards on the home page @@ -1432,7 +1432,7 @@ Search - Search + Búsqueda Read-only @@ -1852,75 +1852,75 @@ 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 - See who contributed to Files + Ver quiénes contribuyen a Files Find out what's new in Files - Find out what's new in Files + Ver las novedades de esta versión Send the developers an issue report with more information - 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 - 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 - Details + Detalles diff --git a/Files/MultilingualResources/Files.hu-HU.xlf b/Files/MultilingualResources/Files.hu-HU.xlf index c03e0a712c9a..c54e74b1ea2d 100644 --- a/Files/MultilingualResources/Files.hu-HU.xlf +++ b/Files/MultilingualResources/Files.hu-HU.xlf @@ -1925,4 +1925,4 @@ - + \ No newline at end of file diff --git a/Files/Strings/es-ES/Resources.resw b/Files/Strings/es-ES/Resources.resw index b6365513a8ef..e6a506eaa232 100644 --- a/Files/Strings/es-ES/Resources.resw +++ b/Files/Strings/es-ES/Resources.resw @@ -988,7 +988,7 @@ Mover aquí - Dispositivos y Unidades + Dispositivos y unidades Mostrar bibliotecas en la página de inicio @@ -1059,6 +1059,9 @@ Nueva pestaña + + Búsqueda + Solo lectura @@ -1359,4 +1362,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/hu-HU/Resources.resw b/Files/Strings/hu-HU/Resources.resw index 9f0e978103f8..f629e2b1e04e 100644 --- a/Files/Strings/hu-HU/Resources.resw +++ b/Files/Strings/hu-HU/Resources.resw @@ -1080,6 +1080,9 @@ Új lap + + Keresés + Csak olvasható @@ -1351,6 +1354,18 @@ 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 + + + Mappák rendszerezése a fájlokkal \ No newline at end of file From 916a853a99322090ef276baabbf5875f2ee5fcf0 Mon Sep 17 00:00:00 2001 From: Vladyslav Tsvietkov Date: Thu, 17 Dec 2020 02:37:01 +0200 Subject: [PATCH 10/27] Cleanup: Moved duplicated code to the BaseLayout (#2621) --- Files/BaseLayout.cs | 117 +++++++++++++----- .../LayoutModes/GenericFileBrowser.xaml.cs | 102 +++++---------- .../Views/LayoutModes/GridViewBrowser.xaml.cs | 91 +++----------- 3 files changed, 131 insertions(+), 179 deletions(-) diff --git a/Files/BaseLayout.cs b/Files/BaseLayout.cs index fba410d6d789..ca23b7ef8d91 100644 --- a/Files/BaseLayout.cs +++ b/Files/BaseLayout.cs @@ -9,9 +9,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; @@ -153,7 +153,15 @@ public BaseLayout() 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 +169,29 @@ public BaseLayout() public abstract void ScrollIntoView(ListedItem item); - public abstract int GetSelectedIndex(); + protected abstract void AddSelectedItem(ListedItem item); - public abstract void SetSelectedItemOnUi(ListedItem selectedItem); + protected abstract IEnumerable GetAllItems(); - public abstract void SetSelectedItemsOnUi(List selectedItems); + public virtual void SetSelectedItemOnUi(ListedItem selectedItem) + { + ClearSelection(); + AddSelectedItem(selectedItem); + } + + 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 +200,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 +244,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; + } - public abstract void SetItemOpacity(ListedItem item); + foreach (ListedItem listedItem in items) + { + if (listedItem.IsHiddenItem) + { + listedItem.Opacity = 0.4; + } + else + { + listedItem.Opacity = 1; + } + } + } + + public virtual void SetItemOpacity(ListedItem item) + { + item.Opacity = 0.4; + } protected abstract ListedItem GetItemFromElement(object element); @@ -314,10 +361,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; } } @@ -485,7 +539,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 +551,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 +609,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/Views/LayoutModes/GenericFileBrowser.xaml.cs b/Files/Views/LayoutModes/GenericFileBrowser.xaml.cs index 5fcccb261a97..8ca7752f8eda 100644 --- a/Files/Views/LayoutModes/GenericFileBrowser.xaml.cs +++ b/Files/Views/LayoutModes/GenericFileBrowser.xaml.cs @@ -28,14 +28,15 @@ namespace Files public sealed partial class GenericFileBrowser : BaseLayout { private string oldItemName; - private DataGridColumn _sortedColumn; - private static readonly MethodInfo SelectAllMethod = typeof(DataGrid).GetMethod("SelectAll", BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Instance); + private DataGridColumn sortedColumn; + private static readonly MethodInfo SelectAllMethod = typeof(DataGrid) + .GetMethod("SelectAll", BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Instance); public DataGridColumn SortedColumn { get { - return _sortedColumn; + return sortedColumn; } set { @@ -60,25 +61,26 @@ public DataGridColumn SortedColumn AppSettings.DirectorySortOption = SortOption.Name; } - if (value != _sortedColumn) + if (value != sortedColumn) { // Remove arrow on previous sorted column - if (_sortedColumn != null) + if (sortedColumn != null) { - _sortedColumn.SortDirection = null; + sortedColumn.SortDirection = null; } } value.SortDirection = AppSettings.DirectorySortDirection == SortDirection.Ascending ? DataGridSortDirection.Ascending : DataGridSortDirection.Descending; - _sortedColumn = value; + sortedColumn = value; } } public GenericFileBrowser() { InitializeComponent(); - base.BaseLayoutContextFlyout = this.BaseLayoutContextFlyout; - base.BaseLayoutItemContextFlyout = this.BaseLayoutItemContextFlyout; - this.tapDebounceTimer = new DispatcherTimer(); + base.BaseLayoutContextFlyout = BaseLayoutContextFlyout; + base.BaseLayoutItemContextFlyout = BaseLayoutItemContextFlyout; + + tapDebounceTimer = new DispatcherTimer(); switch (AppSettings.DirectorySortOption) { case SortOption.Name: @@ -134,27 +136,14 @@ private void AppSettings_ThemeModeChanged(object sender, EventArgs e) RequestedTheme = ThemeHelper.RootTheme; } - public override void SetSelectedItemOnUi(ListedItem item) + protected override void AddSelectedItem(ListedItem item) { - ClearSelection(); AllView.SelectedItems.Add(item); } - public override void SetSelectedItemsOnUi(List selectedItems) + protected override IEnumerable GetAllItems() { - ClearSelection(); - foreach (ListedItem selectedItem in selectedItems) - { - AllView.SelectedItems.Add(selectedItem); - } - } - - public override void AddSelectedItemsOnUi(List selectedItems) - { - foreach (ListedItem selectedItem in selectedItems) - { - AllView.SelectedItems.Add(selectedItem); - } + return AllView.ItemsSource; } public override void SelectAllItems() @@ -162,14 +151,6 @@ public override void SelectAllItems() SelectAllMethod.Invoke(AllView, null); } - public override void InvertSelection() - { - List allItems = ParentShellPageInstance.FilesystemViewModel.FilesAndFolders.ToList(); - List newSelectedItems = allItems.Except(SelectedItems).ToList(); - - SetSelectedItemsOnUi(newSelectedItems); - } - public override void ClearSelection() { AllView.SelectedItems.Clear(); @@ -180,7 +161,7 @@ public override void SetDragModeForItems() if (IsItemSelected && !InstanceViewModel.IsPageTypeSearchResults) { var rows = new List(); - Interacts.Interaction.FindChildren(rows, AllView); + Interaction.FindChildren(rows, AllView); foreach (DataGridRow row in rows) { row.CanDrag = SelectedItems.Contains(row.DataContext); @@ -193,11 +174,6 @@ public override void ScrollIntoView(ListedItem item) AllView.ScrollIntoView(item, null); } - public override int GetSelectedIndex() - { - return AllView.SelectedIndex; - } - public override void FocusSelectedItems() { AllView.ScrollIntoView(AllView.ItemsSource.Cast().Last(), null); @@ -209,32 +185,6 @@ public override void StartRenameItem() AllView.BeginEdit(); } - public override void ResetItemOpacity() - { - IEnumerable items = AllView.ItemsSource; - if (items == null) - { - return; - } - - foreach (ListedItem listedItem in items) - { - if (listedItem.IsHiddenItem) - { - listedItem.Opacity = 0.4; - } - else - { - listedItem.Opacity = 1; - } - } - } - - public override void SetItemOpacity(ListedItem item) - { - item.Opacity = 0.4; - } - private async void ViewModel_PropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == "DirectorySortOption") @@ -261,15 +211,16 @@ private async void ViewModel_PropertyChanged(object sender, PropertyChangedEvent else if (e.PropertyName == "DirectorySortDirection") { // Swap arrows - SortedColumn = _sortedColumn; + SortedColumn = sortedColumn; } else if (e.PropertyName == "IsLoadingItems") { - if (!ParentShellPageInstance.FilesystemViewModel.IsLoadingItems && ParentShellPageInstance.FilesystemViewModel.FilesAndFolders.Count > 0) + if (!ParentShellPageInstance.FilesystemViewModel.IsLoadingItems + && ParentShellPageInstance.FilesystemViewModel.FilesAndFolders.Count > 0) { var allRows = new List(); - Interacts.Interaction.FindChildren(allRows, AllView); + Interaction.FindChildren(allRows, AllView); foreach (DataGridRow row in allRows.Take(25)) { if (!(row.DataContext as ListedItem).ItemPropertiesInitialized) @@ -307,6 +258,7 @@ private void AllView_PreparingCellForEdit(object sender, DataGridPreparingCellFo AllView.CancelEdit(); // Cancel the edit operation return; } + if (!tapDebounceTimer.IsEnabled) { tapDebounceTimer.Debounce(() => @@ -320,6 +272,7 @@ private void AllView_PreparingCellForEdit(object sender, DataGridPreparingCellFo tapDebounceTimer.Stop(); ParentShellPageInstance.InteractionOperations.OpenItem_Click(null, null); // Open selected files } + AllView.CancelEdit(); // Cancel the edit operation return; } @@ -438,11 +391,12 @@ private async void AllView_Sorting(object sender, DataGridColumnEventArgs e) ParentShellPageInstance.FilesystemViewModel.IsSortedAscending = true; } - if (!ParentShellPageInstance.FilesystemViewModel.IsLoadingItems && ParentShellPageInstance.FilesystemViewModel.FilesAndFolders.Count > 0) + if (!ParentShellPageInstance.FilesystemViewModel.IsLoadingItems + && ParentShellPageInstance.FilesystemViewModel.FilesAndFolders.Count > 0) { var allRows = new List(); - Interacts.Interaction.FindChildren(allRows, AllView); + Interaction.FindChildren(allRows, AllView); foreach (DataGridRow row in allRows.Take(25)) { if (!(row.DataContext as ListedItem).ItemPropertiesInitialized) @@ -478,7 +432,7 @@ private void AllView_PreviewKeyDown(object sender, KeyRoutedEventArgs e) else if (e.KeyStatus.IsMenuKeyDown && (e.Key == VirtualKey.Left || e.Key == VirtualKey.Right || e.Key == VirtualKey.Up)) { // Unfocus the GridView so keyboard shortcut can be handled - this.Focus(FocusState.Programmatic); + Focus(FocusState.Programmatic); } } @@ -497,7 +451,7 @@ public void AllView_Holding(object sender, HoldingRoutedEventArgs e) private void HandleRightClick(object sender, RoutedEventArgs e) { - var rowPressed = Interacts.Interaction.FindParent(e.OriginalSource as DependencyObject); + var rowPressed = Interaction.FindParent(e.OriginalSource as DependencyObject); if (rowPressed != null) { var objectPressed = ((ReadOnlyObservableCollection)AllView.ItemsSource)[rowPressed.GetIndex()]; @@ -525,7 +479,7 @@ protected override void Page_CharacterReceived(CoreWindow sender, CharacterRecei // Don't block the various uses of enter key (key 13) var focusedElement = FocusManager.GetFocusedElement() as FrameworkElement; if (args.KeyCode == 13 || focusedElement is Button || focusedElement is TextBox || focusedElement is PasswordBox || - Interacts.Interaction.FindParent(focusedElement) != null) + Interaction.FindParent(focusedElement) != null) { return; } diff --git a/Files/Views/LayoutModes/GridViewBrowser.xaml.cs b/Files/Views/LayoutModes/GridViewBrowser.xaml.cs index af548566cf34..7e40659ee0f7 100644 --- a/Files/Views/LayoutModes/GridViewBrowser.xaml.cs +++ b/Files/Views/LayoutModes/GridViewBrowser.xaml.cs @@ -21,9 +21,9 @@ public sealed partial class GridViewBrowser : BaseLayout public GridViewBrowser() { - this.InitializeComponent(); - base.BaseLayoutContextFlyout = this.BaseLayoutContextFlyout; - base.BaseLayoutItemContextFlyout = this.BaseLayoutItemContextFlyout; + InitializeComponent(); + base.BaseLayoutContextFlyout = BaseLayoutContextFlyout; + base.BaseLayoutItemContextFlyout = BaseLayoutItemContextFlyout; var selectionRectangle = RectangleSelection.Create(FileList, SelectionRectangle, FileList_SelectionChanged); selectionRectangle.SelectionEnded += SelectionRectangle_SelectionEnded; @@ -54,49 +54,26 @@ private void SetItemTemplate() } else if (App.AppSettings.LayoutMode == 2) { - _iconSize = UpdateThumbnailSize(); // Get icon size for jumps from other layouts directly to a grid size + currentIconSize = GetIconSize(); // Get icon size for jumps from other layouts directly to a grid size App.AppSettings.GridViewSizeChangeRequested += AppSettings_GridViewSizeChangeRequested; } } - public override void SetSelectedItemOnUi(ListedItem item) + protected override void AddSelectedItem(ListedItem item) { - ClearSelection(); FileList.SelectedItems.Add(item); } - public override void SetSelectedItemsOnUi(List items) + protected override IEnumerable GetAllItems() { - ClearSelection(); - - foreach (ListedItem item in items) - { - FileList.SelectedItems.Add(item); - } - } - - public override void AddSelectedItemsOnUi(List selectedItems) - { - foreach (ListedItem selectedItem in selectedItems) - { - FileList.SelectedItems.Add(selectedItem); - } + return FileList.Items; } public override void SelectAllItems() { - ClearSelection(); FileList.SelectAll(); } - public override void InvertSelection() - { - List allItems = FileList.Items.Cast().ToList(); - List newSelectedItems = allItems.Except(SelectedItems).ToList(); - - SetSelectedItemsOnUi(newSelectedItems); - } - public override void ClearSelection() { FileList.SelectedItems.Clear(); @@ -126,11 +103,6 @@ public override void ScrollIntoView(ListedItem item) FileList.ScrollIntoView(item); } - public override int GetSelectedIndex() - { - return FileList.SelectedIndex; - } - public override void FocusSelectedItems() { FileList.ScrollIntoView(FileList.Items.Last()); @@ -220,32 +192,6 @@ private void GridViewTextBoxItemName_TextChanged(object sender, TextChangedEvent } } - public override void ResetItemOpacity() - { - IEnumerable items = (IEnumerable)FileList.ItemsSource; - if (items == null) - { - return; - } - - foreach (ListedItem listedItem in items) - { - if (listedItem.IsHiddenItem) - { - listedItem.Opacity = 0.4; - } - else - { - listedItem.Opacity = 1; - } - } - } - - public override void SetItemOpacity(ListedItem item) - { - item.Opacity = 0.4; - } - private void RenameTextBox_KeyDown(object sender, KeyRoutedEventArgs e) { if (e.Key == VirtualKey.Escape) @@ -333,7 +279,7 @@ private void FileList_PreviewKeyDown(object sender, KeyRoutedEventArgs e) else if (e.KeyStatus.IsMenuKeyDown && (e.Key == VirtualKey.Left || e.Key == VirtualKey.Right || e.Key == VirtualKey.Up)) { // Unfocus the GridView so keyboard shortcut can be handled - this.Focus(FocusState.Programmatic); + Focus(FocusState.Programmatic); } } @@ -345,8 +291,11 @@ protected override void Page_CharacterReceived(CoreWindow sender, CharacterRecei { // Don't block the various uses of enter key (key 13) var focusedElement = FocusManager.GetFocusedElement() as FrameworkElement; - if (args.KeyCode == 13 || focusedElement is Button || focusedElement is TextBox || focusedElement is PasswordBox || - Interacts.Interaction.FindParent(focusedElement) != null) + if (args.KeyCode == 13 + || focusedElement is Button + || focusedElement is TextBox + || focusedElement is PasswordBox + || Interaction.FindParent(focusedElement) != null) { return; } @@ -363,7 +312,7 @@ private async void Grid_EffectiveViewportChanged(FrameworkElement sender, Effect { await Window.Current.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Low, () => { - ParentShellPageInstance.FilesystemViewModel.LoadExtendedItemProperties(item, _iconSize); + ParentShellPageInstance.FilesystemViewModel.LoadExtendedItemProperties(item, currentIconSize); item.ItemPropertiesInitialized = true; }); @@ -405,9 +354,9 @@ private void FileListGridItem_PointerPressed(object sender, PointerRoutedEventAr } } - private uint _iconSize = UpdateThumbnailSize(); + private uint currentIconSize = GetIconSize(); - private static uint UpdateThumbnailSize() + private static uint GetIconSize() { if (App.AppSettings.LayoutMode == 1 || App.AppSettings.GridViewSize < Constants.Browser.GridViewBrowser.GridViewSizeSmall + 75) { @@ -429,16 +378,14 @@ private static uint UpdateThumbnailSize() private void AppSettings_GridViewSizeChangeRequested(object sender, EventArgs e) { - var iconSize = UpdateThumbnailSize(); // Get new icon size + var requestedIconSize = GetIconSize(); // Get new icon size // Prevents reloading icons when the icon size hasn't changed - if (iconSize != _iconSize) + if (requestedIconSize != currentIconSize) { - _iconSize = iconSize; // Update icon size before refreshing + currentIconSize = requestedIconSize; // Update icon size before refreshing ParentShellPageInstance.Refresh_Click(); // Refresh icons } - else - _iconSize = iconSize; // Update icon size } private async void FileList_ItemClick(object sender, ItemClickEventArgs e) From 4a337bae1db6caaba30f8283b8b877a075a393b9 Mon Sep 17 00:00:00 2001 From: Thomas1664 <46387399+Thomas1664@users.noreply.github.com> Date: Thu, 17 Dec 2020 18:32:48 +0100 Subject: [PATCH 11/27] Check for updates from Files (#2508) --- Files.Package/Package.appxmanifest | 2 +- Files/Files.csproj | 1 + Files/Helpers/AppUpdater.cs | 85 +++++++++++++++++++ Files/MultilingualResources/Files.de-DE.xlf | 16 ++++ Files/MultilingualResources/Files.es-ES.xlf | 16 ++++ Files/MultilingualResources/Files.fr-FR.xlf | 20 ++++- Files/MultilingualResources/Files.he-IL.xlf | 16 ++++ Files/MultilingualResources/Files.hi-IN.xlf | 16 ++++ Files/MultilingualResources/Files.hu-HU.xlf | 16 ++++ Files/MultilingualResources/Files.it-IT.xlf | 16 ++++ Files/MultilingualResources/Files.ja-JP.xlf | 16 ++++ Files/MultilingualResources/Files.nl-NL.xlf | 16 ++++ Files/MultilingualResources/Files.or-IN.xlf | 16 ++++ Files/MultilingualResources/Files.pl-PL.xlf | 16 ++++ Files/MultilingualResources/Files.pt-BR.xlf | 16 ++++ Files/MultilingualResources/Files.ru-RU.xlf | 16 ++++ Files/MultilingualResources/Files.ta.xlf | 16 ++++ Files/MultilingualResources/Files.tr-TR.xlf | 16 ++++ Files/MultilingualResources/Files.uk-UA.xlf | 16 ++++ Files/MultilingualResources/Files.zh-Hans.xlf | 16 ++++ Files/MultilingualResources/Files.zh-Hant.xlf | 16 ++++ Files/Strings/en-US/Resources.resw | 12 +++ Files/Strings/fr-FR/Resources.resw | 33 +++++++ Files/Views/MainPage.xaml.cs | 6 +- 24 files changed, 427 insertions(+), 4 deletions(-) create mode 100644 Files/Helpers/AppUpdater.cs 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/Files.csproj b/Files/Files.csproj index 73f9227a7149..507f3de8c1af 100644 --- a/Files/Files.csproj +++ b/Files/Files.csproj @@ -164,6 +164,7 @@ + diff --git a/Files/Helpers/AppUpdater.cs b/Files/Helpers/AppUpdater.cs new file mode 100644 index 000000000000..d8c728f77ee2 --- /dev/null +++ b/Files/Helpers/AppUpdater.cs @@ -0,0 +1,85 @@ +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 +{ + 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; + } + } +} diff --git a/Files/MultilingualResources/Files.de-DE.xlf b/Files/MultilingualResources/Files.de-DE.xlf index 48dc53d204b1..dc306314907e 100644 --- a/Files/MultilingualResources/Files.de-DE.xlf +++ b/Files/MultilingualResources/Files.de-DE.xlf @@ -1923,6 +1923,22 @@ 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 + diff --git a/Files/MultilingualResources/Files.es-ES.xlf b/Files/MultilingualResources/Files.es-ES.xlf index b51c55f3eeb0..ef8f6b8b396f 100644 --- a/Files/MultilingualResources/Files.es-ES.xlf +++ b/Files/MultilingualResources/Files.es-ES.xlf @@ -1922,6 +1922,22 @@ 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 + diff --git a/Files/MultilingualResources/Files.fr-FR.xlf b/Files/MultilingualResources/Files.fr-FR.xlf index e7a885b48fef..311ab2cf5b59 100644 --- a/Files/MultilingualResources/Files.fr-FR.xlf +++ b/Files/MultilingualResources/Files.fr-FR.xlf @@ -1,4 +1,4 @@ - +
@@ -1922,7 +1922,23 @@ 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 + - + \ No newline at end of file diff --git a/Files/MultilingualResources/Files.he-IL.xlf b/Files/MultilingualResources/Files.he-IL.xlf index e7a9ae8d8b96..d0a990c8ccc2 100644 --- a/Files/MultilingualResources/Files.he-IL.xlf +++ b/Files/MultilingualResources/Files.he-IL.xlf @@ -1922,6 +1922,22 @@ 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 + diff --git a/Files/MultilingualResources/Files.hi-IN.xlf b/Files/MultilingualResources/Files.hi-IN.xlf index 0c5d4bd9fa87..23ae7fc7689a 100644 --- a/Files/MultilingualResources/Files.hi-IN.xlf +++ b/Files/MultilingualResources/Files.hi-IN.xlf @@ -1932,6 +1932,22 @@ 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 + diff --git a/Files/MultilingualResources/Files.hu-HU.xlf b/Files/MultilingualResources/Files.hu-HU.xlf index c54e74b1ea2d..a39c79be0fb3 100644 --- a/Files/MultilingualResources/Files.hu-HU.xlf +++ b/Files/MultilingualResources/Files.hu-HU.xlf @@ -1922,6 +1922,22 @@ 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 + diff --git a/Files/MultilingualResources/Files.it-IT.xlf b/Files/MultilingualResources/Files.it-IT.xlf index f3e1b2c32b4f..c295f407bc21 100644 --- a/Files/MultilingualResources/Files.it-IT.xlf +++ b/Files/MultilingualResources/Files.it-IT.xlf @@ -1923,6 +1923,22 @@ Details Dettagli + + 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 + diff --git a/Files/MultilingualResources/Files.ja-JP.xlf b/Files/MultilingualResources/Files.ja-JP.xlf index 7b251a6949b6..bd295878c3c6 100644 --- a/Files/MultilingualResources/Files.ja-JP.xlf +++ b/Files/MultilingualResources/Files.ja-JP.xlf @@ -1922,6 +1922,22 @@ 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 + diff --git a/Files/MultilingualResources/Files.nl-NL.xlf b/Files/MultilingualResources/Files.nl-NL.xlf index d86d45228a16..57eaae4b00f4 100644 --- a/Files/MultilingualResources/Files.nl-NL.xlf +++ b/Files/MultilingualResources/Files.nl-NL.xlf @@ -1934,6 +1934,22 @@ 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 + diff --git a/Files/MultilingualResources/Files.or-IN.xlf b/Files/MultilingualResources/Files.or-IN.xlf index c5f99650863d..9fd85a3912e3 100644 --- a/Files/MultilingualResources/Files.or-IN.xlf +++ b/Files/MultilingualResources/Files.or-IN.xlf @@ -1932,6 +1932,22 @@ 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 + diff --git a/Files/MultilingualResources/Files.pl-PL.xlf b/Files/MultilingualResources/Files.pl-PL.xlf index 2cb7f714e99c..e2ff295ee43e 100644 --- a/Files/MultilingualResources/Files.pl-PL.xlf +++ b/Files/MultilingualResources/Files.pl-PL.xlf @@ -1931,6 +1931,22 @@ 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 + diff --git a/Files/MultilingualResources/Files.pt-BR.xlf b/Files/MultilingualResources/Files.pt-BR.xlf index 3856dd35f862..ba751940a6b5 100644 --- a/Files/MultilingualResources/Files.pt-BR.xlf +++ b/Files/MultilingualResources/Files.pt-BR.xlf @@ -1922,6 +1922,22 @@ 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 + diff --git a/Files/MultilingualResources/Files.ru-RU.xlf b/Files/MultilingualResources/Files.ru-RU.xlf index e6fb26791382..e88b3838d393 100644 --- a/Files/MultilingualResources/Files.ru-RU.xlf +++ b/Files/MultilingualResources/Files.ru-RU.xlf @@ -1922,6 +1922,22 @@ 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 + diff --git a/Files/MultilingualResources/Files.ta.xlf b/Files/MultilingualResources/Files.ta.xlf index 253b9f66d790..664e1c88acec 100644 --- a/Files/MultilingualResources/Files.ta.xlf +++ b/Files/MultilingualResources/Files.ta.xlf @@ -1927,6 +1927,22 @@ 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 + diff --git a/Files/MultilingualResources/Files.tr-TR.xlf b/Files/MultilingualResources/Files.tr-TR.xlf index 5ed79daf889a..248a00a6c198 100644 --- a/Files/MultilingualResources/Files.tr-TR.xlf +++ b/Files/MultilingualResources/Files.tr-TR.xlf @@ -1929,6 +1929,22 @@ 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 + diff --git a/Files/MultilingualResources/Files.uk-UA.xlf b/Files/MultilingualResources/Files.uk-UA.xlf index e9df0a59e968..480266ad478b 100644 --- a/Files/MultilingualResources/Files.uk-UA.xlf +++ b/Files/MultilingualResources/Files.uk-UA.xlf @@ -1922,6 +1922,22 @@ 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 + diff --git a/Files/MultilingualResources/Files.zh-Hans.xlf b/Files/MultilingualResources/Files.zh-Hans.xlf index 24f02e3c78b8..4be97d203f11 100644 --- a/Files/MultilingualResources/Files.zh-Hans.xlf +++ b/Files/MultilingualResources/Files.zh-Hans.xlf @@ -1927,6 +1927,22 @@ 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 + diff --git a/Files/MultilingualResources/Files.zh-Hant.xlf b/Files/MultilingualResources/Files.zh-Hant.xlf index c7d6d42d0d81..24af692b1953 100644 --- a/Files/MultilingualResources/Files.zh-Hant.xlf +++ b/Files/MultilingualResources/Files.zh-Hant.xlf @@ -1931,6 +1931,22 @@ 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 + diff --git a/Files/Strings/en-US/Resources.resw b/Files/Strings/en-US/Resources.resw index 3ca24be1a5ae..3e51deb636d0 100644 --- a/Files/Strings/en-US/Resources.resw +++ b/Files/Strings/en-US/Resources.resw @@ -1554,4 +1554,16 @@ Details + + No + + + Do you want to download and install the latest version of Files? + + + Yes + + + Updates Available + \ No newline at end of file diff --git a/Files/Strings/fr-FR/Resources.resw b/Files/Strings/fr-FR/Resources.resw index 23b63db5ba8d..85052481ab2c 100644 --- a/Files/Strings/fr-FR/Resources.resw +++ b/Files/Strings/fr-FR/Resources.resw @@ -1098,6 +1098,9 @@ Longitude + + Altitude + Marque d'appareil @@ -1113,15 +1116,27 @@ Ouverture + + Format + Artiste Genre + + Durée + + + Producteur + Année + + Version + Vidéo @@ -1140,6 +1155,9 @@ Annuler + + Certaines propriétés peuvent contenir des informations personnelles. + Supprimer les propriétés @@ -1149,4 +1167,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/Views/MainPage.xaml.cs b/Files/Views/MainPage.xaml.cs index 9e58293f7a4f..3e8abb044aac 100644 --- a/Files/Views/MainPage.xaml.cs +++ b/Files/Views/MainPage.xaml.cs @@ -1,6 +1,7 @@ using Files.Controllers; using Files.Controls; using Files.Filesystem; +using Files.Helpers; using Files.UserControls.MultitaskingControl; using Files.View_Models; using Files.Views.Pages; @@ -23,7 +24,6 @@ using Windows.UI.Xaml.Input; using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Navigation; - using static Files.Helpers.PathNormalization; namespace Files.Views @@ -161,6 +161,10 @@ protected override async void OnNavigatedTo(NavigationEventArgs eventArgs) await AddNewTabByPathAsync(typeof(ModernShellPage), navArgs); } + // Check for required updates + AppUpdater updater = new AppUpdater(); + updater.CheckForUpdatesAsync(); + // Initial setting of SelectedTabItem Frame rootFrame = Window.Current.Content as Frame; var mainView = rootFrame.Content as MainPage; From 654fe569e7d0b57855bebfdc046961ba1febcf00 Mon Sep 17 00:00:00 2001 From: Yair Aichenbaum <39923744+yaichenbaum@users.noreply.github.com> Date: Thu, 17 Dec 2020 12:36:19 -0500 Subject: [PATCH 12/27] Added the option to hide columns in the details layout (#2622) --- Files/View Models/SettingsViewModel.cs | 18 ++++++++ .../Views/LayoutModes/GenericFileBrowser.xaml | 43 +++++++++---------- 2 files changed, 39 insertions(+), 22 deletions(-) diff --git a/Files/View Models/SettingsViewModel.cs b/Files/View Models/SettingsViewModel.cs index ffd49c94e6a1..37e9cb0d81c5 100644 --- a/Files/View Models/SettingsViewModel.cs +++ b/Files/View Models/SettingsViewModel.cs @@ -296,6 +296,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"; diff --git a/Files/Views/LayoutModes/GenericFileBrowser.xaml b/Files/Views/LayoutModes/GenericFileBrowser.xaml index 166fc64c3880..93b19389f570 100644 --- a/Files/Views/LayoutModes/GenericFileBrowser.xaml +++ b/Files/Views/LayoutModes/GenericFileBrowser.xaml @@ -27,9 +27,9 @@ + x:Key="BoolToVisibilityConverter" + FalseValue="Collapsed" + TrueValue="Visible" /> - - - - - - - - - - + + + @@ -870,7 +866,8 @@ FontSize="12" Header="Date modified" IsReadOnly="True" - Tag="Date"> + Tag="Date" + Visibility="{x:Bind AppSettings.ShowDateColumn, Mode=OneWay}"> - + \ 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/UserControls/MultitaskingControl/HorizontalMultitaskingControl.xaml.cs b/Files/UserControls/MultitaskingControl/HorizontalMultitaskingControl.xaml.cs index c50c365cca15..4efce4fd9fd8 100644 --- a/Files/UserControls/MultitaskingControl/HorizontalMultitaskingControl.xaml.cs +++ b/Files/UserControls/MultitaskingControl/HorizontalMultitaskingControl.xaml.cs @@ -1,5 +1,4 @@ -using Files.Filesystem; -using Files.Interacts; +using Files.Interacts; using Files.View_Models; using Files.Views; using Files.Views.Pages; diff --git a/Files/UserControls/MultitaskingControl/TabItem/ITabItem.cs b/Files/UserControls/MultitaskingControl/TabItem/ITabItem.cs index c0907c3d5a3e..2c8704c20448 100644 --- a/Files/UserControls/MultitaskingControl/TabItem/ITabItem.cs +++ b/Files/UserControls/MultitaskingControl/TabItem/ITabItem.cs @@ -8,4 +8,4 @@ public interface ITabItem : IDisposable object NavigationArgs { get; } } -} +} \ No newline at end of file diff --git a/Files/UserControls/MultitaskingControl/TabItem/ITabItemControl.cs b/Files/UserControls/MultitaskingControl/TabItem/ITabItemControl.cs index e50e92f60a8a..fbf7c0e46c7a 100644 --- a/Files/UserControls/MultitaskingControl/TabItem/ITabItemControl.cs +++ b/Files/UserControls/MultitaskingControl/TabItem/ITabItemControl.cs @@ -15,4 +15,4 @@ public interface ITabItemControl : IDisposable bool AllowStorageItemDrop { get; } } -} +} \ No newline at end of file diff --git a/Files/UserControls/MultitaskingControl/TabItem/TabItem.cs b/Files/UserControls/MultitaskingControl/TabItem/TabItem.cs index 33c6ffc8ce60..d81a1370f3bc 100644 --- a/Files/UserControls/MultitaskingControl/TabItem/TabItem.cs +++ b/Files/UserControls/MultitaskingControl/TabItem/TabItem.cs @@ -61,7 +61,7 @@ public void Dispose() Content = null; } - #endregion + #endregion IDisposable } public class TabItemContent diff --git a/Files/UserControls/MultitaskingControl/VerticalTabViewControl.xaml.cs b/Files/UserControls/MultitaskingControl/VerticalTabViewControl.xaml.cs index fe235bb01abc..827c05977ffc 100644 --- a/Files/UserControls/MultitaskingControl/VerticalTabViewControl.xaml.cs +++ b/Files/UserControls/MultitaskingControl/VerticalTabViewControl.xaml.cs @@ -1,5 +1,4 @@ -using Files.Filesystem; -using Files.Interacts; +using Files.Interacts; using Files.Views; using Files.Views.Pages; using Microsoft.Toolkit.Uwp.Extensions; diff --git a/Files/UserControls/NavigationToolbar.xaml.cs b/Files/UserControls/NavigationToolbar.xaml.cs index dae3dfe3f4ec..4ed7a140242c 100644 --- a/Files/UserControls/NavigationToolbar.xaml.cs +++ b/Files/UserControls/NavigationToolbar.xaml.cs @@ -12,7 +12,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; @@ -115,7 +114,7 @@ public bool IsCreateButtonEnabledInPage typeof(NavigationToolbar), new PropertyMetadata(null) ); - + public static readonly DependencyProperty CanCopyPathInPageProperty = DependencyProperty.Register( "CanCopyPathInPage", typeof(bool), @@ -134,6 +133,7 @@ public bool CanCreateFileInPage SetValue(CanCreateFileInPageProperty, value); } } + public bool CanCopyPathInPage { get @@ -363,6 +363,7 @@ public bool ClickablePathLoaded public string PathText { get; set; } private bool _IsSearchReigonVisible = false; + public bool IsSearchReigonVisible { get 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/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/View Models/CurrentInstanceViewModel.cs b/Files/View Models/CurrentInstanceViewModel.cs index e91afdf57ed2..8d043ff493f6 100644 --- a/Files/View Models/CurrentInstanceViewModel.cs +++ b/Files/View Models/CurrentInstanceViewModel.cs @@ -4,11 +4,11 @@ namespace Files.View_Models { public class CurrentInstanceViewModel : ObservableObject { - /* + /* * TODO: * In the future, we should consolidate these public variables into * a single enum property providing simplified customization of the - * values being manipulated inside the setter blocks. + * values being manipulated inside the setter blocks. */ private bool _IsPageTypeSearchResults = false; diff --git a/Files/View Models/ItemViewModel.cs b/Files/View Models/ItemViewModel.cs index ccad13cc9fd8..f61b849cc9f5 100644 --- a/Files/View Models/ItemViewModel.cs +++ b/Files/View Models/ItemViewModel.cs @@ -401,7 +401,6 @@ private void WorkingDirectoryChanged(string singleItemOverride = null) { AssociatedInstance.NavigationToolbar.PathComponents.Add(new Views.Pages.PathBoxItem() { Path = null, Title = singleItemOverride }); } - } public void CancelLoadAndClearFiles(bool isSearchResultPage = false) @@ -430,7 +429,7 @@ public void CancelLoadAndClearFiles(bool isSearchResultPage = false) AssociatedInstance.NavigationToolbar.CanGoBack = true; // Impose no artificial restrictions on back navigation. Even in a search results page. _filesAndFolders.Clear(); - + if (!(WorkingDirectory?.StartsWith(AppSettings.RecycleBinPath) ?? false) && !isSearchResultPage) { // Can't go up from recycle bin 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/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 37e9cb0d81c5..da6b1d83b9d0 100644 --- a/Files/View Models/SettingsViewModel.cs +++ b/Files/View Models/SettingsViewModel.cs @@ -300,14 +300,14 @@ public bool ShowDateColumn { get => Get(true); set => Set(value); - } + } public bool ShowTypeColumn { get => Get(true); set => Set(value); } - + public bool ShowSizeColumn { get => Get(true); @@ -455,7 +455,7 @@ public bool OpenNewTabPageOnStartup get => Get(true); set => Set(value); } - + public bool ShowStatusCenterTeachingTip { get => Get(true); @@ -497,7 +497,7 @@ public bool AreHiddenItemsVisible get => Get(false); set => Set(value); } - + public bool ListAndSortDirectoriesAlongsideFiles { get => Get(false); diff --git a/Files/Views/LayoutModes/GenericFileBrowser.xaml.cs b/Files/Views/LayoutModes/GenericFileBrowser.xaml.cs index 8ca7752f8eda..9484a90eae34 100644 --- a/Files/Views/LayoutModes/GenericFileBrowser.xaml.cs +++ b/Files/Views/LayoutModes/GenericFileBrowser.xaml.cs @@ -29,6 +29,7 @@ public sealed partial class GenericFileBrowser : BaseLayout { private string oldItemName; private DataGridColumn sortedColumn; + private static readonly MethodInfo SelectAllMethod = typeof(DataGrid) .GetMethod("SelectAll", BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Instance); @@ -215,7 +216,7 @@ private async void ViewModel_PropertyChanged(object sender, PropertyChangedEvent } else if (e.PropertyName == "IsLoadingItems") { - if (!ParentShellPageInstance.FilesystemViewModel.IsLoadingItems + if (!ParentShellPageInstance.FilesystemViewModel.IsLoadingItems && ParentShellPageInstance.FilesystemViewModel.FilesAndFolders.Count > 0) { var allRows = new List(); @@ -391,7 +392,7 @@ private async void AllView_Sorting(object sender, DataGridColumnEventArgs e) ParentShellPageInstance.FilesystemViewModel.IsSortedAscending = true; } - if (!ParentShellPageInstance.FilesystemViewModel.IsLoadingItems + if (!ParentShellPageInstance.FilesystemViewModel.IsLoadingItems && ParentShellPageInstance.FilesystemViewModel.FilesAndFolders.Count > 0) { var allRows = new List(); diff --git a/Files/Views/LayoutModes/GridViewBrowser.xaml.cs b/Files/Views/LayoutModes/GridViewBrowser.xaml.cs index 7e40659ee0f7..1e5998d93545 100644 --- a/Files/Views/LayoutModes/GridViewBrowser.xaml.cs +++ b/Files/Views/LayoutModes/GridViewBrowser.xaml.cs @@ -291,10 +291,10 @@ protected override void Page_CharacterReceived(CoreWindow sender, CharacterRecei { // Don't block the various uses of enter key (key 13) var focusedElement = FocusManager.GetFocusedElement() as FrameworkElement; - if (args.KeyCode == 13 - || focusedElement is Button - || focusedElement is TextBox - || focusedElement is PasswordBox + if (args.KeyCode == 13 + || focusedElement is Button + || focusedElement is TextBox + || focusedElement is PasswordBox || Interaction.FindParent(focusedElement) != null) { return; diff --git a/Files/Views/ModernShellPage.xaml.cs b/Files/Views/ModernShellPage.xaml.cs index baca7c6f0a96..f32e654c4fc1 100644 --- a/Files/Views/ModernShellPage.xaml.cs +++ b/Files/Views/ModernShellPage.xaml.cs @@ -1,13 +1,12 @@ using Files.Common; using Files.Dialogs; using Files.Filesystem; -using Files.Filesystem.Search; using Files.Filesystem.FilesystemHistory; +using Files.Filesystem.Search; using Files.Helpers; using Files.Interacts; using Files.UserControls; using Files.View_Models; -using Microsoft.Toolkit.Mvvm.Input; using Microsoft.Toolkit.Uwp.Extensions; using System; using System.Collections.Generic; @@ -24,7 +23,6 @@ using Windows.ApplicationModel.Resources.Core; using Windows.Foundation.Collections; using Windows.Storage; -using Windows.Storage.Search; using Windows.System; using Windows.UI.Core; using Windows.UI.Text; @@ -132,7 +130,7 @@ public ModernShellPage() navToolbar.AddressBarTextEntered += ModernShellPage_AddressBarTextEntered; navToolbar.PathBoxItemDropped += ModernShellPage_PathBoxItemDropped; } - + AppSettings.SortDirectionPreferenceUpdated += AppSettings_SortDirectionPreferenceUpdated; AppSettings.SortOptionPreferenceUpdated += AppSettings_SortOptionPreferenceUpdated; @@ -162,7 +160,7 @@ private async void ModernShellPage_SearchSuggestionChosen(AutoSuggestBox sender, private async void ModernShellPage_SearchTextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) { - if(args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) + if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput) { if (!string.IsNullOrWhiteSpace(sender.Text)) { @@ -986,7 +984,6 @@ private async void KeyboardAccelerator_Invoked(KeyboardAccelerator sender, Keybo case (false, true, false, true, VirtualKey.Delete): // shift + delete, PermanentDelete if (!NavigationToolbar.IsEditModeEnabled && !InstanceViewModel.IsPageTypeSearchResults) { - await filesystemHelpers.DeleteItemsAsync( ContentPage.SelectedItems.Select((item) => new PathWithType( item.ItemPath, @@ -1214,7 +1211,7 @@ public void Dispose() navToolbar.AddressBarTextEntered -= ModernShellPage_AddressBarTextEntered; navToolbar.PathBoxItemDropped -= ModernShellPage_PathBoxItemDropped; } - + AppSettings.SortDirectionPreferenceUpdated -= AppSettings_SortDirectionPreferenceUpdated; AppSettings.SortOptionPreferenceUpdated -= AppSettings_SortOptionPreferenceUpdated; diff --git a/Files/Views/Pages/Properties.xaml b/Files/Views/Pages/Properties.xaml index bfff3085bc7d..8b0edbc0fd87 100644 --- a/Files/Views/Pages/Properties.xaml +++ b/Files/Views/Pages/Properties.xaml @@ -40,9 +40,9 @@ IsPaneToggleButtonVisible="False" IsSettingsVisible="False" PaneDisplayMode="Top" - SelectionFollowsFocus="Enabled" + SelectedItem="{x:Bind TabGeneral}" SelectionChanged="NavigationView_SelectionChanged" - SelectedItem="{x:Bind TabGeneral}"> + SelectionFollowsFocus="Enabled"> @@ -77,8 +77,11 @@ - - + + diff --git a/Files/Views/Pages/PropertiesDetails.xaml b/Files/Views/Pages/PropertiesDetails.xaml index 8253f1af255b..bc599b7c81df 100644 --- a/Files/Views/Pages/PropertiesDetails.xaml +++ b/Files/Views/Pages/PropertiesDetails.xaml @@ -103,4 +103,4 @@ - + \ No newline at end of file diff --git a/Files/Views/Pages/PropertiesDetails.xaml.cs b/Files/Views/Pages/PropertiesDetails.xaml.cs index 85308fc06d03..14f85831e471 100644 --- a/Files/Views/Pages/PropertiesDetails.xaml.cs +++ b/Files/Views/Pages/PropertiesDetails.xaml.cs @@ -1,10 +1,10 @@ -using Files.View_Models.Properties; +using Files.Dialogs; +using Files.View_Models.Properties; using System; using System.Diagnostics; using System.Threading.Tasks; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; -using Files.Dialogs; namespace Files { @@ -12,7 +12,7 @@ public sealed partial class PropertiesDetails : PropertiesTab { public PropertiesDetails() { - InitializeComponent(); + InitializeComponent(); } protected override void Properties_Loaded(object sender, RoutedEventArgs e) @@ -48,8 +48,10 @@ public async Task SaveChangesAsync() { case ContentDialogResult.Primary: break; + case ContentDialogResult.Secondary: return true; + default: return false; } @@ -59,7 +61,7 @@ public async Task SaveChangesAsync() // and opening another dialog (attempting to open more than one ContentDialog // at a time will throw an error) while (dialog.IsLoaded) - {} + { } } } @@ -69,4 +71,4 @@ private async void ClearPropertiesConfirmation_Click(object sender, RoutedEventA await (BaseProperties as FileProperties).ClearPropertiesAsync(); } } -} +} \ No newline at end of file diff --git a/Files/Views/Settings.xaml.cs b/Files/Views/Settings.xaml.cs index 869325d0f2b1..0b05f9e8738b 100644 --- a/Files/Views/Settings.xaml.cs +++ b/Files/Views/Settings.xaml.cs @@ -83,6 +83,6 @@ private void SettingsPane_SelectionChanged(Microsoft.UI.Xaml.Controls.Navigation 7 => SettingsContentFrame.Navigate(typeof(About)), _ => SettingsContentFrame.Navigate(typeof(Appearance)) }; - } + } } } \ No newline at end of file diff --git a/Files/Views/SettingsPages/Appearance.xaml b/Files/Views/SettingsPages/Appearance.xaml index 66325fe9ed5b..ef0af8812ce6 100644 --- a/Files/Views/SettingsPages/Appearance.xaml +++ b/Files/Views/SettingsPages/Appearance.xaml @@ -54,13 +54,13 @@ + Style="{ThemeResource TextBlockButtonStyle}" + ToolTipService.ToolTip="Learn more about date formats" /> + + + \ No newline at end of file diff --git a/Files/priconfig.packaging.xml b/Files/priconfig.packaging.xml new file mode 100644 index 000000000000..a8b3b89f6e65 --- /dev/null +++ b/Files/priconfig.packaging.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file From dbcb98de0ac2b63fdb79f9351f639b0364b5175b Mon Sep 17 00:00:00 2001 From: Marco Gavelli Date: Fri, 18 Dec 2020 01:44:53 +0100 Subject: [PATCH 15/27] Fixed an issue where the properties dialog would sometimes show the properties of the wrong directory (#2629) --- Files/View Models/Properties/FolderProperties.cs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) 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) From d0150fcbc2bb046c6b5d7f4b780429440b062480 Mon Sep 17 00:00:00 2001 From: Vladyslav Tsvietkov Date: Fri, 18 Dec 2020 05:04:09 +0200 Subject: [PATCH 16/27] SidebarControl: Adapt pane width to AppSettings SidebarWidth (#2631) --- Files/UserControls/SidebarControl.xaml | 2 +- Files/Views/ModernShellPage.xaml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Files/UserControls/SidebarControl.xaml b/Files/UserControls/SidebarControl.xaml index 4eb2d7b8aadd..11ecc6f13d82 100644 --- a/Files/UserControls/SidebarControl.xaml +++ b/Files/UserControls/SidebarControl.xaml @@ -136,7 +136,7 @@ ItemInvoked="Sidebar_ItemInvoked" MenuItemTemplateSelector="{StaticResource NavItemSelector}" MenuItemsSource="{x:Bind local3:MainPage.SideBarItems, Mode=OneWay}" - OpenPaneLength="500" + OpenPaneLength="{x:Bind AppSettings.SidebarWidth.Value, Mode=OneWay}" PaneDisplayMode="Left" SelectedItem="{x:Bind SelectedSidebarItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"> diff --git a/Files/Views/ModernShellPage.xaml b/Files/Views/ModernShellPage.xaml index 0734e8a5de1a..8bcacf9267ec 100644 --- a/Files/Views/ModernShellPage.xaml +++ b/Files/Views/ModernShellPage.xaml @@ -162,7 +162,9 @@ - + From 2d8c3de90017c5b8bdbc68c048519227f813a39e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20K=C3=A9kesi?= <64812024+KristofKekesi@users.noreply.github.com> Date: Fri, 18 Dec 2020 18:05:49 +0100 Subject: [PATCH 17/27] =?UTF-8?q?=F0=9F=93=93=20Updated=20HUN=20(#2634)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Files/MultilingualResources/Files.hu-HU.xlf | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Files/MultilingualResources/Files.hu-HU.xlf b/Files/MultilingualResources/Files.hu-HU.xlf index a39c79be0fb3..624c7a557e88 100644 --- a/Files/MultilingualResources/Files.hu-HU.xlf +++ b/Files/MultilingualResources/Files.hu-HU.xlf @@ -1696,7 +1696,7 @@ Contributor - Contributor + Közreműködő Last Author @@ -1900,19 +1900,19 @@ See who contributed to Files - See who contributed to Files + Közreműködők Find out what's new in Files - Find out what's new in Files + Újdonságok a Files-ban Send the developers an issue report with more information - Send the developers an issue report with more information + Visszajelzés küldése a fejlesztőknek Support us on PayPal - Support us on PayPal + Támogatás PayPal-on List and sort directories alongside files @@ -1920,25 +1920,25 @@ Details - Details + Részletek No - No + Nem Do you want to download and install the latest version of Files? - 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 - Yes + Igen Updates Available - Updates Available + Frissítés elérhető - \ No newline at end of file + From cec90960050b8697fe54b87efa789f8daa87f93d Mon Sep 17 00:00:00 2001 From: Kacper Szymczuch Date: Fri, 18 Dec 2020 21:24:11 +0100 Subject: [PATCH 18/27] Updated polish translation (#2635) --- Files/MultilingualResources/Files.pl-PL.xlf | 104 ++++++++++---------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/Files/MultilingualResources/Files.pl-PL.xlf b/Files/MultilingualResources/Files.pl-PL.xlf index e2ff295ee43e..d72a82924e80 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 @@ -287,7 +287,7 @@ QuickLook - QuickLook + Szybki podgląd Please verify the translation’s accuracy as the source string was updated after it was translated. @@ -296,7 +296,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. @@ -365,12 +365,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 +378,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. @@ -611,7 +611,7 @@ Layout mode - Tryb układu + Układu Selection options @@ -891,7 +891,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 +928,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 +957,15 @@ Working directory: - Katalog roboczy + Katalog roboczy Application - Aplikacja + Aplikacja File - Plik + Plik Folder @@ -973,19 +973,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 +997,11 @@ Open file location - Otwórz lokalizację pliku + Otwórz lokalizację pliku Unknown - Nieznany + Nieznany Open log location @@ -1013,15 +1013,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 +1029,7 @@ Release Notes - Informacje o wersji + Informacje o wersji Find out what's new in Files @@ -1045,7 +1045,7 @@ Version: - Wersja: + Wersja: There's nothing to share right now... @@ -1073,7 +1073,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 +1093,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 +1117,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 +1125,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 +1137,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,11 +1177,11 @@ Cancel - Anuluj + Anuluj Bitmap Image - Obraz - mapa bitowa + Obraz - mapa bitowa Creates an empty bitmap image file @@ -1197,7 +1197,7 @@ Text Document - Dokument tekstowy + Dokument tekstowy Creates an empty text file @@ -1205,7 +1205,7 @@ Layout mode - Tryb układu + Układ Navigate backwards @@ -1213,7 +1213,7 @@ Navigate forward - Nawiguj do przodu + Nawiguj do przodu Refresh the directory @@ -1950,4 +1950,4 @@ - \ No newline at end of file + From d0491a1a8e25ea8ef5f4949fc7f76e6f7fdd5c31 Mon Sep 17 00:00:00 2001 From: Marco Gavelli Date: Sun, 20 Dec 2020 00:16:34 +0100 Subject: [PATCH 19/27] Set focus on file list when changing folder (#2636) --- Files/BaseLayout.cs | 4 ++++ Files/Views/LayoutModes/GenericFileBrowser.xaml.cs | 5 +++++ Files/Views/LayoutModes/GridViewBrowser.xaml.cs | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/Files/BaseLayout.cs b/Files/BaseLayout.cs index ca23b7ef8d91..0fb2f561df1f 100644 --- a/Files/BaseLayout.cs +++ b/Files/BaseLayout.cs @@ -151,6 +151,8 @@ public BaseLayout() } } + public abstract void FocusFileList(); + public abstract void SelectAllItems(); public virtual void InvertSelection() @@ -348,6 +350,8 @@ 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); + + FocusFileList(); // Set focus on layout specific file list control } protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) diff --git a/Files/Views/LayoutModes/GenericFileBrowser.xaml.cs b/Files/Views/LayoutModes/GenericFileBrowser.xaml.cs index 9484a90eae34..fdffefd2e78f 100644 --- a/Files/Views/LayoutModes/GenericFileBrowser.xaml.cs +++ b/Files/Views/LayoutModes/GenericFileBrowser.xaml.cs @@ -175,6 +175,11 @@ public override void ScrollIntoView(ListedItem item) AllView.ScrollIntoView(item, null); } + public override void FocusFileList() + { + AllView.Focus(FocusState.Programmatic); + } + public override void FocusSelectedItems() { AllView.ScrollIntoView(AllView.ItemsSource.Cast().Last(), null); diff --git a/Files/Views/LayoutModes/GridViewBrowser.xaml.cs b/Files/Views/LayoutModes/GridViewBrowser.xaml.cs index 1e5998d93545..b7d385434d85 100644 --- a/Files/Views/LayoutModes/GridViewBrowser.xaml.cs +++ b/Files/Views/LayoutModes/GridViewBrowser.xaml.cs @@ -38,6 +38,11 @@ private async void SelectionRectangle_SelectionEnded(object sender, EventArgs e) FileList.Focus(FocusState.Programmatic); } + public override void FocusFileList() + { + FileList.Focus(FocusState.Programmatic); + } + private void AppSettings_LayoutModeChangeRequested(object sender, EventArgs e) { SetItemTemplate(); // Set ItemTemplate From 947c00b80c54b7a1d1e72d2d87aa39beff3cb00a Mon Sep 17 00:00:00 2001 From: Marco Gavelli Date: Sun, 20 Dec 2020 00:22:07 +0100 Subject: [PATCH 20/27] Load file icons from storagefile if fulltrustprocess fails (#2637) --- Files/View Models/ItemViewModel.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Files/View Models/ItemViewModel.cs b/Files/View Models/ItemViewModel.cs index f61b849cc9f5..453989714e49 100644 --- a/Files/View Models/ItemViewModel.cs +++ b/Files/View Models/ItemViewModel.cs @@ -644,6 +644,19 @@ public async void LoadExtendedItemProperties(ListedItem item, uint thumbnailSize StorageFile matchingStorageItem = await GetFileFromPathAsync(item.ItemPath); if (matchingStorageItem != null) { + if (!matchingItem.LoadFileIcon) // Loading icon from fulltrust process failed + { + using (var Thumbnail = await matchingStorageItem.GetThumbnailAsync(ThumbnailMode.SingleItem, thumbnailSize, ThumbnailOptions.UseCurrentScale)) + { + if (Thumbnail != null) + { + matchingItem.FileImage = new BitmapImage(); + await matchingItem.FileImage.SetSourceAsync(Thumbnail); + matchingItem.LoadUnknownTypeGlyph = false; + matchingItem.LoadFileIcon = true; + } + } + } matchingItem.FolderRelativeId = matchingStorageItem.FolderRelativeId; matchingItem.ItemType = matchingStorageItem.DisplayType; var syncStatus = await CheckCloudDriveSyncStatusAsync(matchingStorageItem); From a469ccf956fc8110960989a2dcb3a26e2f5eb110 Mon Sep 17 00:00:00 2001 From: Marco Gavelli Date: Sun, 20 Dec 2020 00:27:23 +0100 Subject: [PATCH 21/27] Added an option to show system files (#2638) --- Files.Launcher/Program.cs | 6 +++++- .../FilesystemOperations.cs | 3 ++- Files/Filesystem/Search/FolderSearch.cs | 4 ++-- Files/MultilingualResources/Files.de-DE.xlf | 8 ++++++++ Files/MultilingualResources/Files.es-ES.xlf | 8 ++++++++ Files/MultilingualResources/Files.fr-FR.xlf | 8 ++++++++ Files/MultilingualResources/Files.he-IL.xlf | 8 ++++++++ Files/MultilingualResources/Files.hi-IN.xlf | 8 ++++++++ Files/MultilingualResources/Files.hu-HU.xlf | 8 ++++++++ Files/MultilingualResources/Files.it-IT.xlf | 16 ++++++++++++---- Files/MultilingualResources/Files.ja-JP.xlf | 8 ++++++++ Files/MultilingualResources/Files.nl-NL.xlf | 8 ++++++++ Files/MultilingualResources/Files.or-IN.xlf | 8 ++++++++ Files/MultilingualResources/Files.pl-PL.xlf | 8 ++++++++ Files/MultilingualResources/Files.pt-BR.xlf | 8 ++++++++ Files/MultilingualResources/Files.ru-RU.xlf | 8 ++++++++ Files/MultilingualResources/Files.ta.xlf | 8 ++++++++ Files/MultilingualResources/Files.tr-TR.xlf | 8 ++++++++ Files/MultilingualResources/Files.uk-UA.xlf | 8 ++++++++ Files/MultilingualResources/Files.zh-Hans.xlf | 8 ++++++++ Files/MultilingualResources/Files.zh-Hant.xlf | 8 ++++++++ Files/Strings/en-US/Resources.resw | 6 ++++++ Files/Strings/it-IT/Resources.resw | 18 ++++++++++++++++++ Files/View Models/ItemViewModel.cs | 4 ++-- Files/View Models/SettingsViewModel.cs | 6 ++++++ Files/Views/SettingsPages/FilesAndFolders.xaml | 6 ++++++ 26 files changed, 195 insertions(+), 10 deletions(-) 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/Filesystem/FilesystemOperations/FilesystemOperations.cs b/Files/Filesystem/FilesystemOperations/FilesystemOperations.cs index 291d457fdae5..787ac5bc88b6 100644 --- a/Files/Filesystem/FilesystemOperations/FilesystemOperations.cs +++ b/Files/Filesystem/FilesystemOperations/FilesystemOperations.cs @@ -349,7 +349,8 @@ public async Task DeleteAsync(PathWithType source, { "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) diff --git a/Files/Filesystem/Search/FolderSearch.cs b/Files/Filesystem/Search/FolderSearch.cs index 690c80e2f39c..3f4f749ac2b0 100644 --- a/Files/Filesystem/Search/FolderSearch.cs +++ b/Files/Filesystem/Search/FolderSearch.cs @@ -117,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) diff --git a/Files/MultilingualResources/Files.de-DE.xlf b/Files/MultilingualResources/Files.de-DE.xlf index dc306314907e..9e1304201286 100644 --- a/Files/MultilingualResources/Files.de-DE.xlf +++ b/Files/MultilingualResources/Files.de-DE.xlf @@ -1939,6 +1939,14 @@ 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) + diff --git a/Files/MultilingualResources/Files.es-ES.xlf b/Files/MultilingualResources/Files.es-ES.xlf index ef8f6b8b396f..429d455a0afd 100644 --- a/Files/MultilingualResources/Files.es-ES.xlf +++ b/Files/MultilingualResources/Files.es-ES.xlf @@ -1938,6 +1938,14 @@ 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) + diff --git a/Files/MultilingualResources/Files.fr-FR.xlf b/Files/MultilingualResources/Files.fr-FR.xlf index 311ab2cf5b59..58f74b29d5a3 100644 --- a/Files/MultilingualResources/Files.fr-FR.xlf +++ b/Files/MultilingualResources/Files.fr-FR.xlf @@ -1938,6 +1938,14 @@ 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) + diff --git a/Files/MultilingualResources/Files.he-IL.xlf b/Files/MultilingualResources/Files.he-IL.xlf index d0a990c8ccc2..ea82e4bba87c 100644 --- a/Files/MultilingualResources/Files.he-IL.xlf +++ b/Files/MultilingualResources/Files.he-IL.xlf @@ -1938,6 +1938,14 @@ 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) + diff --git a/Files/MultilingualResources/Files.hi-IN.xlf b/Files/MultilingualResources/Files.hi-IN.xlf index 23ae7fc7689a..5862ad1b2413 100644 --- a/Files/MultilingualResources/Files.hi-IN.xlf +++ b/Files/MultilingualResources/Files.hi-IN.xlf @@ -1948,6 +1948,14 @@ 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) + diff --git a/Files/MultilingualResources/Files.hu-HU.xlf b/Files/MultilingualResources/Files.hu-HU.xlf index 624c7a557e88..55760208f401 100644 --- a/Files/MultilingualResources/Files.hu-HU.xlf +++ b/Files/MultilingualResources/Files.hu-HU.xlf @@ -1938,6 +1938,14 @@ 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) + diff --git a/Files/MultilingualResources/Files.it-IT.xlf b/Files/MultilingualResources/Files.it-IT.xlf index c295f407bc21..e0466d0dd714 100644 --- a/Files/MultilingualResources/Files.it-IT.xlf +++ b/Files/MultilingualResources/Files.it-IT.xlf @@ -1925,19 +1925,27 @@ No - 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? + Vuoi scaricare e installare l'ultima versione di Files? Yes - Yes + Updates Available - 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) diff --git a/Files/MultilingualResources/Files.ja-JP.xlf b/Files/MultilingualResources/Files.ja-JP.xlf index bd295878c3c6..94bf9d07a367 100644 --- a/Files/MultilingualResources/Files.ja-JP.xlf +++ b/Files/MultilingualResources/Files.ja-JP.xlf @@ -1938,6 +1938,14 @@ 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) + diff --git a/Files/MultilingualResources/Files.nl-NL.xlf b/Files/MultilingualResources/Files.nl-NL.xlf index 57eaae4b00f4..013a01bd82aa 100644 --- a/Files/MultilingualResources/Files.nl-NL.xlf +++ b/Files/MultilingualResources/Files.nl-NL.xlf @@ -1950,6 +1950,14 @@ 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) + diff --git a/Files/MultilingualResources/Files.or-IN.xlf b/Files/MultilingualResources/Files.or-IN.xlf index 9fd85a3912e3..87eef0467b86 100644 --- a/Files/MultilingualResources/Files.or-IN.xlf +++ b/Files/MultilingualResources/Files.or-IN.xlf @@ -1948,6 +1948,14 @@ 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) + diff --git a/Files/MultilingualResources/Files.pl-PL.xlf b/Files/MultilingualResources/Files.pl-PL.xlf index d72a82924e80..602229210729 100644 --- a/Files/MultilingualResources/Files.pl-PL.xlf +++ b/Files/MultilingualResources/Files.pl-PL.xlf @@ -1947,6 +1947,14 @@ 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) + diff --git a/Files/MultilingualResources/Files.pt-BR.xlf b/Files/MultilingualResources/Files.pt-BR.xlf index ba751940a6b5..04ae09c3c508 100644 --- a/Files/MultilingualResources/Files.pt-BR.xlf +++ b/Files/MultilingualResources/Files.pt-BR.xlf @@ -1938,6 +1938,14 @@ 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) + diff --git a/Files/MultilingualResources/Files.ru-RU.xlf b/Files/MultilingualResources/Files.ru-RU.xlf index e88b3838d393..106aa063d518 100644 --- a/Files/MultilingualResources/Files.ru-RU.xlf +++ b/Files/MultilingualResources/Files.ru-RU.xlf @@ -1938,6 +1938,14 @@ 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) + diff --git a/Files/MultilingualResources/Files.ta.xlf b/Files/MultilingualResources/Files.ta.xlf index 664e1c88acec..70c33c05ce2f 100644 --- a/Files/MultilingualResources/Files.ta.xlf +++ b/Files/MultilingualResources/Files.ta.xlf @@ -1943,6 +1943,14 @@ 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) + diff --git a/Files/MultilingualResources/Files.tr-TR.xlf b/Files/MultilingualResources/Files.tr-TR.xlf index 248a00a6c198..3859e286042d 100644 --- a/Files/MultilingualResources/Files.tr-TR.xlf +++ b/Files/MultilingualResources/Files.tr-TR.xlf @@ -1945,6 +1945,14 @@ 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) + diff --git a/Files/MultilingualResources/Files.uk-UA.xlf b/Files/MultilingualResources/Files.uk-UA.xlf index 480266ad478b..e3b8481be7ed 100644 --- a/Files/MultilingualResources/Files.uk-UA.xlf +++ b/Files/MultilingualResources/Files.uk-UA.xlf @@ -1938,6 +1938,14 @@ 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) + diff --git a/Files/MultilingualResources/Files.zh-Hans.xlf b/Files/MultilingualResources/Files.zh-Hans.xlf index 4be97d203f11..3d91443a7fc5 100644 --- a/Files/MultilingualResources/Files.zh-Hans.xlf +++ b/Files/MultilingualResources/Files.zh-Hans.xlf @@ -1943,6 +1943,14 @@ 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) + diff --git a/Files/MultilingualResources/Files.zh-Hant.xlf b/Files/MultilingualResources/Files.zh-Hant.xlf index 24af692b1953..e035ab9b65c0 100644 --- a/Files/MultilingualResources/Files.zh-Hant.xlf +++ b/Files/MultilingualResources/Files.zh-Hant.xlf @@ -1947,6 +1947,14 @@ 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) + diff --git a/Files/Strings/en-US/Resources.resw b/Files/Strings/en-US/Resources.resw index 3e51deb636d0..82ce0eac5055 100644 --- a/Files/Strings/en-US/Resources.resw +++ b/Files/Strings/en-US/Resources.resw @@ -1566,4 +1566,10 @@ 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/it-IT/Resources.resw b/Files/Strings/it-IT/Resources.resw index 9f5934cd883c..9cf26f8f554f 100644 --- a/Files/Strings/it-IT/Resources.resw +++ b/Files/Strings/it-IT/Resources.resw @@ -1449,4 +1449,22 @@ 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) + \ No newline at end of file diff --git a/Files/View Models/ItemViewModel.cs b/Files/View Models/ItemViewModel.cs index 453989714e49..16544effea33 100644 --- a/Files/View Models/ItemViewModel.cs +++ b/Files/View Models/ItemViewModel.cs @@ -1096,9 +1096,9 @@ await Task.Run(async () => 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) diff --git a/Files/View Models/SettingsViewModel.cs b/Files/View Models/SettingsViewModel.cs index da6b1d83b9d0..fbeb0e4bf0cd 100644 --- a/Files/View Models/SettingsViewModel.cs +++ b/Files/View Models/SettingsViewModel.cs @@ -498,6 +498,12 @@ public bool AreHiddenItemsVisible set => Set(value); } + public bool AreSystemItemsHidden + { + get => Get(true); + set => Set(value); + } + public bool ListAndSortDirectoriesAlongsideFiles { get => Get(false); diff --git a/Files/Views/SettingsPages/FilesAndFolders.xaml b/Files/Views/SettingsPages/FilesAndFolders.xaml index db7d8d46a77b..46fb71ab1ec9 100644 --- a/Files/Views/SettingsPages/FilesAndFolders.xaml +++ b/Files/Views/SettingsPages/FilesAndFolders.xaml @@ -32,6 +32,12 @@ HeaderTemplate="{StaticResource CustomHeaderStyle}" IsOn="{x:Bind AppSettings.AreHiddenItemsVisible, Mode=TwoWay}" /> + + Date: Sun, 20 Dec 2020 00:42:17 +0100 Subject: [PATCH 22/27] Fixed some issues with undo/redo (#2632) --- Files/Files.csproj | 2 - .../FilesystemOperations.cs | 77 +++++----- .../Helpers/FilesystemHelpers.cs | 62 ++++---- .../Helpers/IFilesystemHelpers.cs | 18 +-- .../IFilesystemOperations.cs | 12 +- .../FilesystemOperations/PathWithType.cs | 64 -------- .../IStorageItemWithPath.cs | 1 + .../StorageFileHelpers/StorageFileWithPath.cs | 1 + .../StorageFolderWithPath.cs | 1 + .../StorageHistory/IStorageHistory.cs | 8 +- .../StorageHistory/StorageHistory.cs | 15 +- .../StorageHistoryOperations.cs | 45 ++++-- .../StorageHistory/StorageHistoryWrapper.cs | 30 ++-- Files/Helpers/ArrayHelpers.cs | 8 - Files/Helpers/StorageItemHelpers.cs | 145 +++--------------- Files/Interacts/Interaction.cs | 12 +- Files/View Models/ItemViewModel.cs | 4 + Files/Views/ModernShellPage.xaml.cs | 4 +- 18 files changed, 187 insertions(+), 322 deletions(-) delete mode 100644 Files/Filesystem/FilesystemOperations/PathWithType.cs delete mode 100644 Files/Helpers/ArrayHelpers.cs diff --git a/Files/Files.csproj b/Files/Files.csproj index 3dabd3a159de..aa5df1c98126 100644 --- a/Files/Files.csproj +++ b/Files/Files.csproj @@ -200,7 +200,6 @@ - @@ -219,7 +218,6 @@ - diff --git a/Files/Filesystem/FilesystemOperations/FilesystemOperations.cs b/Files/Filesystem/FilesystemOperations/FilesystemOperations.cs index 787ac5bc88b6..2ad11007c78d 100644 --- a/Files/Filesystem/FilesystemOperations/FilesystemOperations.cs +++ b/Files/Filesystem/FilesystemOperations/FilesystemOperations.cs @@ -46,7 +46,7 @@ public FilesystemOperations(IShellPage associatedInstance) #region IFilesystemOperations - public async Task CreateAsync(PathWithType source, IProgress errorCode, CancellationToken cancellationToken) + public async Task CreateAsync(IStorageItemWithPath source, IProgress errorCode, CancellationToken cancellationToken) { try { @@ -54,7 +54,7 @@ public async Task CreateAsync(PathWithType source, IProgress 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,12 +121,12 @@ 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) || + 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,14 +168,14 @@ 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 => { @@ -201,7 +200,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 +208,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 +221,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 +252,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 +263,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 +299,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, @@ -392,7 +387,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); @@ -427,7 +422,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) { @@ -439,7 +434,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, @@ -457,11 +452,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) { @@ -473,7 +468,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, @@ -490,7 +485,7 @@ public async Task RestoreFromTrashAsync(PathWithType source, fsResult = sourceFolder.ErrorCode | destinationFolder.ErrorCode; errorCode?.Report(fsResult); - if (sourceFolder && destinationFolder) + if (fsResult) { fsResult = await FilesystemTasks.Wrap(() => { @@ -510,7 +505,7 @@ public async Task RestoreFromTrashAsync(PathWithType source, fsResult = sourceFile.ErrorCode | destinationFolder.ErrorCode; errorCode?.Report(fsResult); - if (sourceFile && destinationFolder) + if (fsResult) { fsResult = await FilesystemTasks.Wrap(() => { @@ -519,13 +514,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) @@ -544,7 +547,7 @@ 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 IFilesystemOperations diff --git a/Files/Filesystem/FilesystemOperations/Helpers/FilesystemHelpers.cs b/Files/Filesystem/FilesystemOperations/Helpers/FilesystemHelpers.cs index bad600d7662d..7240785d7953 100644 --- a/Files/Filesystem/FilesystemOperations/Helpers/FilesystemHelpers.cs +++ b/Files/Filesystem/FilesystemOperations/Helpers/FilesystemHelpers.cs @@ -63,7 +63,7 @@ public FilesystemHelpers(IShellPage associatedInstance, CancellationToken cancel #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(); @@ -83,10 +83,10 @@ public async Task CreateAsync(PathWithType source, bool registerHi #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); @@ -399,7 +399,7 @@ public async Task DeleteItemAsync(IStorageItem source, bool showDi #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; } @@ -588,15 +596,15 @@ public async Task CopyItemsFromClipboard(DataPackageView packageVi 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, @@ -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(); diff --git a/Files/Filesystem/FilesystemOperations/Helpers/IFilesystemHelpers.cs b/Files/Filesystem/FilesystemOperations/Helpers/IFilesystemHelpers.cs index 435a67de23ac..f0a36ebdb3e7 100644 --- a/Files/Filesystem/FilesystemOperations/Helpers/IFilesystemHelpers.cs +++ b/Files/Filesystem/FilesystemOperations/Helpers/IFilesystemHelpers.cs @@ -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,7 +58,7 @@ 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 Delete @@ -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 @@ -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 @@ -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 7ddc59fa4793..22a24fde0c3b 100644 --- a/Files/Filesystem/FilesystemOperations/IFilesystemOperations.cs +++ b/Files/Filesystem/FilesystemOperations/IFilesystemOperations.cs @@ -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 5eb507386d4b..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 Public Properties - - #region Constructor - - public PathWithType(string path, FilesystemItemType itemType) - { - Path = path; - ItemType = itemType; - } - - #endregion Constructor - - #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 Operators - - #region Override - - public override string ToString() - { - return Path; - } - - #endregion Override - - #region IDisposable - - public void Dispose() - { - Path ??= string.Empty; - - Path = null; - } - - #endregion IDisposable - } -} \ No newline at end of file diff --git a/Files/Filesystem/StorageFileHelpers/IStorageItemWithPath.cs b/Files/Filesystem/StorageFileHelpers/IStorageItemWithPath.cs index da51720b68f4..46e508639700 100644 --- a/Files/Filesystem/StorageFileHelpers/IStorageItemWithPath.cs +++ b/Files/Filesystem/StorageFileHelpers/IStorageItemWithPath.cs @@ -7,5 +7,6 @@ public interface IStorageItemWithPath // TODO: Maybe use here : IStorageItem ins { 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/IStorageHistory.cs b/Files/Filesystem/StorageHistory/IStorageHistory.cs index 48bda14e6416..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,15 +29,15 @@ 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 Modify } diff --git a/Files/Filesystem/StorageHistory/StorageHistory.cs b/Files/Filesystem/StorageHistory/StorageHistory.cs index f1e330eedd8e..458687d2050c 100644 --- a/Files/Filesystem/StorageHistory/StorageHistory.cs +++ b/Files/Filesystem/StorageHistory/StorageHistory.cs @@ -10,22 +10,22 @@ 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 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(); @@ -43,14 +43,14 @@ 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(); @@ -63,9 +63,6 @@ public void Modify(FileOperationType operationType, PathWithType source, PathWit public void Dispose() { - Source?.ForEach((item) => item?.Dispose()); - Destination?.ForEach((item) => item?.Dispose()); - Source = null; Destination = null; } diff --git a/Files/Filesystem/StorageHistory/StorageHistoryOperations.cs b/Files/Filesystem/StorageHistory/StorageHistoryOperations.cs index ebf517d723a1..b65439abe293 100644 --- a/Files/Filesystem/StorageHistory/StorageHistoryOperations.cs +++ b/Files/Filesystem/StorageHistory/StorageHistoryOperations.cs @@ -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; } @@ -316,11 +330,12 @@ await filesystemOperations.RenameAsync( #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 Private Helpers diff --git a/Files/Filesystem/StorageHistory/StorageHistoryWrapper.cs b/Files/Filesystem/StorageHistory/StorageHistoryWrapper.cs index d5d3cf1640a0..92e0911c2c04 100644 --- a/Files/Filesystem/StorageHistory/StorageHistoryWrapper.cs +++ b/Files/Filesystem/StorageHistory/StorageHistoryWrapper.cs @@ -19,7 +19,7 @@ public class StorageHistoryWrapper : IDisposable public StorageHistoryWrapper() { this.storageHistory = new List(); - this.storageHistoryIndex = 0; + this.storageHistoryIndex = -1; } #endregion Constructor @@ -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() @@ -81,7 +90,6 @@ public bool CanRedo() => public void Dispose() { storageHistory?.ForEach((item) => item?.Dispose()); - storageHistory?.ForEach((item) => item = null); storageHistory = null; } diff --git a/Files/Helpers/ArrayHelpers.cs b/Files/Helpers/ArrayHelpers.cs deleted file mode 100644 index 50148fa0c630..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)); - } -} \ No newline at end of file diff --git a/Files/Helpers/StorageItemHelpers.cs b/Files/Helpers/StorageItemHelpers.cs index 262632f76612..110b5ba197ca 100644 --- a/Files/Helpers/StorageItemHelpers.cs +++ b/Files/Helpers/StorageItemHelpers.cs @@ -11,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/Interacts/Interaction.cs b/Files/Interacts/Interaction.cs index 8b5a86b4171c..b26fcb127aac 100644 --- a/Files/Interacts/Interaction.cs +++ b/Files/Interacts/Interaction.cs @@ -806,7 +806,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 +928,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); } @@ -1174,7 +1174,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,7 +1185,7 @@ 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; @@ -1195,7 +1195,7 @@ public async void CreateFileFromDialogResultType(AddItemType itemType) created = await FilesystemTasks.Wrap(async () => { return await FilesystemHelpers.CreateAsync( - new PathWithType(Path.Combine(folderRes.Result.Path, userInput + ".txt"), FilesystemItemType.File), + StorageItemHelpers.FromPathAndType(Path.Combine(folderRes.Result.Path, userInput + ".txt"), FilesystemItemType.File), true); }); break; @@ -1205,7 +1205,7 @@ public async void CreateFileFromDialogResultType(AddItemType itemType) 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 + ".bmp"), FilesystemItemType.File), true); }); break; diff --git a/Files/View Models/ItemViewModel.cs b/Files/View Models/ItemViewModel.cs index 16544effea33..dccd4e22fb79 100644 --- a/Files/View Models/ItemViewModel.cs +++ b/Files/View Models/ItemViewModel.cs @@ -1214,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/Views/ModernShellPage.xaml.cs b/Files/Views/ModernShellPage.xaml.cs index f32e654c4fc1..4083defc7323 100644 --- a/Files/Views/ModernShellPage.xaml.cs +++ b/Files/Views/ModernShellPage.xaml.cs @@ -985,7 +985,7 @@ private async void KeyboardAccelerator_Invoked(KeyboardAccelerator sender, Keybo if (!NavigationToolbar.IsEditModeEnabled && !InstanceViewModel.IsPageTypeSearchResults) { await filesystemHelpers.DeleteItemsAsync( - ContentPage.SelectedItems.Select((item) => new PathWithType( + ContentPage.SelectedItems.Select((item) => StorageItemHelpers.FromPathAndType( item.ItemPath, item.PrimaryItemAttribute == StorageItemTypes.File ? FilesystemItemType.File : FilesystemItemType.Directory)).ToList(), true, true, true); @@ -1053,7 +1053,7 @@ await filesystemHelpers.DeleteItemsAsync( if (ContentPage.IsItemSelected && !ContentPage.IsRenamingItem && !InstanceViewModel.IsPageTypeSearchResults) { await filesystemHelpers.DeleteItemsAsync( - ContentPage.SelectedItems.Select((item) => new PathWithType( + ContentPage.SelectedItems.Select((item) => StorageItemHelpers.FromPathAndType( item.ItemPath, item.PrimaryItemAttribute == StorageItemTypes.File ? FilesystemItemType.File : FilesystemItemType.Directory)).ToList(), true, false, true); From 4398e8280b71a31ac60b3ed6b636e966e84a0c4a Mon Sep 17 00:00:00 2001 From: Marco Gavelli Date: Sun, 20 Dec 2020 03:18:16 +0100 Subject: [PATCH 23/27] Added more file types to the new file menu (#2644) --- Files/BaseLayout.cs | 47 ++++++++ Files/DataModels/ShellNewEntry.cs | 55 +++++++++ Files/Dialogs/AddItemDialog.xaml | 75 +++++++----- Files/Dialogs/AddItemDialog.xaml.cs | 81 +++++++++---- Files/Files.csproj | 2 + .../FilesystemOperations.cs | 12 +- .../StorageFileHelpers/FilesystemResult.cs | 4 +- Files/Helpers/RegistryHelper.cs | 112 ++++++++++++++++++ Files/Interacts/Interaction.cs | 33 ++---- Files/MultilingualResources/Files.de-DE.xlf | 48 +++----- Files/MultilingualResources/Files.es-ES.xlf | 48 +++----- Files/MultilingualResources/Files.fr-FR.xlf | 48 +++----- Files/MultilingualResources/Files.he-IL.xlf | 48 +++----- Files/MultilingualResources/Files.hi-IN.xlf | 48 +++----- Files/MultilingualResources/Files.hu-HU.xlf | 50 +++----- Files/MultilingualResources/Files.it-IT.xlf | 48 +++----- Files/MultilingualResources/Files.ja-JP.xlf | 48 +++----- Files/MultilingualResources/Files.nl-NL.xlf | 48 +++----- Files/MultilingualResources/Files.or-IN.xlf | 48 +++----- Files/MultilingualResources/Files.pl-PL.xlf | 50 +++----- Files/MultilingualResources/Files.pt-BR.xlf | 48 +++----- Files/MultilingualResources/Files.ru-RU.xlf | 48 +++----- Files/MultilingualResources/Files.ta.xlf | 48 +++----- Files/MultilingualResources/Files.tr-TR.xlf | 48 +++----- Files/MultilingualResources/Files.uk-UA.xlf | 48 +++----- Files/MultilingualResources/Files.zh-Hans.xlf | 48 +++----- Files/MultilingualResources/Files.zh-Hant.xlf | 48 +++----- Files/Strings/de-DE/Resources.resw | 24 ---- Files/Strings/en-US/Resources.resw | 28 ++--- Files/Strings/es-ES/Resources.resw | 24 ---- Files/Strings/fr-FR/Resources.resw | 24 ---- Files/Strings/he-IL/Resources.resw | 18 --- Files/Strings/hi-IN/Resources.resw | 18 --- Files/Strings/hu-HU/Resources.resw | 54 +++++---- Files/Strings/it-IT/Resources.resw | 36 ++---- Files/Strings/ja-JP/Resources.resw | 24 ---- Files/Strings/nl-NL/Resources.resw | 18 --- Files/Strings/or-IN/Resources.resw | 18 --- Files/Strings/pl-PL/Resources.resw | 44 ++----- Files/Strings/pt-BR/Resources.resw | 24 ---- Files/Strings/ru-RU/Resources.resw | 24 ---- Files/Strings/ta/Resources.resw | 24 ---- Files/Strings/tr-TR/Resources.resw | 21 ---- Files/Strings/uk-UA/Resources.resw | 24 ---- Files/Strings/zh-Hans/Resources.resw | 24 ---- Files/Strings/zh-Hant/Resources.resw | 12 -- Files/UserControls/NavigationToolbar.xaml | 26 ++-- Files/UserControls/NavigationToolbar.xaml.cs | 89 ++++++++++---- .../Views/LayoutModes/GenericFileBrowser.xaml | 21 +--- Files/Views/LayoutModes/GridViewBrowser.xaml | 21 +--- Files/Views/ModernShellPage.xaml | 3 +- Files/Views/ModernShellPage.xaml.cs | 6 +- 52 files changed, 779 insertions(+), 1159 deletions(-) create mode 100644 Files/DataModels/ShellNewEntry.cs create mode 100644 Files/Helpers/RegistryHelper.cs diff --git a/Files/BaseLayout.cs b/Files/BaseLayout.cs index 0fb2f561df1f..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; @@ -136,6 +137,8 @@ internal set public ListedItem SelectedItem { get; private set; } + private List cachedNewContextMenuEntries { get; set; } + public BaseLayout() { SelectedItemsPropertiesViewModel = new SelectedItemsPropertiesViewModel(this); @@ -351,6 +354,8 @@ 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 } @@ -509,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) 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 bae12834751a..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/Files.csproj b/Files/Files.csproj index aa5df1c98126..b958b2b64f9b 100644 --- a/Files/Files.csproj +++ b/Files/Files.csproj @@ -164,6 +164,7 @@ + @@ -179,6 +180,7 @@ RestartDialog.xaml + diff --git a/Files/Filesystem/FilesystemOperations/FilesystemOperations.cs b/Files/Filesystem/FilesystemOperations/FilesystemOperations.cs index 2ad11007c78d..1a5017422912 100644 --- a/Files/Filesystem/FilesystemOperations/FilesystemOperations.cs +++ b/Files/Filesystem/FilesystemOperations/FilesystemOperations.cs @@ -54,8 +54,16 @@ public async Task CreateAsync(IStorageItemWithPath source, IPro { case FilesystemItemType.File: { - StorageFolder folder = await associatedInstance.FilesystemViewModel.GetFolderFromPathAsync(Path.GetDirectoryName(source.Path)); - await folder.CreateFileAsync(Path.GetFileName(source.Path)); + var newEntryInfo = await RegistryHelper.GetNewContextMenuEntryForType(Path.GetExtension(source.Path)); + if (newEntryInfo == null) + { + StorageFolder folder = await associatedInstance.FilesystemViewModel.GetFolderFromPathAsync(Path.GetDirectoryName(source.Path)); + await folder.CreateFileAsync(Path.GetFileName(source.Path)); + } + else + { + await newEntryInfo.Create(source.Path, associatedInstance); + } break; } 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/Helpers/RegistryHelper.cs b/Files/Helpers/RegistryHelper.cs new file mode 100644 index 000000000000..fbe8bea149ce --- /dev/null +++ b/Files/Helpers/RegistryHelper.cs @@ -0,0 +1,112 @@ +using Files.DataModels; +using Files.Filesystem; +using Microsoft.Win32; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Windows.Storage; + +namespace Files.Helpers +{ + public 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.OpenSubKey(keyName); + 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.OpenSubKey(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.OpenSubKey(keyName); + 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; + } + } +} diff --git a/Files/Interacts/Interaction.cs b/Files/Interacts/Interaction.cs index b26fcb127aac..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; @@ -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) @@ -1190,22 +1191,12 @@ public async void CreateFileFromDialogResultType(AddItemType itemType) }); 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( - StorageItemHelpers.FromPathAndType(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( - StorageItemHelpers.FromPathAndType(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()); diff --git a/Files/MultilingualResources/Files.de-DE.xlf b/Files/MultilingualResources/Files.de-DE.xlf index 9e1304201286..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 @@ -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 @@ -1947,6 +1915,22 @@ 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 429d455a0afd..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 @@ -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 @@ -1946,6 +1914,22 @@ 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 58f74b29d5a3..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 @@ -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 @@ -1946,6 +1914,22 @@ 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 ea82e4bba87c..9c6570358717 100644 --- a/Files/MultilingualResources/Files.he-IL.xlf +++ b/Files/MultilingualResources/Files.he-IL.xlf @@ -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 מצב פריסה @@ -1946,6 +1914,22 @@ 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 5862ad1b2413..83673e527987 100644 --- a/Files/MultilingualResources/Files.hi-IN.xlf +++ b/Files/MultilingualResources/Files.hi-IN.xlf @@ -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 @@ -1956,6 +1924,22 @@ 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 55760208f401..e321ee43da71 100644 --- a/Files/MultilingualResources/Files.hu-HU.xlf +++ b/Files/MultilingualResources/Files.hu-HU.xlf @@ -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 @@ -1946,7 +1914,23 @@ 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 + - + \ No newline at end of file diff --git a/Files/MultilingualResources/Files.it-IT.xlf b/Files/MultilingualResources/Files.it-IT.xlf index e0466d0dd714..6fb8e738c517 100644 --- a/Files/MultilingualResources/Files.it-IT.xlf +++ b/Files/MultilingualResources/Files.it-IT.xlf @@ -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 @@ -1947,6 +1915,22 @@ 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 94bf9d07a367..9725e6838ca0 100644 --- a/Files/MultilingualResources/Files.ja-JP.xlf +++ b/Files/MultilingualResources/Files.ja-JP.xlf @@ -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 レイアウト モード @@ -1946,6 +1914,22 @@ 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 013a01bd82aa..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 @@ -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 @@ -1958,6 +1926,22 @@ 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 87eef0467b86..962adef4c4ff 100644 --- a/Files/MultilingualResources/Files.or-IN.xlf +++ b/Files/MultilingualResources/Files.or-IN.xlf @@ -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 @@ -1956,6 +1924,22 @@ 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 602229210729..1c35ecd96356 100644 --- a/Files/MultilingualResources/Files.pl-PL.xlf +++ b/Files/MultilingualResources/Files.pl-PL.xlf @@ -229,14 +229,6 @@ Folder Folder - - Bitmap Image - Obraz - mapa bitowa - - - Text Document - Dokument tekstowy - Properties Właściwości @@ -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. @@ -1179,14 +1163,6 @@ Cancel Anuluj - - Bitmap Image - Obraz - mapa bitowa - - - Creates an empty bitmap image file - Tworzy pusty plik obrazu bitmapowego - Folder Folder @@ -1195,14 +1171,6 @@ Creates an empty folder Tworzy pusty folder - - Text Document - Dokument tekstowy - - - Creates an empty text file - Tworzy pusty plik tekstowy - Layout mode Układ @@ -1955,7 +1923,23 @@ 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 + - + \ No newline at end of file diff --git a/Files/MultilingualResources/Files.pt-BR.xlf b/Files/MultilingualResources/Files.pt-BR.xlf index 04ae09c3c508..117b79d91223 100644 --- a/Files/MultilingualResources/Files.pt-BR.xlf +++ b/Files/MultilingualResources/Files.pt-BR.xlf @@ -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 @@ -1946,6 +1914,22 @@ 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 106aa063d518..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 Свойства @@ -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 Вид значков @@ -1946,6 +1914,22 @@ 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 70c33c05ce2f..d80c8f1d4a1c 100644 --- a/Files/MultilingualResources/Files.ta.xlf +++ b/Files/MultilingualResources/Files.ta.xlf @@ -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 தளவமைப்பு முறை @@ -1951,6 +1919,22 @@ 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 3859e286042d..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 @@ -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 @@ -1953,6 +1921,22 @@ 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 e3b8481be7ed..cb1d917bb94e 100644 --- a/Files/MultilingualResources/Files.uk-UA.xlf +++ b/Files/MultilingualResources/Files.uk-UA.xlf @@ -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 Вид піктограм @@ -1946,6 +1914,22 @@ 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 3d91443a7fc5..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 属性 @@ -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 布局模式 @@ -1951,6 +1919,22 @@ 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 e035ab9b65c0..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 內容 @@ -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 @@ -1955,6 +1923,22 @@ 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/Strings/de-DE/Resources.resw b/Files/Strings/de-DE/Resources.resw index b57495f1badc..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 @@ -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 82ce0eac5055..0f739129ec0b 100644 --- a/Files/Strings/en-US/Resources.resw +++ b/Files/Strings/en-US/Resources.resw @@ -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 diff --git a/Files/Strings/es-ES/Resources.resw b/Files/Strings/es-ES/Resources.resw index e6a506eaa232..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 @@ -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 diff --git a/Files/Strings/fr-FR/Resources.resw b/Files/Strings/fr-FR/Resources.resw index 85052481ab2c..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 @@ -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 diff --git a/Files/Strings/he-IL/Resources.resw b/Files/Strings/he-IL/Resources.resw index 9b308b7b4fbd..747e10a13a61 100644 --- a/Files/Strings/he-IL/Resources.resw +++ b/Files/Strings/he-IL/Resources.resw @@ -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 7cd438ba5488..ad3edb3290f9 100644 --- a/Files/Strings/hi-IN/Resources.resw +++ b/Files/Strings/hi-IN/Resources.resw @@ -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 f629e2b1e04e..c2360f43351f 100644 --- a/Files/Strings/hu-HU/Resources.resw +++ b/Files/Strings/hu-HU/Resources.resw @@ -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 @@ -1224,6 +1200,9 @@ Év + + Közreműködő + Felülvizsgálat száma @@ -1365,7 +1344,34 @@ 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 9cf26f8f554f..75204223ed56 100644 --- a/Files/Strings/it-IT/Resources.resw +++ b/Files/Strings/it-IT/Resources.resw @@ -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 @@ -1467,4 +1443,16 @@ 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 417be2ecf3d1..47055cfcbba7 100644 --- a/Files/Strings/ja-JP/Resources.resw +++ b/Files/Strings/ja-JP/Resources.resw @@ -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 f932b4bac2e8..428c5445d2c4 100644 --- a/Files/Strings/nl-NL/Resources.resw +++ b/Files/Strings/nl-NL/Resources.resw @@ -177,12 +177,6 @@ Map - - Bitmapafbeelding - - - Tekstdocument - Eigenschappen @@ -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 dfce556a093e..976155d0f5cc 100644 --- a/Files/Strings/or-IN/Resources.resw +++ b/Files/Strings/or-IN/Resources.resw @@ -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 ce4bf014f1a5..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 @@ -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 faf5f8fddf83..ecfe53de236e 100644 --- a/Files/Strings/pt-BR/Resources.resw +++ b/Files/Strings/pt-BR/Resources.resw @@ -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 8cacabd32b48..9e7b2e390261 100644 --- a/Files/Strings/ru-RU/Resources.resw +++ b/Files/Strings/ru-RU/Resources.resw @@ -195,12 +195,6 @@ Папку - - Изображение - - - Текстовый документ - Свойства @@ -312,12 +306,6 @@ Новая папка - - Новый текстовый документ - - - Рисунок - Эта папка пуста. @@ -882,24 +870,12 @@ Отмена - - Изображение - - - Создает пустой файл изображения - Папка Создает пустую папку - - Текстовый документ - - - Создает пустой текстовый документ. - Вид значков diff --git a/Files/Strings/ta/Resources.resw b/Files/Strings/ta/Resources.resw index f90f2b18cfe5..d257a81c767a 100644 --- a/Files/Strings/ta/Resources.resw +++ b/Files/Strings/ta/Resources.resw @@ -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 8bdee799a900..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 @@ -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 066d4b79092b..60a8c31f61f5 100644 --- a/Files/Strings/uk-UA/Resources.resw +++ b/Files/Strings/uk-UA/Resources.resw @@ -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 5f554a8f8734..492795adabdb 100644 --- a/Files/Strings/zh-Hans/Resources.resw +++ b/Files/Strings/zh-Hans/Resources.resw @@ -177,12 +177,6 @@ 文件夹 - - 位图 - - - 文本文档 - 属性 @@ -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 132b14a1cccd..d55b2039148a 100644 --- a/Files/Strings/zh-Hant/Resources.resw +++ b/Files/Strings/zh-Hant/Resources.resw @@ -177,12 +177,6 @@ 資料夾 - - Bitmap 點陣圖 - - - 文字文件 - 內容 @@ -315,12 +309,6 @@ 新增資料夾 - - 新增文字文件 - - - 新增 Bitmap 點陣圖 - 該資料夾為空。 diff --git a/Files/UserControls/NavigationToolbar.xaml b/Files/UserControls/NavigationToolbar.xaml index f7d54f9b5bfe..d8ef99907e2f 100644 --- a/Files/UserControls/NavigationToolbar.xaml +++ b/Files/UserControls/NavigationToolbar.xaml @@ -996,7 +996,8 @@ ToolTipService.ToolTip="More options" Visibility="Visible"> - + - + + Text="File"> - - - - - - + diff --git a/Files/UserControls/NavigationToolbar.xaml.cs b/Files/UserControls/NavigationToolbar.xaml.cs index 4ed7a140242c..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; @@ -22,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 @@ -165,41 +168,22 @@ public bool CanOpenTerminalInPage } } - public static readonly DependencyProperty NewDocumentInvokedCommandProperty = DependencyProperty.Register( - "NewDocumentInvokedCommand", + public static readonly DependencyProperty NewFileInvokedCommandProperty = DependencyProperty.Register( + "NewFileInvokedCommand", typeof(ICommand), typeof(NavigationToolbar), new PropertyMetadata(null) ); - public ICommand NewDocumentInvokedCommand + public ICommand NewFileInvokedCommand { get { - return (ICommand)GetValue(NewDocumentInvokedCommandProperty); + return (ICommand)GetValue(NewFileInvokedCommandProperty); } set { - SetValue(NewDocumentInvokedCommandProperty, value); - } - } - - public static readonly DependencyProperty NewImageInvokedCommandProperty = DependencyProperty.Register( - "NewImageInvokedCommand", - typeof(ICommand), - typeof(NavigationToolbar), - new PropertyMetadata(null) - ); - - public ICommand NewImageInvokedCommand - { - get - { - return (ICommand)GetValue(NewImageInvokedCommandProperty); - } - 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; @@ -818,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/Views/LayoutModes/GenericFileBrowser.xaml b/Files/Views/LayoutModes/GenericFileBrowser.xaml index 93b19389f570..518ba96887a7 100644 --- a/Files/Views/LayoutModes/GenericFileBrowser.xaml +++ b/Files/Views/LayoutModes/GenericFileBrowser.xaml @@ -194,23 +194,14 @@ - - - - - - + + Text="File"> diff --git a/Files/Views/LayoutModes/GridViewBrowser.xaml b/Files/Views/LayoutModes/GridViewBrowser.xaml index 86953b451691..2e3063bf1389 100644 --- a/Files/Views/LayoutModes/GridViewBrowser.xaml +++ b/Files/Views/LayoutModes/GridViewBrowser.xaml @@ -170,23 +170,14 @@ - - - - - - + + Text="File"> diff --git a/Files/Views/ModernShellPage.xaml b/Files/Views/ModernShellPage.xaml index 8bcacf9267ec..67173331607b 100644 --- a/Files/Views/ModernShellPage.xaml +++ b/Files/Views/ModernShellPage.xaml @@ -201,9 +201,8 @@ CopyPathInvokedCommand="{x:Bind InteractionOperations.CopyPathOfWorkingDirectory, Mode=OneWay}" IsCreateButtonEnabledInPage="{x:Bind InstanceViewModel.IsCreateButtonEnabledInPage, Mode=OneWay}" IsPageTypeNotHome="{x:Bind InstanceViewModel.IsPageTypeNotHome, Mode=OneWay}" - NewDocumentInvokedCommand="{x:Bind InteractionOperations.CreateNewTextDocument, Mode=OneWay}" + NewFileInvokedCommand="{x:Bind InteractionOperations.CreateNewFile, Mode=OneWay}" NewFolderInvokedCommand="{x:Bind InteractionOperations.CreateNewFolder, Mode=OneWay}" - NewImageInvokedCommand="{x:Bind InteractionOperations.CreateNewBitmapImage, Mode=OneWay}" NewTabInvokedCommand="{x:Bind InteractionOperations.AddNewTabToMultitaskingControl, Mode=OneWay}" NewWindowInvokedCommand="{x:Bind InteractionOperations.OpenNewWindow, Mode=OneWay}" OpenInTerminalInvokedCommand="{x:Bind InteractionOperations.OpenDirectoryInDefaultTerminal, Mode=OneWay}" diff --git a/Files/Views/ModernShellPage.xaml.cs b/Files/Views/ModernShellPage.xaml.cs index 4083defc7323..d7000dbbb9ac 100644 --- a/Files/Views/ModernShellPage.xaml.cs +++ b/Files/Views/ModernShellPage.xaml.cs @@ -974,9 +974,11 @@ private async void KeyboardAccelerator_Invoked(KeyboardAccelerator sender, Keybo { var addItemDialog = new AddItemDialog(); await addItemDialog.ShowAsync(); - if (addItemDialog.ResultType != AddItemType.Cancel) + if (addItemDialog.ResultType.ItemType != AddItemType.Cancel) { - InteractionOperations.CreateFileFromDialogResultType(addItemDialog.ResultType); + InteractionOperations.CreateFileFromDialogResultType( + addItemDialog.ResultType.ItemType, + addItemDialog.ResultType.ItemInfo); } } break; From d77c162407fd381fbbabc8ef7173910bbef79bdf Mon Sep 17 00:00:00 2001 From: Marco Gavelli Date: Sun, 20 Dec 2020 16:38:00 +0100 Subject: [PATCH 24/27] Fixed crash on app launch (#2648) --- Files/Controllers/TerminalController.cs | 84 ++++++++++++++++--------- Files/Helpers/RegistryHelper.cs | 34 +++++++--- 2 files changed, 81 insertions(+), 37 deletions(-) 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/Helpers/RegistryHelper.cs b/Files/Helpers/RegistryHelper.cs index fbe8bea149ce..3e16b59f321a 100644 --- a/Files/Helpers/RegistryHelper.cs +++ b/Files/Helpers/RegistryHelper.cs @@ -5,13 +5,14 @@ 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 class RegistryHelper + public static class RegistryHelper { public static async Task> GetNewContextMenuEntries() { @@ -19,11 +20,14 @@ public static async Task> GetNewContextMenuEntries() foreach (var keyName in Registry.ClassesRoot.GetSubKeyNames() .Where(x => x.StartsWith(".") && !new string[] { ".library-ms", ".url", ".lnk" }.Contains(x))) { - using var key = Registry.ClassesRoot.OpenSubKey(keyName); - var ret = await GetShellNewRegistryEntries(key, key); - if (ret != null) + using var key = Registry.ClassesRoot.OpenSubKeySafe(keyName); + if (key != null) { - newMenuItems.Add(ret); + var ret = await GetShellNewRegistryEntries(key, key); + if (ret != null) + { + newMenuItems.Add(ret); + } } } return newMenuItems; @@ -32,7 +36,7 @@ public static async Task> GetNewContextMenuEntries() public static async Task GetNewContextMenuEntryForType(string extension) { if (string.IsNullOrEmpty(extension)) return null; - using var key = Registry.ClassesRoot.OpenSubKey(extension); + using var key = Registry.ClassesRoot.OpenSubKeySafe(extension); return key != null ? await GetShellNewRegistryEntries(key, key) : null; } @@ -40,7 +44,11 @@ private static async Task GetShellNewRegistryEntries(RegistryKey { foreach (var keyName in current.GetSubKeyNames()) { - using var key = current.OpenSubKey(keyName); + using var key = current.OpenSubKeySafe(keyName); + if (key == null) + { + continue; + } if (keyName == "ShellNew") { return await ParseShellNewRegistryEntry(key, root); @@ -108,5 +116,17 @@ private static async Task ParseShellNewRegistryEntry(RegistryKey return entry; } + + private static RegistryKey OpenSubKeySafe(this RegistryKey root, string keyName) + { + try + { + return root.OpenSubKey(keyName); + } + catch (SecurityException) + { + return null; + } + } } } From a53cc5e8d353d9411849611a0a016534d33d95c9 Mon Sep 17 00:00:00 2001 From: Yair Aichenbaum <39923744+yaichenbaum@users.noreply.github.com> Date: Sun, 20 Dec 2020 15:50:08 -0500 Subject: [PATCH 25/27] Switched the color of the selection rectangle to use the system accent color (#2650) --- Files/Views/LayoutModes/GenericFileBrowser.xaml | 5 +++-- Files/Views/LayoutModes/GridViewBrowser.xaml | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Files/Views/LayoutModes/GenericFileBrowser.xaml b/Files/Views/LayoutModes/GenericFileBrowser.xaml index 518ba96887a7..e48af030f3a9 100644 --- a/Files/Views/LayoutModes/GenericFileBrowser.xaml +++ b/Files/Views/LayoutModes/GenericFileBrowser.xaml @@ -194,7 +194,7 @@ - + diff --git a/Files/Views/LayoutModes/GridViewBrowser.xaml b/Files/Views/LayoutModes/GridViewBrowser.xaml index 2e3063bf1389..cc130c1b7f98 100644 --- a/Files/Views/LayoutModes/GridViewBrowser.xaml +++ b/Files/Views/LayoutModes/GridViewBrowser.xaml @@ -170,7 +170,7 @@ - + From c122bd31482d42ce0b4c0a932a81ebfbcc69a4d2 Mon Sep 17 00:00:00 2001 From: Yair Aichenbaum <39923744+yaichenbaum@users.noreply.github.com> Date: Sun, 20 Dec 2020 17:49:13 -0500 Subject: [PATCH 26/27] Fixed an issue where changing a setting wouldn't save the setting correctly the first time the value was changed (#2649) --- Files/Dialogs/PropertiesDialog.xaml | 2 +- Files/Enums/SidebarOpacity.cs | 2 +- .../HorizontalMultitaskingControl.xaml | 4 +-- Files/UserControls/SidebarControl.xaml | 4 +-- Files/View Models/SettingsViewModel.cs | 30 ++++--------------- Files/Views/Pages/Properties.xaml.cs | 4 +-- Files/Views/Settings.xaml | 4 +-- Files/Views/SettingsPages/Appearance.xaml | 2 +- 8 files changed, 17 insertions(+), 35 deletions(-) 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 @@ Set(value); } - private void DetectAcrylicPreference() + public bool IsAcrylicDisabled { - if (localSettings.Values["AcrylicEnabled"] == null) - { - localSettings.Values["AcrylicEnabled"] = true; - } - AcrylicEnabled = (bool)localSettings.Values["AcrylicEnabled"]; - } - - private bool _AcrylicEnabled = true; - - public bool AcrylicEnabled - { - get => _AcrylicEnabled; - set - { - if (value != _AcrylicEnabled) - { - SetProperty(ref _AcrylicEnabled, value); - localSettings.Values["AcrylicEnabled"] = value; - } - } + get => Get(true); + set => Set(value); } public bool ShowAllContextMenuItems @@ -772,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/Pages/Properties.xaml.cs b/Files/Views/Pages/Properties.xaml.cs index d34d5406b580..f51cc7f0efb8 100644 --- a/Files/Views/Pages/Properties.xaml.cs +++ b/Files/Views/Pages/Properties.xaml.cs @@ -75,7 +75,7 @@ private void AppSettings_PropertyChanged(object sender, System.ComponentModel.Pr { switch (e.PropertyName) { - case "AcrylicEnabled": + case "IsAcrylicDisabled": case "FallbackColor": case "TintColor": case "TintOpacity": @@ -90,7 +90,7 @@ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { var backgroundBrush = new AcrylicBrush() { - AlwaysUseFallback = AppSettings.AcrylicEnabled, + AlwaysUseFallback = AppSettings.IsAcrylicDisabled, BackgroundSource = AcrylicBackgroundSource.HostBackdrop, FallbackColor = AppSettings.AcrylicTheme.FallbackColor, TintColor = AppSettings.AcrylicTheme.TintColor, diff --git a/Files/Views/Settings.xaml b/Files/Views/Settings.xaml index c37d338cc8cb..df73484a64e2 100644 --- a/Files/Views/Settings.xaml +++ b/Files/Views/Settings.xaml @@ -17,7 +17,7 @@ + IsOn="{x:Bind AppSettings.IsAcrylicDisabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource BoolNegationConverter}}" /> From 090b7f50ebc8722f9ae645640414e52f17f6dc4b Mon Sep 17 00:00:00 2001 From: Yair Aichenbaum <39923744+yaichenbaum@users.noreply.github.com> Date: Sun, 20 Dec 2020 22:12:08 -0500 Subject: [PATCH 27/27] Updated priconfig (#2645) --- Files.Package/Files.Package.wapproj | 4 ++-- Files.Package/priconfig.default.xml | 4 ---- Files.Package/priconfig.packaging.xml | 5 ----- Files/Files.csproj | 4 ++-- Files/priconfig.default.xml | 4 ---- Files/priconfig.packaging.xml | 5 ----- 6 files changed, 4 insertions(+), 22 deletions(-) delete mode 100644 Files.Package/priconfig.default.xml delete mode 100644 Files.Package/priconfig.packaging.xml delete mode 100644 Files/priconfig.default.xml delete mode 100644 Files/priconfig.packaging.xml 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/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/Files.csproj b/Files/Files.csproj index b958b2b64f9b..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 @@ -415,8 +417,6 @@ PreserveNewest - - diff --git a/Files/priconfig.default.xml b/Files/priconfig.default.xml deleted file mode 100644 index 980fc1a84224..000000000000 --- a/Files/priconfig.default.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Files/priconfig.packaging.xml b/Files/priconfig.packaging.xml deleted file mode 100644 index a8b3b89f6e65..000000000000 --- a/Files/priconfig.packaging.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file