From 4d8f3e367997ef0db12cbe6b0ec4186343fd832c Mon Sep 17 00:00:00 2001 From: faroukbmiled Date: Wed, 20 Sep 2023 14:44:00 +0100 Subject: [PATCH] add --- boiiiwd_package/src/helpers.py | 6 ++---- boiiiwd_package/src/main.py | 5 ++--- boiiiwd_package/src/settings_tab.py | 6 ++---- boiiiwd_package/src/update_window.py | 9 ++++----- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/boiiiwd_package/src/helpers.py b/boiiiwd_package/src/helpers.py index 492a047..30af1aa 100644 --- a/boiiiwd_package/src/helpers.py +++ b/boiiiwd_package/src/helpers.py @@ -21,10 +21,8 @@ def check_custom_theme(theme_name): if os.path.exists(os.path.join(application_path, theme_name)): return os.path.join(application_path, theme_name) else: - try: - return os.path.join(RESOURCES_DIR, theme_name) - except: - return os.path.join(RESOURCES_DIR, "boiiiwd_theme.json") + try: return os.path.join(RESOURCES_DIR, theme_name) + except: return os.path.join(RESOURCES_DIR, "boiiiwd_theme.json") # theme initialization ctk.set_appearance_mode(check_config("appearance", "Dark")) # Modes: "System" (standard), "Dark", "Light" diff --git a/boiiiwd_package/src/main.py b/boiiiwd_package/src/main.py index 0143170..b2f0c7b 100644 --- a/boiiiwd_package/src/main.py +++ b/boiiiwd_package/src/main.py @@ -223,8 +223,7 @@ class BOIIIWD(ctk.CTk): self.settings_tab.load_settings("reset_on_fail", "10") self.settings_tab.load_settings("show_fails", "on") self.settings_tab.load_settings("skip_already_installed", "on") - except: - pass + except: pass if not check_steamcmd(): self.show_steam_warning_message() @@ -367,7 +366,7 @@ class BOIIIWD(ctk.CTk): self.library_tab.grid_remove() def show_library_widgets(self): - self.title("BOIII Workshop Downloader - Library") + self.title("BOIII Workshop Downloader - Library ➜ Loading... ⏳") status = self.library_tab.load_items(self.edit_destination_folder.get()) self.library_tab.grid(row=0, rowspan=3, column=1, padx=(0, 20), pady=(20, 20), sticky="nsew") self.title(f"BOIII Workshop Downloader - Library ➜ {status}") diff --git a/boiiiwd_package/src/settings_tab.py b/boiiiwd_package/src/settings_tab.py index ce996f6..41f123a 100644 --- a/boiiiwd_package/src/settings_tab.py +++ b/boiiiwd_package/src/settings_tab.py @@ -216,10 +216,8 @@ class SettingsTab(ctk.CTkFrame): pass def enable_save_button(self, *args): - try: - self.save_button.configure(state='normal') - except: - pass + try: self.save_button.configure(state='normal') + except: pass def save_settings(self): self.save_button.configure(state='disabled') diff --git a/boiiiwd_package/src/update_window.py b/boiiiwd_package/src/update_window.py index 541828c..a70af6c 100644 --- a/boiiiwd_package/src/update_window.py +++ b/boiiiwd_package/src/update_window.py @@ -133,12 +133,11 @@ class UpdateWindow(ctk.CTkToplevel): os.remove(fr"{zip_path}") self.label_download.configure(text="Update cancelled.") self.progress_bar.set(0.0) - # there's a better solution ill implement it later - try: - main_app.app.attributes('-alpha', 1.0) - except: - pass + + try: main_app.app.attributes('-alpha', 1.0) + except: pass show_message("Cancelled!", "Update cancelled by user", icon="warning") + except Exception as e: self.progress_bar.set(0.0) self.label_download.configure(text="Update failed")