Fix rename issue

This commit is contained in:
Kevin Zhang 2021-11-06 13:58:28 -05:00
parent 5ee6c4b6a5
commit a3b62bc4d8
2 changed files with 11 additions and 21 deletions

View file

@ -63,7 +63,7 @@ namespace Flow.Launcher.Plugin.Program
.AsParallel()
.WithCancellation(token)
.Where(p => p.Enabled)
.Select(p => p.Result(query.Search, _context.API))
.Select(p => p.Result(query.Search, Context.API))
.Where(r => r?.Score > 0)
.ToList());
@ -80,7 +80,7 @@ namespace Flow.Launcher.Plugin.Program
public async Task InitAsync(PluginInitContext context)
{
_context = context;
Context = context;
_settings = context.API.LoadSettingJsonStorage<Settings>();
@ -155,17 +155,17 @@ namespace Flow.Launcher.Plugin.Program
public Control CreateSettingPanel()
{
return new ProgramSetting(_context, _settings, _win32s, _uwps);
return new ProgramSetting(Context, _settings, _win32s, _uwps);
}
public string GetTranslatedPluginTitle()
{
return _context.API.GetTranslation("flowlauncher_plugin_program_plugin_name");
return Context.API.GetTranslation("flowlauncher_plugin_program_plugin_name");
}
public string GetTranslatedPluginDescription()
{
return _context.API.GetTranslation("flowlauncher_plugin_program_plugin_description");
return Context.API.GetTranslation("flowlauncher_plugin_program_plugin_description");
}
public List<Result> LoadContextMenus(Result selectedResult)
@ -174,19 +174,19 @@ namespace Flow.Launcher.Plugin.Program
var program = selectedResult.ContextData as IProgram;
if (program != null)
{
menuOptions = program.ContextMenus(_context.API);
menuOptions = program.ContextMenus(Context.API);
}
menuOptions.Add(
new Result
{
Title = _context.API.GetTranslation("flowlauncher_plugin_program_disable_program"),
Title = Context.API.GetTranslation("flowlauncher_plugin_program_disable_program"),
Action = c =>
{
DisableProgram(program);
_context.API.ShowMsg(
_context.API.GetTranslation("flowlauncher_plugin_program_disable_dlgtitle_success"),
_context.API.GetTranslation(
Context.API.ShowMsg(
Context.API.GetTranslation("flowlauncher_plugin_program_disable_dlgtitle_success"),
Context.API.GetTranslation(
"flowlauncher_plugin_program_disable_dlgtitle_success_message"));
return false;
},
@ -235,7 +235,7 @@ namespace Flow.Launcher.Plugin.Program
{
var name = "Plugin: Program";
var message = $"Unable to start: {info.FileName}";
_context.API.ShowMsg(name, message, string.Empty);
Context.API.ShowMsg(name, message, string.Empty);
}
}

View file

@ -347,15 +347,5 @@ namespace Flow.Launcher.Plugin.Program.Views
btnProgramSourceStatus.Content = "Enable";
}
}
private void CustomizeExplorer(object sender, TextChangedEventArgs e)
{
_settings.CustomizedExplorer = CustomizeExplorerBox.Text;
}
private void CustomizeExplorerArgs(object sender, TextChangedEventArgs e)
{
_settings.CustomizedArgs = CustomizeArgsBox.Text;
}
}
}