feat(core): 初步完成托管bilibili游戏隐私政策功能

This commit is contained in:
DLmaster
2025-02-08 12:05:28 +08:00
parent 5c24eb7d56
commit d13fbb063d
5 changed files with 121 additions and 50 deletions

View File

@@ -83,6 +83,7 @@ class Setting(QWidget):
self.other = OtherSettingCard(self)
self.function.card_IfAllowSleep.checkedChanged.connect(System.set_Sleep)
self.function.card_IfAgreeBilibili.checkedChanged.connect(self.agree_bilibili)
self.start.card_IfSelfStart.checkedChanged.connect(System.set_SelfStart)
self.security.card_changePASSWORD.clicked.connect(self.change_PASSWORD)
self.updater.card_CheckUpdate.clicked.connect(self.get_update)
@@ -102,6 +103,31 @@ class Setting(QWidget):
self.setLayout(layout)
def agree_bilibili(self) -> None:
"""授权bilibili游戏隐私政策"""
if not Config.global_config.get(Config.global_config.function_IfAgreeBilibili):
logger.info("取消授权bilibili游戏隐私政策")
MainInfoBar.push_info_bar(
"info", "操作成功", "已取消授权bilibili游戏隐私政策", 3000
)
return None
choice = MessageBox(
"授权声明",
"开启“托管bilibili游戏隐私政策”功能即代表您已完整阅读并同意《哔哩哔哩弹幕网用户使用协议》、《哔哩哔哩隐私政策》和《哔哩哔哩游戏中心用户协议》并授权AUTO_MAA在其认定需要时以其认定合适的方法替您处理相关弹窗\n\n是否同意授权?",
self.window(),
)
if choice.exec():
logger.success("确认授权bilibili游戏隐私政策")
MainInfoBar.push_info_bar(
"success", "操作成功", "已确认授权bilibili游戏隐私政策", 3000
)
else:
Config.global_config.set(
Config.global_config.function_IfAgreeBilibili, False
)
def check_PASSWORD(self) -> None:
"""检查并配置管理密钥"""
@@ -127,8 +153,7 @@ class Setting(QWidget):
)
choice.cancelButton.hide()
choice.buttonLayout.insertStretch(1)
if choice.exec():
pass
choice.exec()
def change_PASSWORD(self) -> None:
"""修改管理密钥"""
@@ -183,8 +208,7 @@ class Setting(QWidget):
choice = MessageBox("错误", "管理密钥错误", self.window())
choice.cancelButton.hide()
choice.buttonLayout.insertStretch(1)
if choice.exec():
pass
choice.exec()
else:
choice = MessageBox(
"确认",
@@ -400,10 +424,17 @@ class FunctionSettingCard(HeaderCardWidget):
configItem=Config.global_config.function_IfAllowSleep,
)
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,
)
Layout = QVBoxLayout()
Layout.addWidget(self.card_IfAllowSleep)
Layout.addWidget(self.card_IfSilence)
Layout.addWidget(self.card_IfAgreeBilibili)
self.viewLayout.addLayout(Layout)
class SilenceSettingCard(ExpandGroupSettingCard):