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):
VERSION = "4.4.1.3"
VERSION = "4.4.1.4"
stage_refreshed = Signal()
PASSWORD_refreshed = Signal()

View File

@@ -112,12 +112,18 @@ class _MainTimer(QObject):
windows = System.get_window_info()
# 此处排除雷电名为新通知的窗口
if any(
str(emulator_path) in window and window[0] != "新通知"
for window in windows
for emulator_path in Config.silence_list
):
emulator_windows = []
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:
keyboard.press_and_release(
"+".join(
@@ -146,7 +152,7 @@ class _MainTimer(QObject):
"Sleep": "睡眠",
"Hibernate": "休眠",
"Shutdown": "关机",
"ShutdownForce": "关机(强制)"
"ShutdownForce": "关机(强制)",
}
choice = ProgressRingMessageBox(

View File

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