Skip to content
Open

feat #1132

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions app/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,14 +611,12 @@ def _rebuild_interfaces_for_language(self):
QApplication.restoreOverrideCursor()

def _onTaskFinished(self, exit_code):
"""处理任务完成信号"""
# 如果是启动任务且设置了完成后退出,则在任务成功完成时退出程序
if self.exit_on_complete and self.startup_task and exit_code == 0:
from PySide6.QtCore import QTimer
# 延迟一小段时间让用户看到完成状态
QTimer.singleShot(5000, self.quitApp)
elif cfg.after_finish == "ExitApp" and exit_code == 0:
QTimer.singleShot(0, self.quitApp)
else:
# 任务失败或未指定退出时,清除自动退出标记
self.exit_on_complete = False

def quitApp(self):
Expand Down
2 changes: 1 addition & 1 deletion app/setting_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ def __initCard(self):
FIF.POWER_BUTTON,
tr('任务完成后'),
tr('“退出”指退出游戏,不再建议使用循环模式,请改用日志界面的定时运行功能'),
texts={tr('无'): 'None', tr('退出'): 'Exit', tr('关机'): 'Shutdown', tr('睡眠'): 'Sleep', tr('休眠'): 'Hibernate', tr('重启'): 'Restart', tr('注销'): 'Logoff', tr('关闭显示器'): 'TurnOffDisplay', tr('运行脚本'): 'RunScript', tr('循环'): 'Loop'}
texts={tr('无'): 'None', tr('退出'): 'Exit', tr('关闭软件'): 'ExitApp', tr('关机'): 'Shutdown', tr('睡眠'): 'Sleep', tr('休眠'): 'Hibernate', tr('重启'): 'Restart', tr('注销'): 'Logoff', tr('关闭显示器'): 'TurnOffDisplay', tr('运行脚本'): 'RunScript', tr('循环'): 'Loop'}
)
self.loopModeCard = ComboBoxSettingCard2(
"loop_mode",
Expand Down
Loading