From c33e9dedb85b8e11fdda534edef07875cd765879 Mon Sep 17 00:00:00 2001 From: DB P Date: Fri, 30 May 2025 13:20:16 +0900 Subject: [PATCH 1/4] Update delete confirmation message for folder link in context menu --- Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs index eabd118fb33..db0128b3b53 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs @@ -199,7 +199,7 @@ public List LoadContextMenus(Result selectedResult) { if (Context.API.ShowMsgBox( string.Format(Context.API.GetTranslation("plugin_explorer_delete_folder_link"), record.FullPath), - string.Empty, + Context.API.GetTranslation("plugin_explorer_deletefilefolder"), MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.No) From ebb74da8b39b92c7621d201a687bc3e5efd40928 Mon Sep 17 00:00:00 2001 From: DB P Date: Fri, 30 May 2025 13:37:50 +0900 Subject: [PATCH 2/4] Refactor key press handling in MessageBoxEx to improve result assignment logic --- Flow.Launcher/MessageBoxEx.xaml.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Flow.Launcher/MessageBoxEx.xaml.cs b/Flow.Launcher/MessageBoxEx.xaml.cs index c084b5149d3..510d14b89ee 100644 --- a/Flow.Launcher/MessageBoxEx.xaml.cs +++ b/Flow.Launcher/MessageBoxEx.xaml.cs @@ -159,12 +159,19 @@ private async Task SetImageAsync(string imageName) private void KeyEsc_OnPress(object sender, ExecutedRoutedEventArgs e) { - if (_button == MessageBoxButton.YesNo) - return; - else if (_button == MessageBoxButton.OK) - _result = MessageBoxResult.OK; - else - _result = MessageBoxResult.Cancel; + switch (_button) + { + case MessageBoxButton.OK: + _result = MessageBoxResult.None; + break; + case MessageBoxButton.OKCancel: + case MessageBoxButton.YesNoCancel: + _result = MessageBoxResult.Cancel; + break; + case MessageBoxButton.YesNo: + _result = MessageBoxResult.No; + break; + } DialogResult = false; Close(); } From e6eb8c01c05672e4908e04be52649b6c027314f1 Mon Sep 17 00:00:00 2001 From: DB P Date: Fri, 30 May 2025 14:48:25 +0900 Subject: [PATCH 3/4] Revert key press handling --- Flow.Launcher/MessageBoxEx.xaml.cs | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/Flow.Launcher/MessageBoxEx.xaml.cs b/Flow.Launcher/MessageBoxEx.xaml.cs index 510d14b89ee..c084b5149d3 100644 --- a/Flow.Launcher/MessageBoxEx.xaml.cs +++ b/Flow.Launcher/MessageBoxEx.xaml.cs @@ -159,19 +159,12 @@ private async Task SetImageAsync(string imageName) private void KeyEsc_OnPress(object sender, ExecutedRoutedEventArgs e) { - switch (_button) - { - case MessageBoxButton.OK: - _result = MessageBoxResult.None; - break; - case MessageBoxButton.OKCancel: - case MessageBoxButton.YesNoCancel: - _result = MessageBoxResult.Cancel; - break; - case MessageBoxButton.YesNo: - _result = MessageBoxResult.No; - break; - } + if (_button == MessageBoxButton.YesNo) + return; + else if (_button == MessageBoxButton.OK) + _result = MessageBoxResult.OK; + else + _result = MessageBoxResult.Cancel; DialogResult = false; Close(); } From 7c718ce0614949ef2f56638efeca97e1af881909 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Fri, 30 May 2025 15:28:39 +0800 Subject: [PATCH 4/4] Add code comments --- Flow.Launcher/MessageBoxEx.xaml.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Flow.Launcher/MessageBoxEx.xaml.cs b/Flow.Launcher/MessageBoxEx.xaml.cs index c084b5149d3..7296ff4cab6 100644 --- a/Flow.Launcher/MessageBoxEx.xaml.cs +++ b/Flow.Launcher/MessageBoxEx.xaml.cs @@ -160,6 +160,7 @@ private async Task SetImageAsync(string imageName) private void KeyEsc_OnPress(object sender, ExecutedRoutedEventArgs e) { if (_button == MessageBoxButton.YesNo) + // Follow System.Windows.MessageBox behavior return; else if (_button == MessageBoxButton.OK) _result = MessageBoxResult.OK; @@ -188,6 +189,7 @@ private void Button_Click(object sender, RoutedEventArgs e) private void Button_Cancel(object sender, RoutedEventArgs e) { if (_button == MessageBoxButton.YesNo) + // Follow System.Windows.MessageBox behavior return; else if (_button == MessageBoxButton.OK) _result = MessageBoxResult.OK;