mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge branch 'dev' into update_all
This commit is contained in:
commit
87f35d49e4
5 changed files with 19 additions and 15 deletions
|
|
@ -126,14 +126,15 @@ namespace Flow.Launcher.Core.Plugin
|
||||||
|
|
||||||
private async Task InitSettingAsync()
|
private async Task InitSettingAsync()
|
||||||
{
|
{
|
||||||
if (!File.Exists(SettingConfigurationPath))
|
JsonRpcConfigurationModel configuration = null;
|
||||||
return;
|
if (File.Exists(SettingConfigurationPath))
|
||||||
|
{
|
||||||
|
var deserializer = new DeserializerBuilder().WithNamingConvention(CamelCaseNamingConvention.Instance).Build();
|
||||||
|
configuration =
|
||||||
|
deserializer.Deserialize<JsonRpcConfigurationModel>(
|
||||||
|
await File.ReadAllTextAsync(SettingConfigurationPath));
|
||||||
|
}
|
||||||
|
|
||||||
var deserializer = new DeserializerBuilder().WithNamingConvention(CamelCaseNamingConvention.Instance)
|
|
||||||
.Build();
|
|
||||||
var configuration =
|
|
||||||
deserializer.Deserialize<JsonRpcConfigurationModel>(
|
|
||||||
await File.ReadAllTextAsync(SettingConfigurationPath));
|
|
||||||
|
|
||||||
Settings ??= new JsonRPCPluginSettings
|
Settings ??= new JsonRPCPluginSettings
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ namespace Flow.Launcher.Core.Plugin
|
||||||
{
|
{
|
||||||
public class JsonRPCPluginSettings
|
public class JsonRPCPluginSettings
|
||||||
{
|
{
|
||||||
public required JsonRpcConfigurationModel Configuration { get; init; }
|
public required JsonRpcConfigurationModel? Configuration { get; init; }
|
||||||
|
|
||||||
public required string SettingPath { get; init; }
|
public required string SettingPath { get; init; }
|
||||||
public Dictionary<string, FrameworkElement> SettingControls { get; } = new();
|
public Dictionary<string, FrameworkElement> SettingControls { get; } = new();
|
||||||
|
|
@ -37,6 +37,11 @@ namespace Flow.Launcher.Core.Plugin
|
||||||
_storage = new JsonStorage<ConcurrentDictionary<string, object>>(SettingPath);
|
_storage = new JsonStorage<ConcurrentDictionary<string, object>>(SettingPath);
|
||||||
Settings = await _storage.LoadAsync();
|
Settings = await _storage.LoadAsync();
|
||||||
|
|
||||||
|
if (Settings != null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (var (type, attributes) in Configuration.Body)
|
foreach (var (type, attributes) in Configuration.Body)
|
||||||
{
|
{
|
||||||
if (attributes.Name == null)
|
if (attributes.Name == null)
|
||||||
|
|
@ -59,10 +64,7 @@ namespace Flow.Launcher.Core.Plugin
|
||||||
|
|
||||||
foreach (var (key, value) in settings)
|
foreach (var (key, value) in settings)
|
||||||
{
|
{
|
||||||
if (Settings.ContainsKey(key))
|
Settings[key] = value;
|
||||||
{
|
|
||||||
Settings[key] = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (SettingControls.TryGetValue(key, out var control))
|
if (SettingControls.TryGetValue(key, out var control))
|
||||||
{
|
{
|
||||||
|
|
@ -83,6 +85,7 @@ namespace Flow.Launcher.Core.Plugin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task SaveAsync()
|
public async Task SaveAsync()
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@
|
||||||
<PackageReference Include="NLog.Schema" Version="4.7.10" />
|
<PackageReference Include="NLog.Schema" Version="4.7.10" />
|
||||||
<PackageReference Include="NLog.Web.AspNetCore" Version="4.13.0" />
|
<PackageReference Include="NLog.Web.AspNetCore" Version="4.13.0" />
|
||||||
<PackageReference Include="PropertyChanged.Fody" Version="3.4.0" />
|
<PackageReference Include="PropertyChanged.Fody" Version="3.4.0" />
|
||||||
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
|
<PackageReference Include="System.Drawing.Common" Version="8.0.0" />
|
||||||
<!--ToolGood.Words.Pinyin v3.0.2.6 results in high memory usage when search with pinyin is enabled-->
|
<!--ToolGood.Words.Pinyin v3.0.2.6 results in high memory usage when search with pinyin is enabled-->
|
||||||
<!--Bumping to it or higher needs to test and ensure this is no longer a problem-->
|
<!--Bumping to it or higher needs to test and ensure this is no longer a problem-->
|
||||||
<PackageReference Include="ToolGood.Words.Pinyin" Version="3.0.1.4" />
|
<PackageReference Include="ToolGood.Words.Pinyin" Version="3.0.1.4" />
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Data.Sqlite" Version="7.0.13" />
|
<PackageReference Include="Microsoft.Data.Sqlite" Version="8.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
Loading…
Reference in a new issue