Skip to content

Commit 5da1351

Browse files
authored
Disable pasting to recycle bin (not yet implemented) (#906)
Fix Ctrl+V after copying text
1 parent 587df5c commit 5da1351

File tree

14 files changed

+63
-0
lines changed

14 files changed

+63
-0
lines changed

Files/Interacts/Interaction.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,19 @@ public async void PasteItem_ClickAsync(object sender, RoutedEventArgs e)
840840

841841
public async Task PasteItems(DataPackageView packageView, string destinationPath, DataPackageOperation acceptedOperation)
842842
{
843+
if (!packageView.Contains(StandardDataFormats.StorageItems))
844+
{
845+
// Happens if you copy some text and then you Ctrl+V in FilesUWP
846+
// Should this be done in ModernShellPage?
847+
return;
848+
}
849+
if (CurrentInstance.ViewModel.WorkingDirectory.StartsWith(App.AppSettings.RecycleBinPath))
850+
{
851+
// Do not paste files and folders inside the recycle bin
852+
await DialogDisplayHelper.ShowDialog(ResourceController.GetTranslation("ErrorDialogThisActionCannotBeDone"), ResourceController.GetTranslation("ErrorDialogUnsupportedOperation"));
853+
return;
854+
}
855+
843856
itemsToPaste = await packageView.GetStorageItemsAsync();
844857
HashSet<IStorageItem> pastedItems = new HashSet<IStorageItem>();
845858
itemsPasted = 0;

Files/MultilingualResources/Files.de-DE.xlf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,10 @@
764764
<source>New Tab</source>
765765
<target state="new">New Tab</target>
766766
</trans-unit>
767+
<trans-unit id="ErrorDialogUnsupportedOperation" translate="yes" xml:space="preserve">
768+
<source>The requested operation is not supported</source>
769+
<target state="new">The requested operation is not supported</target>
770+
</trans-unit>
767771
<trans-unit id="DriveFreeSpaceAndCapacity" translate="yes" xml:space="preserve">
768772
<source>{0} free of {1}</source>
769773
<target state="new">{0} free of {1}</target>

Files/MultilingualResources/Files.es-ES.xlf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,10 @@
762762
<source>New Tab</source>
763763
<target state="translated">Nueva pestaña</target>
764764
</trans-unit>
765+
<trans-unit id="ErrorDialogUnsupportedOperation" translate="yes" xml:space="preserve">
766+
<source>The requested operation is not supported</source>
767+
<target state="new">The requested operation is not supported</target>
768+
</trans-unit>
765769
<trans-unit id="DriveFreeSpaceAndCapacity" translate="yes" xml:space="preserve">
766770
<source>{0} free of {1}</source>
767771
<target state="translated">{0} disponibles de {1}</target>

Files/MultilingualResources/Files.fr-FR.xlf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,10 @@
765765
<source>New Tab</source>
766766
<target state="new">New Tab</target>
767767
</trans-unit>
768+
<trans-unit id="ErrorDialogUnsupportedOperation" translate="yes" xml:space="preserve">
769+
<source>The requested operation is not supported</source>
770+
<target state="new">The requested operation is not supported</target>
771+
</trans-unit>
768772
<trans-unit id="DriveFreeSpaceAndCapacity" translate="yes" xml:space="preserve">
769773
<source>{0} free of {1}</source>
770774
<target state="new">{0} free of {1}</target>

Files/MultilingualResources/Files.it-IT.xlf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,10 @@
764764
<source>New Tab</source>
765765
<target state="new">New Tab</target>
766766
</trans-unit>
767+
<trans-unit id="ErrorDialogUnsupportedOperation" translate="yes" xml:space="preserve">
768+
<source>The requested operation is not supported</source>
769+
<target state="translated">L'operazione richiesta non è supportata</target>
770+
</trans-unit>
767771
<trans-unit id="DriveFreeSpaceAndCapacity" translate="yes" xml:space="preserve">
768772
<source>{0} free of {1}</source>
769773
<target state="new">{0} free of {1}</target>

Files/MultilingualResources/Files.nl-NL.xlf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,10 @@
765765
<source>New Tab</source>
766766
<target state="new">New Tab</target>
767767
</trans-unit>
768+
<trans-unit id="ErrorDialogUnsupportedOperation" translate="yes" xml:space="preserve">
769+
<source>The requested operation is not supported</source>
770+
<target state="new">The requested operation is not supported</target>
771+
</trans-unit>
768772
<trans-unit id="DriveFreeSpaceAndCapacity" translate="yes" xml:space="preserve">
769773
<source>{0} free of {1}</source>
770774
<target state="new">{0} free of {1}</target>

Files/MultilingualResources/Files.pl-PL.xlf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,10 @@
765765
<source>New Tab</source>
766766
<target state="new">New Tab</target>
767767
</trans-unit>
768+
<trans-unit id="ErrorDialogUnsupportedOperation" translate="yes" xml:space="preserve">
769+
<source>The requested operation is not supported</source>
770+
<target state="new">The requested operation is not supported</target>
771+
</trans-unit>
768772
<trans-unit id="DriveFreeSpaceAndCapacity" translate="yes" xml:space="preserve">
769773
<source>{0} free of {1}</source>
770774
<target state="new">{0} free of {1}</target>

Files/MultilingualResources/Files.ru-RU.xlf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,10 @@
767767
<source>New Tab</source>
768768
<target state="new">New Tab</target>
769769
</trans-unit>
770+
<trans-unit id="ErrorDialogUnsupportedOperation" translate="yes" xml:space="preserve">
771+
<source>The requested operation is not supported</source>
772+
<target state="new">The requested operation is not supported</target>
773+
</trans-unit>
770774
</group>
771775
</body>
772776
</file>

Files/MultilingualResources/Files.ta.xlf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,10 @@
767767
<source>{0} free of {1}</source>
768768
<target state="new">{0} free of {1}</target>
769769
</trans-unit>
770+
<trans-unit id="ErrorDialogUnsupportedOperation" translate="yes" xml:space="preserve">
771+
<source>The requested operation is not supported</source>
772+
<target state="new">The requested operation is not supported</target>
773+
</trans-unit>
770774
</group>
771775
</body>
772776
</file>

Files/MultilingualResources/Files.tr-TR.xlf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,10 @@
765765
<source>New Tab</source>
766766
<target state="new">New Tab</target>
767767
</trans-unit>
768+
<trans-unit id="ErrorDialogUnsupportedOperation" translate="yes" xml:space="preserve">
769+
<source>The requested operation is not supported</source>
770+
<target state="new">The requested operation is not supported</target>
771+
</trans-unit>
768772
<trans-unit id="DriveFreeSpaceAndCapacity" translate="yes" xml:space="preserve">
769773
<source>{0} free of {1}</source>
770774
<target state="new">{0} free of {1}</target>

0 commit comments

Comments
 (0)