improve:PPT模块

This commit is contained in:
2025-07-25 10:21:55 +08:00
parent 19b1c7ae8b
commit a7b861f83c
2 changed files with 25 additions and 12 deletions
+14 -1
View File
@@ -81,6 +81,9 @@ namespace Ink_Canvas {
// 在类中添加字段 // 在类中添加字段
private bool wasFloatingBarFoldedWhenEnterSlideShow = false; private bool wasFloatingBarFoldedWhenEnterSlideShow = false;
// 新增:用于控制WPS强制关闭提示只弹一次
private static bool hasShownWpsForceCloseWarning = false;
private void BtnCheckPPT_Click(object sender, RoutedEventArgs e) { private void BtnCheckPPT_Click(object sender, RoutedEventArgs e) {
try { try {
pptApplication = pptApplication =
@@ -1473,7 +1476,10 @@ namespace Ink_Canvas {
if (!allSaved) if (!allSaved)
{ {
// 弹窗提示用户 // 弹窗提示用户(只弹一次)
if (!hasShownWpsForceCloseWarning)
{
hasShownWpsForceCloseWarning = true;
bool userContinue = false; bool userContinue = false;
Application.Current.Dispatcher.Invoke(() => Application.Current.Dispatcher.Invoke(() =>
{ {
@@ -1489,6 +1495,12 @@ namespace Ink_Canvas {
return; return;
} }
} }
else
{
// 已弹过,直接跳过或默认继续
LogHelper.WriteLogToFile("WPS强制关闭提示已弹出,自动继续。", LogHelper.LogType.Trace);
}
}
// 立即结束WPP进程 // 立即结束WPP进程
try try
@@ -1531,6 +1543,7 @@ namespace Ink_Canvas {
} }
finally finally
{ {
hasShownWpsForceCloseWarning = false; // 复位,便于下次检测
StopWppProcessCheckTimer(); StopWppProcessCheckTimer();
} }
} }