From 64390850c43247a58f6d3e3f5ba9f91884ebb350 Mon Sep 17 00:00:00 2001
From: Yair Aichenbaum <39923744+yaichenbaum@users.noreply.github.com>
Date: Wed, 2 Sep 2020 22:23:56 -0400
Subject: [PATCH 1/4] Updated the confirm delete dialog to include the number
of selected items.
---
Files/BaseLayout.cs | 9 +++++++--
Files/Dialogs/ConfirmDeleteDialog.xaml | 5 +----
Files/Dialogs/ConfirmDeleteDialog.xaml.cs | 14 +++++++++++++-
Files/MultilingualResources/Files.de-DE.xlf | 17 ++++++++++++-----
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.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/Strings/de-DE/Resources.resw | 3 ---
Files/Strings/en-US/Resources.resw | 14 ++++++++++----
Files/Strings/es-ES/Resources.resw | 3 ---
Files/Strings/fr-FR/Resources.resw | 3 ---
Files/Strings/he-IL/Resources.resw | 3 ---
Files/Strings/hi-IN/Resources.resw | 3 ---
Files/Strings/it-IT/Resources.resw | 3 ---
Files/Strings/ja-JP/Resources.resw | 3 ---
Files/Strings/nl-NL/Resources.resw | 3 ---
Files/Strings/or-IN/Resources.resw | 3 ---
Files/Strings/pl-PL/Resources.resw | 3 ---
Files/Strings/pt-BR/Resources.resw | 3 ---
Files/Strings/ru-RU/Resources.resw | 3 ---
Files/Strings/ta/Resources.resw | 3 ---
Files/Strings/tr-TR/Resources.resw | 3 ---
Files/Strings/uk-UA/Resources.resw | 3 ---
Files/Strings/zh-Hans/Resources.resw | 3 ---
Files/UserControls/StatusBarControl.xaml | 2 +-
.../SelectedItemsPropertiesViewModel.cs | 10 +++++++++-
38 files changed, 233 insertions(+), 126 deletions(-)
diff --git a/Files/BaseLayout.cs b/Files/BaseLayout.cs
index f355611868c8..949a773e0403 100644
--- a/Files/BaseLayout.cs
+++ b/Files/BaseLayout.cs
@@ -85,14 +85,19 @@ internal set
SelectedItem = _SelectedItems.First();
SelectedItemsPropertiesViewModel.IsItemSelected = true;
+ if (SelectedItems.Count >= 1)
+ {
+ SelectedItemsPropertiesViewModel.SelectedItemsCount = SelectedItems.Count.ToString();
+ }
+
if (SelectedItems.Count == 1)
{
- SelectedItemsPropertiesViewModel.SelectedItemsCount = SelectedItems.Count.ToString() + " " + ResourceController.GetTranslation("ItemSelected/Text");
+ SelectedItemsPropertiesViewModel.ItemsSelectedCount = SelectedItems.Count.ToString() + " " + ResourceController.GetTranslation("ItemSelected/Text");
SelectedItemsPropertiesViewModel.ItemSize = SelectedItem.FileSize;
}
else
{
- SelectedItemsPropertiesViewModel.SelectedItemsCount = SelectedItems.Count.ToString() + " " + ResourceController.GetTranslation("ItemsSelected/Text");
+ SelectedItemsPropertiesViewModel.ItemsSelectedCount = SelectedItems.Count.ToString() + " " + ResourceController.GetTranslation("ItemsSelected/Text");
if (SelectedItems.All(x => x.PrimaryItemAttribute == StorageItemTypes.File))
{
diff --git a/Files/Dialogs/ConfirmDeleteDialog.xaml b/Files/Dialogs/ConfirmDeleteDialog.xaml
index 341819a18484..a687c6efc10b 100644
--- a/Files/Dialogs/ConfirmDeleteDialog.xaml
+++ b/Files/Dialogs/ConfirmDeleteDialog.xaml
@@ -22,10 +22,7 @@
-
+
App.CurrentInstance.ContentPage.SelectedItemsPropertiesViewModel;
public MyResult Result { get; set; }
public enum MyResult
@@ -27,6 +30,15 @@ public ConfirmDeleteDialog(bool deleteFromRecycleBin, StorageDeleteOption delete
// If deleting from recycle bin disable "permanently delete" option
this.chkPermanentlyDelete.IsEnabled = !deleteFromRecycleBin;
+
+ if (SelectedItemsPropertiesViewModel.SelectedItemsCount == "1")
+ {
+ Description = ResourceController.GetTranslation("ConfirmDeleteDialogDeleteOneItem/Text");
+ }
+ else
+ {
+ Description = ResourceController.GetTranslation("ConfirmDeleteDialogDeleteMultipleItemsPart1/Text") + SelectedItemsPropertiesViewModel.SelectedItemsCount + ResourceController.GetTranslation("ConfirmDeleteDialogDeleteMultipleItemsPart2/Text");
+ }
}
private void btnDelete_Click(object sender, RoutedEventArgs e)
diff --git a/Files/MultilingualResources/Files.de-DE.xlf b/Files/MultilingualResources/Files.de-DE.xlf
index d4a9d83db56e..949f31d601cb 100644
--- a/Files/MultilingualResources/Files.de-DE.xlf
+++ b/Files/MultilingualResources/Files.de-DE.xlf
@@ -183,11 +183,6 @@
Delete
Löschen
-
Permanently delete
Endgültig löschen
@@ -1193,6 +1188,18 @@
Show all context menu items
Alle im Kontextmenü verfügbaren Elemente anzeigen
+
+ Are you sure you want to delete these
+ Are you sure you want to delete these
+
+
+ items?
+ items?
+
+
+ Are you sure you want do delete this item?
+ Are you sure you want do delete this item?
+