Merge branch 'DLMS_dev' into dev
This commit is contained in:
@@ -127,6 +127,8 @@ class AppConfig:
|
||||
self.queue_config = QueueConfig()
|
||||
self.maa_config = MaaConfig()
|
||||
|
||||
qconfig.load(self.config_path, self.global_config)
|
||||
|
||||
config_list = self.search_config()
|
||||
for config in config_list:
|
||||
if config[0] == "Maa":
|
||||
|
||||
@@ -67,8 +67,6 @@ class Task(QThread):
|
||||
|
||||
self.logs = []
|
||||
|
||||
self.question_response.connect(lambda: print("response"))
|
||||
|
||||
def run(self):
|
||||
|
||||
if "设置MAA" in self.mode:
|
||||
|
||||
@@ -86,25 +86,30 @@ class MainTimer(QWidget):
|
||||
def set_silence(self):
|
||||
"""设置静默模式"""
|
||||
|
||||
windows = System.get_window_info()
|
||||
if any(
|
||||
str(emulator_path) in window
|
||||
for window in windows
|
||||
for emulator_path in Config.silence_list
|
||||
if (
|
||||
Config.global_config.get(Config.global_config.function_IfSilence)
|
||||
and Config.global_config.get(Config.global_config.function_BossKey) != ""
|
||||
):
|
||||
try:
|
||||
pyautogui.hotkey(
|
||||
*[
|
||||
_.strip().lower()
|
||||
for _ in Config.global_config.get(
|
||||
Config.global_config.function_BossKey
|
||||
).split("+")
|
||||
]
|
||||
)
|
||||
except pyautogui.FailSafeException as e:
|
||||
if not self.if_FailSafeException:
|
||||
logger.warning(f"FailSafeException: {e}")
|
||||
self.if_FailSafeException = True
|
||||
|
||||
windows = System.get_window_info()
|
||||
if any(
|
||||
str(emulator_path) in window
|
||||
for window in windows
|
||||
for emulator_path in Config.silence_list
|
||||
):
|
||||
try:
|
||||
pyautogui.hotkey(
|
||||
*[
|
||||
_.strip().lower()
|
||||
for _ in Config.global_config.get(
|
||||
Config.global_config.function_BossKey
|
||||
).split("+")
|
||||
]
|
||||
)
|
||||
except pyautogui.FailSafeException as e:
|
||||
if not self.if_FailSafeException:
|
||||
logger.warning(f"FailSafeException: {e}")
|
||||
self.if_FailSafeException = True
|
||||
|
||||
def search_queue(self) -> list:
|
||||
"""搜索所有调度队列实例"""
|
||||
|
||||
@@ -188,17 +188,12 @@ class MaaManager(QObject):
|
||||
creationflags=subprocess.CREATE_NO_WINDOW,
|
||||
)
|
||||
# 添加静默进程标记
|
||||
if Config.global_config.get(
|
||||
Config.global_config.function_IfSilence
|
||||
):
|
||||
with self.maa_set_path.open(
|
||||
mode="r", encoding="utf-8"
|
||||
) as f:
|
||||
set = json.load(f)
|
||||
self.emulator_path = Path(
|
||||
set["Configurations"]["Default"]["Start.EmulatorPath"]
|
||||
)
|
||||
Config.silence_list.append(self.emulator_path)
|
||||
with self.maa_set_path.open(mode="r", encoding="utf-8") as f:
|
||||
set = json.load(f)
|
||||
self.emulator_path = Path(
|
||||
set["Configurations"]["Default"]["Start.EmulatorPath"]
|
||||
)
|
||||
Config.silence_list.append(self.emulator_path)
|
||||
# 记录是否超时的标记
|
||||
self.if_time_out = False
|
||||
|
||||
@@ -254,10 +249,7 @@ class MaaManager(QObject):
|
||||
"检测到MAA进程完成代理任务\n正在等待相关程序结束\n请等待10s"
|
||||
)
|
||||
# 移除静默进程标记
|
||||
if Config.global_config.get(
|
||||
Config.global_config.function_IfSilence
|
||||
):
|
||||
Config.silence_list.remove(self.emulator_path)
|
||||
Config.silence_list.remove(self.emulator_path)
|
||||
for _ in range(10):
|
||||
if self.isInterruptionRequested:
|
||||
break
|
||||
@@ -278,10 +270,7 @@ class MaaManager(QObject):
|
||||
)
|
||||
killprocess.wait()
|
||||
# 移除静默进程标记
|
||||
if Config.global_config.get(
|
||||
Config.global_config.function_IfSilence
|
||||
):
|
||||
Config.silence_list.remove(self.emulator_path)
|
||||
Config.silence_list.remove(self.emulator_path)
|
||||
# 推送异常通知
|
||||
Notify.push_notification(
|
||||
"用户自动代理出现异常!",
|
||||
|
||||
@@ -223,7 +223,7 @@ class AUTO_MAA(MSFluentWindow):
|
||||
else:
|
||||
|
||||
self.titleBar.minBtn.clicked.disconnect()
|
||||
self.titleBar.minBtn.clicked.connect(self.showMinimized)
|
||||
self.titleBar.minBtn.clicked.connect(self.window().showMinimized)
|
||||
|
||||
def on_tray_activated(self, reason):
|
||||
"""双击返回主界面"""
|
||||
@@ -285,11 +285,11 @@ class AUTO_MAA(MSFluentWindow):
|
||||
),
|
||||
)
|
||||
)
|
||||
self.setGeometry(location[0], location[1], size[0], size[1])
|
||||
self.show()
|
||||
self.window().setGeometry(location[0], location[1], size[0], size[1])
|
||||
self.window().show()
|
||||
if not if_quick:
|
||||
if Config.global_config.get(Config.global_config.ui_maximized):
|
||||
self.showMaximized()
|
||||
self.window().showMaximized()
|
||||
self.set_min_method()
|
||||
self.show_ui("配置托盘")
|
||||
|
||||
@@ -303,7 +303,7 @@ class AUTO_MAA(MSFluentWindow):
|
||||
elif mode == "隐藏到托盘":
|
||||
|
||||
# 保存窗口相关属性
|
||||
if not self.isMaximized():
|
||||
if not self.window().isMaximized():
|
||||
|
||||
Config.global_config.set(
|
||||
Config.global_config.ui_size,
|
||||
@@ -314,14 +314,14 @@ class AUTO_MAA(MSFluentWindow):
|
||||
f"{self.geometry().x()}x{self.geometry().y()}",
|
||||
)
|
||||
Config.global_config.set(
|
||||
Config.global_config.ui_maximized, self.isMaximized()
|
||||
Config.global_config.ui_maximized, self.window().isMaximized()
|
||||
)
|
||||
Config.global_config.save()
|
||||
|
||||
# 隐藏主窗口
|
||||
if not if_quick:
|
||||
|
||||
self.hide()
|
||||
self.window().hide()
|
||||
self.tray.show()
|
||||
|
||||
def closeEvent(self, event: QCloseEvent):
|
||||
@@ -338,6 +338,6 @@ class AUTO_MAA(MSFluentWindow):
|
||||
Config.close_database()
|
||||
|
||||
logger.info("AUTO_MAA主程序关闭")
|
||||
logger.info("===================================")
|
||||
logger.info("----------------END----------------")
|
||||
|
||||
event.accept()
|
||||
|
||||
@@ -535,7 +535,11 @@ class MaaSettingBox(QWidget):
|
||||
|
||||
def PathClicked(self):
|
||||
|
||||
folder = QFileDialog.getExistingDirectory(self, "选择MAA目录", "./")
|
||||
folder = QFileDialog.getExistingDirectory(
|
||||
self,
|
||||
"选择MAA目录",
|
||||
Config.maa_config.get(Config.maa_config.MaaSet_Path),
|
||||
)
|
||||
if (
|
||||
not folder
|
||||
or Config.maa_config.get(Config.maa_config.MaaSet_Path) == folder
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"main_version": "4.2.2.3",
|
||||
"main_version": "4.2.2.4",
|
||||
"updater_version": "1.1.1.3",
|
||||
"announcement": "\n## 新增功能\n- 添加用户每日代理次数上限功能 #15\n- 新增代理成功消息推送渠道Server酱与企业微信群机器人推送\n- 添加更新类别可选项\n- 添加调度队列完成任务后行为选项\n## 修复BUG\n- 修复自定义基建无法正常使用的问题\n- 修正人工排查文案\n- 修复高级MAA配置序号错位\n- 修复高级用户列表无法配置问题\n- 修复主调度台选项乱动问题\n- 修复更新器文件夹定位问题\n## 程序优化\n- 优化弹窗逻辑",
|
||||
"announcement": "\n## 新增功能\n- 添加用户每日代理次数上限功能 #15\n- 新增代理成功消息推送渠道Server酱与企业微信群机器人推送\n- 添加更新类别可选项\n- 添加调度队列完成任务后行为选项\n## 修复BUG\n- 修复自定义基建无法正常使用的问题\n- 修正人工排查文案\n- 修复高级MAA配置序号错位\n- 修复高级用户列表无法配置问题\n- 修复主调度台选项乱动问题\n- 修复更新器文件夹定位问题\n- 修复窗口记忆功能失效问题\n## 程序优化\n- 优化弹窗逻辑\n- 优化静默判定逻辑\n- 调整MAA设置目录时打开当前已配置的目录位置",
|
||||
"proxy_list": [
|
||||
"",
|
||||
"https://gitproxy.click/",
|
||||
|
||||
Reference in New Issue
Block a user