Merge pull request #5 from faroukbmiled/refactored

UI bug fix
This commit is contained in:
Ryuk 2023-09-24 11:59:31 -07:00 committed by GitHub
commit d9d34f4366
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -224,13 +224,10 @@ class LibraryTab(ctk.CTkScrollableFrame):
def load_items(self, boiiiFolder, dont_add=False):
if self.refresh_next_time and not dont_add:
self.refresh_next_time = False
self.refresh_items()
return
status = self.refresh_items()
return status
if dont_add:
self.label_list.clear()
self.button_list.clear()
self.button_view_list.clear()
self.added_items.clear()
self.added_folders.clear()
self.ids_added.clear()
@ -426,7 +423,7 @@ class LibraryTab(ctk.CTkScrollableFrame):
self.button_view_list.remove(button_view_list)
self.remove_item_by_option(items_file, id)
def refresh_items(self, skip_load=False):
def refresh_items(self):
main_app.app.title("BOIII Workshop Downloader - Library ➜ Loading... ⏳")
for label, button, button_view_list in zip(self.label_list, self.button_list, self.button_view_list):
label.destroy()
@ -438,9 +435,10 @@ class LibraryTab(ctk.CTkScrollableFrame):
self.added_items.clear()
self.added_folders.clear()
self.ids_added.clear()
if not skip_load:
status = self.load_items(main_app.app.edit_destination_folder.get().strip())
main_app.app.title(f"BOIII Workshop Downloader - Library ➜ {status}")
status = self.load_items(main_app.app.edit_destination_folder.get().strip())
main_app.app.title(f"BOIII Workshop Downloader - Library ➜ {status}")
# main_app library event needs a return for status => when refresh_next_time is true
return status
def view_item(self, workshop_id):
url = f"https://steamcommunity.com/sharedfiles/filedetails/?id={workshop_id}"