From 0a1772ea5ea13ee077324f56703bd56dd42e4550 Mon Sep 17 00:00:00 2001 From: Falko Habel Date: Sun, 5 May 2024 21:13:27 +0200 Subject: [PATCH] Simple Bug Fixing and Simple Linux Support --- main.py | 8 +++++--- scripts/ClosePopup.py | 8 +++++--- scripts/get_sys_info.py | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/main.py b/main.py index 36c5b0c..6970802 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,5 @@ import customtkinter as Ctk +import platform from icons.icons import Icons import scripts.get_sys_info as system_code @@ -25,9 +26,10 @@ class App(Ctk.CTk): self.font_entry = Ctk.CTkFont(family="Berlin Sans FB", size=18) self.minsize(1000, 750) self.geometry(f"{system_code.window_width}x{system_code.window_height}") - icon_path = self.icons.get_icon_path() - self.iconbitmap(icon_path) - self.after(1, self.wm_state, system_code.window_state) + if platform.system() == "Windows": + icon_path = self.icons.get_icon_path() + self.iconbitmap(icon_path) + self.after(1, self.wm_state, system_code.window_state) self.back_btn_image = self.icons.get_image("BackButton") self.title("MPENN") self.protocol('WM_DELETE_WINDOW', self.close_attempt) diff --git a/scripts/ClosePopup.py b/scripts/ClosePopup.py index f212dba..da022e2 100644 --- a/scripts/ClosePopup.py +++ b/scripts/ClosePopup.py @@ -1,5 +1,6 @@ import customtkinter as Ctk import scripts.get_sys_info as system_code +import platform from icons.icons import Icons @@ -11,9 +12,10 @@ class ClosePopup(Ctk.CTkToplevel): self.my_font = Ctk.CTkFont(family="Berlin Sans FB", size=22) self.geometry("400x300") self.resizable(False, False) - icon_path = self.icons.get_icon_path() - self.iconbitmap(icon_path) - self.after(201, lambda: self.iconbitmap(icon_path)) + if platform.system() == "Windows": + icon_path = self.icons.get_icon_path() + self.iconbitmap(icon_path) + self.after(201, lambda: self.iconbitmap(icon_path)) self.callback = callback self.label = Ctk.CTkLabel(self, text="Do you want to leave?\n You might lose some Data", font=self.my_font) # Add exit button diff --git a/scripts/get_sys_info.py b/scripts/get_sys_info.py index dc9614e..ad8328b 100644 --- a/scripts/get_sys_info.py +++ b/scripts/get_sys_info.py @@ -156,7 +156,7 @@ def set_theme(): data_path = create_folder("MPENNconfigs") -json_file_path = data_path + "./program.json" +json_file_path = data_path + "/program.json" theme = Theme(path=data_path)