diff --git a/assets/i18n/en_US.json b/assets/i18n/en_US.json index b732f5453d..13163555f5 100644 --- a/assets/i18n/en_US.json +++ b/assets/i18n/en_US.json @@ -17,7 +17,7 @@ "homeView": { "refreshSuccess": "Refreshed successfully", "widgetTitle": "Dashboard", - + "updatesSubtitle": "Updates", "patchedSubtitle": "Patched applications", @@ -211,6 +211,7 @@ "resetStoredPatchesLabel": "Reset patches", "resetStoredPatchesHint": "Reset the stored patches selection", + "resetStoredPatchesDialogText": "Are you sure you want to reset the stored patches selection?", "resetStoredPatches": "Patches selection has been reset", "deleteLogsLabel": "Delete logs", diff --git a/lib/ui/widgets/settingsView/settings_export_section.dart b/lib/ui/widgets/settingsView/settings_export_section.dart index 0702f065b7..b2d65c9577 100644 --- a/lib/ui/widgets/settingsView/settings_export_section.dart +++ b/lib/ui/widgets/settingsView/settings_export_section.dart @@ -3,6 +3,7 @@ import 'package:flutter_i18n/widgets/I18nText.dart'; import 'package:revanced_manager/ui/views/settings/settingsFragment/settings_manage_keystore_password.dart'; import 'package:revanced_manager/ui/views/settings/settings_viewmodel.dart'; import 'package:revanced_manager/ui/widgets/settingsView/settings_section.dart'; +import 'package:revanced_manager/ui/widgets/shared/custom_material_button.dart'; final _settingsViewModel = SettingsViewModel(); @@ -91,9 +92,36 @@ class SExportSection extends StatelessWidget { ), ), subtitle: I18nText('settingsView.resetStoredPatchesHint'), - onTap: () => _settingsViewModel.resetSelectedPatches(), + onTap: () => _showResetStoredPatchesDialog(context), ), ], ); } + + Future _showResetStoredPatchesDialog(context) { + return showDialog( + context: context, + builder: (context) => AlertDialog( + title: I18nText('warning'), + backgroundColor: Theme.of(context).colorScheme.secondaryContainer, + content: I18nText( + 'settingsView.resetStoredPatchesDialogText', + ), + actions: [ + CustomMaterialButton( + isFilled: false, + label: I18nText('noButton'), + onPressed: () => Navigator.of(context).pop(), + ), + CustomMaterialButton( + label: I18nText('yesButton'), + onPressed: () => { + Navigator.of(context).pop(), + _settingsViewModel.resetSelectedPatches() + }, + ) + ], + ), + ); + } }