From 9cd3f90ec43353b2f60becf98889f056bc65b132 Mon Sep 17 00:00:00 2001 From: Kevin Zhang Date: Sat, 30 Oct 2021 16:17:33 -0500 Subject: [PATCH] Change some configuration and refactor code --- Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs b/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs index ce5e8ed7f..358f2956f 100644 --- a/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs +++ b/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs @@ -48,8 +48,8 @@ namespace Flow.Launcher.Core.Plugin private static readonly RecyclableMemoryStreamManager BufferManager = new(); - private string SettingConfigurationPath => Path.Combine(context.CurrentPluginMetadata.PluginDirectory, "SettingConfiguration.yaml"); - private string SettingPath => Path.Combine(DataLocation.PluginSettingsDirectory, context.CurrentPluginMetadata.Name, "Setting.json"); + private string SettingConfigurationPath => Path.Combine(context.CurrentPluginMetadata.PluginDirectory, "SettingsTemplate.yaml"); + private string SettingPath => Path.Combine(DataLocation.PluginSettingsDirectory, context.CurrentPluginMetadata.Name, "Settings.json"); public List LoadContextMenus(Result selectedResult) { @@ -417,9 +417,9 @@ namespace Flow.Launcher.Core.Plugin IsChecked = Settings[attribute.Name] is bool isChecked ? isChecked : bool.Parse(attribute.DefaultValue), Margin = settingControlMargin }; - checkBox.Click += (_, _) => + checkBox.Click += (sender, _) => { - Settings[attribute.Name] = !((bool)Settings[attribute.Name]); + Settings[attribute.Name] = ((CheckBox) sender).IsChecked; }; contentControl = checkBox; break;