Skip to content

Commit

Permalink
Added confirmation before resetting the app
Browse files Browse the repository at this point in the history
  • Loading branch information
MrBananaPants committed Jul 29, 2022
1 parent fcd1b85 commit b7a04b8
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions PyFit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit b7a04b8

Please sign in to comment.