From c4df06615d36008389ff719a66acc49d5ffaa64e Mon Sep 17 00:00:00 2001 From: "Jeison Yehuda Amihud (Blender Dumbass)" Date: Mon, 11 Jan 2021 19:07:16 +0000 Subject: [PATCH] Updater Now Can Re-Install the Full VCStudio I made some mistakes in the names of the Versions. For the updater. And so I need a way to fix it. So users could install the updates regardless of their version. I think I'm going to push a silent update for this. And change the names of the versions. So users could click update all for the next one. Or something like this. I don't know. Wait. Let's give users a day or two. I gonna update with the wrong names this time. Fully documented. Then update the number. So 21.1 will be 21.01 which is the more reasonable name. LOL. Anyways. Here is this. LOL. --- project_manager/pm_installUpdatesLayer.py | 2 + project_manager/pm_updateLayer.py | 51 ++++++++++++++++++++++- project_manager/update_reader.py | 10 +++++ 3 files changed, 61 insertions(+), 2 deletions(-) diff --git a/project_manager/pm_installUpdatesLayer.py b/project_manager/pm_installUpdatesLayer.py index 15f81e6..2aae0b3 100644 --- a/project_manager/pm_installUpdatesLayer.py +++ b/project_manager/pm_installUpdatesLayer.py @@ -71,6 +71,8 @@ def layer(win): frame = win.current["frame"] - win.update["frame"] - 50 files = win.update["get_files"] + if win.settings["Update_all"]: + files = win.update["get_all_files"] UI_color.set(layer, win, "progress_background") UI_elements.roundrect(layer, win, diff --git a/project_manager/pm_updateLayer.py b/project_manager/pm_updateLayer.py index 088f3c4..e162f88 100644 --- a/project_manager/pm_updateLayer.py +++ b/project_manager/pm_updateLayer.py @@ -29,6 +29,9 @@ def layer(win): win.current['h']) layer = cairo.Context(surface) + print("NEW FILES:", win.update["get_files"]) + print("ALL FILES:", win.update["get_all_files"]) + #text setting layer.select_font_face("Monospace", cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_NORMAL) @@ -68,10 +71,54 @@ def layer(win): button=do, icon="cancel", tip=talk.text("cancel")) + + + # Setting to get all files. Sometimes you need a way to restore the entire + # program. Or sometimes I make mistakes. And want give myself and others a + # simple way to refresh the system. So here I gonna make a button that will + # tell the updater to ignore the update version and download the whole + # package. All 300 something files. ( It's 2021/01 at the time. ) + + # Also not so long ago I made Version naming mistakes. So some kind of way + # to download versions should exist. Here we go. + + if "Update_all" not in win.settings: + win.settings["Update_all"] = False + settings.write("Update_all", False) + + if win.settings["Update_all"]: + ic = "checked" + else: + ic = "unchecked" + + def do(): + win.settings["Update_all"] = not win.settings["Update_all"] + settings.write("Update_all", win.settings["Update_all"]) + + + UI_elements.roundrect(layer, win, + win.current["w"]/2-250, + win.current["h"]-140, + 420, + 40, + 10, + button=do, + icon=ic, + tip=talk.text("update_all_tooltip")) + + + UI_color.set(layer, win, "text_normal") + layer.set_font_size(15) + layer.move_to( + win.current["w"]/2-200, + win.current["h"]-115) + layer.show_text(talk.text("update_all")+" "+str(len(win.update["get_all_files"]))+" "+talk.text("files")) + + # Install Updates button try: - if win.update["count"]: + if win.update["count"] or win.settings["Update_all"]: def do(): win.url = "install_updates" win.update["frame"] = win.current["frame"] @@ -87,7 +134,7 @@ def layer(win): icon="ok", tip=talk.text("update_install")) except: - pass + pass # Clipping everything UI_elements.roundrect(layer, win, diff --git a/project_manager/update_reader.py b/project_manager/update_reader.py index da708c5..618777b 100644 --- a/project_manager/update_reader.py +++ b/project_manager/update_reader.py @@ -50,6 +50,7 @@ def get_update_info(win): stdout=PIPE, universal_newlines=True) win.update["versions"] = {} win.update["get_files"] = [] + win.update["get_all_files"] = [] elif "END" not in win.update: # This going to read lines returned by the process on every frame. @@ -94,6 +95,15 @@ def get_update_info(win): if line not in win.update["get_files"]: win.update["get_files"].append(line) + # All files. In case the user wants to update everything + # or I made a mistake somewhere. There will be an option + # in the update UI to download everything. + + if line not in win.update["get_all_files"]: + win.update["get_all_files"].append(line) + + + except: pass