From b7a04b8c9e0552d76a63df8a618b5b8a93447b58 Mon Sep 17 00:00:00 2001 From: MrBananaPants Date: Fri, 29 Jul 2022 16:37:02 +0200 Subject: [PATCH] Added confirmation before resetting the app --- PyFit.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/PyFit.py b/PyFit.py index 9b800aa..2e32f33 100644 --- a/PyFit.py +++ b/PyFit.py @@ -367,17 +367,18 @@ def check_for_updates(alert_when_no_update=False): def reset(): - clear_entries() - clear_edit_entries() - remove_files() - check_files() - workout_option_menu.configure(values=get_stored_workouts()) - workout_option_menu.set(get_stored_workouts()[0]) - select_stored_workout_menu.configure(values=get_stored_workout_names()) - select_stored_workout_menu.set(get_stored_workout_names()[0]) - ctk.set_appearance_mode("dark") - app.update() - messagebox.showinfo("PyFit", "Reset complete. Custom workouts have been removed.") + if messagebox.askyesno("PyFit", f"Are you sure you want to continue? This will remove all custom workout files and reset all settings."): + clear_entries() + clear_edit_entries() + remove_files() + check_files() + workout_option_menu.configure(values=get_stored_workouts()) + workout_option_menu.set(get_stored_workouts()[0]) + select_stored_workout_menu.configure(values=get_stored_workout_names()) + select_stored_workout_menu.set(get_stored_workout_names()[0]) + ctk.set_appearance_mode("dark") + app.update() + messagebox.showinfo("PyFit", "Reset complete") def remove_files():