fix: 修正部分格式

This commit is contained in:
DLmaster361
2025-07-26 13:11:23 +08:00
parent a4f867665f
commit 3cdb1e511d
4 changed files with 33 additions and 15 deletions

View File

@@ -713,7 +713,7 @@ class GeneralSubConfig(LQConfig):
class AppConfig(GlobalConfig): class AppConfig(GlobalConfig):
VERSION = "4.4.1.3" VERSION = "4.4.1.4"
stage_refreshed = Signal() stage_refreshed = Signal()
PASSWORD_refreshed = Signal() PASSWORD_refreshed = Signal()

View File

@@ -112,12 +112,18 @@ class _MainTimer(QObject):
windows = System.get_window_info() windows = System.get_window_info()
# 此处排除雷电名为新通知的窗口 emulator_windows = []
if any( for window in windows:
str(emulator_path) in window and window[0] != "新通知" for emulator_path in Config.silence_list:
for window in windows # 此处排除雷电名为新通知的窗口
for emulator_path in Config.silence_list if str(emulator_path) in window and window[0] != "新通知":
): emulator_windows.append(window)
if emulator_windows:
logger.info(
f"检测到模拟器窗口:{emulator_windows}", module="主业务定时器"
)
try: try:
keyboard.press_and_release( keyboard.press_and_release(
"+".join( "+".join(
@@ -146,7 +152,7 @@ class _MainTimer(QObject):
"Sleep": "睡眠", "Sleep": "睡眠",
"Hibernate": "休眠", "Hibernate": "休眠",
"Shutdown": "关机", "Shutdown": "关机",
"ShutdownForce": "关机(强制)" "ShutdownForce": "关机(强制)",
} }
choice = ProgressRingMessageBox( choice = ProgressRingMessageBox(

View File

@@ -204,10 +204,8 @@ class _SystemHandler:
elif mode == "Shutdown": elif mode == "Shutdown":
logger.info("执行关机操作", module="系统服务")
logger.info("正在清除模拟器进程",module="系统服务")
self.kill_emulator_processes() self.kill_emulator_processes()
logger.info("清除模拟器进程完成,正在关机",module="系统服务") logger.info("执行关机操作", module="系统服务")
subprocess.run(["shutdown", "/s", "/t", "0"]) subprocess.run(["shutdown", "/s", "/t", "0"])
elif mode == "ShutdownForce": elif mode == "ShutdownForce":
@@ -262,16 +260,25 @@ class _SystemHandler:
sys.exit(0) sys.exit(0)
def kill_emulator_processes(self): def kill_emulator_processes(self):
# 这里暂时仅支持 MuMu 模拟器 """这里暂时仅支持 MuMu 模拟器"""
keywords = ["Nemu", "nemu", "emulator","MuMu"]
logger.info("正在清除模拟器进程", module="系统服务")
keywords = ["Nemu", "nemu", "emulator", "MuMu"]
for proc in psutil.process_iter(["pid", "name"]): for proc in psutil.process_iter(["pid", "name"]):
try: try:
pname = proc.info["name"].lower() pname = proc.info["name"].lower()
if any(keyword.lower() in pname for keyword in keywords): if any(keyword.lower() in pname for keyword in keywords):
proc.kill() proc.kill()
logger.info(f"已关闭 MuMu 模拟器进程: {proc.info['name']}", module="系统服务") logger.info(
f"已关闭 MuMu 模拟器进程: {proc.info['name']}",
module="系统服务",
)
except (psutil.NoSuchProcess, psutil.AccessDenied): except (psutil.NoSuchProcess, psutil.AccessDenied):
continue continue
logger.success("模拟器进程清除完成", module="系统服务")
def is_startup(self) -> bool: def is_startup(self) -> bool:
"""判断程序是否已经开机自启""" """判断程序是否已经开机自启"""

View File

@@ -1,6 +1,11 @@
{ {
"main_version": "4.4.1.3", "main_version": "4.4.1.4",
"version_info": { "version_info": {
"4.4.1.4": {
"修复BUG": [
"添加强制关机功能并优化关机流程"
]
},
"4.4.1.3": { "4.4.1.3": {
"修复BUG": [ "修复BUG": [
"移除崩溃弹窗机制" "移除崩溃弹窗机制"