From e27636dd930cf629d943047fdf25266de4719ff4 Mon Sep 17 00:00:00 2001 From: "Mr.Xia" <1424473282@qq.com> Date: Sun, 14 Jun 2026 13:43:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BA=8C=E9=92=BB=E6=B6=A8=E7=BC=A9?= =?UTF-8?q?=E7=B3=BB=E6=95=B0=E8=AE=B0=E5=BF=86=E5=9C=A8=E5=86=99=E5=9B=9E?= =?UTF-8?q?=E9=92=BB=E5=B8=A6=E5=90=8E=E7=AB=8B=E5=8D=B3=E8=90=BD=E7=9B=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原实现 Save 在'涨缩完成'MessageBox(模态阻塞)之后才执行,配置滞后到用户点掉弹窗。改为写回钻带后立即 Save,失败信息并入完成提示,避免两个连续模态框。 --- App.xaml.cs | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/App.xaml.cs b/App.xaml.cs index f0b8d09..2c5eb49 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -221,24 +221,27 @@ namespace DrillTools using var writer = new StreamWriter(filePath, false, Encoding.GetEncoding(936)); writer.Write(scaledContent); - System.Windows.MessageBox.Show( - $"涨缩完成,原文件已备份为:\n{Path.GetFileName(filePath)}.bak", - "涨缩完成", - MessageBoxButton.OK, - MessageBoxImage.Information); - - // 系数记忆:将本次模式与原始输入连同源文件名写入 ini,供下次载入。 - // 属辅助功能,失败不回滚已完成的涨缩,单独提示。 + // 系数记忆:紧跟钻带写回立即落盘,不滞后到完成提示之后。 + // 属辅助功能,失败不回滚已完成的涨缩,失败原因随完成提示一并告知。 + string? memoryWarning = null; try { ScalingProfileStore.Save(result.Mode, result.InputX, result.InputY, Path.GetFileName(filePath)); } catch (Exception ex) { - System.Windows.MessageBox.Show( - $"系数记忆保存失败:\n{ex.Message}\n本次涨缩已完成,不影响结果。", - "系数记忆", MessageBoxButton.OK, MessageBoxImage.Warning); + memoryWarning = $"\n(系数记忆保存失败:{ex.Message})"; } + + string completionMessage = $"涨缩完成,原文件已备份为:\n{Path.GetFileName(filePath)}.bak"; + if (memoryWarning != null) + completionMessage += memoryWarning; + + System.Windows.MessageBox.Show( + completionMessage, + "涨缩完成", + MessageBoxButton.OK, + MessageBoxImage.Information); } catch (Exception ex) {