mirror of
https://github.com/fishyboteso/fishyboteso.git
synced 2024-08-30 18:32:13 +00:00
Update main_gui.py
This commit is contained in:
parent
ad77ac85b9
commit
cab56da6e4
@ -5,6 +5,7 @@ import tkinter.ttk as ttk
|
||||
from tkinter import messagebox
|
||||
import typing
|
||||
from functools import partial
|
||||
import os
|
||||
|
||||
from fishy.gui import update_dialog
|
||||
from ttkthemes import ThemedTk
|
||||
@ -84,22 +85,27 @@ def _create(gui: 'GUI'):
|
||||
debug_menu.add_command(label="Check QR Value",
|
||||
command=lambda: gui.engine.check_qr_val())
|
||||
|
||||
|
||||
def toggle_show_grab():
|
||||
new_val = 1 - config.get("show_grab", 0)
|
||||
show_grab_var.set(new_val)
|
||||
config.set("show_grab", new_val)
|
||||
if new_val:
|
||||
logging.info(f"Screenshots taken by fishy will be saved in {helper.save_img_path()}")
|
||||
messagebox.showwarning("Warning", "Screenshots taken by Fishy will be saved in Documents.")
|
||||
logging.info(f"Screenshots taken by Fishy will be saved in {helper.save_img_path()}")
|
||||
else:
|
||||
delete_screenshots = messagebox.askyesno("Confirmation", "Do you want to delete the saved screenshots?")
|
||||
if delete_screenshots:
|
||||
# Delete the saved screenshots
|
||||
# Add your code here to delete the screenshots
|
||||
logging.info("Saved screenshots have been deleted.")
|
||||
folder_path = helper.save_img_path()
|
||||
try:
|
||||
os.rmdir(folder_path) # Deletes the folder
|
||||
logging.info("Saved screenshots folder has been deleted.")
|
||||
except OSError as e:
|
||||
logging.error(f"Error occurred while deleting the folder: {e}")
|
||||
else:
|
||||
logging.info("Saved screenshots were not deleted.")
|
||||
logging.info("Saved screenshots will be preserved.")
|
||||
|
||||
|
||||
show_grab_var = tk.IntVar()
|
||||
show_grab_var.set(config.get("show_grab", 0))
|
||||
|
Loading…
Reference in New Issue
Block a user