Flow.Launcher/Plugins/Flow.Launcher.Plugin.Sys/CommandKeywordSetting.xaml.cs
Jack Ye 5b6ea73513
Code cleanup & Use Flow.Launcher.Localization to improve code quality (#4009)
* Use Flow.Launcher.Localization to improve code quality

* Code cleanup

* Improve code quality

* Improve code quality

* Use internal static Context & Improve code quality

* Use Flow.Launcher.Localization to improve code quality

* Code cleanup

* Use Flow.Launcher.Localization to improve code quality

* Improve code quality

* Improve code quality

* Use Flow.Launcher.Localization to improve code quality

* Fix logic issue

* Fix the variable name typo

* Fix redundant boolean cast and ensure consistent default value handling

* Use Flow.Launcher.Localization to improve code quality

* Revert namespace styles

* Fix indent format

* Revert namespace style

* Fix indent format

* Fix namespace style

* Fix indent format

* Fix indent format
2025-09-27 19:18:33 +03:00

43 lines
1.3 KiB
C#

using System.Windows;
namespace Flow.Launcher.Plugin.Sys
{
public partial class CommandKeywordSettingWindow
{
private readonly Command _oldSearchSource;
public CommandKeywordSettingWindow(Command old)
{
_oldSearchSource = old;
InitializeComponent();
CommandKeyword.Text = old.Keyword;
CommandKeywordTips.Text = Localize.flowlauncher_plugin_sys_custom_command_keyword_tip(old.Name);
}
private void OnCancelButtonClick(object sender, RoutedEventArgs e)
{
Close();
}
private void OnConfirmButtonClick(object sender, RoutedEventArgs e)
{
var keyword = CommandKeyword.Text;
if (string.IsNullOrEmpty(keyword))
{
var warning = Localize.flowlauncher_plugin_sys_input_command_keyword();
Main.Context.API.ShowMsgBox(warning);
}
else
{
_oldSearchSource.Keyword = keyword;
Close();
}
}
private void OnResetButtonClick(object sender, RoutedEventArgs e)
{
// Key is the default value of this command
CommandKeyword.Text = _oldSearchSource.Key;
}
}
}