Skip to content

Commit 6fbfa59

Browse files
jaigakJaiganeshkumaran
andauthored
Alert the user when trying to delete a file which is in use (#862)
Co-authored-by: Jaiganeshkumaran <[email protected]>
1 parent a805180 commit 6fbfa59

File tree

13 files changed

+195
-0
lines changed

13 files changed

+195
-0
lines changed

Files/Interacts/Interaction.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,13 @@ public async void DeleteItem_Click(object sender, RoutedEventArgs e)
560560
{
561561
await DialogDisplayHelper.ShowDialog(ResourceController.GetTranslation("FileNotFoundDialog.Title"), ResourceController.GetTranslation("FileNotFoundDialog.Text"));
562562
}
563+
catch (IOException)
564+
{
565+
if (await DialogDisplayHelper.ShowDialog(ResourceController.GetTranslation("FileInUseDeleteDialog.Title"), ResourceController.GetTranslation("FileInUseDeleteDialog.Text"), ResourceController.GetTranslation("FileInUseDeleteDialog.PrimaryButtonText"), ResourceController.GetTranslation("FileInUseDeleteDialog.SecondaryButtonText")))
566+
{
567+
DeleteItem_Click(null, null);
568+
}
569+
}
563570

564571
App.InteractionViewModel.PermanentlyDelete = StorageDeleteOption.Default; //reset PermanentlyDelete flag
565572
}

Files/MultilingualResources/Files.de-DE.xlf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,22 @@
695695
<source>Selection options</source>
696696
<target state="new">Selection options</target>
697697
</trans-unit>
698+
<trans-unit id="FileInUseDeleteDialog.Text" translate="yes" xml:space="preserve">
699+
<source>The file you're trying to delete is currently being used by an another application.</source>
700+
<target state="new">The file you're trying to delete is currently being used by an another application.</target>
701+
</trans-unit>
702+
<trans-unit id="FileInUseDeleteDialog.Title" translate="yes" xml:space="preserve">
703+
<source>File is in use</source>
704+
<target state="new">File is in use</target>
705+
</trans-unit>
706+
<trans-unit id="FileInUseDeleteDialog.PrimaryButtonText" translate="yes" xml:space="preserve">
707+
<source>Try again</source>
708+
<target state="new">Try again</target>
709+
</trans-unit>
710+
<trans-unit id="FileInUseDeleteDialog.SecondaryButtonText" translate="yes" xml:space="preserve">
711+
<source>OK</source>
712+
<target state="new">OK</target>
713+
</trans-unit>
698714
<trans-unit id="PropertiesDialogReadOnly.Content" translate="yes" xml:space="preserve">
699715
<source>Read-only</source>
700716
<target state="new">Read-only</target>

Files/MultilingualResources/Files.es-ES.xlf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,22 @@
694694
<source>Selection options</source>
695695
<target state="translated">Opciones de selección</target>
696696
</trans-unit>
697+
<trans-unit id="FileInUseDeleteDialog.Text" translate="yes" xml:space="preserve">
698+
<source>The file you're trying to delete is currently being used by an another application.</source>
699+
<target state="new">The file you're trying to delete is currently being used by an another application.</target>
700+
</trans-unit>
701+
<trans-unit id="FileInUseDeleteDialog.Title" translate="yes" xml:space="preserve">
702+
<source>File is in use</source>
703+
<target state="new">File is in use</target>
704+
</trans-unit>
705+
<trans-unit id="FileInUseDeleteDialog.PrimaryButtonText" translate="yes" xml:space="preserve">
706+
<source>Try again</source>
707+
<target state="new">Try again</target>
708+
</trans-unit>
709+
<trans-unit id="FileInUseDeleteDialog.SecondaryButtonText" translate="yes" xml:space="preserve">
710+
<source>OK</source>
711+
<target state="new">OK</target>
712+
</trans-unit>
697713
<trans-unit id="PropertiesDialogReadOnly.Content" translate="yes" xml:space="preserve">
698714
<source>Read-only</source>
699715
<target state="translated">Solo lectura</target>

Files/MultilingualResources/Files.fr-FR.xlf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,22 @@
696696
<source>Selection options</source>
697697
<target state="new">Selection options</target>
698698
</trans-unit>
699+
<trans-unit id="FileInUseDeleteDialog.Text" translate="yes" xml:space="preserve">
700+
<source>The file you're trying to delete is currently being used by an another application.</source>
701+
<target state="new">The file you're trying to delete is currently being used by an another application.</target>
702+
</trans-unit>
703+
<trans-unit id="FileInUseDeleteDialog.Title" translate="yes" xml:space="preserve">
704+
<source>File is in use</source>
705+
<target state="new">File is in use</target>
706+
</trans-unit>
707+
<trans-unit id="FileInUseDeleteDialog.PrimaryButtonText" translate="yes" xml:space="preserve">
708+
<source>Try again</source>
709+
<target state="new">Try again</target>
710+
</trans-unit>
711+
<trans-unit id="FileInUseDeleteDialog.SecondaryButtonText" translate="yes" xml:space="preserve">
712+
<source>OK</source>
713+
<target state="new">OK</target>
714+
</trans-unit>
699715
<trans-unit id="PropertiesDialogReadOnly.Content" translate="yes" xml:space="preserve">
700716
<source>Read-only</source>
701717
<target state="new">Read-only</target>

Files/MultilingualResources/Files.it-IT.xlf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,22 @@
695695
<source>Selection options</source>
696696
<target state="new">Selection options</target>
697697
</trans-unit>
698+
<trans-unit id="FileInUseDeleteDialog.Text" translate="yes" xml:space="preserve">
699+
<source>The file you're trying to delete is currently being used by an another application.</source>
700+
<target state="new">The file you're trying to delete is currently being used by an another application.</target>
701+
</trans-unit>
702+
<trans-unit id="FileInUseDeleteDialog.Title" translate="yes" xml:space="preserve">
703+
<source>File is in use</source>
704+
<target state="new">File is in use</target>
705+
</trans-unit>
706+
<trans-unit id="FileInUseDeleteDialog.PrimaryButtonText" translate="yes" xml:space="preserve">
707+
<source>Try again</source>
708+
<target state="new">Try again</target>
709+
</trans-unit>
710+
<trans-unit id="FileInUseDeleteDialog.SecondaryButtonText" translate="yes" xml:space="preserve">
711+
<source>OK</source>
712+
<target state="new">OK</target>
713+
</trans-unit>
698714
<trans-unit id="PropertiesDialogReadOnly.Content" translate="yes" xml:space="preserve">
699715
<source>Read-only</source>
700716
<target state="new">Read-only</target>

Files/MultilingualResources/Files.nl-NL.xlf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,22 @@
696696
<source>Selection options</source>
697697
<target state="new">Selection options</target>
698698
</trans-unit>
699+
<trans-unit id="FileInUseDeleteDialog.Text" translate="yes" xml:space="preserve">
700+
<source>The file you're trying to delete is currently being used by an another application.</source>
701+
<target state="new">The file you're trying to delete is currently being used by an another application.</target>
702+
</trans-unit>
703+
<trans-unit id="FileInUseDeleteDialog.Title" translate="yes" xml:space="preserve">
704+
<source>File is in use</source>
705+
<target state="new">File is in use</target>
706+
</trans-unit>
707+
<trans-unit id="FileInUseDeleteDialog.PrimaryButtonText" translate="yes" xml:space="preserve">
708+
<source>Try again</source>
709+
<target state="new">Try again</target>
710+
</trans-unit>
711+
<trans-unit id="FileInUseDeleteDialog.SecondaryButtonText" translate="yes" xml:space="preserve">
712+
<source>OK</source>
713+
<target state="new">OK</target>
714+
</trans-unit>
699715
<trans-unit id="PropertiesDialogReadOnly.Content" translate="yes" xml:space="preserve">
700716
<source>Read-only</source>
701717
<target state="new">Read-only</target>

Files/MultilingualResources/Files.pl-PL.xlf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,22 @@
696696
<source>Selection options</source>
697697
<target state="new">Selection options</target>
698698
</trans-unit>
699+
<trans-unit id="FileInUseDeleteDialog.Text" translate="yes" xml:space="preserve">
700+
<source>The file you're trying to delete is currently being used by an another application.</source>
701+
<target state="new">The file you're trying to delete is currently being used by an another application.</target>
702+
</trans-unit>
703+
<trans-unit id="FileInUseDeleteDialog.Title" translate="yes" xml:space="preserve">
704+
<source>File is in use</source>
705+
<target state="new">File is in use</target>
706+
</trans-unit>
707+
<trans-unit id="FileInUseDeleteDialog.PrimaryButtonText" translate="yes" xml:space="preserve">
708+
<source>Try again</source>
709+
<target state="new">Try again</target>
710+
</trans-unit>
711+
<trans-unit id="FileInUseDeleteDialog.SecondaryButtonText" translate="yes" xml:space="preserve">
712+
<source>OK</source>
713+
<target state="new">OK</target>
714+
</trans-unit>
699715
<trans-unit id="PropertiesDialogReadOnly.Content" translate="yes" xml:space="preserve">
700716
<source>Read-only</source>
701717
<target state="new">Read-only</target>

Files/MultilingualResources/Files.ru-RU.xlf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,22 @@
694694
<source>Selection options</source>
695695
<target state="new">Selection options</target>
696696
</trans-unit>
697+
<trans-unit id="FileInUseDeleteDialog.Text" translate="yes" xml:space="preserve">
698+
<source>The file you're trying to delete is currently being used by an another application.</source>
699+
<target state="new">The file you're trying to delete is currently being used by an another application.</target>
700+
</trans-unit>
701+
<trans-unit id="FileInUseDeleteDialog.Title" translate="yes" xml:space="preserve">
702+
<source>File is in use</source>
703+
<target state="new">File is in use</target>
704+
</trans-unit>
705+
<trans-unit id="FileInUseDeleteDialog.PrimaryButtonText" translate="yes" xml:space="preserve">
706+
<source>Try again</source>
707+
<target state="new">Try again</target>
708+
</trans-unit>
709+
<trans-unit id="FileInUseDeleteDialog.SecondaryButtonText" translate="yes" xml:space="preserve">
710+
<source>OK</source>
711+
<target state="new">OK</target>
712+
</trans-unit>
697713
<trans-unit id="PropertiesDialogReadOnly.Content" translate="yes" xml:space="preserve">
698714
<source>Read-only</source>
699715
<target state="new">Read-only</target>

Files/MultilingualResources/Files.ta.xlf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,22 @@
694694
<source>Selection options</source>
695695
<target state="new">Selection options</target>
696696
</trans-unit>
697+
<trans-unit id="FileInUseDeleteDialog.Text" translate="yes" xml:space="preserve">
698+
<source>The file you're trying to delete is currently being used by an another application.</source>
699+
<target state="new">The file you're trying to delete is currently being used by an another application.</target>
700+
</trans-unit>
701+
<trans-unit id="FileInUseDeleteDialog.Title" translate="yes" xml:space="preserve">
702+
<source>File is in use</source>
703+
<target state="new">File is in use</target>
704+
</trans-unit>
705+
<trans-unit id="FileInUseDeleteDialog.PrimaryButtonText" translate="yes" xml:space="preserve">
706+
<source>Try again</source>
707+
<target state="new">Try again</target>
708+
</trans-unit>
709+
<trans-unit id="FileInUseDeleteDialog.SecondaryButtonText" translate="yes" xml:space="preserve">
710+
<source>OK</source>
711+
<target state="new">OK</target>
712+
</trans-unit>
697713
<trans-unit id="PropertiesDialogReadOnly.Content" translate="yes" xml:space="preserve">
698714
<source>Read-only</source>
699715
<target state="new">Read-only</target>

Files/MultilingualResources/Files.tr-TR.xlf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,22 @@
696696
<source>Selection options</source>
697697
<target state="new">Selection options</target>
698698
</trans-unit>
699+
<trans-unit id="FileInUseDeleteDialog.Text" translate="yes" xml:space="preserve">
700+
<source>The file you're trying to delete is currently being used by an another application.</source>
701+
<target state="new">The file you're trying to delete is currently being used by an another application.</target>
702+
</trans-unit>
703+
<trans-unit id="FileInUseDeleteDialog.Title" translate="yes" xml:space="preserve">
704+
<source>File is in use</source>
705+
<target state="new">File is in use</target>
706+
</trans-unit>
707+
<trans-unit id="FileInUseDeleteDialog.PrimaryButtonText" translate="yes" xml:space="preserve">
708+
<source>Try again</source>
709+
<target state="new">Try again</target>
710+
</trans-unit>
711+
<trans-unit id="FileInUseDeleteDialog.SecondaryButtonText" translate="yes" xml:space="preserve">
712+
<source>OK</source>
713+
<target state="new">OK</target>
714+
</trans-unit>
699715
<trans-unit id="PropertiesDialogReadOnly.Content" translate="yes" xml:space="preserve">
700716
<source>Read-only</source>
701717
<target state="new">Read-only</target>

0 commit comments

Comments
 (0)