Skip to content

Commit

Permalink
Hot Fix
Browse files Browse the repository at this point in the history
On no...
  • Loading branch information
Ivole32 authored Sep 3, 2024
1 parent 4ccdb7b commit 80a80d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions main_GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,14 @@ def load_switch_var():
switch_var = ctk.IntVar(value=int(config["settings"]["developer-mode"][1:-1]))
return switch_var

def reload_window(event):
def reload_window(event=None):
root.destroy()
os.system("python3 main.py")

def add_buttons():
install_quilt_button = ctk.CTkButton(tabview.tab("Manage Profiles"), text="Install Quilt", command=lambda:subprocess.Popen(["./loader-install.sh", "quilt"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True))
install_quilt_button.grid(row=1, column=0, sticky="nsew")

reload_button = ctk.CTkButton(tabview.tab("Settings"), text="Reload", command=reload_window)
reload_button.grid(row=1, column=0, sticky="nsew")

def add_switches():
developer_mode_switch_var = load_switch_var()
Expand All @@ -80,13 +78,15 @@ def check_tab_change():
last_tab = selected_tab
root.after(1, check_tab_change)

root.bind("r", reload_window)

check_tab_change()

add_buttons()
add_switches()

if load_switch_var().get() == 1:
root.bind("r", reload_window)

root.mainloop()


2 changes: 1 addition & 1 deletion prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
ctk = None

def create_config(trigger):
if trigger == True:
if trigger == True or not os.path.isfile("config.ini"):
with open("config.ini", "w") as config:
config.write("[settings]\ndeveloper-mode = '0'")

Expand Down

0 comments on commit 80a80d4

Please sign in to comment.