Merge branch 'fluent-gui-dev'

This commit is contained in:
DLmaster
2025-01-01 21:55:16 +08:00
8 changed files with 416 additions and 268 deletions

View File

@@ -49,8 +49,6 @@ class AppConfig:
# 检查文件完整性 # 检查文件完整性
self.initialize() self.initialize()
self.check_config()
self.check_database()
def initialize(self) -> None: def initialize(self) -> None:
"""初始化程序的配置文件""" """初始化程序的配置文件"""
@@ -83,6 +81,9 @@ class AppConfig:
encoding="utf-8", encoding="utf-8",
) )
self.check_config()
self.check_database()
def check_config(self) -> None: def check_config(self) -> None:
"""检查配置文件字段完整性并补全""" """检查配置文件字段完整性并补全"""

View File

@@ -48,7 +48,7 @@ class Notification:
title=title, title=title,
message=message, message=message,
app_name="AUTO_MAA", app_name="AUTO_MAA",
app_icon=self.config.app_path / "resources/icons/AUTO_MAA.ico", app_icon=str(self.config.app_path / "resources/icons/AUTO_MAA.ico"),
timeout=t, timeout=t,
ticker=ticker, ticker=ticker,
toast=True, toast=True,

View File

@@ -26,26 +26,35 @@ v4.2
""" """
from PySide6.QtWidgets import ( from PySide6.QtWidgets import (
QWidget, QWidget, #
QMainWindow, QMainWindow, #
QApplication, QApplication, #
QSystemTrayIcon, QSystemTrayIcon, #
QMenu, QFileDialog, #
QInputDialog, QTabWidget, #
QFileDialog, QToolBox, #
QMessageBox, QComboBox, #
QLineEdit, QTableWidgetItem, #
QTabWidget, QHeaderView, #
QToolBox, )
QTableWidget, from qfluentwidgets import (
QTableWidgetItem, Action,
QComboBox, PushButton,
QPushButton, LineEdit,
QHeaderView, PasswordLineEdit,
QSpinBox, TextBrowser,
QTimeEdit, TableWidget,
QCheckBox, TimePicker,
QTextBrowser, ComboBox,
CheckBox,
SpinBox,
FluentIcon,
RoundMenu,
MessageBox,
MessageBoxBase,
HeaderCardWidget,
BodyLabel,
SubtitleLabel,
) )
from PySide6.QtUiTools import QUiLoader from PySide6.QtUiTools import QUiLoader
from PySide6.QtGui import QIcon, QCloseEvent from PySide6.QtGui import QIcon, QCloseEvent
@@ -149,32 +158,22 @@ class Main(QWidget):
"-", "-",
] ]
uiLoader.registerCustomWidget(PushButton)
uiLoader.registerCustomWidget(LineEdit)
uiLoader.registerCustomWidget(TextBrowser)
uiLoader.registerCustomWidget(TableWidget)
uiLoader.registerCustomWidget(TimePicker)
uiLoader.registerCustomWidget(SpinBox)
uiLoader.registerCustomWidget(CheckBox)
uiLoader.registerCustomWidget(HeaderCardWidget)
uiLoader.registerCustomWidget(BodyLabel)
# 导入ui配置 # 导入ui配置
self.ui = uiLoader.load(self.config.app_path / "resources/gui/main.ui") self.ui = uiLoader.load(self.config.app_path / "resources/gui/main.ui")
self.ui.setWindowIcon( self.ui.setWindowIcon(
QIcon(str(self.config.app_path / "resources/icons/AUTO_MAA.ico")) QIcon(str(self.config.app_path / "resources/icons/AUTO_MAA.ico"))
) )
# 生成管理密钥
if not self.config.key_path.exists():
while True:
self.PASSWORD, ok_pressed = QInputDialog.getText(
self.ui,
"请设置管理密钥",
"未检测到管理密钥,请设置您的管理密钥:",
QLineEdit.Password,
"",
)
if ok_pressed and self.PASSWORD != "":
self.crypto.get_PASSWORD(self.PASSWORD)
break
else:
choice = QMessageBox.question(
self.ui, "确认", "您没有输入管理密钥,确定要暂时跳过这一步吗?"
)
if choice == QMessageBox.Yes:
break
# 初始化控件 # 初始化控件
self.main_tab: QTabWidget = self.ui.findChild(QTabWidget, "tabWidget_main") self.main_tab: QTabWidget = self.ui.findChild(QTabWidget, "tabWidget_main")
self.main_tab.currentChanged.connect(self.change_config) self.main_tab.currentChanged.connect(self.change_config)
@@ -182,141 +181,144 @@ class Main(QWidget):
self.user_set: QToolBox = self.ui.findChild(QToolBox, "toolBox_userset") self.user_set: QToolBox = self.ui.findChild(QToolBox, "toolBox_userset")
self.user_set.currentChanged.connect(lambda: self.update_user_info("normal")) self.user_set.currentChanged.connect(lambda: self.update_user_info("normal"))
self.user_list_simple: QTableWidget = self.ui.findChild( self.user_list_simple: TableWidget = self.ui.findChild(
QTableWidget, "tableWidget_userlist_simple" TableWidget, "tableWidget_userlist_simple"
) )
self.user_list_simple.itemChanged.connect( self.user_list_simple.itemChanged.connect(
lambda item: self.change_user_Item(item, "simple") lambda item: self.change_user_Item(item, "simple")
) )
self.user_list_beta: QTableWidget = self.ui.findChild( self.user_list_beta: TableWidget = self.ui.findChild(
QTableWidget, "tableWidget_userlist_beta" TableWidget, "tableWidget_userlist_beta"
) )
self.user_list_beta.itemChanged.connect( self.user_list_beta.itemChanged.connect(
lambda item: self.change_user_Item(item, "beta") lambda item: self.change_user_Item(item, "beta")
) )
self.user_add: QPushButton = self.ui.findChild(QPushButton, "pushButton_new") self.user_add: PushButton = self.ui.findChild(PushButton, "pushButton_new")
self.user_add.setIcon(FluentIcon.ADD_TO)
self.user_add.clicked.connect(self.add_user) self.user_add.clicked.connect(self.add_user)
self.user_del: QPushButton = self.ui.findChild(QPushButton, "pushButton_del") self.user_del: PushButton = self.ui.findChild(PushButton, "pushButton_del")
self.user_del.setIcon(FluentIcon.REMOVE_FROM)
self.user_del.clicked.connect(self.del_user) self.user_del.clicked.connect(self.del_user)
self.user_switch: QPushButton = self.ui.findChild( self.user_switch: PushButton = self.ui.findChild(
QPushButton, "pushButton_switch" PushButton, "pushButton_switch"
) )
self.user_switch.setIcon(FluentIcon.MOVE)
self.user_switch.clicked.connect(self.switch_user) self.user_switch.clicked.connect(self.switch_user)
self.read_PASSWORD: QPushButton = self.ui.findChild( self.read_PASSWORD: PushButton = self.ui.findChild(
QPushButton, "pushButton_password" PushButton, "pushButton_password"
) )
self.read_PASSWORD.setIcon(FluentIcon.HIDE)
self.read_PASSWORD.clicked.connect(lambda: self.read("key")) self.read_PASSWORD.clicked.connect(lambda: self.read("key"))
self.refresh: QPushButton = self.ui.findChild(QPushButton, "pushButton_refresh") self.refresh: PushButton = self.ui.findChild(PushButton, "pushButton_refresh")
self.refresh.setIcon(FluentIcon.SYNC)
self.refresh.clicked.connect(lambda: self.update_user_info("clear")) self.refresh.clicked.connect(lambda: self.update_user_info("clear"))
self.run_now: QPushButton = self.ui.findChild(QPushButton, "pushButton_runnow") self.run_now: PushButton = self.ui.findChild(PushButton, "pushButton_runnow")
self.run_now.setIcon(FluentIcon.PLAY)
self.run_now.clicked.connect(lambda: self.maa_starter("日常代理")) self.run_now.clicked.connect(lambda: self.maa_starter("日常代理"))
self.check_start: QPushButton = self.ui.findChild( self.check_start: PushButton = self.ui.findChild(
QPushButton, "pushButton_checkstart" PushButton, "pushButton_checkstart"
) )
self.check_start.setIcon(FluentIcon.PLAY)
self.check_start.clicked.connect(lambda: self.maa_starter("人工排查")) self.check_start.clicked.connect(lambda: self.maa_starter("人工排查"))
self.maa_path: QLineEdit = self.ui.findChild(QLineEdit, "lineEdit_MAApath") self.maa_path: LineEdit = self.ui.findChild(LineEdit, "lineEdit_MAApath")
self.maa_path.textChanged.connect(self.change_config) self.maa_path.textChanged.connect(self.change_config)
self.maa_path.setReadOnly(True) self.maa_path.setReadOnly(True)
self.get_maa_path: QPushButton = self.ui.findChild( self.get_maa_path: PushButton = self.ui.findChild(
QPushButton, "pushButton_getMAApath" PushButton, "pushButton_getMAApath"
) )
self.get_maa_path.setIcon(FluentIcon.FOLDER)
self.get_maa_path.clicked.connect(lambda: self.read("file_path_maa")) self.get_maa_path.clicked.connect(lambda: self.read("file_path_maa"))
self.set_maa: QPushButton = self.ui.findChild(QPushButton, "pushButton_setMAA") self.set_maa: PushButton = self.ui.findChild(PushButton, "pushButton_setMAA")
self.set_maa.setIcon(FluentIcon.SETTING)
self.set_maa.clicked.connect(lambda: self.maa_starter("设置MAA_全局")) self.set_maa.clicked.connect(lambda: self.maa_starter("设置MAA_全局"))
self.routine: QSpinBox = self.ui.findChild(QSpinBox, "spinBox_routine") self.routine: SpinBox = self.ui.findChild(SpinBox, "spinBox_routine")
self.routine.valueChanged.connect(self.change_config) self.routine.valueChanged.connect(self.change_config)
self.annihilation: QSpinBox = self.ui.findChild( self.annihilation: SpinBox = self.ui.findChild(SpinBox, "spinBox_annihilation")
QSpinBox, "spinBox_annihilation"
)
self.annihilation.valueChanged.connect(self.change_config) self.annihilation.valueChanged.connect(self.change_config)
self.num: QSpinBox = self.ui.findChild(QSpinBox, "spinBox_numt") self.num: SpinBox = self.ui.findChild(SpinBox, "spinBox_numt")
self.num.valueChanged.connect(self.change_config) self.num.valueChanged.connect(self.change_config)
self.if_self_start: QCheckBox = self.ui.findChild( self.if_self_start: CheckBox = self.ui.findChild(
QCheckBox, "checkBox_ifselfstart" CheckBox, "checkBox_ifselfstart"
) )
self.if_self_start.stateChanged.connect(self.change_config) self.if_self_start.stateChanged.connect(self.change_config)
self.if_sleep: QCheckBox = self.ui.findChild(QCheckBox, "checkBox_ifsleep") self.if_sleep: CheckBox = self.ui.findChild(CheckBox, "checkBox_ifsleep")
self.if_sleep.stateChanged.connect(self.change_config) self.if_sleep.stateChanged.connect(self.change_config)
self.if_proxy_directly: QCheckBox = self.ui.findChild( self.if_proxy_directly: CheckBox = self.ui.findChild(
QCheckBox, "checkBox_ifproxydirectly" CheckBox, "checkBox_ifproxydirectly"
) )
self.if_proxy_directly.stateChanged.connect(self.change_config) self.if_proxy_directly.stateChanged.connect(self.change_config)
self.if_send_mail: QCheckBox = self.ui.findChild( self.if_send_mail: CheckBox = self.ui.findChild(CheckBox, "checkBox_ifsendmail")
QCheckBox, "checkBox_ifsendmail"
)
self.if_send_mail.stateChanged.connect(self.change_config) self.if_send_mail.stateChanged.connect(self.change_config)
self.mail_address: QLineEdit = self.ui.findChild( self.mail_address: LineEdit = self.ui.findChild(
QLineEdit, "lineEdit_mailaddress" LineEdit, "lineEdit_mailaddress"
) )
self.mail_address.textChanged.connect(self.change_config) self.mail_address.textChanged.connect(self.change_config)
self.if_send_error_only: QCheckBox = self.ui.findChild( self.if_send_error_only: CheckBox = self.ui.findChild(
QCheckBox, "checkBox_ifonlyerror" CheckBox, "checkBox_ifonlyerror"
) )
self.if_send_error_only.stateChanged.connect(self.change_config) self.if_send_error_only.stateChanged.connect(self.change_config)
self.if_silence: QCheckBox = self.ui.findChild(QCheckBox, "checkBox_silence") self.if_silence: CheckBox = self.ui.findChild(CheckBox, "checkBox_silence")
self.if_silence.stateChanged.connect(self.change_config) self.if_silence.stateChanged.connect(self.change_config)
self.boss_key: QLineEdit = self.ui.findChild(QLineEdit, "lineEdit_boss") self.boss_key: LineEdit = self.ui.findChild(LineEdit, "lineEdit_boss")
self.boss_key.textChanged.connect(self.change_config) self.boss_key.textChanged.connect(self.change_config)
self.if_to_tray: QCheckBox = self.ui.findChild(QCheckBox, "checkBox_iftotray") self.if_to_tray: CheckBox = self.ui.findChild(CheckBox, "checkBox_iftotray")
self.if_to_tray.stateChanged.connect(self.change_config) self.if_to_tray.stateChanged.connect(self.change_config)
self.check_update: QCheckBox = self.ui.findChild( self.check_update: PushButton = self.ui.findChild(
QPushButton, "pushButton_check_update" PushButton, "pushButton_check_update"
) )
self.check_update.setIcon(FluentIcon.UPDATE)
self.check_update.clicked.connect(self.check_version) self.check_update.clicked.connect(self.check_version)
self.tips: QTextBrowser = self.ui.findChild(QTextBrowser, "textBrowser_tips") self.tips: TextBrowser = self.ui.findChild(TextBrowser, "textBrowser_tips")
self.tips.setOpenExternalLinks(True) self.tips.setOpenExternalLinks(True)
self.run_text: QTextBrowser = self.ui.findChild(QTextBrowser, "textBrowser_run") self.run_text: TextBrowser = self.ui.findChild(TextBrowser, "textBrowser_run")
self.wait_text: QTextBrowser = self.ui.findChild( self.wait_text: TextBrowser = self.ui.findChild(TextBrowser, "textBrowser_wait")
QTextBrowser, "textBrowser_wait" self.over_text: TextBrowser = self.ui.findChild(TextBrowser, "textBrowser_over")
self.error_text: TextBrowser = self.ui.findChild(
TextBrowser, "textBrowser_error"
) )
self.over_text: QTextBrowser = self.ui.findChild( self.log_text: TextBrowser = self.ui.findChild(TextBrowser, "textBrowser_log")
QTextBrowser, "textBrowser_over"
)
self.error_text: QTextBrowser = self.ui.findChild(
QTextBrowser, "textBrowser_error"
)
self.log_text: QTextBrowser = self.ui.findChild(QTextBrowser, "textBrowser_log")
self.start_time: List[Tuple[QCheckBox, QTimeEdit]] = [] self.start_time: List[Tuple[CheckBox, TimePicker]] = []
for i in range(10): for i in range(10):
self.start_time.append( self.start_time.append(
[ [
self.ui.findChild(QCheckBox, f"checkBox_t{i + 1}"), self.ui.findChild(CheckBox, f"checkBox_t{i + 1}"),
self.ui.findChild(QTimeEdit, f"timeEdit_{i + 1}"), self.ui.findChild(TimePicker, f"timeEdit_{i + 1}"),
] ]
) )
self.start_time[i][0].stateChanged.connect(self.change_config) self.start_time[i][0].stateChanged.connect(self.change_config)
self.start_time[i][1].timeChanged.connect(self.change_config) self.start_time[i][1].timeChanged.connect(self.change_config)
self.change_password: QPushButton = self.ui.findChild( self.change_password: PushButton = self.ui.findChild(
QPushButton, "pushButton_changePASSWORD" PushButton, "pushButton_changePASSWORD"
) )
self.change_password.setIcon(FluentIcon.VPN)
self.change_password.clicked.connect(self.change_PASSWORD) self.change_password.clicked.connect(self.change_PASSWORD)
# 初始化线程 # 初始化线程
@@ -345,6 +347,24 @@ class Main(QWidget):
if self.config.content["Default"]["SelfSet.IfProxyDirectly"] == "True": if self.config.content["Default"]["SelfSet.IfProxyDirectly"] == "True":
self.maa_starter("日常代理") self.maa_starter("日常代理")
def check_PASSWORD(self) -> None:
"""检查并配置管理密钥"""
if self.config.key_path.exists():
return None
while True:
if self.read("setkey"):
self.crypto.get_PASSWORD(self.PASSWORD)
break
else:
choice = MessageBox(
"确认", "您没有输入管理密钥,确定要暂时跳过这一步吗?", self.ui
)
if choice.exec():
break
def change_PASSWORD(self) -> None: def change_PASSWORD(self) -> None:
"""修改管理密钥""" """修改管理密钥"""
@@ -353,24 +373,30 @@ class Main(QWidget):
data = self.config.cur.fetchall() data = self.config.cur.fetchall()
if len(data) == 0: if len(data) == 0:
QMessageBox.information(self.ui, "验证通过", "当前无用户,验证自动通过") choice = MessageBox("验证通过", "当前无用户,验证自动通过", self.ui)
choice.cancelButton.hide()
choice.buttonLayout.insertStretch(1)
# 获取新的管理密钥 # 获取新的管理密钥
while True: if choice.exec():
PASSWORD_new = self.read("newkey") while True:
if PASSWORD_new == 0: PASSWORD_new = self.read("newkey")
choice = QMessageBox.question( if PASSWORD_new == None:
self.ui, choice = MessageBox(
"确认", "确认",
"您没有输入新的管理密钥,是否取消修改管理密钥?", "您没有输入新的管理密钥,是否取消修改管理密钥?",
) self.ui,
if choice == QMessageBox.Yes: )
break if choice.exec():
else: break
# 修改管理密钥 else:
self.PASSWORD = PASSWORD_new # 修改管理密钥
self.crypto.get_PASSWORD(self.PASSWORD) self.PASSWORD = PASSWORD_new
QMessageBox.information(self.ui, "操作成功", "管理密钥修改成功") self.crypto.get_PASSWORD(self.PASSWORD)
break choice = MessageBox("操作成功", "管理密钥修改成功", self.ui)
choice.cancelButton.hide()
choice.buttonLayout.insertStretch(1)
if choice.exec():
break
else: else:
# 验证管理密钥 # 验证管理密钥
if_change = True if_change = True
@@ -378,18 +404,22 @@ class Main(QWidget):
if self.read("oldkey"): if self.read("oldkey"):
# 验证旧管理密钥 # 验证旧管理密钥
if not self.crypto.check_PASSWORD(self.PASSWORD): if not self.crypto.check_PASSWORD(self.PASSWORD):
QMessageBox.critical(self.ui, "错误", "管理密钥错误") choice = MessageBox("错误", "管理密钥错误", self.ui)
choice.cancelButton.hide()
choice.buttonLayout.insertStretch(1)
if choice.exec():
pass
else: else:
# 获取新的管理密钥 # 获取新的管理密钥
while True: while True:
PASSWORD_new = self.read("newkey") PASSWORD_new = self.read("newkey")
if PASSWORD_new == 0: if PASSWORD_new == None:
choice = QMessageBox.question( choice = MessageBox(
self.ui,
"确认", "确认",
"您没有输入新的管理密钥,是否取消修改管理密钥?", "您没有输入新的管理密钥,是否取消修改管理密钥?",
self.ui,
) )
if choice == QMessageBox.Yes: if choice.exec():
if_change = False if_change = False
break break
# 修改管理密钥 # 修改管理密钥
@@ -398,16 +428,21 @@ class Main(QWidget):
data, self.PASSWORD, PASSWORD_new data, self.PASSWORD, PASSWORD_new
) )
self.PASSWORD = PASSWORD_new self.PASSWORD = PASSWORD_new
QMessageBox.information( choice = MessageBox(
self.ui, "操作成功", "管理密钥修改成功" "操作成功", "管理密钥修改成功", self.ui
) )
if_change = False choice.cancelButton.hide()
break choice.buttonLayout.insertStretch(1)
if choice.exec():
if_change = False
break
else: else:
choice = QMessageBox.question( choice = MessageBox(
self.ui, "确认", "您没有输入管理密钥,是否取消修改管理密钥?" "确认",
"您没有输入管理密钥,是否取消修改管理密钥?",
self.ui,
) )
if choice == QMessageBox.Yes: if choice.exec():
break break
def update_user_info(self, operation: str) -> None: def update_user_info(self, operation: str) -> None:
@@ -444,7 +479,7 @@ class Main(QWidget):
# 生成表格组件 # 生成表格组件
if j == 2: if j == 2:
item = QComboBox() item = ComboBox()
item.addItems(["官服", "B服"]) item.addItems(["官服", "B服"])
if value == "Official": if value == "Official":
item.setCurrentIndex(0) item.setCurrentIndex(0)
@@ -524,7 +559,7 @@ class Main(QWidget):
# 生成表格组件 # 生成表格组件
if j in [4, 9, 10]: if j in [4, 9, 10]:
item = QComboBox() item = ComboBox()
if j == 4: if j == 4:
item.addItems(["启用", "禁用"]) item.addItems(["启用", "禁用"])
elif j in [9, 10]: elif j in [9, 10]:
@@ -579,11 +614,11 @@ class Main(QWidget):
# 设置列表可编辑状态 # 设置列表可编辑状态
if self.if_user_list_editable: if self.if_user_list_editable:
self.user_list_simple.setEditTriggers(QTableWidget.AllEditTriggers) self.user_list_simple.setEditTriggers(TableWidget.AllEditTriggers)
self.user_list_beta.setEditTriggers(QTableWidget.AllEditTriggers) self.user_list_beta.setEditTriggers(TableWidget.AllEditTriggers)
else: else:
self.user_list_simple.setEditTriggers(QTableWidget.NoEditTriggers) self.user_list_simple.setEditTriggers(TableWidget.NoEditTriggers)
self.user_list_beta.setEditTriggers(QTableWidget.NoEditTriggers) self.user_list_beta.setEditTriggers(TableWidget.NoEditTriggers)
# 允许GUI改变被同步到本地数据库 # 允许GUI改变被同步到本地数据库
self.if_update_database = True self.if_update_database = True
@@ -683,12 +718,15 @@ class Main(QWidget):
# 判断是否已设置管理密钥 # 判断是否已设置管理密钥
if not self.config.key_path.exists(): if not self.config.key_path.exists():
QMessageBox.critical( choice = MessageBox(
self.ui,
"错误", "错误",
"请先设置管理密钥再执行添加用户操作", "请先设置管理密钥再执行添加用户操作",
self.ui,
) )
return None choice.cancelButton.hide()
choice.buttonLayout.insertStretch(1)
if choice.exec():
return None
# 插入预设用户数据 # 插入预设用户数据
set_book = [ set_book = [
@@ -719,8 +757,11 @@ class Main(QWidget):
# 判断选择合理性 # 判断选择合理性
if row == -1: if row == -1:
QMessageBox.critical(self.ui, "错误", "请选中一个用户后再执行删除操作") choice = MessageBox("错误", "请选中一个用户后再执行删除操作", self.ui)
return None choice.cancelButton.hide()
choice.buttonLayout.insertStretch(1)
if choice.exec():
return None
# 确认待删除用户信息 # 确认待删除用户信息
self.config.cur.execute( self.config.cur.execute(
@@ -731,12 +772,10 @@ class Main(QWidget):
), ),
) )
data = self.config.cur.fetchall() data = self.config.cur.fetchall()
choice = QMessageBox.question( choice = MessageBox("确认", f"确定要删除用户 {data[0][0]} 吗?", self.ui)
self.ui, "确认", f"确定要删除用户 {data[0][0]} 吗?"
)
# 删除用户 # 删除用户
if choice == QMessageBox.Yes: if choice.exec():
# 删除所选用户 # 删除所选用户
self.config.cur.execute( self.config.cur.execute(
"DELETE FROM adminx WHERE mode = ? AND uid = ?", "DELETE FROM adminx WHERE mode = ? AND uid = ?",
@@ -791,8 +830,11 @@ class Main(QWidget):
# 判断选择合理性 # 判断选择合理性
if row == -1: if row == -1:
QMessageBox.critical(self.ui, "错误", "请选中一个用户后再执行切换操作") choice = MessageBox("错误", "请选中一个用户后再执行切换操作", self.ui)
return None choice.cancelButton.hide()
choice.buttonLayout.insertStretch(1)
if choice.exec():
return None
# 确认待切换用户信息 # 确认待切换用户信息
self.config.cur.execute( self.config.cur.execute(
@@ -805,14 +847,14 @@ class Main(QWidget):
data = self.config.cur.fetchall() data = self.config.cur.fetchall()
mode_list = ["简洁", "高级"] mode_list = ["简洁", "高级"]
choice = QMessageBox.question( choice = MessageBox(
self.ui,
"确认", "确认",
f"确定要将用户 {data[0][0]} 转为{mode_list[1 - self.user_set.currentIndex()]}配置模式吗?", f"确定要将用户 {data[0][0]} 转为{mode_list[1 - self.user_set.currentIndex()]}配置模式吗?",
self.ui,
) )
# 切换用户 # 切换用户
if choice == QMessageBox.Yes: if choice.exec():
self.config.cur.execute("SELECT * FROM adminx WHERE True") self.config.cur.execute("SELECT * FROM adminx WHERE True")
data = self.config.cur.fetchall() data = self.config.cur.fetchall()
if self.user_set.currentIndex() == 0: if self.user_set.currentIndex() == 0:
@@ -886,12 +928,15 @@ class Main(QWidget):
) )
return True return True
else: else:
QMessageBox.critical( choice = MessageBox(
self.ui,
"错误", "错误",
"未选择自定义基建文件", "未选择自定义基建文件",
self.ui,
) )
return False choice.cancelButton.hide()
choice.buttonLayout.insertStretch(1)
if choice.exec():
return False
# 获取高级用户MAA配置文件 # 获取高级用户MAA配置文件
elif info[2] in ["routine", "annihilation"]: elif info[2] in ["routine", "annihilation"]:
( (
@@ -904,7 +949,7 @@ class Main(QWidget):
/ f"data/MAAconfig/{self.user_mode_list[info[0]]}/{info[1]}/{info[2]}", / f"data/MAAconfig/{self.user_mode_list[info[0]]}/{info[1]}/{info[2]}",
) )
def change_user_Item(self, item: QTableWidget, mode): def change_user_Item(self, item: TableWidget, mode):
"""将GUI中发生修改的用户配置表中的一般信息同步至本地数据库""" """将GUI中发生修改的用户配置表中的一般信息同步至本地数据库"""
# 验证能否写入本地数据库 # 验证能否写入本地数据库
@@ -1078,11 +1123,13 @@ class Main(QWidget):
) )
self.get_maa_config(["Default"]) self.get_maa_config(["Default"])
else: else:
QMessageBox.critical( choice = MessageBox(
self.ui,
"错误", "错误",
"该路径下未找到MAA.exe或MAA配置文件请重新设置MAA路径", "该路径下未找到MAA.exe或MAA配置文件请重新设置MAA路径",
self.ui,
) )
if choice.exec():
pass
self.config.content["Default"][ self.config.content["Default"][
"SelfSet.MainIndex" "SelfSet.MainIndex"
@@ -1135,7 +1182,7 @@ class Main(QWidget):
self.config.content["Default"][f"TimeSet.set{i + 1}"] = "True" self.config.content["Default"][f"TimeSet.set{i + 1}"] = "True"
else: else:
self.config.content["Default"][f"TimeSet.set{i + 1}"] = "False" self.config.content["Default"][f"TimeSet.set{i + 1}"] = "False"
time = self.start_time[i][1].time().toString("HH:mm") time = self.start_time[i][1].getTime().toString("HH:mm")
self.config.content["Default"][f"TimeSet.run{i + 1}"] = time self.config.content["Default"][f"TimeSet.run{i + 1}"] = time
# 将配置信息同步至本地JSON文件 # 将配置信息同步至本地JSON文件
@@ -1153,40 +1200,78 @@ class Main(QWidget):
def read(self, operation): def read(self, operation):
"""弹出对话框组件进行读入""" """弹出对话框组件进行读入"""
class InputMessageBox(MessageBoxBase):
"""输入对话框"""
def __init__(self, parent, title: str, content: str, mode: str):
super().__init__(parent)
self.title = SubtitleLabel(title)
if mode == "明文":
self.input = LineEdit()
elif mode == "密码":
self.input = PasswordLineEdit()
self.input.setPlaceholderText(content)
self.input.setClearButtonEnabled(True)
# 将组件添加到布局中
self.viewLayout.addWidget(self.title)
self.viewLayout.addWidget(self.input)
# 读入PASSWORD # 读入PASSWORD
if operation == "key": if operation == "key":
self.PASSWORD, ok_pressed = QInputDialog.getText(
self.ui, "请输入管理密钥", "管理密钥", QLineEdit.Password, "" choice = InputMessageBox(self.ui, "请输入管理密钥", "管理密钥", "密码")
) if choice.exec() and choice.input.text() != "":
if ok_pressed and self.PASSWORD != "": self.PASSWORD = choice.input.text()
self.update_user_info("normal") self.update_user_info("normal")
elif operation == "oldkey": elif operation == "oldkey":
self.PASSWORD, ok_pressed = QInputDialog.getText(
self.ui, "请输入旧的管理密钥", "旧管理密钥:", QLineEdit.Password, "" choice = InputMessageBox(
self.ui, "请输入旧的管理密钥", "旧管理密钥", "密码"
) )
if ok_pressed and self.PASSWORD != "": if choice.exec() and choice.input.text() != "":
self.PASSWORD = choice.input.text()
return True return True
else: else:
return False return False
elif operation == "newkey": elif operation == "newkey":
new_PASSWORD, ok_pressed = QInputDialog.getText(
self.ui, "请输入新的管理密钥", "新管理密钥:", QLineEdit.Password, "" choice = InputMessageBox(
self.ui, "请输入新的管理密钥", "新管理密钥", "密码"
) )
if ok_pressed and new_PASSWORD != "": if choice.exec() and choice.input.text() != "":
return new_PASSWORD return choice.input.text()
else: else:
return None return None
elif operation == "setkey":
choice = InputMessageBox(
self.ui,
"未检测到管理密钥,请设置您的管理密钥",
"管理密钥",
"密码",
)
if choice.exec() and choice.input.text() != "":
self.PASSWORD = choice.input.text()
return True
else:
return False
# 读入选择 # 读入选择
elif operation == "question_runner": elif operation == "question_runner":
choice = QMessageBox.question( choice = MessageBox(
self.ui,
self.MaaManager.question_title, self.MaaManager.question_title,
self.MaaManager.question_info, self.MaaManager.question_info,
None,
) )
if choice == QMessageBox.Yes: if choice.exec():
self.MaaManager.question_choice = "Yes" self.MaaManager.question_choice = "Yes"
elif choice == QMessageBox.No: else:
self.MaaManager.question_choice = "No" self.MaaManager.question_choice = "No"
# 读入MAA文件目录 # 读入MAA文件目录
@@ -1334,8 +1419,11 @@ class Main(QWidget):
Path(self.config.content["Default"]["MaaSet.path"]) / "config/gui.json" Path(self.config.content["Default"]["MaaSet.path"]) / "config/gui.json"
).exists() ).exists()
): ):
QMessageBox.critical(self.ui, "错误", "您还未正确配置MAA路径") choice = MessageBox("错误", "您还未正确配置MAA路径", self.ui)
return None choice.cancelButton.hide()
choice.buttonLayout.insertStretch(1)
if choice.exec():
return None
self.maa_running_set(f"{mode}_开始") self.maa_running_set(f"{mode}_开始")
@@ -1458,12 +1546,15 @@ class Main(QWidget):
err = e err = e
time.sleep(0.1) time.sleep(0.1)
else: else:
QMessageBox.critical( choice = MessageBox(
self.ui,
"错误", "错误",
f"获取版本信息时出错:\n{err}", f"获取版本信息时出错:\n{err}",
self.ui,
) )
return None choice.cancelButton.hide()
choice.buttonLayout.insertStretch(1)
if choice.exec():
return None
main_version_remote = list(map(int, version_remote["main_version"].split("."))) main_version_remote = list(map(int, version_remote["main_version"].split(".")))
updater_version_remote = list( updater_version_remote = list(
@@ -1490,12 +1581,12 @@ class Main(QWidget):
) )
# 询问是否开始版本更新 # 询问是否开始版本更新
choice = QMessageBox.question( choice = MessageBox(
self.ui,
"版本更新", "版本更新",
f"发现新版本:\n{main_version_info}{updater_version_info} 更新说明:\n{version_remote['announcement'].replace("\n# ","\n ").replace("\n## ","\n - ").replace("\n- ","\n · ")}\n\n是否开始更新?\n\n 注意主程序更新时AUTO_MAA将自动关闭", f"发现新版本:\n{main_version_info}{updater_version_info} 更新说明:\n{version_remote['announcement'].replace("\n# ","\n ").replace("\n## ","\n - ").replace("\n- ","\n · ")}\n\n是否开始更新?\n\n 注意主程序更新时AUTO_MAA将自动关闭",
self.ui,
) )
if choice == QMessageBox.No: if not choice.exec():
return None return None
# 更新更新器 # 更新更新器
@@ -1567,25 +1658,36 @@ class AUTO_MAA(QMainWindow):
self, self,
) )
self.tray.setToolTip("AUTO_MAA") self.tray.setToolTip("AUTO_MAA")
self.tray_menu = QMenu() self.tray_menu = RoundMenu()
# 显示主界面菜单项 # 显示主界面菜单项
show_main = self.tray_menu.addAction("显示主界面") self.tray_menu.addAction(
show_main.triggered.connect(self.show_main) Action(FluentIcon.CAFE, "显示主界面", triggered=self.show_main)
)
self.tray_menu.addSeparator()
# 开始任务菜单项 # 开始任务菜单项
start_task_1 = self.tray_menu.addAction("运行日常代理") self.tray_menu.addActions(
start_task_1.triggered.connect(lambda: self.start_task("日常代理")) [
Action(
start_task_2 = self.tray_menu.addAction("运行人工排查") FluentIcon.PLAY,
start_task_2.triggered.connect(lambda: self.start_task("人工排查")) "运行日常代理",
triggered=lambda: self.start_task("日常代理"),
stop_task = self.tray_menu.addAction("中止当前任务") ),
stop_task.triggered.connect(self.stop_task) # Action(
# FluentIcon.PLAY,
# "运行人工排查",
# triggered=lambda: self.start_task("人工排查"),
# ),
Action(FluentIcon.PAUSE, "中止当前任务", triggered=self.stop_task),
]
)
self.tray_menu.addSeparator()
# 退出主程序菜单项 # 退出主程序菜单项
kill = self.tray_menu.addAction("退出主程序") self.tray_menu.addAction(
kill.triggered.connect(self.kill_main) Action(FluentIcon.POWER_BUTTON, "退出主程序", triggered=self.kill_main)
)
# 设置托盘菜单 # 设置托盘菜单
self.tray.setContextMenu(self.tray_menu) self.tray.setContextMenu(self.tray_menu)

View File

@@ -38,9 +38,8 @@ from PySide6.QtWidgets import (
QApplication, QApplication,
QDialog, QDialog,
QVBoxLayout, QVBoxLayout,
QLabel,
QProgressBar,
) )
from qfluentwidgets import ProgressBar, BodyLabel
from PySide6.QtGui import QIcon from PySide6.QtGui import QIcon
from PySide6.QtCore import QObject, QThread, Signal from PySide6.QtCore import QObject, QThread, Signal
@@ -265,10 +264,10 @@ class Updater(QObject):
# 创建垂直布局 # 创建垂直布局
self.Layout_v = QVBoxLayout(self.ui) self.Layout_v = QVBoxLayout(self.ui)
self.info = QLabel("正在初始化", self.ui) self.info = BodyLabel("正在初始化", self.ui)
self.Layout_v.addWidget(self.info) self.Layout_v.addWidget(self.info)
self.progress = QProgressBar(self.ui) self.progress = ProgressBar(self.ui)
self.progress.setRange(0, 0) self.progress.setRange(0, 0)
self.Layout_v.addWidget(self.progress) self.Layout_v.addWidget(self.progress)

View File

@@ -38,4 +38,5 @@ if __name__ == "__main__":
application = QApplication(sys.argv) application = QApplication(sys.argv)
window = AUTO_MAA(config=config, notify=notify, crypto=crypto) window = AUTO_MAA(config=config, notify=notify, crypto=crypto)
window.main.check_PASSWORD()
sys.exit(application.exec()) sys.exit(application.exec())

View File

@@ -1,5 +1,6 @@
plyer plyer
PySide6 PySide6
PySide6-Fluent-Widgets[full]
psutil psutil
pywin32 pywin32
pyautogui pyautogui

View File

@@ -39,21 +39,21 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<widget class="QPushButton" name="pushButton_new"> <widget class="PushButton" name="pushButton_new">
<property name="text"> <property name="text">
<string>新建</string> <string>新建</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButton_del"> <widget class="PushButton" name="pushButton_del">
<property name="text"> <property name="text">
<string>删除</string> <string>删除</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButton_switch"> <widget class="PushButton" name="pushButton_switch">
<property name="text"> <property name="text">
<string>转为</string> <string>转为</string>
</property> </property>
@@ -73,14 +73,14 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButton_password"> <widget class="PushButton" name="pushButton_password">
<property name="text"> <property name="text">
<string>显示密码</string> <string>显示密码</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButton_refresh"> <widget class="PushButton" name="pushButton_refresh">
<property name="text"> <property name="text">
<string>刷新</string> <string>刷新</string>
</property> </property>
@@ -107,7 +107,7 @@
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_16"> <layout class="QVBoxLayout" name="verticalLayout_16">
<item> <item>
<widget class="QTableWidget" name="tableWidget_userlist_simple"> <widget class="TableWidget" name="tableWidget_userlist_simple">
<column> <column>
<property name="text"> <property name="text">
<string>用户名</string> <string>用户名</string>
@@ -191,7 +191,7 @@
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_17"> <layout class="QVBoxLayout" name="verticalLayout_17">
<item> <item>
<widget class="QTableWidget" name="tableWidget_userlist_beta"> <widget class="TableWidget" name="tableWidget_userlist_beta">
<column> <column>
<property name="text"> <property name="text">
<string>用户名</string> <string>用户名</string>
@@ -253,7 +253,7 @@
<property name="title"> <property name="title">
<string>定时执行</string> <string>定时执行</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_27">
<item> <item>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="2" column="0"> <item row="2" column="0">
@@ -266,7 +266,7 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_7" stretch="0,0"> <layout class="QHBoxLayout" name="horizontalLayout_7" stretch="0,0">
<item> <item>
<widget class="QCheckBox" name="checkBox_t1"> <widget class="CheckBox" name="checkBox_t1">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
@@ -288,7 +288,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTimeEdit" name="timeEdit_1"/> <widget class="TimePicker" name="timeEdit_1"/>
</item> </item>
</layout> </layout>
</widget> </widget>
@@ -303,7 +303,7 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_16"> <layout class="QHBoxLayout" name="horizontalLayout_16">
<item> <item>
<widget class="QCheckBox" name="checkBox_t10"> <widget class="CheckBox" name="checkBox_t10">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
@@ -325,7 +325,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTimeEdit" name="timeEdit_10"/> <widget class="TimePicker" name="timeEdit_10"/>
</item> </item>
</layout> </layout>
</widget> </widget>
@@ -340,7 +340,7 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_9"> <layout class="QHBoxLayout" name="horizontalLayout_9">
<item> <item>
<widget class="QCheckBox" name="checkBox_t3"> <widget class="CheckBox" name="checkBox_t3">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
@@ -362,7 +362,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTimeEdit" name="timeEdit_3"/> <widget class="TimePicker" name="timeEdit_3"/>
</item> </item>
</layout> </layout>
</widget> </widget>
@@ -377,7 +377,7 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_8"> <layout class="QHBoxLayout" name="horizontalLayout_8">
<item> <item>
<widget class="QCheckBox" name="checkBox_t2"> <widget class="CheckBox" name="checkBox_t2">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
@@ -399,7 +399,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTimeEdit" name="timeEdit_2"/> <widget class="TimePicker" name="timeEdit_2"/>
</item> </item>
</layout> </layout>
</widget> </widget>
@@ -414,7 +414,7 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_15"> <layout class="QHBoxLayout" name="horizontalLayout_15">
<item> <item>
<widget class="QCheckBox" name="checkBox_t9"> <widget class="CheckBox" name="checkBox_t9">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
@@ -436,7 +436,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTimeEdit" name="timeEdit_9"/> <widget class="TimePicker" name="timeEdit_9"/>
</item> </item>
</layout> </layout>
</widget> </widget>
@@ -451,7 +451,7 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_10"> <layout class="QHBoxLayout" name="horizontalLayout_10">
<item> <item>
<widget class="QCheckBox" name="checkBox_t4"> <widget class="CheckBox" name="checkBox_t4">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
@@ -473,7 +473,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTimeEdit" name="timeEdit_4"/> <widget class="TimePicker" name="timeEdit_4"/>
</item> </item>
</layout> </layout>
</widget> </widget>
@@ -488,7 +488,7 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_12"> <layout class="QHBoxLayout" name="horizontalLayout_12">
<item> <item>
<widget class="QCheckBox" name="checkBox_t6"> <widget class="CheckBox" name="checkBox_t6">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
@@ -510,7 +510,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTimeEdit" name="timeEdit_6"/> <widget class="TimePicker" name="timeEdit_6"/>
</item> </item>
</layout> </layout>
</widget> </widget>
@@ -525,7 +525,7 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_11"> <layout class="QHBoxLayout" name="horizontalLayout_11">
<item> <item>
<widget class="QCheckBox" name="checkBox_t5"> <widget class="CheckBox" name="checkBox_t5">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
@@ -547,7 +547,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTimeEdit" name="timeEdit_5"/> <widget class="TimePicker" name="timeEdit_5"/>
</item> </item>
</layout> </layout>
</widget> </widget>
@@ -562,7 +562,7 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_13"> <layout class="QHBoxLayout" name="horizontalLayout_13">
<item> <item>
<widget class="QCheckBox" name="checkBox_t8"> <widget class="CheckBox" name="checkBox_t8">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
@@ -584,7 +584,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTimeEdit" name="timeEdit_7"/> <widget class="TimePicker" name="timeEdit_7"/>
</item> </item>
</layout> </layout>
</widget> </widget>
@@ -599,7 +599,7 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_14"> <layout class="QHBoxLayout" name="horizontalLayout_14">
<item> <item>
<widget class="QCheckBox" name="checkBox_t7"> <widget class="CheckBox" name="checkBox_t7">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
@@ -621,7 +621,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTimeEdit" name="timeEdit_8"/> <widget class="TimePicker" name="timeEdit_8"/>
</item> </item>
</layout> </layout>
</widget> </widget>
@@ -651,7 +651,7 @@
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>
<widget class="QLabel" name="label_main"> <widget class="BodyLabel" name="label_main">
<property name="text"> <property name="text">
<string>调度器</string> <string>调度器</string>
</property> </property>
@@ -671,14 +671,14 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButton_checkstart"> <widget class="PushButton" name="pushButton_checkstart">
<property name="text"> <property name="text">
<string>开始排查</string> <string>开始排查</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButton_runnow"> <widget class="PushButton" name="pushButton_runnow">
<property name="text"> <property name="text">
<string>立即执行</string> <string>立即执行</string>
</property> </property>
@@ -706,7 +706,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTextBrowser" name="textBrowser_run"/> <widget class="TextBrowser" name="textBrowser_run"/>
</item> </item>
</layout> </layout>
</widget> </widget>
@@ -728,7 +728,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTextBrowser" name="textBrowser_wait"/> <widget class="TextBrowser" name="textBrowser_wait"/>
</item> </item>
</layout> </layout>
</widget> </widget>
@@ -750,7 +750,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTextBrowser" name="textBrowser_over"/> <widget class="TextBrowser" name="textBrowser_over"/>
</item> </item>
</layout> </layout>
</widget> </widget>
@@ -772,7 +772,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTextBrowser" name="textBrowser_error"/> <widget class="TextBrowser" name="textBrowser_error"/>
</item> </item>
</layout> </layout>
</widget> </widget>
@@ -796,7 +796,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTextBrowser" name="textBrowser_log"/> <widget class="TextBrowser" name="textBrowser_log"/>
</item> </item>
</layout> </layout>
</widget> </widget>
@@ -816,7 +816,7 @@
<property name="title"> <property name="title">
<string>MAA设置</string> <string>MAA设置</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_14"> <layout class="QHBoxLayout" name="horizontalLayout_28">
<item> <item>
<widget class="QFrame" name="frame_maaset"> <widget class="QFrame" name="frame_maaset">
<property name="frameShape"> <property name="frameShape">
@@ -827,17 +827,17 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_4" stretch="0,20,2,1,2"> <layout class="QHBoxLayout" name="horizontalLayout_4" stretch="0,20,2,1,2">
<item> <item>
<widget class="QLabel" name="label_2"> <widget class="BodyLabel" name="label_2">
<property name="text"> <property name="text">
<string>MAA路径</string> <string>MAA路径</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="lineEdit_MAApath"/> <widget class="LineEdit" name="lineEdit_MAApath"/>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButton_getMAApath"> <widget class="PushButton" name="pushButton_getMAApath">
<property name="text"> <property name="text">
<string>浏览</string> <string>浏览</string>
</property> </property>
@@ -857,7 +857,7 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButton_setMAA"> <widget class="PushButton" name="pushButton_setMAA">
<property name="text"> <property name="text">
<string>设置MAA</string> <string>设置MAA</string>
</property> </property>
@@ -874,8 +874,8 @@
<property name="title"> <property name="title">
<string>执行限制</string> <string>执行限制</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_24">
<item row="0" column="0"> <item>
<widget class="QFrame" name="frame_routine"> <widget class="QFrame" name="frame_routine">
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::Shape::StyledPanel</enum> <enum>QFrame::Shape::StyledPanel</enum>
@@ -885,7 +885,7 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_5"> <layout class="QHBoxLayout" name="horizontalLayout_5">
<item> <item>
<widget class="QLabel" name="label_routine"> <widget class="BodyLabel" name="label_routine">
<property name="text"> <property name="text">
<string>日常限制</string> <string>日常限制</string>
</property> </property>
@@ -905,11 +905,11 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QSpinBox" name="spinBox_routine"> <widget class="SpinBox" name="spinBox_routine">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>140</width>
<height>0</height> <height>30</height>
</size> </size>
</property> </property>
<property name="minimum"> <property name="minimum">
@@ -930,7 +930,7 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item>
<widget class="QFrame" name="frame_annihilation"> <widget class="QFrame" name="frame_annihilation">
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::Shape::StyledPanel</enum> <enum>QFrame::Shape::StyledPanel</enum>
@@ -940,7 +940,7 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_6"> <layout class="QHBoxLayout" name="horizontalLayout_6">
<item> <item>
<widget class="QLabel" name="label_annihilation"> <widget class="BodyLabel" name="label_annihilation">
<property name="text"> <property name="text">
<string>剿灭限制</string> <string>剿灭限制</string>
</property> </property>
@@ -960,11 +960,11 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QSpinBox" name="spinBox_annihilation"> <widget class="SpinBox" name="spinBox_annihilation">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>140</width>
<height>0</height> <height>30</height>
</size> </size>
</property> </property>
<property name="minimum"> <property name="minimum">
@@ -985,7 +985,7 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="0" column="2"> <item>
<widget class="QFrame" name="frame_annihilation_2"> <widget class="QFrame" name="frame_annihilation_2">
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::Shape::StyledPanel</enum> <enum>QFrame::Shape::StyledPanel</enum>
@@ -995,7 +995,7 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_17"> <layout class="QHBoxLayout" name="horizontalLayout_17">
<item> <item>
<widget class="QLabel" name="label_num"> <widget class="BodyLabel" name="label_num">
<property name="text"> <property name="text">
<string>运行失败重试次数上限</string> <string>运行失败重试次数上限</string>
</property> </property>
@@ -1015,11 +1015,11 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QSpinBox" name="spinBox_numt"> <widget class="SpinBox" name="spinBox_numt">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>140</width>
<height>0</height> <height>30</height>
</size> </size>
</property> </property>
<property name="minimum"> <property name="minimum">
@@ -1072,7 +1072,7 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_22" stretch="0,1,3"> <layout class="QHBoxLayout" name="horizontalLayout_22" stretch="0,1,3">
<item> <item>
<widget class="QCheckBox" name="checkBox_silence"> <widget class="CheckBox" name="checkBox_silence">
<property name="text"> <property name="text">
<string>后台静默代理</string> <string>后台静默代理</string>
</property> </property>
@@ -1092,7 +1092,7 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="lineEdit_boss"> <widget class="LineEdit" name="lineEdit_boss">
<property name="placeholderText"> <property name="placeholderText">
<string>安卓模拟器老板键</string> <string>安卓模拟器老板键</string>
</property> </property>
@@ -1124,7 +1124,7 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_26" stretch="0,1,3,0"> <layout class="QHBoxLayout" name="horizontalLayout_26" stretch="0,1,3,0">
<item> <item>
<widget class="QCheckBox" name="checkBox_ifsendmail"> <widget class="CheckBox" name="checkBox_ifsendmail">
<property name="text"> <property name="text">
<string>通过邮件通知结果</string> <string>通过邮件通知结果</string>
</property> </property>
@@ -1144,14 +1144,14 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="lineEdit_mailaddress"> <widget class="LineEdit" name="lineEdit_mailaddress">
<property name="placeholderText"> <property name="placeholderText">
<string>收信邮箱地址</string> <string>收信邮箱地址</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="checkBox_ifonlyerror"> <widget class="CheckBox" name="checkBox_ifonlyerror">
<property name="text"> <property name="text">
<string>仅推送异常信息</string> <string>仅推送异常信息</string>
</property> </property>
@@ -1170,7 +1170,7 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_23"> <layout class="QHBoxLayout" name="horizontalLayout_23">
<item> <item>
<widget class="QCheckBox" name="checkBox_iftotray"> <widget class="CheckBox" name="checkBox_iftotray">
<property name="text"> <property name="text">
<string>最小化到托盘</string> <string>最小化到托盘</string>
</property> </property>
@@ -1202,7 +1202,7 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_20"> <layout class="QHBoxLayout" name="horizontalLayout_20">
<item> <item>
<widget class="QCheckBox" name="checkBox_ifproxydirectly"> <widget class="CheckBox" name="checkBox_ifproxydirectly">
<property name="text"> <property name="text">
<string>启动AUTO_MAA后直接代理</string> <string>启动AUTO_MAA后直接代理</string>
</property> </property>
@@ -1247,7 +1247,7 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_19"> <layout class="QHBoxLayout" name="horizontalLayout_19">
<item> <item>
<widget class="QCheckBox" name="checkBox_ifselfstart"> <widget class="CheckBox" name="checkBox_ifselfstart">
<property name="text"> <property name="text">
<string>开机自动启动AUTO_MAA</string> <string>开机自动启动AUTO_MAA</string>
</property> </property>
@@ -1279,7 +1279,7 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_18"> <layout class="QHBoxLayout" name="horizontalLayout_18">
<item> <item>
<widget class="QCheckBox" name="checkBox_ifsleep"> <widget class="CheckBox" name="checkBox_ifsleep">
<property name="text"> <property name="text">
<string>AUTO_MAA启动时禁止电脑休眠</string> <string>AUTO_MAA启动时禁止电脑休眠</string>
</property> </property>
@@ -1350,7 +1350,7 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButton_changePASSWORD"> <widget class="PushButton" name="pushButton_changePASSWORD">
<property name="text"> <property name="text">
<string>修改管理密钥</string> <string>修改管理密钥</string>
</property> </property>
@@ -1408,7 +1408,7 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButton_check_update"> <widget class="PushButton" name="pushButton_check_update">
<property name="text"> <property name="text">
<string> 检查版本更新 </string> <string> 检查版本更新 </string>
</property> </property>
@@ -1440,7 +1440,7 @@
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_15"> <layout class="QVBoxLayout" name="verticalLayout_15">
<item> <item>
<widget class="QTextBrowser" name="textBrowser_tips"> <widget class="TextBrowser" name="textBrowser_tips">
<property name="html"> <property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;meta charset=&quot;utf-8&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;meta charset=&quot;utf-8&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
@@ -1451,6 +1451,8 @@ li.checked::marker { content: &quot;\2612&quot;; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Microsoft YaHei UI'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt; &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Microsoft YaHei UI'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;致用户:&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;致用户:&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 这是AUTO_MAA_v4.2.0-beta.1,项目初步进行界面美化。希望大家喜欢这个新年礼物!&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 使用本程序前请先仔细阅读README.md。&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 使用本程序前请先仔细阅读README.md。&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 对于B服用户由于我们无权替您同意用户协议若出现用户协议弹窗您需要自行完成确认否则可能造成MAA卡死代理任务失败。&lt;/p&gt; &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt; 对于B服用户由于我们无权替您同意用户协议若出现用户协议弹窗您需要自行完成确认否则可能造成MAA卡死代理任务失败。&lt;/p&gt;
@@ -1468,7 +1470,7 @@ li.checked::marker { content: &quot;\2612&quot;; }
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_notice"> <widget class="BodyLabel" name="label_notice">
<property name="text"> <property name="text">
<string>注意:在设置页执行的所有更改,不会对正在执行的任务生效;正在执行任务时,用户管理页无法编辑。</string> <string>注意:在设置页执行的所有更改,不会对正在执行的任务生效;正在执行任务时,用户管理页无法编辑。</string>
</property> </property>
@@ -1496,6 +1498,48 @@ li.checked::marker { content: &quot;\2612&quot;; }
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>PushButton</class>
<extends>QPushButton</extends>
<header location="global">qfluentwidgets</header>
</customwidget>
<customwidget>
<class>TimePicker</class>
<extends>QTimeEdit</extends>
<header location="global">qfluentwidgets</header>
</customwidget>
<customwidget>
<class>TableWidget</class>
<extends>QTableWidget</extends>
<header location="global">qfluentwidgets</header>
</customwidget>
<customwidget>
<class>LineEdit</class>
<extends>QLineEdit</extends>
<header location="global">qfluentwidgets</header>
</customwidget>
<customwidget>
<class>SpinBox</class>
<extends>QSpinBox</extends>
<header location="global">qfluentwidgets</header>
</customwidget>
<customwidget>
<class>CheckBox</class>
<extends>QCheckBox</extends>
<header location="global">qfluentwidgets</header>
</customwidget>
<customwidget>
<class>TextBrowser</class>
<extends>QTextBrowser</extends>
<header location="global">qfluentwidgets</header>
</customwidget>
<customwidget>
<class>BodyLabel</class>
<extends>QLabel</extends>
<header location="global">qfluentwidgets</header>
</customwidget>
</customwidgets>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@@ -1,7 +1,7 @@
{ {
"main_version": "4.2.0.0", "main_version": "4.2.0.1",
"updater_version": "1.1.0.0", "updater_version": "1.1.0.1",
"announcement": "\n## 新增功能\n- 提供完整打包代码\n## 修复BUG\n- 同步MAA`v5.11.1`的字段修改\n- 清除自动化中无效的整合流程\n## 程序优化\n- 调整项目结构,模块化各功能组件\n- 改用`nuitka`编译,压缩软件体积,提升运行速度", "announcement": "\n## 新增功能\n- 初步引入`qfluentwidgets`UI界面美化",
"proxy_list":[ "proxy_list":[
"", "",
"https://gitproxy.click/", "https://gitproxy.click/",