From 08c625d991226530631e54445cf841f1e7a84202 Mon Sep 17 00:00:00 2001 From: moyanj <1561515308@qq.com> Date: Mon, 9 Sep 2024 22:55:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E4=BA=8E=E7=95=8C=E9=9D=A2=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E5=92=8C=E8=AE=BE=E7=BD=AE=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=B8=85=E7=90=86=E5=92=8C=E5=8A=9F=E8=83=BD=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- interface/init/about.py | 4 +--- interface/setting.py | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/interface/init/about.py b/interface/init/about.py index b37e224..39a3492 100644 --- a/interface/init/about.py +++ b/interface/init/about.py @@ -2,6 +2,4 @@ from PyQt5.QtWidgets import QWidget class AboutWidget(QWidget): def __init__(self, typex="init"): - self.init_ui() - - def init_ui() \ No newline at end of file + \ No newline at end of file diff --git a/interface/setting.py b/interface/setting.py index d269b41..6f3e691 100644 --- a/interface/setting.py +++ b/interface/setting.py @@ -35,7 +35,7 @@ class SettingWidget(QWidget): def save(self): # 保存配置到 JSON 文件 - with open("config.json", "w") as config_file: + with open(os.path.join(env.dirs.user_config_path, "config.json"), "w") as config_file: config_file.write(self.c1.toPlainText()) InfoBar.success( @@ -50,7 +50,7 @@ class SettingWidget(QWidget): def reload(self): # 重新加载 JSON 配置 - with open("config.json", "r") as config_file: + with open(os.path.join(env.dirs.user_config_path, "config.json"), "r") as config_file: config_data = config_file.read() self.c1.setPlainText(config_data)