Skip to content

armgit / ente

Public Imported from GitHub
0

💚 End-to-end encrypted cloud for everything.

[mobile][photos] copy changes and refactors

Priyanshu Dangare8797a4bb4710
diff --git a/mobile/apps/photos/lib/core/constants.dart b/mobile/apps/photos/lib/core/constants.dart
index bc0921e9d1..d08ee2a82f 100644
--- a/mobile/apps/photos/lib/core/constants.dart
+++ b/mobile/apps/photos/lib/core/constants.dart
@@ -29,6 +29,8 @@ const String sharedMediaIdentifier = 'ente-shared-media://';
const galleryThumbnailDiskLoadDeferDuration = Duration(milliseconds: 80);
const galleryThumbnailServerLoadDeferDuration = Duration(milliseconds: 80);
+const mediaManagementHintDismissDuration = Duration(days: 7);
+const mediaManagementHintDeleteAttemptThreshold = 3;
// 256 bit key maps to 24 words
// https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki#Generating_the_mnemonic
diff --git a/mobile/apps/photos/lib/l10n/intl_ar.arb b/mobile/apps/photos/lib/l10n/intl_ar.arb
index 69e626afa9..6f22e9e81c 100644
--- a/mobile/apps/photos/lib/l10n/intl_ar.arb
+++ b/mobile/apps/photos/lib/l10n/intl_ar.arb
@@ -331,9 +331,9 @@
"videoSmallCase": "فيديو",
"photoSmallCase": "صورة",
"singleFileDeleteHighlight": "سيتم حذفه من جميع الألبومات.",
- "singleFileInBothLocalAndRemote": "{fileType} موجود في Ente وعلى جهازك.",
- "singleFileInRemoteOnly": "سيتم حذف {fileType} من Ente.",
- "singleFileDeleteFromDevice": "سيتم حذف {fileType} من جهازك.",
+ "singleFileInBothLocalAndRemote": "موجود في Ente وعلى جهازك.",
+ "singleFileInRemoteOnly": "سيتم حذف من Ente.",
+ "singleFileDeleteFromDevice": "سيتم حذف من جهازك.",
"deleteFromEnte": "حذف من Ente",
"yesDelete": "نعم، حذف",
"movedToTrash": "تم النقل إلى سلة المهملات",
diff --git a/mobile/apps/photos/lib/l10n/intl_az.arb b/mobile/apps/photos/lib/l10n/intl_az.arb
index 9826390b49..26823c4b02 100644
--- a/mobile/apps/photos/lib/l10n/intl_az.arb
+++ b/mobile/apps/photos/lib/l10n/intl_az.arb
@@ -409,9 +409,9 @@
"videoSmallCase": "video",
"photoSmallCase": "şəkil",
"singleFileDeleteHighlight": "Bütün albomlardan silinəcək.",
- "singleFileInBothLocalAndRemote": "Bu {fileType} həm Ente-də, həm də cihazınızdadır.",
- "singleFileInRemoteOnly": "Bu {fileType} Ente-dən silinəcək.",
- "singleFileDeleteFromDevice": "Bu {fileType} cihazınızdan silinəcək.",
+ "singleFileInBothLocalAndRemote": "Bu həm Ente-də, həm də cihazınızdadır.",
+ "singleFileInRemoteOnly": "Bu Ente-dən silinəcək.",
+ "singleFileDeleteFromDevice": "Bu cihazınızdan silinəcək.",
"deleteFromEnte": "Ente-dən sil",
"yesDelete": "Bəli, sil",
"movedToTrash": "Zibil qutusuna köçürüldü",
diff --git a/mobile/apps/photos/lib/l10n/intl_be.arb b/mobile/apps/photos/lib/l10n/intl_be.arb
index e62e48c3aa..03e4a5d1c9 100644
--- a/mobile/apps/photos/lib/l10n/intl_be.arb
+++ b/mobile/apps/photos/lib/l10n/intl_be.arb
@@ -358,9 +358,9 @@
"videoSmallCase": "відэа",
"photoSmallCase": "фатаграфіі",
"singleFileDeleteHighlight": "Гэта дзеянне прывядзе да выдалення з усіх альбомаў.",
- "singleFileInBothLocalAndRemote": "Гэта {fileType} ёсць і ў Ente, і на вашай прыладзе.",
- "singleFileInRemoteOnly": "Гэта {fileType} будзе выдалена з Ente.",
- "singleFileDeleteFromDevice": "Гэта {fileType} будзе выдалена з вашай прылады.",
+ "singleFileInBothLocalAndRemote": "Гэта ёсць і ў Ente, і на вашай прыладзе.",
+ "singleFileInRemoteOnly": "Гэта будзе выдалена з Ente.",
+ "singleFileDeleteFromDevice": "Гэта будзе выдалена з вашай прылады.",
"deleteFromEnte": "Выдаліць з Ente",
"yesDelete": "Так, выдаліць",
"movedToTrash": "Перамешчана ў сметніцу",
diff --git a/mobile/apps/photos/lib/l10n/intl_ca.arb b/mobile/apps/photos/lib/l10n/intl_ca.arb
index 4812a4fa36..de2b77da0f 100644
--- a/mobile/apps/photos/lib/l10n/intl_ca.arb
+++ b/mobile/apps/photos/lib/l10n/intl_ca.arb
@@ -386,9 +386,9 @@
"videoSmallCase": "vídeo",
"photoSmallCase": "foto",
"singleFileDeleteHighlight": "S'eliminarà de tots els àlbums.",
- "singleFileInBothLocalAndRemote": "Aquest {fileType} està tant a Ente com al teu dispositiu.",
- "singleFileInRemoteOnly": "Aquest {fileType} s'eliminarà d'Ente.",
- "singleFileDeleteFromDevice": "Aquest {fileType} s'eliminarà del teu dispositiu.",
+ "singleFileInBothLocalAndRemote": "Aquest està tant a Ente com al teu dispositiu.",
+ "singleFileInRemoteOnly": "Aquest s'eliminarà d'Ente.",
+ "singleFileDeleteFromDevice": "Aquest s'eliminarà del teu dispositiu.",
"deleteFromEnte": "Esborra d'Ente",
"yesDelete": "Sí, esborra",
"movedToTrash": "Mogut a la paperera",
diff --git a/mobile/apps/photos/lib/l10n/intl_cs.arb b/mobile/apps/photos/lib/l10n/intl_cs.arb
index d6c6f52771..944b43596f 100644
--- a/mobile/apps/photos/lib/l10n/intl_cs.arb
+++ b/mobile/apps/photos/lib/l10n/intl_cs.arb
@@ -419,9 +419,9 @@
"videoSmallCase": "video",
"photoSmallCase": "fotografie",
"singleFileDeleteHighlight": "Bude odstraněno ze všech alb.",
- "singleFileInBothLocalAndRemote": "{fileType} se nachází jak v Ente, tak ve Vašem zařízení.",
- "singleFileInRemoteOnly": "Tento {fileType} bude odstraněn z Ente.",
- "singleFileDeleteFromDevice": "Tento {fileType} bude odstraněn z Vašeho zařízení.",
+ "singleFileInBothLocalAndRemote": "se nachází jak v Ente, tak ve Vašem zařízení.",
+ "singleFileInRemoteOnly": "Tento bude odstraněn z Ente.",
+ "singleFileDeleteFromDevice": "Tento bude odstraněn z Vašeho zařízení.",
"deleteFromEnte": "Odstranit z Ente",
"yesDelete": "Ano, smazat",
"movedToTrash": "Přesunuto do koše",
diff --git a/mobile/apps/photos/lib/l10n/intl_de.arb b/mobile/apps/photos/lib/l10n/intl_de.arb
index 45852c7a3e..0397851fad 100644
--- a/mobile/apps/photos/lib/l10n/intl_de.arb
+++ b/mobile/apps/photos/lib/l10n/intl_de.arb
@@ -444,7 +444,7 @@
"singleFileDeleteHighlight": "Es wird aus allen Alben gelöscht.",
"singleFileInBothLocalAndRemote": "Diese Datei ist sowohl in Ente als auch auf deinem Gerät.",
"singleFileInRemoteOnly": "Diese Datei wird von Ente gelöscht.",
- "singleFileDeleteFromDevice": "Dieses {fileType} wird von deinem Gerät gelöscht.",
+ "singleFileDeleteFromDevice": "Dieses wird von deinem Gerät gelöscht.",
"deleteFromEnte": "Von Ente löschen",
"yesDelete": "Ja, löschen",
"movedToTrash": "In den Papierkorb verschoben",
diff --git a/mobile/apps/photos/lib/l10n/intl_el.arb b/mobile/apps/photos/lib/l10n/intl_el.arb
index a7d32f55af..dff6de5f63 100644
--- a/mobile/apps/photos/lib/l10n/intl_el.arb
+++ b/mobile/apps/photos/lib/l10n/intl_el.arb
@@ -297,9 +297,9 @@
"videoSmallCase": "βίντεο",
"photoSmallCase": "φωτογραφία",
"singleFileDeleteHighlight": "Θα διαγραφεί από όλα τα άλμπουμ.",
- "singleFileInBothLocalAndRemote": "Αυτό το αρχείο ({fileType}) είναι και στο Ente και στη συσκευή σας.",
- "singleFileInRemoteOnly": "Αυτό το αρχείο ({fileType}) θα διαγραφεί από το Ente.",
- "singleFileDeleteFromDevice": "Αυτό το αρχείο ({fileType}) θα διαγραφεί από τη συσκευή σας.",
+ "singleFileInBothLocalAndRemote": "Αυτό το αρχείο είναι και στο Ente και στη συσκευή σας.",
+ "singleFileInRemoteOnly": "Αυτό το αρχείο θα διαγραφεί από το Ente.",
+ "singleFileDeleteFromDevice": "Αυτό το αρχείο θα διαγραφεί από τη συσκευή σας.",
"deleteFromEnte": "Διαγραφή από το Ente",
"yesDelete": "Ναι, διαγραφή",
"movedToTrash": "Μετακίνηση στον κάδο",
diff --git a/mobile/apps/photos/lib/l10n/intl_en.arb b/mobile/apps/photos/lib/l10n/intl_en.arb
index 7d8ef23e19..10a4260fbf 100644
--- a/mobile/apps/photos/lib/l10n/intl_en.arb
+++ b/mobile/apps/photos/lib/l10n/intl_en.arb
@@ -442,17 +442,9 @@
"videoSmallCase": "video",
"photoSmallCase": "photo",
"singleFileDeleteHighlight": "It will be deleted from all albums.",
- "singleFileInBothLocalAndRemote": "This {fileType} is available on your device and Ente.",
- "singleFileInRemoteOnly": "This {fileType} will be deleted from all albums. You can recover it from Trash.",
- "singleFileDeleteFromDevice": "{fileType} not backed up. Permanently delete from device?",
- "deleteFileQuestion": "Delete {fileType}?",
- "@deleteFileQuestion": {
- "placeholders": {
- "fileType": {
- "type": "String"
- }
- }
- },
+ "singleFileInBothLocalAndRemote": "This item is available on your device and Ente.",
+ "singleFileInRemoteOnly": "This item will be deleted from all albums. You can recover it from Trash.",
+ "singleFileDeleteFromDevice": "Item not backed up. Permanently delete from device?",
"deleteItemsQuestion": "{count, plural, one {Delete item?} other {Delete {count} items?}}",
"@deleteItemsQuestion": {
"placeholders": {
@@ -461,30 +453,9 @@
}
}
},
- "selectedFilesSavedOnDeviceOnly": "{fileTypes} not backed up. Permanently delete from device?",
- "@selectedFilesSavedOnDeviceOnly": {
- "placeholders": {
- "fileTypes": {
- "type": "String"
- }
- }
- },
- "selectedFilesBackedUpToEnte": "These {fileTypes} will be deleted from all albums. You can recover them from Trash.",
- "@selectedFilesBackedUpToEnte": {
- "placeholders": {
- "fileTypes": {
- "type": "String"
- }
- }
- },
- "someSelectedFilesBackedUpToEnte": "These {fileTypes} are available on device and Ente.",
- "@someSelectedFilesBackedUpToEnte": {
- "placeholders": {
- "fileTypes": {
- "type": "String"
- }
- }
- },
+ "selectedFilesSavedOnDeviceOnly": "Items not backed up. Permanently delete from device?",
+ "selectedFilesBackedUpToEnte": "These items will be deleted from all albums. You can recover them from Trash.",
+ "someSelectedFilesBackedUpToEnte": "These items are available on device and Ente.",
"deleteFromEnte": "Delete from Ente",
"yesDelete": "Yes, delete",
"movedToTrash": "Moved to trash",
diff --git a/mobile/apps/photos/lib/l10n/intl_es.arb b/mobile/apps/photos/lib/l10n/intl_es.arb
index 46647c3d5c..7d590c2794 100644
--- a/mobile/apps/photos/lib/l10n/intl_es.arb
+++ b/mobile/apps/photos/lib/l10n/intl_es.arb
@@ -414,9 +414,9 @@
"videoSmallCase": "vídeo",
"photoSmallCase": "foto",
"singleFileDeleteHighlight": "Se borrará de todos los álbumes.",
- "singleFileInBothLocalAndRemote": "Este {fileType} está tanto en Ente como en tu dispositivo.",
- "singleFileInRemoteOnly": "Este {fileType} será eliminado de Ente.",
- "singleFileDeleteFromDevice": "Este {fileType} se eliminará de tu dispositivo.",
+ "singleFileInBothLocalAndRemote": "Este está tanto en Ente como en tu dispositivo.",
+ "singleFileInRemoteOnly": "Este será eliminado de Ente.",
+ "singleFileDeleteFromDevice": "Este se eliminará de tu dispositivo.",
"deleteFromEnte": "Eliminar de Ente",
"yesDelete": "Sí, eliminar",
"movedToTrash": "Movido a la papelera",
diff --git a/mobile/apps/photos/lib/l10n/intl_eu.arb b/mobile/apps/photos/lib/l10n/intl_eu.arb
index 6ff33a0b65..b331376137 100644
--- a/mobile/apps/photos/lib/l10n/intl_eu.arb
+++ b/mobile/apps/photos/lib/l10n/intl_eu.arb
@@ -332,9 +332,9 @@
"videoSmallCase": "bideoa",
"photoSmallCase": "argazkia",
"singleFileDeleteHighlight": "Album guztietatik ezabatuko da.",
- "singleFileInBothLocalAndRemote": "{fileType} hau Ente-n eta zure gailuan dago.",
- "singleFileInRemoteOnly": "{fileType} hau Ente-tik ezabatuko da.",
- "singleFileDeleteFromDevice": "{fileType} hau zure gailutik ezabatuko da.",
+ "singleFileInBothLocalAndRemote": "hau Ente-n eta zure gailuan dago.",
+ "singleFileInRemoteOnly": "hau Ente-tik ezabatuko da.",
+ "singleFileDeleteFromDevice": "hau zure gailutik ezabatuko da.",
"deleteFromEnte": "Ezabatu Ente-tik",
"yesDelete": "Bai, ezabatu",
"movedToTrash": "Zarama mugituta",
diff --git a/mobile/apps/photos/lib/l10n/intl_fr.arb b/mobile/apps/photos/lib/l10n/intl_fr.arb
index 75d46d9d56..760d6dadbd 100644
--- a/mobile/apps/photos/lib/l10n/intl_fr.arb
+++ b/mobile/apps/photos/lib/l10n/intl_fr.arb
@@ -441,9 +441,9 @@
"videoSmallCase": "vidéo",
"photoSmallCase": "photo",
"singleFileDeleteHighlight": "Elle sera supprimée de tous les albums.",
- "singleFileInBothLocalAndRemote": "Cette {fileType} est à la fois sur ente et sur votre appareil.",
- "singleFileInRemoteOnly": "Cette {fileType} sera supprimée de l'Ente.",
- "singleFileDeleteFromDevice": "Elle {fileType} sera supprimée de votre appareil.",
+ "singleFileInBothLocalAndRemote": "Cette est à la fois sur ente et sur votre appareil.",
+ "singleFileInRemoteOnly": "Cette sera supprimée de l'Ente.",
+ "singleFileDeleteFromDevice": "Elle sera supprimée de votre appareil.",
"deleteFromEnte": "Supprimer de Ente",
"yesDelete": "Oui, supprimer",
"movedToTrash": "Déplacé dans la corbeille",
diff --git a/mobile/apps/photos/lib/l10n/intl_he.arb b/mobile/apps/photos/lib/l10n/intl_he.arb
index de664ed970..3e791efa2a 100644
--- a/mobile/apps/photos/lib/l10n/intl_he.arb
+++ b/mobile/apps/photos/lib/l10n/intl_he.arb
@@ -316,7 +316,7 @@
"videoSmallCase": "וידאו",
"photoSmallCase": "תמונה",
"singleFileDeleteHighlight": "זה יימחק מכל האלבומים.",
- "singleFileDeleteFromDevice": "{fileType} יימחק מהמכשיר שלך.",
+ "singleFileDeleteFromDevice": "יימחק מהמכשיר שלך.",
"yesDelete": "כן, מחק",
"movedToTrash": "הועבר לאשפה",
"deleteFromDevice": "מחק מהמכשיר",
diff --git a/mobile/apps/photos/lib/l10n/intl_hu.arb b/mobile/apps/photos/lib/l10n/intl_hu.arb
index af2168f51b..f0ec7ca29d 100644
--- a/mobile/apps/photos/lib/l10n/intl_hu.arb
+++ b/mobile/apps/photos/lib/l10n/intl_hu.arb
@@ -442,9 +442,9 @@
"videoSmallCase": "videó",
"photoSmallCase": "fénykép",
"singleFileDeleteHighlight": "Az összes albumból törlésre kerül.",
- "singleFileInBothLocalAndRemote": "Ez a {fileType} fájltípus megtalálható mind az Enterben, mind az eszközödön.",
- "singleFileInRemoteOnly": "Ez a {fileType} fájl törlődik az Ente-ből.",
- "singleFileDeleteFromDevice": "Ez a {fileType} fájl törlődni fog az eszközéről.",
+ "singleFileInBothLocalAndRemote": "Ez a fájltípus megtalálható mind az Enterben, mind az eszközödön.",
+ "singleFileInRemoteOnly": "Ez a fájl törlődik az Ente-ből.",
+ "singleFileDeleteFromDevice": "Ez a fájl törlődni fog az eszközéről.",
"deleteFromEnte": "Törlés az Ente-ből",
"yesDelete": "Igen, törlés",
"movedToTrash": "Áthelyezve a kukába",
diff --git a/mobile/apps/photos/lib/l10n/intl_id.arb b/mobile/apps/photos/lib/l10n/intl_id.arb
index 7e785a4d48..fa34c354e5 100644
--- a/mobile/apps/photos/lib/l10n/intl_id.arb
+++ b/mobile/apps/photos/lib/l10n/intl_id.arb
@@ -331,9 +331,9 @@
"videoSmallCase": "video",
"photoSmallCase": "foto",
"singleFileDeleteHighlight": "Ia akan dihapus dari semua album.",
- "singleFileInBothLocalAndRemote": "{fileType} ini tersimpan di Ente dan juga di perangkat ini.",
- "singleFileInRemoteOnly": "{fileType} ini akan dihapus dari Ente.",
- "singleFileDeleteFromDevice": "{fileType} ini akan dihapus dari perangkat ini.",
+ "singleFileInBothLocalAndRemote": "ini tersimpan di Ente dan juga di perangkat ini.",
+ "singleFileInRemoteOnly": "ini akan dihapus dari Ente.",
+ "singleFileDeleteFromDevice": "ini akan dihapus dari perangkat ini.",
"deleteFromEnte": "Hapus dari Ente",
"yesDelete": "Ya, hapus",
"movedToTrash": "Pindah ke sampah",
diff --git a/mobile/apps/photos/lib/l10n/intl_it.arb b/mobile/apps/photos/lib/l10n/intl_it.arb
index c7f3e8392e..d05bc6b969 100644
--- a/mobile/apps/photos/lib/l10n/intl_it.arb
+++ b/mobile/apps/photos/lib/l10n/intl_it.arb
@@ -419,9 +419,9 @@
"videoSmallCase": "video",
"photoSmallCase": "foto",
"singleFileDeleteHighlight": "Verrà eliminato da tutti gli album.",
- "singleFileInBothLocalAndRemote": "Questo {fileType} è sia su Ente che sul tuo dispositivo.",
- "singleFileInRemoteOnly": "Questo {fileType} verrà eliminato da Ente.",
- "singleFileDeleteFromDevice": "Questo {fileType} verrà eliminato dal tuo dispositivo.",
+ "singleFileInBothLocalAndRemote": "Questo è sia su Ente che sul tuo dispositivo.",
+ "singleFileInRemoteOnly": "Questo verrà eliminato da Ente.",
+ "singleFileDeleteFromDevice": "Questo verrà eliminato dal tuo dispositivo.",
"deleteFromEnte": "Elimina da Ente",
"yesDelete": "Sì, elimina",
"movedToTrash": "Spostato nel cestino",
diff --git a/mobile/apps/photos/lib/l10n/intl_ja.arb b/mobile/apps/photos/lib/l10n/intl_ja.arb
index 79a030d632..6780f5dc6d 100644
--- a/mobile/apps/photos/lib/l10n/intl_ja.arb
+++ b/mobile/apps/photos/lib/l10n/intl_ja.arb
@@ -391,9 +391,9 @@
"videoSmallCase": "ビデオ",
"photoSmallCase": "写真",
"singleFileDeleteHighlight": "全てのアルバムから削除されます。",
- "singleFileInBothLocalAndRemote": "この {fileType} はEnteとお使いのデバイスの両方にあります。",
- "singleFileInRemoteOnly": "{fileType} はEnteから削除されます。",
- "singleFileDeleteFromDevice": "{fileType} はEnteから削除されます。",
+ "singleFileInBothLocalAndRemote": "この はEnteとお使いのデバイスの両方にあります。",
+ "singleFileInRemoteOnly": "はEnteから削除されます。",
+ "singleFileDeleteFromDevice": "はEnteから削除されます。",
"deleteFromEnte": "Enteから削除",
"yesDelete": "はい、削除します",
"movedToTrash": "ごみ箱へ移動",
diff --git a/mobile/apps/photos/lib/l10n/intl_lt.arb b/mobile/apps/photos/lib/l10n/intl_lt.arb
index 96a556aec1..7525d9ddca 100644
--- a/mobile/apps/photos/lib/l10n/intl_lt.arb
+++ b/mobile/apps/photos/lib/l10n/intl_lt.arb
@@ -369,9 +369,9 @@
"videoSmallCase": "vaizdo įrašas",
"photoSmallCase": "nuotrauka",
"singleFileDeleteHighlight": "Jis bus ištrintas iš visų albumų.",
- "singleFileInBothLocalAndRemote": "Šis {fileType} yra ir saugykloje „Ente“ bei įrenginyje.",
- "singleFileInRemoteOnly": "Šis {fileType} bus ištrintas iš „Ente“.",
- "singleFileDeleteFromDevice": "Šis {fileType} bus ištrintas iš jūsų įrenginio.",
+ "singleFileInBothLocalAndRemote": "Šis yra ir saugykloje „Ente“ bei įrenginyje.",
+ "singleFileInRemoteOnly": "Šis bus ištrintas iš „Ente“.",
+ "singleFileDeleteFromDevice": "Šis bus ištrintas iš jūsų įrenginio.",
"deleteFromEnte": "Ištrinti iš „Ente“",
"yesDelete": "Taip, ištrinti",
"movedToTrash": "Perkelta į šiukšlinę",
diff --git a/mobile/apps/photos/lib/l10n/intl_nl.arb b/mobile/apps/photos/lib/l10n/intl_nl.arb
index 111b40ff6e..964b3a9be8 100644
--- a/mobile/apps/photos/lib/l10n/intl_nl.arb
+++ b/mobile/apps/photos/lib/l10n/intl_nl.arb
@@ -417,9 +417,9 @@
"videoSmallCase": "video",
"photoSmallCase": "foto",
"singleFileDeleteHighlight": "Het wordt uit alle albums verwijderd.",
- "singleFileInBothLocalAndRemote": "Deze {fileType} staat zowel in Ente als op jouw apparaat.",
- "singleFileInRemoteOnly": "Deze {fileType} zal worden verwijderd uit Ente.",
- "singleFileDeleteFromDevice": "Deze {fileType} zal worden verwijderd van jouw apparaat.",
+ "singleFileInBothLocalAndRemote": "Deze staat zowel in Ente als op jouw apparaat.",
+ "singleFileInRemoteOnly": "Deze zal worden verwijderd uit Ente.",
+ "singleFileDeleteFromDevice": "Deze zal worden verwijderd van jouw apparaat.",
"deleteFromEnte": "Verwijder van Ente",
"yesDelete": "Ja, verwijderen",
"movedToTrash": "Naar prullenbak verplaatst",
diff --git a/mobile/apps/photos/lib/l10n/intl_no.arb b/mobile/apps/photos/lib/l10n/intl_no.arb
index f70b6410d9..d39c306b08 100644
--- a/mobile/apps/photos/lib/l10n/intl_no.arb
+++ b/mobile/apps/photos/lib/l10n/intl_no.arb
@@ -331,9 +331,9 @@
"videoSmallCase": "video",
"photoSmallCase": "bilde",
"singleFileDeleteHighlight": "Den vil bli slettet fra alle album.",
- "singleFileInBothLocalAndRemote": "Denne {fileType} er både i Ente og på enheten din.",
- "singleFileInRemoteOnly": "Denne {fileType} vil bli slettet fra Ente.",
- "singleFileDeleteFromDevice": "Denne {fileType} vil bli slettet fra enheten din.",
+ "singleFileInBothLocalAndRemote": "Denne er både i Ente og på enheten din.",
+ "singleFileInRemoteOnly": "Denne vil bli slettet fra Ente.",
+ "singleFileDeleteFromDevice": "Denne vil bli slettet fra enheten din.",
"deleteFromEnte": "Slett fra Ente",
"yesDelete": "Ja, slett",
"movedToTrash": "Flyttet til papirkurven",
diff --git a/mobile/apps/photos/lib/l10n/intl_pl.arb b/mobile/apps/photos/lib/l10n/intl_pl.arb
index 862cc2163a..4cf4e2a290 100644
--- a/mobile/apps/photos/lib/l10n/intl_pl.arb
+++ b/mobile/apps/photos/lib/l10n/intl_pl.arb
@@ -441,9 +441,9 @@
"videoSmallCase": "wideo",
"photoSmallCase": "zdjęcie",
"singleFileDeleteHighlight": "To zostanie usunięte ze wszystkich albumów.",
- "singleFileInBothLocalAndRemote": "Ten {fileType} jest zarówno w Ente, jak i na twoim urządzeniu.",
- "singleFileInRemoteOnly": "Ten {fileType} zostanie usunięty z Ente.",
- "singleFileDeleteFromDevice": "Ten {fileType} zostanie usunięty z Twojego urządzenia.",
+ "singleFileInBothLocalAndRemote": "Ten jest zarówno w Ente, jak i na twoim urządzeniu.",
+ "singleFileInRemoteOnly": "Ten zostanie usunięty z Ente.",
+ "singleFileDeleteFromDevice": "Ten zostanie usunięty z Twojego urządzenia.",
"deleteFromEnte": "Usuń z Ente",
"yesDelete": "Tak, usuń",
"movedToTrash": "Przeniesiono do kosza",
diff --git a/mobile/apps/photos/lib/l10n/intl_pt.arb b/mobile/apps/photos/lib/l10n/intl_pt.arb
index 8fba9b0450..8b27c6f821 100644
--- a/mobile/apps/photos/lib/l10n/intl_pt.arb
+++ b/mobile/apps/photos/lib/l10n/intl_pt.arb
@@ -355,9 +355,9 @@
"videoSmallCase": "vídeo",
"photoSmallCase": "foto",
"singleFileDeleteHighlight": "Será eliminado de todos os álbuns.",
- "singleFileInBothLocalAndRemote": "Este {fileType} encontra-se tanto no Ente como no seu dispositivo.",
- "singleFileInRemoteOnly": "Este {fileType} será eliminado do Ente.",
- "singleFileDeleteFromDevice": "Este {fileType} será eliminado do seu dispositivo.",
+ "singleFileInBothLocalAndRemote": "Este encontra-se tanto no Ente como no seu dispositivo.",
+ "singleFileInRemoteOnly": "Este será eliminado do Ente.",
+ "singleFileDeleteFromDevice": "Este será eliminado do seu dispositivo.",
"deleteFromEnte": "Apagar do Ente",
"yesDelete": "Sim, apagar",
"movedToTrash": "Mover para o lixo",
diff --git a/mobile/apps/photos/lib/l10n/intl_pt_BR.arb b/mobile/apps/photos/lib/l10n/intl_pt_BR.arb
index ad1871d3db..f741e8c551 100644
--- a/mobile/apps/photos/lib/l10n/intl_pt_BR.arb
+++ b/mobile/apps/photos/lib/l10n/intl_pt_BR.arb
@@ -442,9 +442,9 @@
"videoSmallCase": "vídeo",
"photoSmallCase": "foto",
"singleFileDeleteHighlight": "Ele será excluído de todos os álbuns.",
- "singleFileInBothLocalAndRemote": "Este {fileType} está no Ente e em seu dispositivo.",
- "singleFileInRemoteOnly": "Este {fileType} será excluído do Ente.",
- "singleFileDeleteFromDevice": "Este {fileType} será excluído do dispositivo.",
+ "singleFileInBothLocalAndRemote": "Este está no Ente e em seu dispositivo.",
+ "singleFileInRemoteOnly": "Este será excluído do Ente.",
+ "singleFileDeleteFromDevice": "Este será excluído do dispositivo.",
"deleteFromEnte": "Excluir do Ente",
"yesDelete": "Sim, excluir",
"movedToTrash": "Movido para a lixeira",
diff --git a/mobile/apps/photos/lib/l10n/intl_pt_PT.arb b/mobile/apps/photos/lib/l10n/intl_pt_PT.arb
index b470f37c81..05285749b0 100644
--- a/mobile/apps/photos/lib/l10n/intl_pt_PT.arb
+++ b/mobile/apps/photos/lib/l10n/intl_pt_PT.arb
@@ -410,9 +410,9 @@
"videoSmallCase": "vídeo",
"photoSmallCase": "foto",
"singleFileDeleteHighlight": "Será eliminado de todos os álbuns.",
- "singleFileInBothLocalAndRemote": "Este {fileType} encontra-se tanto no Ente como no seu dispositivo.",
- "singleFileInRemoteOnly": "Este {fileType} será eliminado do Ente.",
- "singleFileDeleteFromDevice": "Este {fileType} será eliminado do seu dispositivo.",
+ "singleFileInBothLocalAndRemote": "Este encontra-se tanto no Ente como no seu dispositivo.",
+ "singleFileInRemoteOnly": "Este será eliminado do Ente.",
+ "singleFileDeleteFromDevice": "Este será eliminado do seu dispositivo.",
"deleteFromEnte": "Apagar do Ente",
"yesDelete": "Sim, apagar",
"movedToTrash": "Mover para o lixo",
diff --git a/mobile/apps/photos/lib/l10n/intl_ro.arb b/mobile/apps/photos/lib/l10n/intl_ro.arb
index 9908377ca6..a459c4e265 100644
--- a/mobile/apps/photos/lib/l10n/intl_ro.arb
+++ b/mobile/apps/photos/lib/l10n/intl_ro.arb
@@ -330,9 +330,9 @@
"videoSmallCase": "videoclip",
"photoSmallCase": "fotografie",
"singleFileDeleteHighlight": "Acesta va fi șters din toate albumele.",
- "singleFileInBothLocalAndRemote": "Fișierul de tip {fileType} este atât în Ente, cât și în dispozitivul dvs.",
- "singleFileInRemoteOnly": "Fișierul de tip {fileType} va fi șters din Ente.",
- "singleFileDeleteFromDevice": "Fișierul de tip {fileType} va fi șters din dispozitivul dvs.",
+ "singleFileInBothLocalAndRemote": "Fișierul de tip este atât în Ente, cât și în dispozitivul dvs.",
+ "singleFileInRemoteOnly": "Fișierul de tip va fi șters din Ente.",
+ "singleFileDeleteFromDevice": "Fișierul de tip va fi șters din dispozitivul dvs.",
"deleteFromEnte": "Ștergeți din Ente",
"yesDelete": "Da, șterge",
"movedToTrash": "S-a mutat în coșul de gunoi",
diff --git a/mobile/apps/photos/lib/l10n/intl_ru.arb b/mobile/apps/photos/lib/l10n/intl_ru.arb
index d25a56c288..16bb6ff4b2 100644
--- a/mobile/apps/photos/lib/l10n/intl_ru.arb
+++ b/mobile/apps/photos/lib/l10n/intl_ru.arb
@@ -419,9 +419,9 @@
"videoSmallCase": "видео",
"photoSmallCase": "фото",
"singleFileDeleteHighlight": "Оно будет удалено из всех альбомов.",
- "singleFileInBothLocalAndRemote": "Это {fileType} есть и в Ente, и на вашем устройстве.",
- "singleFileInRemoteOnly": "Это {fileType} будет удалено из Ente.",
- "singleFileDeleteFromDevice": "Это {fileType} будет удалено с вашего устройства.",
+ "singleFileInBothLocalAndRemote": "Это есть и в Ente, и на вашем устройстве.",
+ "singleFileInRemoteOnly": "Это будет удалено из Ente.",
+ "singleFileDeleteFromDevice": "Это будет удалено с вашего устройства.",
"deleteFromEnte": "Удалить из Ente",
"yesDelete": "Да, удалить",
"movedToTrash": "Перемещено в корзину",
diff --git a/mobile/apps/photos/lib/l10n/intl_sr.arb b/mobile/apps/photos/lib/l10n/intl_sr.arb
index 4f436e48a6..16f73993c8 100644
--- a/mobile/apps/photos/lib/l10n/intl_sr.arb
+++ b/mobile/apps/photos/lib/l10n/intl_sr.arb
@@ -306,9 +306,9 @@
"videoSmallCase": "видео",
"photoSmallCase": "слика",
"singleFileDeleteHighlight": "Биће обрисано из свих албума.",
- "singleFileInBothLocalAndRemote": "Овај {fileType} се налази и у Енте-у и на Вашем уређају.",
- "singleFileInRemoteOnly": "Овај {fileType} ће бити избрисан из Енте-а.",
- "singleFileDeleteFromDevice": "Овај {fileType} ће бити избрисан са твог уређаја.",
+ "singleFileInBothLocalAndRemote": "Овај се налази и у Енте-у и на Вашем уређају.",
+ "singleFileInRemoteOnly": "Овај ће бити избрисан из Енте-а.",
+ "singleFileDeleteFromDevice": "Овај ће бити избрисан са твог уређаја.",
"deleteFromEnte": "Обриши са Енте-а",
"yesDelete": "Да, обриши",
"movedToTrash": "Премештено у смеће",
diff --git a/mobile/apps/photos/lib/l10n/intl_sv.arb b/mobile/apps/photos/lib/l10n/intl_sv.arb
index c77d56aa90..d7248f5e22 100644
--- a/mobile/apps/photos/lib/l10n/intl_sv.arb
+++ b/mobile/apps/photos/lib/l10n/intl_sv.arb
@@ -371,9 +371,9 @@
"videoSmallCase": "video",
"photoSmallCase": "foto",
"singleFileDeleteHighlight": "Det kommer att tas bort från alla album.",
- "singleFileInBothLocalAndRemote": "Denna {fileType} finns i både Ente och din enhet.",
- "singleFileInRemoteOnly": "Denna {fileType} kommer att raderas från Ente.",
- "singleFileDeleteFromDevice": "Denna {fileType} kommer att raderas från din enhet.",
+ "singleFileInBothLocalAndRemote": "Denna finns i både Ente och din enhet.",
+ "singleFileInRemoteOnly": "Denna kommer att raderas från Ente.",
+ "singleFileDeleteFromDevice": "Denna kommer att raderas från din enhet.",
"deleteFromEnte": "Radera från ente",
"yesDelete": "Ja, radera",
"movedToTrash": "Flyttad till papperskorgen",
diff --git a/mobile/apps/photos/lib/l10n/intl_th.arb b/mobile/apps/photos/lib/l10n/intl_th.arb
index 29e07db157..292490883e 100644
--- a/mobile/apps/photos/lib/l10n/intl_th.arb
+++ b/mobile/apps/photos/lib/l10n/intl_th.arb
@@ -273,9 +273,9 @@
"uncategorized": "ไม่มีหมวดหมู่",
"videoSmallCase": "วิดีโอ",
"photoSmallCase": "รูปภาพ",
- "singleFileInBothLocalAndRemote": "{fileType} นี้จะถูกลบออกจากทั้ง Ente และ เครื่องของคุณ",
- "singleFileInRemoteOnly": "{fileType} นี้จะถูกลบออกจาก Ente",
- "singleFileDeleteFromDevice": "{fileType} นี้จะถูกลบจากเครื่องของคุณ",
+ "singleFileInBothLocalAndRemote": "นี้จะถูกลบออกจากทั้ง Ente และ เครื่องของคุณ",
+ "singleFileInRemoteOnly": "นี้จะถูกลบออกจาก Ente",
+ "singleFileDeleteFromDevice": "นี้จะถูกลบจากเครื่องของคุณ",
"deleteFromEnte": "ลบออกจาก Ente",
"yesDelete": "ยืนยันการลบ",
"movedToTrash": "ย้ายไปถังขยะแล้ว",
diff --git a/mobile/apps/photos/lib/l10n/intl_tr.arb b/mobile/apps/photos/lib/l10n/intl_tr.arb
index 87db9a6afe..0437fbeb99 100644
--- a/mobile/apps/photos/lib/l10n/intl_tr.arb
+++ b/mobile/apps/photos/lib/l10n/intl_tr.arb
@@ -411,9 +411,9 @@
"videoSmallCase": "video",
"photoSmallCase": "fotoğraf",
"singleFileDeleteHighlight": "Tüm albümlerden silinecek.",
- "singleFileInBothLocalAndRemote": "{fileType} Ente ve cihazınızdan silinecektir.",
- "singleFileInRemoteOnly": "{fileType} Ente'den silinecektir.",
- "singleFileDeleteFromDevice": "Bu {fileType}, cihazınızdan silinecek.",
+ "singleFileInBothLocalAndRemote": "Ente ve cihazınızdan silinecektir.",
+ "singleFileInRemoteOnly": "Ente'den silinecektir.",
+ "singleFileDeleteFromDevice": "Bu, cihazınızdan silinecek.",
"deleteFromEnte": "Ente'den Sil",
"yesDelete": "Evet, sil",
"movedToTrash": "Çöp kutusuna taşındı",
diff --git a/mobile/apps/photos/lib/l10n/intl_uk.arb b/mobile/apps/photos/lib/l10n/intl_uk.arb
index b141175545..3c55c6fe41 100644
--- a/mobile/apps/photos/lib/l10n/intl_uk.arb
+++ b/mobile/apps/photos/lib/l10n/intl_uk.arb
@@ -348,9 +348,9 @@
"videoSmallCase": "відео",
"photoSmallCase": "фото",
"singleFileDeleteHighlight": "Воно буде видалено з усіх альбомів.",
- "singleFileInBothLocalAndRemote": "Цей {fileType} знаходиться і в Ente, і на вашому пристрої.",
- "singleFileInRemoteOnly": "Цей {fileType} буде видалено з Ente.",
- "singleFileDeleteFromDevice": "Цей {fileType} буде видалено з пристрою.",
+ "singleFileInBothLocalAndRemote": "Цей знаходиться і в Ente, і на вашому пристрої.",
+ "singleFileInRemoteOnly": "Цей буде видалено з Ente.",
+ "singleFileDeleteFromDevice": "Цей буде видалено з пристрою.",
"deleteFromEnte": "Видалити з Ente",
"yesDelete": "Так, видалити",
"movedToTrash": "Переміщено у смітник",
diff --git a/mobile/apps/photos/lib/l10n/intl_ur.arb b/mobile/apps/photos/lib/l10n/intl_ur.arb
index 08bc568f88..2403076159 100644
--- a/mobile/apps/photos/lib/l10n/intl_ur.arb
+++ b/mobile/apps/photos/lib/l10n/intl_ur.arb
@@ -438,9 +438,9 @@
"videoSmallCase": "ویڈیو",
"photoSmallCase": "تصویر",
"singleFileDeleteHighlight": "یہ تمام البمز سے ڈیلیٹ کر دیا جائے گا.",
- "singleFileInBothLocalAndRemote": "یہ {fileType} Ente اور آپ کی ڈیوائس دونوں میں ہے.",
- "singleFileInRemoteOnly": "یہ {fileType} Ente سے ڈیلیٹ کر دیا جائے گا.",
- "singleFileDeleteFromDevice": "یہ {fileType} آپ کی ڈیوائس سے ڈیلیٹ کر دیا جائے گا.",
+ "singleFileInBothLocalAndRemote": "یہ Ente اور آپ کی ڈیوائس دونوں میں ہے.",
+ "singleFileInRemoteOnly": "یہ Ente سے ڈیلیٹ کر دیا جائے گا.",
+ "singleFileDeleteFromDevice": "یہ آپ کی ڈیوائس سے ڈیلیٹ کر دیا جائے گا.",
"deleteFromEnte": "Ente سے ڈیلیٹ کریں",
"yesDelete": "ہاں، ڈیلیٹ کریں",
"movedToTrash": "ردی میں منتقل کر دیا گیا",
diff --git a/mobile/apps/photos/lib/l10n/intl_vi.arb b/mobile/apps/photos/lib/l10n/intl_vi.arb
index f29fadab97..f41f76a611 100644
--- a/mobile/apps/photos/lib/l10n/intl_vi.arb
+++ b/mobile/apps/photos/lib/l10n/intl_vi.arb
@@ -442,9 +442,9 @@
"videoSmallCase": "video",
"photoSmallCase": "ảnh",
"singleFileDeleteHighlight": "Nó sẽ bị xóa khỏi tất cả album.",
- "singleFileInBothLocalAndRemote": "Tệp {fileType} này có trong cả Ente và thiết bị của bạn.",
- "singleFileInRemoteOnly": "Tệp {fileType} này sẽ bị xóa khỏi Ente.",
- "singleFileDeleteFromDevice": "Tệp {fileType} này sẽ bị xóa khỏi thiết bị của bạn.",
+ "singleFileInBothLocalAndRemote": "Tệp này có trong cả Ente và thiết bị của bạn.",
+ "singleFileInRemoteOnly": "Tệp này sẽ bị xóa khỏi Ente.",
+ "singleFileDeleteFromDevice": "Tệp này sẽ bị xóa khỏi thiết bị của bạn.",
"deleteFromEnte": "Xóa khỏi Ente",
"yesDelete": "Có, xóa",
"movedToTrash": "Đã cho vào thùng rác",
diff --git a/mobile/apps/photos/lib/l10n/intl_zh.arb b/mobile/apps/photos/lib/l10n/intl_zh.arb
index a275bfb813..c379e1fd54 100644
--- a/mobile/apps/photos/lib/l10n/intl_zh.arb
+++ b/mobile/apps/photos/lib/l10n/intl_zh.arb
@@ -404,9 +404,9 @@
"videoSmallCase": "视频",
"photoSmallCase": "照片",
"singleFileDeleteHighlight": "它将从所有相册中删除。",
- "singleFileInBothLocalAndRemote": "{fileType} 已同时存在于 Ente 和您的设备中。",
- "singleFileInRemoteOnly": "{fileType} 将从 Ente 中删除。",
- "singleFileDeleteFromDevice": "此 {fileType} 将从您的设备中删除。",
+ "singleFileInBothLocalAndRemote": "已同时存在于 Ente 和您的设备中。",
+ "singleFileInRemoteOnly": "将从 Ente 中删除。",
+ "singleFileDeleteFromDevice": "此 将从您的设备中删除。",
"deleteFromEnte": "从 Ente 中删除",
"yesDelete": "是的, 删除",
"movedToTrash": "已移至回收站",
diff --git a/mobile/apps/photos/lib/l10n/intl_zh_CN.arb b/mobile/apps/photos/lib/l10n/intl_zh_CN.arb
index faa92cfd17..9055646b70 100644
--- a/mobile/apps/photos/lib/l10n/intl_zh_CN.arb
+++ b/mobile/apps/photos/lib/l10n/intl_zh_CN.arb
@@ -390,9 +390,9 @@
"videoSmallCase": "视频",
"photoSmallCase": "照片",
"singleFileDeleteHighlight": "它将从所有相册中删除。",
- "singleFileInBothLocalAndRemote": "{fileType} 已同时存在于 Ente 和您的设备中。",
- "singleFileInRemoteOnly": "{fileType} 将从 Ente 中删除。",
- "singleFileDeleteFromDevice": "此 {fileType} 将从您的设备中删除。",
+ "singleFileInBothLocalAndRemote": "已同时存在于 Ente 和您的设备中。",
+ "singleFileInRemoteOnly": "将从 Ente 中删除。",
+ "singleFileDeleteFromDevice": "此 将从您的设备中删除。",
"deleteFromEnte": "从 Ente 中删除",
"yesDelete": "是的, 删除",
"movedToTrash": "已移至回收站",
diff --git a/mobile/apps/photos/lib/settings/local_settings.dart b/mobile/apps/photos/lib/settings/local_settings.dart
index 5997846151..ce93e666e8 100644
--- a/mobile/apps/photos/lib/settings/local_settings.dart
+++ b/mobile/apps/photos/lib/settings/local_settings.dart
@@ -50,8 +50,7 @@ enum DeletePreference {
return switch (value) {
"delete_from_both" => DeleteFromBoth,
"delete_from_local_only" => DeleteFromLocalOnly,
- "delete_from_remote_only" ||
- "delete_from_ente_only" => DeleteFromRemoteOnly,
+ "delete_from_remote_only" => DeleteFromRemoteOnly,
_ => null,
};
}
@@ -112,9 +111,6 @@ class LocalSettings {
"media_management_hint_delete_attempts";
static const _kMediaManagementHintDismissedAt =
"media_management_hint_dismissed_at";
- static const _kMediaManagementHintDismissDuration = Duration(days: 7);
- static const _kMediaManagementHintDeleteAttemptThreshold = 3;
-
static const _kWidgetHideTextFlags = "ls.widget_hide_text_flags";
/// Key used by the native (Android/iOS) widget providers to read the
@@ -634,7 +630,7 @@ class LocalSettings {
bool hasMediaManagementHintDeleteAttemptsReached() {
return _mediaManagementHintDeleteAttempts >=
- _kMediaManagementHintDeleteAttemptThreshold;
+ mediaManagementHintDeleteAttemptThreshold;
}
bool get isMediaManagementHintDismissed {
@@ -642,7 +638,7 @@ class LocalSettings {
if (dismissedAtMs == 0) return false;
final elapsed = DateTime.now().millisecondsSinceEpoch - dismissedAtMs;
return elapsed >= 0 &&
- elapsed < _kMediaManagementHintDismissDuration.inMilliseconds;
+ elapsed < mediaManagementHintDismissDuration.inMilliseconds;
}
Future<void> incrementMediaManagementHintDeleteAttempts() async {
diff --git a/mobile/apps/photos/lib/utils/delete_file_util.dart b/mobile/apps/photos/lib/utils/delete_file_util.dart
index 47c956eb25..68c95bd37f 100644
--- a/mobile/apps/photos/lib/utils/delete_file_util.dart
+++ b/mobile/apps/photos/lib/utils/delete_file_util.dart
@@ -18,7 +18,6 @@ import "package:photos/generated/l10n.dart";
import "package:photos/l10n/l10n.dart";
import "package:photos/models/button_result.dart";
import 'package:photos/models/file/file.dart';
-import 'package:photos/models/file/file_type.dart';
import "package:photos/models/files_split.dart";
import "package:photos/models/freeable_space_info.dart";
import 'package:photos/models/selected_files.dart';
@@ -884,20 +883,12 @@ Future<void> showDeleteSheet(
}
var didDelete = false;
if (Platform.isAndroid && await MediaStoreService.canManageMedia()) {
- final hasVideos = localGalleryDeletableFiles.any(
- (file) => file.fileType == FileType.video,
- );
- final hasPhotos = localGalleryDeletableFiles.any(
- (file) => file.fileType != FileType.video,
- );
didDelete =
await showBottomSheetComponent<bool>(
context: context,
useRootNavigator: Platform.isIOS,
builder: (_) => DeleteConfirmationSheet(
count: localGalleryDeletableFiles.length,
- hasPhotos: hasPhotos,
- hasVideos: hasVideos,
isLocal: true,
isRemote: false,
onDeleteFromLocal: () async {
@@ -930,12 +921,6 @@ Future<void> showDeleteSheet(
}
final hasRemoteFiles = deletableFiles.any((f) => f.isUploaded);
final hasLocalFiles = deletableFiles.any((f) => f.localID != null);
- final hasVideos = deletableFiles.any(
- (file) => file.fileType == FileType.video,
- );
- final hasPhotos = deletableFiles.any(
- (file) => file.fileType != FileType.video,
- );
final bool isBothLocalAndRemote = hasRemoteFiles && hasLocalFiles;
final bool isLocalOnly = !hasRemoteFiles;
@@ -962,8 +947,6 @@ Future<void> showDeleteSheet(
isLocal: hasLocalFiles,
isRemote: hasRemoteFiles,
count: deletableFiles.length,
- hasPhotos: hasPhotos,
- hasVideos: hasVideos,
onDeleteFromLocal: () async {
await deleteOnDeviceOnlyAction(context, deletableFiles);
},
@@ -1060,8 +1043,6 @@ class DeleteConfirmationSheet extends StatefulWidget {
final bool isLocal;
final bool isRemote;
final int count;
- final bool hasPhotos;
- final bool hasVideos;
final Future<void> Function() onDeleteFromLocal;
final Future<void> Function() onDeleteFromRemote;
final Future<void> Function() onDeleteFromBoth;
@@ -1071,8 +1052,6 @@ class DeleteConfirmationSheet extends StatefulWidget {
required this.isLocal,
required this.isRemote,
required this.count,
- required this.hasPhotos,
- required this.hasVideos,
required this.onDeleteFromLocal,
required this.onDeleteFromRemote,
required this.onDeleteFromBoth,
@@ -1088,45 +1067,54 @@ class DeleteConfirmationSheetState extends State<DeleteConfirmationSheet> {
var _isMoreOptionsShown = false;
var _isSetAsDefaultSelected = false;
+ Future<void> _onDelete(
+ BuildContext context,
+ Future<void> Function() callback,
+ ) async {
+ try {
+ await callback();
+ if (context.mounted) {
+ Navigator.of(context).pop(true);
+ }
+ } catch (error) {
+ if (context.mounted) {
+ await showGenericErrorDialog(
+ context: context,
+ error: _toException(error),
+ );
+ if (context.mounted) {
+ Navigator.of(context).pop(false);
+ }
+ }
+ rethrow;
+ }
+ }
+
@override
Widget build(BuildContext context) {
final l10n = AppLocalizations.of(context);
final title = l10n.deleteItemsQuestion(count: widget.count);
- final body = widget.count == 1 && widget.isLocal && widget.isRemote
- ? l10n.singleFileInBothLocalAndRemote(fileType: "item")
- : widget.count == 1 && widget.isRemote
- ? l10n.singleFileInRemoteOnly(fileType: "item")
- : widget.count == 1 && widget.isLocal
- ? l10n.singleFileDeleteFromDevice(fileType: "Item")
- : widget.isLocal && widget.isRemote
- ? l10n.someSelectedFilesBackedUpToEnte(fileTypes: "items")
- : widget.isRemote
- ? l10n.selectedFilesBackedUpToEnte(fileTypes: "items")
- : l10n.selectedFilesSavedOnDeviceOnly(fileTypes: "Items");
- final deletePreference = (widget.isLocal && !widget.isRemote)
- ? DeletePreference.DeleteFromLocalOnly
- : (widget.isRemote && !widget.isLocal)
- ? DeletePreference.DeleteFromRemoteOnly
- : localSettings.getDeletePreference() ??
- DeletePreference.DeleteFromBoth;
- Future<void> onDelete(Future<void> Function() callback) async {
- try {
- await callback();
- if (context.mounted) {
- Navigator.of(context).pop(true);
- }
- } catch (error) {
- if (context.mounted) {
- await showGenericErrorDialog(
- context: context,
- error: _toException(error),
- );
- if (context.mounted) {
- Navigator.of(context).pop(false);
- }
- }
- rethrow;
- }
+ var body = l10n.selectedFilesSavedOnDeviceOnly;
+ if (widget.count == 1 && widget.isLocal && widget.isRemote) {
+ body = l10n.singleFileInBothLocalAndRemote;
+ } else if (widget.count == 1 && widget.isRemote) {
+ body = l10n.singleFileInRemoteOnly;
+ } else if (widget.count == 1 && widget.isLocal) {
+ body = l10n.singleFileDeleteFromDevice;
+ } else if (widget.isLocal && widget.isRemote) {
+ body = l10n.someSelectedFilesBackedUpToEnte;
+ } else if (widget.isRemote) {
+ body = l10n.selectedFilesBackedUpToEnte;
+ }
+ var deletePreference = DeletePreference.DeleteFromBoth;
+ if (widget.isLocal && !widget.isRemote) {
+ deletePreference = DeletePreference.DeleteFromLocalOnly;
+ } else if (widget.isRemote && !widget.isLocal) {
+ deletePreference = DeletePreference.DeleteFromRemoteOnly;
+ } else {
+ deletePreference =
+ localSettings.getDeletePreference() ??
+ DeletePreference.DeleteFromBoth;
}
return BottomSheetComponent(
@@ -1153,7 +1141,7 @@ class DeleteConfirmationSheetState extends State<DeleteConfirmationSheet> {
if (_isSetAsDefaultSelected) {
await localSettings.setDeletePreference(.DeleteFromLocalOnly);
}
- await onDelete(widget.onDeleteFromLocal);
+ await _onDelete(context, widget.onDeleteFromLocal);
},
),
ButtonComponent(
@@ -1163,7 +1151,7 @@ class DeleteConfirmationSheetState extends State<DeleteConfirmationSheet> {
if (_isSetAsDefaultSelected) {
await localSettings.setDeletePreference(.DeleteFromRemoteOnly);
}
- await onDelete(widget.onDeleteFromRemote);
+ await _onDelete(context, widget.onDeleteFromRemote);
},
),
ButtonComponent(
@@ -1173,7 +1161,7 @@ class DeleteConfirmationSheetState extends State<DeleteConfirmationSheet> {
if (_isSetAsDefaultSelected) {
await localSettings.setDeletePreference(.DeleteFromBoth);
}
- await onDelete(widget.onDeleteFromBoth);
+ await _onDelete(context, widget.onDeleteFromBoth);
},
),
] else ...[
@@ -1189,11 +1177,11 @@ class DeleteConfirmationSheetState extends State<DeleteConfirmationSheet> {
onTap: () async {
switch (deletePreference) {
case DeletePreference.DeleteFromRemoteOnly:
- await onDelete(widget.onDeleteFromRemote);
+ await _onDelete(context, widget.onDeleteFromRemote);
case DeletePreference.DeleteFromLocalOnly:
- await onDelete(widget.onDeleteFromLocal);
+ await _onDelete(context, widget.onDeleteFromLocal);
case DeletePreference.DeleteFromBoth:
- await onDelete(widget.onDeleteFromBoth);
+ await _onDelete(context, widget.onDeleteFromBoth);
}
},
),