Skip to content

Commit

Permalink
Bug Fix
Browse files Browse the repository at this point in the history
- Fixed "Developer Mode"
- Renamed Button 1 to install Quilt
- Updated shell script
  • Loading branch information
Ivole32 authored Sep 2, 2024
1 parent 0f6e795 commit 7aa5957
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
11 changes: 8 additions & 3 deletions loader-install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

install_quilt()
{
install_quilt() {
mkdir installer
cd installer
curl -L -o quilt-installer.jar https://quiltmc.org/api/v1/download-latest-installer/java-universal
Expand All @@ -13,5 +12,11 @@ install_quilt()
echo "Quilt installation is complete in $INSTALL_DIR!"
}

install_loader() {
if [ "$1" == "quilt" ]; then
install_quilt
fi
}


# Aufruf der Funktion mit Parameter "quilt"
install_loader $1
12 changes: 8 additions & 4 deletions main_GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,20 @@
def switch_setting(switch_var):
config["settings"]["developer-mode"] = str(switch_var.get())
with open('config.ini', 'w') as configfile:

config.write(configfile)

button1 = ctk.CTkButton(tabview.tab("Manage Profiles"), text="Button 1", command=lambda:subprocess.Popen(["./loader-install.sh"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True))
button1 = 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))
button1.grid(row=1, column=0, sticky="nsew")

switch_var = ctk.IntVar(value=0)
try:
switch_var = ctk.IntVar(value=int(config["settings"]["developer-mode"]))
except:
switch_var = ctk.IntVar(value=int(config["settings"]["developer-mode"][1:-1]))


switch = ctk.CTkSwitch(tabview.tab("Settings"), text="Developer Mode", variable=switch_var, command=lambda:switch_setting(switch_var))
switch.pack(padx=20)
switch.grid(row=0, column=0, padx=20, pady=10, sticky="nsew")




Expand Down
13 changes: 10 additions & 3 deletions prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

ctk = None

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


def ensure_customtkinter():
"""Attempts to import customtkinter and installs it if necessary."""
global ctk
Expand Down Expand Up @@ -81,15 +87,16 @@ def install_packages(packages, log_text_widget, progress_bar, install_window):
progress_bar.set(1.0)
show_finish_button(install_window)

def finish(install_window=None):
def finish(install_window=None, trigger=False):
try:
install_window.destroy()
finally:
create_config(trigger)
import main_GUI
sys.exit(0)

def show_finish_button(install_window):
finish_button = ctk.CTkButton(install_window, text="Finish", command=lambda: finish(install_window))
finish_button = ctk.CTkButton(install_window, text="Finish", command=lambda: finish(install_window, True))
finish_button.grid(row=3, column=0, columnspan=2, pady=10)

def start_installation(install_window):
Expand Down Expand Up @@ -152,7 +159,7 @@ def show_installation_window():
install_window.mainloop()
else:
print("No packages need to be installed.")
finish()
finish(False)

show_installation_window()

0 comments on commit 7aa5957

Please sign in to comment.