From 4cb3817e722a38d1c218738a6068870ac2511499 Mon Sep 17 00:00:00 2001 From: Yusen Wu Date: Mon, 5 Feb 2024 01:01:42 +0000 Subject: [PATCH] FIx: GUI open in window --- jsoneditor.py | 6 ++---- modules/configs/defaultSettings.py | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/jsoneditor.py b/jsoneditor.py index 7fb0cb27..a5498c76 100644 --- a/jsoneditor.py +++ b/jsoneditor.py @@ -5,11 +5,10 @@ import sys from modules.configs.MyConfig import MyConfigger, config # 是否以网页形式运行 - isweb=True print("参数:", sys.argv) if len(sys.argv) > 1: if sys.argv[1] == "window": - isweb=False + config.sessiondict["GUI_OPEN_IN_WEB"] = False # 获取到user config文件夹下以json为后缀的文件 def get_json_list(): return [i for i in os.listdir(MyConfigger.USER_CONFIG_FOLDER) if i.endswith(".json")] @@ -37,8 +36,7 @@ def get_json_list(): show_GUI(alljson_list[i], MyConfigger()) # 运行GUI - print("打开形式:"+("网页" if isweb else "窗口")) - if not isweb: + if not config.sessiondict["GUI_OPEN_IN_WEB"]: ui.run(native=True, window_size=(1280,720), title=f"Blue Archive Aris Helper{MyConfigger.NOWVERSION}", favicon="./DATA/assets/aris.ico", language="zh-cn", reload=False, port=native.find_open_port()) else: ui.run(title=f"Blue Archive Aris Helper{MyConfigger.NOWVERSION}", favicon="./DATA/assets/aris.ico", language="zh-cn", reload=False, port=native.find_open_port()) diff --git a/modules/configs/defaultSettings.py b/modules/configs/defaultSettings.py index 7c1f637d..8d412d76 100644 --- a/modules/configs/defaultSettings.py +++ b/modules/configs/defaultSettings.py @@ -95,4 +95,5 @@ defaultSessionDict = { "PORT_IS_USED":{"d":False}, "EMULATOR_PROCESS_PID":{"d":None}, + "GUI_OPEN_IN_WEB":{"d":True} } \ No newline at end of file