Squashed commit of the following:
commit 8724c545a8af8f34565aa71620e66cbd71547f37 Author: DLmaster <DLmaster_361@163.com> Date: Fri Apr 11 18:08:28 2025 +0800 feat(core): 预接入mirrorc commit d57ebaa281ff7c418aa8f11fe8e8ba260d8dbeca Author: DLmaster <DLmaster_361@163.com> Date: Thu Apr 10 12:37:26 2025 +0800 chore(core): 基础配置相关内容重构 - 添加理智药设置选项 #34 - 输入对话框添加回车键确认能力 #35 - 用户列表UI改版升级 - 配置类取消单例限制 - 配置读取方式与界面渲染方法优化 commit 710542287d04719c8443b91acb227de1dccc20d0 Author: DLmaster <DLmaster_361@163.com> Date: Fri Mar 28 23:32:17 2025 +0800 chore(core): search相关结构重整 commit 8009c69236655e29119ce62ff53a0360abaed2af Merge:648f42b9f88f92Author: DLmaster <DLmaster_361@163.com> Date: Mon Mar 24 15:31:40 2025 +0800 Merge branch 'dev' into user_list_dev
This commit is contained in:
@@ -31,6 +31,7 @@ from PySide6.QtWidgets import (
|
||||
QApplication,
|
||||
QVBoxLayout,
|
||||
)
|
||||
from PySide6.QtCore import Qt
|
||||
from qfluentwidgets import (
|
||||
ScrollArea,
|
||||
FluentIcon,
|
||||
@@ -38,13 +39,12 @@ from qfluentwidgets import (
|
||||
Dialog,
|
||||
HyperlinkCard,
|
||||
HeaderCardWidget,
|
||||
SwitchSettingCard,
|
||||
RangeSettingCard,
|
||||
ExpandGroupSettingCard,
|
||||
PushSettingCard,
|
||||
ComboBoxSettingCard,
|
||||
HyperlinkButton,
|
||||
)
|
||||
import os
|
||||
import re
|
||||
import json
|
||||
import time
|
||||
import shutil
|
||||
@@ -56,8 +56,10 @@ from typing import Dict, List, Union
|
||||
|
||||
from app.core import Config, MainInfoBar
|
||||
from app.services import Crypto, System, Notify
|
||||
from app.utils import DownloadManager
|
||||
from .Widget import (
|
||||
SwitchSettingCard,
|
||||
RangeSettingCard,
|
||||
ComboBoxSettingCard,
|
||||
LineEditMessageBox,
|
||||
LineEditSettingCard,
|
||||
PasswordLineEditSettingCard,
|
||||
@@ -111,7 +113,7 @@ class Setting(QWidget):
|
||||
def agree_bilibili(self) -> None:
|
||||
"""授权bilibili游戏隐私政策"""
|
||||
|
||||
if Config.global_config.get(Config.global_config.function_IfAgreeBilibili):
|
||||
if Config.get(Config.function_IfAgreeBilibili):
|
||||
|
||||
choice = MessageBox(
|
||||
"授权声明",
|
||||
@@ -124,9 +126,7 @@ class Setting(QWidget):
|
||||
"success", "操作成功", "已确认授权bilibili游戏隐私政策", 3000
|
||||
)
|
||||
else:
|
||||
Config.global_config.set(
|
||||
Config.global_config.function_IfAgreeBilibili, False
|
||||
)
|
||||
Config.set(Config.function_IfAgreeBilibili, False)
|
||||
else:
|
||||
|
||||
logger.info("取消授权bilibili游戏隐私政策")
|
||||
@@ -141,7 +141,7 @@ class Setting(QWidget):
|
||||
Path(os.getenv("APPDATA")) / "Netease/MuMuPlayer-12.0/data/startupImage"
|
||||
)
|
||||
|
||||
if Config.global_config.get(Config.global_config.function_IfSkipMumuSplashAds):
|
||||
if Config.get(Config.function_IfSkipMumuSplashAds):
|
||||
|
||||
choice = MessageBox(
|
||||
"风险声明",
|
||||
@@ -160,9 +160,7 @@ class Setting(QWidget):
|
||||
"success", "操作成功", "已开启跳过MuMu启动广告功能", 3000
|
||||
)
|
||||
else:
|
||||
Config.global_config.set(
|
||||
Config.global_config.function_IfSkipMumuSplashAds, False
|
||||
)
|
||||
Config.set(Config.function_IfSkipMumuSplashAds, False)
|
||||
|
||||
else:
|
||||
|
||||
@@ -267,28 +265,17 @@ class Setting(QWidget):
|
||||
def check_update(self) -> None:
|
||||
"""检查版本更新,调起文件下载进程"""
|
||||
|
||||
# 从本地版本信息文件获取当前版本信息
|
||||
with Config.version_path.open(mode="r", encoding="utf-8") as f:
|
||||
version_current: Dict[
|
||||
str, Union[str, Dict[str, Union[str, Dict[str, List[str]]]]]
|
||||
] = json.load(f)
|
||||
main_version_current = list(map(int, Config.VERSION.split(".")))
|
||||
updater_version_current = list(
|
||||
map(int, version_current["updater_version"].split("."))
|
||||
)
|
||||
# 检查更新器是否存在
|
||||
if not (Config.app_path / "Updater.exe").exists():
|
||||
updater_version_current = [0, 0, 0, 0]
|
||||
current_version = list(map(int, Config.VERSION.split(".")))
|
||||
|
||||
# 从远程服务器获取最新版本信息
|
||||
for _ in range(3):
|
||||
try:
|
||||
response = requests.get(
|
||||
f"https://gitee.com/DLmaster_361/AUTO_MAA/raw/{Config.global_config.get(Config.global_config.update_UpdateType)}/resources/version.json"
|
||||
f"https://mirrorchyan.com/api/resources/AUTO_MAA/latest?current_version={version_text(current_version)}&cdk={Crypto.win_decryptor(Config.get(Config.update_MirrorChyanCDK))}&channel={Config.get(Config.update_UpdateType)}"
|
||||
)
|
||||
version_info: Dict[str, Union[int, str, Dict[str, str]]] = (
|
||||
response.json()
|
||||
)
|
||||
version_remote: Dict[
|
||||
str, Union[str, Dict[str, Union[str, Dict[str, List[str]]]]]
|
||||
] = response.json()
|
||||
break
|
||||
except Exception as e:
|
||||
err = e
|
||||
@@ -304,52 +291,77 @@ class Setting(QWidget):
|
||||
if choice.exec():
|
||||
return None
|
||||
|
||||
main_version_remote = list(map(int, version_remote["main_version"].split(".")))
|
||||
updater_version_remote = list(
|
||||
map(int, version_remote["updater_version"].split("."))
|
||||
)
|
||||
remote_proxy_list = version_remote["proxy_list"]
|
||||
Config.global_config.set(
|
||||
Config.global_config.update_ProxyUrlList,
|
||||
list(
|
||||
set(
|
||||
Config.global_config.get(Config.global_config.update_ProxyUrlList)
|
||||
+ remote_proxy_list
|
||||
if version_info["code"] != 0:
|
||||
|
||||
logger.error(f"获取版本信息时出错:{version_info["msg"]}")
|
||||
|
||||
error_remark_dict = {
|
||||
1001: "获取版本信息的URL参数不正确",
|
||||
7001: "填入的 CDK 已过期",
|
||||
7002: "填入的 CDK 错误",
|
||||
7003: "填入的 CDK 今日下载次数已达上限",
|
||||
7004: "填入的 CDK 类型和待下载的资源不匹配",
|
||||
7005: "填入的 CDK 不合法",
|
||||
8001: "对应架构和系统下的资源不存在",
|
||||
8002: "错误的系统参数",
|
||||
8003: "错误的架构参数",
|
||||
8004: "错误的更新通道参数",
|
||||
1: version_info["msg"],
|
||||
}
|
||||
|
||||
if version_info["code"] in error_remark_dict:
|
||||
MainInfoBar.push_info_bar(
|
||||
"error",
|
||||
"获取版本信息时出错",
|
||||
error_remark_dict[version_info["code"]],
|
||||
-1,
|
||||
)
|
||||
),
|
||||
else:
|
||||
MainInfoBar.push_info_bar(
|
||||
"error",
|
||||
"获取版本信息时出错",
|
||||
"意料之外的错误,请及时联系项目组以获取来自 Mirror 酱的技术支持",
|
||||
-1,
|
||||
)
|
||||
|
||||
return None
|
||||
|
||||
remote_version = list(
|
||||
map(
|
||||
int,
|
||||
version_info["data"]["version_name"][1:]
|
||||
.replace("-beta", "")
|
||||
.split("."),
|
||||
)
|
||||
)
|
||||
|
||||
version_info_json: Dict[str, Dict[str, str]] = json.loads(
|
||||
re.sub(
|
||||
r"^<!--\s*(.*?)\s*-->$",
|
||||
r"\1",
|
||||
version_info["data"]["release_note"].splitlines()[0],
|
||||
)
|
||||
)
|
||||
|
||||
# 有版本更新
|
||||
if (main_version_remote > main_version_current) or (
|
||||
updater_version_remote > updater_version_current
|
||||
):
|
||||
if remote_version > current_version:
|
||||
|
||||
# 生成版本更新信息
|
||||
if main_version_remote > main_version_current:
|
||||
main_version_info = f"## 主程序:{version_text(main_version_current)} --> {version_text(main_version_remote)}\n\n"
|
||||
else:
|
||||
main_version_info = (
|
||||
f"## 主程序:{version_text(main_version_current)}\n\n"
|
||||
)
|
||||
if updater_version_remote > updater_version_current:
|
||||
updater_version_info = f"## 更新器:{version_text(updater_version_current)} --> {version_text(updater_version_remote)}\n\n"
|
||||
else:
|
||||
updater_version_info = (
|
||||
f"## 更新器:{version_text(updater_version_current)}\n\n"
|
||||
)
|
||||
main_version_info = f"## 主程序:{version_text(current_version)} --> {version_text(remote_version)}"
|
||||
|
||||
update_version_info = {}
|
||||
all_version_info = {}
|
||||
for v_i in [
|
||||
info
|
||||
for version, info in version_remote["version_info"].items()
|
||||
if list(map(int, version.split("."))) > main_version_current
|
||||
for version, info in version_info_json.items()
|
||||
if list(map(int, version.split("."))) > current_version
|
||||
]:
|
||||
for key, value in v_i.items():
|
||||
if key in update_version_info:
|
||||
update_version_info[key] += value.copy()
|
||||
else:
|
||||
update_version_info[key] = value.copy()
|
||||
for v_i in version_remote["version_info"].values():
|
||||
for v_i in update_version_info.values():
|
||||
for key, value in v_i.items():
|
||||
if key in all_version_info:
|
||||
all_version_info[key] += value.copy()
|
||||
@@ -357,69 +369,48 @@ class Setting(QWidget):
|
||||
all_version_info[key] = value.copy()
|
||||
|
||||
version_info = {
|
||||
"更新总览": f"{main_version_info}{updater_version_info}{version_info_markdown(update_version_info)}",
|
||||
"更新总览": f"{main_version_info}\n\n{version_info_markdown(update_version_info)}",
|
||||
"ALL~版本信息": version_info_markdown(all_version_info),
|
||||
**{
|
||||
version_text(list(map(int, k.split(".")))): version_info_markdown(v)
|
||||
for k, v in version_remote["version_info"].items()
|
||||
for k, v in update_version_info.items()
|
||||
},
|
||||
}
|
||||
|
||||
# 询问是否开始版本更新
|
||||
choice = NoticeMessageBox(self.window(), "版本更新", version_info)
|
||||
if not choice.exec():
|
||||
return None
|
||||
if choice.exec():
|
||||
|
||||
# 更新更新器
|
||||
if updater_version_remote > updater_version_current:
|
||||
# 创建更新进程
|
||||
self.updater = DownloadManager(
|
||||
Config.app_path,
|
||||
"AUTO_MAA更新器",
|
||||
main_version_remote,
|
||||
updater_version_remote,
|
||||
{
|
||||
"proxy_list": Config.global_config.get(
|
||||
Config.global_config.update_ProxyUrlList
|
||||
),
|
||||
"download_dict": version_remote["download_dict"],
|
||||
"thread_numb": Config.global_config.get(
|
||||
Config.global_config.update_ThreadNumb
|
||||
),
|
||||
},
|
||||
with Config.version_path.open(mode="r", encoding="utf-8") as f:
|
||||
version_info = json.load(f)
|
||||
version_info["main_version"] = Config.VERSION
|
||||
with Config.version_path.open(mode="w", encoding="utf-8") as f:
|
||||
json.dump(version_info, f, ensure_ascii=False, indent=4)
|
||||
|
||||
if (Config.app_path / "AUTO_Updater.exe").exists():
|
||||
shutil.copy(
|
||||
Config.app_path / "AUTO_Updater.exe",
|
||||
Config.app_path / "AUTO_Updater.active.exe",
|
||||
)
|
||||
else:
|
||||
logger.error("更新器文件不存在")
|
||||
MainInfoBar.push_info_bar(
|
||||
"error", "更新器不存在", "请手动前往 GitHub 获取最新版本", -1
|
||||
)
|
||||
return None
|
||||
|
||||
subprocess.Popen(
|
||||
str(Config.app_path / "AUTO_Updater.active.exe"),
|
||||
shell=True,
|
||||
creationflags=subprocess.CREATE_NO_WINDOW,
|
||||
)
|
||||
# 完成更新器的更新后更新主程序
|
||||
if main_version_remote > main_version_current:
|
||||
self.updater.download_accomplish.connect(self.update_main)
|
||||
# 显示更新页面
|
||||
self.updater.show()
|
||||
self.updater.run()
|
||||
|
||||
# 更新主程序
|
||||
elif main_version_remote > main_version_current:
|
||||
self.update_main()
|
||||
self.close()
|
||||
QApplication.quit()
|
||||
|
||||
# 无版本更新
|
||||
else:
|
||||
MainInfoBar.push_info_bar("success", "更新检查", "已是最新版本~", 3000)
|
||||
|
||||
def update_main(self) -> None:
|
||||
"""更新主程序"""
|
||||
|
||||
with Config.version_path.open(mode="r", encoding="utf-8") as f:
|
||||
version_info = json.load(f)
|
||||
version_info["main_version"] = Config.VERSION
|
||||
with Config.version_path.open(mode="w", encoding="utf-8") as f:
|
||||
json.dump(version_info, f, ensure_ascii=False, indent=4)
|
||||
|
||||
subprocess.Popen(
|
||||
str(Config.app_path / "Updater.exe"),
|
||||
shell=True,
|
||||
creationflags=subprocess.CREATE_NO_WINDOW,
|
||||
)
|
||||
self.close()
|
||||
QApplication.quit()
|
||||
|
||||
def show_notice(self, if_show: bool = True):
|
||||
"""显示公告"""
|
||||
|
||||
@@ -464,8 +455,9 @@ class Setting(QWidget):
|
||||
}
|
||||
|
||||
if if_show or (
|
||||
datetime.now() > datetime.strptime(notice["time"], "%Y-%m-%d %H:%M")
|
||||
and datetime.strptime(notice["time"], "%Y-%m-%d %H:%M") > time_local
|
||||
datetime.now()
|
||||
> datetime.strptime(notice["time"], "%Y-%m-%d %H:%M")
|
||||
> time_local
|
||||
):
|
||||
|
||||
choice = NoticeMessageBox(self.window(), "公告", notice["notice_dict"])
|
||||
@@ -485,37 +477,47 @@ class FunctionSettingCard(HeaderCardWidget):
|
||||
self.setTitle("功能")
|
||||
|
||||
self.card_HomeImageMode = ComboBoxSettingCard(
|
||||
configItem=Config.global_config.function_HomeImageMode,
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="主页背景图模式",
|
||||
content="选择主页背景图的来源",
|
||||
texts=["默认", "自定义", "主题图像"],
|
||||
qconfig=Config,
|
||||
configItem=Config.function_HomeImageMode,
|
||||
parent=self,
|
||||
)
|
||||
self.card_HistoryRetentionTime = ComboBoxSettingCard(
|
||||
configItem=Config.global_config.function_HistoryRetentionTime,
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="历史记录保留时间",
|
||||
content="选择历史记录的保留时间,超期自动清理",
|
||||
texts=["7 天", "15 天", "30 天", "60 天", "永久"],
|
||||
qconfig=Config,
|
||||
configItem=Config.function_HistoryRetentionTime,
|
||||
parent=self,
|
||||
)
|
||||
self.card_IfAllowSleep = SwitchSettingCard(
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="启动时阻止系统休眠",
|
||||
content="仅阻止电脑自动休眠,不会影响屏幕是否熄灭",
|
||||
configItem=Config.global_config.function_IfAllowSleep,
|
||||
qconfig=Config,
|
||||
configItem=Config.function_IfAllowSleep,
|
||||
parent=self,
|
||||
)
|
||||
self.card_IfSilence = self.SilenceSettingCard(self)
|
||||
self.card_IfAgreeBilibili = SwitchSettingCard(
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="托管bilibili游戏隐私政策",
|
||||
content="授权AUTO_MAA同意bilibili游戏隐私政策",
|
||||
configItem=Config.global_config.function_IfAgreeBilibili,
|
||||
qconfig=Config,
|
||||
configItem=Config.function_IfAgreeBilibili,
|
||||
parent=self,
|
||||
)
|
||||
self.card_IfSkipMumuSplashAds = SwitchSettingCard(
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="跳过MuMu启动广告",
|
||||
content="启动MuMu模拟器时屏蔽启动广告",
|
||||
configItem=Config.global_config.function_IfSkipMumuSplashAds,
|
||||
qconfig=Config,
|
||||
configItem=Config.function_IfSkipMumuSplashAds,
|
||||
parent=self,
|
||||
)
|
||||
|
||||
Layout = QVBoxLayout()
|
||||
@@ -541,14 +543,18 @@ class FunctionSettingCard(HeaderCardWidget):
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="静默模式",
|
||||
content="是否启用静默模式",
|
||||
configItem=Config.global_config.function_IfSilence,
|
||||
qconfig=Config,
|
||||
configItem=Config.function_IfSilence,
|
||||
parent=self,
|
||||
)
|
||||
self.card_BossKey = LineEditSettingCard(
|
||||
text="请输入安卓模拟器老板键",
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="模拟器老板键",
|
||||
content="输入模拟器老板快捷键,以“+”分隔",
|
||||
configItem=Config.global_config.function_BossKey,
|
||||
text="请输入安卓模拟器老板键",
|
||||
qconfig=Config,
|
||||
configItem=Config.function_BossKey,
|
||||
parent=self,
|
||||
)
|
||||
|
||||
widget = QWidget()
|
||||
@@ -570,19 +576,25 @@ class StartSettingCard(HeaderCardWidget):
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="开机时自动启动",
|
||||
content="将AUTO_MAA添加到开机启动项",
|
||||
configItem=Config.global_config.start_IfSelfStart,
|
||||
qconfig=Config,
|
||||
configItem=Config.start_IfSelfStart,
|
||||
parent=self,
|
||||
)
|
||||
self.card_IfRunDirectly = SwitchSettingCard(
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="启动后直接运行主任务",
|
||||
content="启动AUTO_MAA后自动运行自动代理任务,优先级:调度队列 1 > 脚本 1",
|
||||
configItem=Config.global_config.start_IfRunDirectly,
|
||||
qconfig=Config,
|
||||
configItem=Config.start_IfRunDirectly,
|
||||
parent=self,
|
||||
)
|
||||
self.card_IfMinimizeDirectly = SwitchSettingCard(
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="启动后直接最小化",
|
||||
content="启动AUTO_MAA后直接最小化",
|
||||
configItem=Config.global_config.start_IfMinimizeDirectly,
|
||||
qconfig=Config,
|
||||
configItem=Config.start_IfMinimizeDirectly,
|
||||
parent=self,
|
||||
)
|
||||
|
||||
Layout = QVBoxLayout()
|
||||
@@ -602,13 +614,17 @@ class UiSettingCard(HeaderCardWidget):
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="显示托盘图标",
|
||||
content="常态显示托盘图标",
|
||||
configItem=Config.global_config.ui_IfShowTray,
|
||||
qconfig=Config,
|
||||
configItem=Config.ui_IfShowTray,
|
||||
parent=self,
|
||||
)
|
||||
self.card_IfToTray = SwitchSettingCard(
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="最小化到托盘",
|
||||
content="最小化时隐藏到托盘",
|
||||
configItem=Config.global_config.ui_IfToTray,
|
||||
qconfig=Config,
|
||||
configItem=Config.ui_IfToTray,
|
||||
parent=self,
|
||||
)
|
||||
|
||||
Layout = QVBoxLayout()
|
||||
@@ -634,6 +650,7 @@ class NotifySettingCard(HeaderCardWidget):
|
||||
icon=FluentIcon.SEND,
|
||||
title="测试通知",
|
||||
content="发送测试通知到所有已启用的通知渠道",
|
||||
parent=self,
|
||||
)
|
||||
self.card_TestNotification.clicked.connect(self.send_test_notification)
|
||||
|
||||
@@ -652,8 +669,8 @@ class NotifySettingCard(HeaderCardWidget):
|
||||
MainInfoBar.push_info_bar(
|
||||
"success",
|
||||
"测试通知已发送",
|
||||
"请检查已配置的通知渠道是否可以收到消息",
|
||||
3000
|
||||
"请检查已配置的通知渠道是否正常收到消息",
|
||||
3000,
|
||||
)
|
||||
|
||||
class NotifyContentSettingCard(ExpandGroupSettingCard):
|
||||
@@ -664,23 +681,29 @@ class NotifySettingCard(HeaderCardWidget):
|
||||
)
|
||||
|
||||
self.card_SendTaskResultTime = ComboBoxSettingCard(
|
||||
configItem=Config.global_config.notify_SendTaskResultTime,
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="推送任务结果选项",
|
||||
content="选择推送自动代理与人工排查任务结果的时机",
|
||||
texts=["不推送", "任何时刻", "仅失败时"],
|
||||
qconfig=Config,
|
||||
configItem=Config.notify_SendTaskResultTime,
|
||||
parent=self,
|
||||
)
|
||||
self.card_IfSendStatistic = SwitchSettingCard(
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="推送统计信息",
|
||||
content="推送自动代理统计信息的通知",
|
||||
configItem=Config.global_config.notify_IfSendStatistic,
|
||||
qconfig=Config,
|
||||
configItem=Config.notify_IfSendStatistic,
|
||||
parent=self,
|
||||
)
|
||||
self.card_IfSendSixStar = SwitchSettingCard(
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="推送公招高资喜报",
|
||||
content="公招出现六星词条时推送喜报",
|
||||
configItem=Config.global_config.notify_IfSendSixStar,
|
||||
qconfig=Config,
|
||||
configItem=Config.notify_IfSendSixStar,
|
||||
parent=self,
|
||||
)
|
||||
|
||||
widget = QWidget()
|
||||
@@ -703,7 +726,9 @@ class NotifySettingCard(HeaderCardWidget):
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="推送系统通知",
|
||||
content="使用Plyer推送系统级通知,不会在通知中心停留",
|
||||
configItem=Config.global_config.notify_IfPushPlyer,
|
||||
qconfig=Config,
|
||||
configItem=Config.notify_IfPushPlyer,
|
||||
parent=self,
|
||||
)
|
||||
|
||||
widget = QWidget()
|
||||
@@ -724,35 +749,46 @@ class NotifySettingCard(HeaderCardWidget):
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="推送邮件通知",
|
||||
content="是否启用邮件通知功能",
|
||||
configItem=Config.global_config.notify_IfSendMail,
|
||||
qconfig=Config,
|
||||
configItem=Config.notify_IfSendMail,
|
||||
parent=self,
|
||||
)
|
||||
self.card_SMTPServerAddress = LineEditSettingCard(
|
||||
text="请输入SMTP服务器地址",
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="SMTP服务器地址",
|
||||
content="发信邮箱的SMTP服务器地址",
|
||||
configItem=Config.global_config.notify_SMTPServerAddress,
|
||||
text="请输入SMTP服务器地址",
|
||||
qconfig=Config,
|
||||
configItem=Config.notify_SMTPServerAddress,
|
||||
parent=self,
|
||||
)
|
||||
self.card_FromAddress = LineEditSettingCard(
|
||||
text="请输入发信邮箱地址",
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="发信邮箱地址",
|
||||
content="发送通知的邮箱地址",
|
||||
configItem=Config.global_config.notify_FromAddress,
|
||||
text="请输入发信邮箱地址",
|
||||
qconfig=Config,
|
||||
configItem=Config.notify_FromAddress,
|
||||
parent=self,
|
||||
)
|
||||
self.card_AuthorizationCode = PasswordLineEditSettingCard(
|
||||
text="请输入发信邮箱授权码",
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="发信邮箱授权码",
|
||||
content="发送通知的邮箱授权码",
|
||||
configItem=Config.global_config.notify_AuthorizationCode,
|
||||
text="请输入发信邮箱授权码",
|
||||
algorithm="DPAPI",
|
||||
qconfig=Config,
|
||||
configItem=Config.notify_AuthorizationCode,
|
||||
parent=self,
|
||||
)
|
||||
self.card_ToAddress = LineEditSettingCard(
|
||||
text="请输入收信邮箱地址",
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="收信邮箱地址",
|
||||
content="接收通知的邮箱地址",
|
||||
configItem=Config.global_config.notify_ToAddress,
|
||||
text="请输入收信邮箱地址",
|
||||
qconfig=Config,
|
||||
configItem=Config.notify_ToAddress,
|
||||
parent=self,
|
||||
)
|
||||
|
||||
widget = QWidget()
|
||||
@@ -779,28 +815,36 @@ class NotifySettingCard(HeaderCardWidget):
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="推送SeverChan通知",
|
||||
content="是否启用SeverChan通知功能",
|
||||
configItem=Config.global_config.notify_IfServerChan,
|
||||
qconfig=Config,
|
||||
configItem=Config.notify_IfServerChan,
|
||||
parent=self,
|
||||
)
|
||||
self.card_ServerChanKey = LineEditSettingCard(
|
||||
text="请输入SendKey",
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="SendKey",
|
||||
content="Server酱的SendKey(SC3与SCT都可以)",
|
||||
configItem=Config.global_config.notify_ServerChanKey,
|
||||
text="请输入SendKey",
|
||||
qconfig=Config,
|
||||
configItem=Config.notify_ServerChanKey,
|
||||
parent=self,
|
||||
)
|
||||
self.card_ServerChanChannel = LineEditSettingCard(
|
||||
text="请输入需要推送的Channel代码(SCT生效)",
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="ServerChanChannel代码",
|
||||
content="可以留空,留空则默认。可以多个,请使用“|”隔开",
|
||||
configItem=Config.global_config.notify_ServerChanChannel,
|
||||
text="请输入需要推送的Channel代码(SCT生效)",
|
||||
qconfig=Config,
|
||||
configItem=Config.notify_ServerChanChannel,
|
||||
parent=self,
|
||||
)
|
||||
self.card_ServerChanTag = LineEditSettingCard(
|
||||
text="请输入加入推送的Tag(SC3生效)",
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="Tag内容",
|
||||
content="可以留空,留空则默认。可以多个,请使用“|”隔开",
|
||||
configItem=Config.global_config.notify_ServerChanTag,
|
||||
text="请输入加入推送的Tag(SC3生效)",
|
||||
qconfig=Config,
|
||||
configItem=Config.notify_ServerChanTag,
|
||||
parent=self,
|
||||
)
|
||||
|
||||
widget = QWidget()
|
||||
@@ -826,14 +870,18 @@ class NotifySettingCard(HeaderCardWidget):
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="推送企业微信机器人通知",
|
||||
content="是否启用企业微信机器人通知功能",
|
||||
configItem=Config.global_config.notify_IfCompanyWebHookBot,
|
||||
qconfig=Config,
|
||||
configItem=Config.notify_IfCompanyWebHookBot,
|
||||
parent=self,
|
||||
)
|
||||
self.card_CompanyWebHookBotUrl = LineEditSettingCard(
|
||||
text="请输入Webhook的Url",
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="WebhookUrl",
|
||||
content="企业微信群机器人的Webhook地址",
|
||||
configItem=Config.global_config.notify_CompanyWebHookBotUrl,
|
||||
text="请输入Webhook的Url",
|
||||
qconfig=Config,
|
||||
configItem=Config.notify_CompanyWebHookBotUrl,
|
||||
parent=self,
|
||||
)
|
||||
|
||||
widget = QWidget()
|
||||
@@ -856,6 +904,7 @@ class SecuritySettingCard(HeaderCardWidget):
|
||||
icon=FluentIcon.VPN,
|
||||
title="修改管理密钥",
|
||||
content="修改用于解密用户密码的管理密钥",
|
||||
parent=self,
|
||||
)
|
||||
|
||||
Layout = QVBoxLayout()
|
||||
@@ -869,45 +918,70 @@ class UpdaterSettingCard(HeaderCardWidget):
|
||||
super().__init__(parent)
|
||||
self.setTitle("更新")
|
||||
|
||||
self.card_IfAutoUpdate = SwitchSettingCard(
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="自动检查更新",
|
||||
content="将在启动时自动检查AUTO_MAA是否有新版本",
|
||||
configItem=Config.global_config.update_IfAutoUpdate,
|
||||
)
|
||||
self.card_UpdateType = ComboBoxSettingCard(
|
||||
configItem=Config.global_config.update_UpdateType,
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="版本更新类别",
|
||||
content="选择AUTO_MAA的更新类别",
|
||||
texts=["稳定版", "公测版"],
|
||||
)
|
||||
self.card_ThreadNumb = RangeSettingCard(
|
||||
configItem=Config.global_config.update_ThreadNumb,
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="下载器线程数",
|
||||
content="更新器的下载线程数,建议仅在下载速度较慢时适量拉高",
|
||||
)
|
||||
self.card_ProxyUrlList = UrlListSettingCard(
|
||||
icon=FluentIcon.SETTING,
|
||||
configItem=Config.global_config.update_ProxyUrlList,
|
||||
title="代理地址列表",
|
||||
content="更新器代理地址列表",
|
||||
parent=self,
|
||||
)
|
||||
self.card_CheckUpdate = PushSettingCard(
|
||||
text="检查更新",
|
||||
icon=FluentIcon.UPDATE,
|
||||
title="获取最新版本",
|
||||
content="检查AUTO_MAA是否有新版本",
|
||||
parent=self,
|
||||
)
|
||||
self.card_IfAutoUpdate = SwitchSettingCard(
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="自动检查更新",
|
||||
content="将在启动时自动检查AUTO_MAA是否有新版本",
|
||||
qconfig=Config,
|
||||
configItem=Config.update_IfAutoUpdate,
|
||||
parent=self,
|
||||
)
|
||||
self.card_UpdateType = ComboBoxSettingCard(
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="版本更新类别",
|
||||
content="选择AUTO_MAA的更新类别",
|
||||
texts=["稳定版", "公测版"],
|
||||
qconfig=Config,
|
||||
configItem=Config.update_UpdateType,
|
||||
parent=self,
|
||||
)
|
||||
self.card_ThreadNumb = RangeSettingCard(
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="下载器线程数",
|
||||
content="更新器的下载线程数,建议仅在下载速度较慢时适量拉高",
|
||||
qconfig=Config,
|
||||
configItem=Config.update_ThreadNumb,
|
||||
parent=self,
|
||||
)
|
||||
self.card_ProxyUrlList = UrlListSettingCard(
|
||||
icon=FluentIcon.SETTING,
|
||||
title="代理地址列表",
|
||||
content="更新器代理地址列表",
|
||||
qconfig=Config,
|
||||
configItem=Config.update_ProxyUrlList,
|
||||
parent=self,
|
||||
)
|
||||
self.card_MirrorChyanCDK = PasswordLineEditSettingCard(
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="Mirror酱CDK",
|
||||
content="填写后改为使用由Mirror酱提供的下载服务",
|
||||
text="请输入Mirror酱CDK",
|
||||
algorithm="DPAPI",
|
||||
qconfig=Config,
|
||||
configItem=Config.update_MirrorChyanCDK,
|
||||
parent=self,
|
||||
)
|
||||
mirrorchyan_url = HyperlinkButton(
|
||||
"https://mirrorchyan.com/", "购买Mirror酱CDK", self
|
||||
)
|
||||
self.card_MirrorChyanCDK.hBoxLayout.insertWidget(
|
||||
5, mirrorchyan_url, 0, Qt.AlignRight
|
||||
)
|
||||
|
||||
Layout = QVBoxLayout()
|
||||
Layout.addWidget(self.card_CheckUpdate)
|
||||
Layout.addWidget(self.card_IfAutoUpdate)
|
||||
Layout.addWidget(self.card_UpdateType)
|
||||
Layout.addWidget(self.card_ThreadNumb)
|
||||
Layout.addWidget(self.card_ProxyUrlList)
|
||||
Layout.addWidget(self.card_CheckUpdate)
|
||||
Layout.addWidget(self.card_MirrorChyanCDK)
|
||||
self.viewLayout.addLayout(Layout)
|
||||
|
||||
|
||||
@@ -922,6 +996,7 @@ class OtherSettingCard(HeaderCardWidget):
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="公告",
|
||||
content="查看AUTO_MAA的最新公告",
|
||||
parent=self,
|
||||
)
|
||||
self.card_UserDocs = HyperlinkCard(
|
||||
url="https://clozya.github.io/AUTOMAA_docs",
|
||||
@@ -929,8 +1004,9 @@ class OtherSettingCard(HeaderCardWidget):
|
||||
icon=FluentIcon.PAGE_RIGHT,
|
||||
title="AUTO_MAA官方文档站",
|
||||
content="访问AUTO_MAA的官方文档站,获取使用指南和项目相关信息",
|
||||
parent=self,
|
||||
)
|
||||
self.card_Association = self.AssociationSettingCard()
|
||||
self.card_Association = self.AssociationSettingCard(self)
|
||||
|
||||
Layout = QVBoxLayout()
|
||||
Layout.addWidget(self.card_Notice)
|
||||
@@ -954,6 +1030,7 @@ class OtherSettingCard(HeaderCardWidget):
|
||||
icon=FluentIcon.GITHUB,
|
||||
title="GitHub",
|
||||
content="查看AUTO_MAA的源代码,提交问题和建议,欢迎参与开发",
|
||||
parent=self,
|
||||
)
|
||||
self.card_QQGroup = HyperlinkCard(
|
||||
url="https://qm.qq.com/q/bd9fISNoME",
|
||||
@@ -961,6 +1038,7 @@ class OtherSettingCard(HeaderCardWidget):
|
||||
icon=FluentIcon.CHAT,
|
||||
title="QQ群",
|
||||
content="与AUTO_MAA开发者和用户交流",
|
||||
parent=self,
|
||||
)
|
||||
|
||||
widget = QWidget()
|
||||
|
||||
Reference in New Issue
Block a user