From a9692a2ee972d1638a087a3b68c216e1d4312f55 Mon Sep 17 00:00:00 2001 From: misyaguziya Date: Sun, 24 Sep 2023 05:36:39 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=91=8D[Update]=20model=20:=20update?= =?UTF-8?q?=E7=B5=90=E6=9E=9C=E3=82=92return=E3=81=A7=E5=87=BA=E5=8A=9B?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/model.py b/model.py index 26a01bef..1bb20dbd 100644 --- a/model.py +++ b/model.py @@ -219,15 +219,15 @@ class Model: fnc() @staticmethod - def checkSoftwareUpdated(fnc): + def checkSoftwareUpdated(): # check update + update_flag = False response = requests_get(config.GITHUB_URL) - tag_name = response.json()["tag_name"] - if tag_name != config.VERSION: - try: - fnc(True) - except: - pass + new_version = response.json()["name"] + if new_version != config.VERSION: + update_flag = True + print("software version", "now:", config.VERSION, "new:", new_version) + return update_flag @staticmethod def getListInputHost(): From 7662dd4bf5761ae9368d396b1dc3ed28508b18d9 Mon Sep 17 00:00:00 2001 From: misyaguziya Date: Sun, 24 Sep 2023 05:38:48 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=91=8D[Update]=20Main=20WIndow=20:=20?= =?UTF-8?q?update=E5=87=A6=E7=90=86=E3=82=92model=E3=81=AE=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=E3=81=AB=E5=90=88=E3=82=8F=E3=81=9B=E3=81=A6=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updateの結果から直接viewを変更する --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 303a7671..03c684aa 100644 --- a/main.py +++ b/main.py @@ -583,7 +583,8 @@ if config.STARTUP_OSC_ENABLED_CHECK is True and config.ENABLE_SEND_MESSAGE_TO_VR model.checkOSCStarted(view.printToTextbox_OSCError) # check Software Updated -model.checkSoftwareUpdated(callbackChangeStatusSoftwareUpdated) +if model.checkSoftwareUpdated() is True: + view.showUpdateAvailableButton() # init logger if config.ENABLE_LOGGER is True: From 95a9adadefc1990b8c796997344ffad25663ab78 Mon Sep 17 00:00:00 2001 From: misyaguziya Date: Sun, 24 Sep 2023 05:41:00 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=91=8D[Update]=20Main=20Window=20:=20?= =?UTF-8?q?UPDATE=5FFLAG=E3=81=B8=E3=81=AE=E5=87=A6=E7=90=86=E3=82=92?= =?UTF-8?q?=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.py | 10 ---------- main.py | 6 ------ 2 files changed, 16 deletions(-) diff --git a/config.py b/config.py index 42c1c404..dd16d9c4 100644 --- a/config.py +++ b/config.py @@ -399,15 +399,6 @@ class Config: self._STARTUP_OSC_ENABLED_CHECK = value saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value) - @property - def UPDATE_FLAG(self): - return self._UPDATE_FLAG - - @UPDATE_FLAG.setter - def UPDATE_FLAG(self, value): - if type(value) is bool: - self._UPDATE_FLAG = value - @property def GITHUB_URL(self): return self._GITHUB_URL @@ -519,7 +510,6 @@ class Config: self._ENABLE_NOTICE_XSOVERLAY = False self._ENABLE_SEND_MESSAGE_TO_VRC = True self._STARTUP_OSC_ENABLED_CHECK = True - self._UPDATE_FLAG = False self._GITHUB_URL = "https://api.github.com/repos/misyaguziya/VRCT/releases/latest" # self._BREAK_KEYSYM_LIST = [ # "Delete", "Select", "Up", "Down", "Next", "End", "Print", diff --git a/main.py b/main.py index 03c684aa..73c62eb7 100644 --- a/main.py +++ b/main.py @@ -223,9 +223,6 @@ def callbackSelectedLanguagePresetTab(selected_tab_no): def callbackSetAuthKeys(keys): config.AUTH_KEYS = keys -def callbackChangeStatusSoftwareUpdated(value): - config.UPDATE_FLAG = value - # command func def callbackToggleTranslation(is_turned_on): config.ENABLE_TRANSLATION = is_turned_on @@ -669,8 +666,5 @@ view.register( }, ) -if config.UPDATE_FLAG is True: - view.showUpdateAvailableButton() - if __name__ == "__main__": view.startMainLoop() \ No newline at end of file