mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 19:26:39 +02:00
Fix setting for multiple action keywords
1. completed rewrite the action keyword setting logic. 2. Fix setting for multiple action keywords in #352 3. Fix setting for Web Search plugin
This commit is contained in:
@@ -2,9 +2,11 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Newtonsoft.Json;
|
||||
using Wox.Infrastructure.Storage;
|
||||
using Wox.Plugin;
|
||||
|
||||
namespace Wox.Core.UserSettings
|
||||
{
|
||||
@@ -118,7 +120,7 @@ namespace Wox.Core.UserSettings
|
||||
public void IncreaseActivateTimes()
|
||||
{
|
||||
ActivateTimes++;
|
||||
if (ActivateTimes%15 == 0)
|
||||
if (ActivateTimes % 15 == 0)
|
||||
{
|
||||
Save();
|
||||
}
|
||||
@@ -162,6 +164,26 @@ namespace Wox.Core.UserSettings
|
||||
storage.Language = "en";
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateActionKeyword(PluginMetadata metadata)
|
||||
{
|
||||
var customizedPluginConfig = CustomizedPluginConfigs.FirstOrDefault(o => o.ID == metadata.ID);
|
||||
if (customizedPluginConfig == null)
|
||||
{
|
||||
CustomizedPluginConfigs.Add(new CustomizedPluginConfig()
|
||||
{
|
||||
Disabled = false,
|
||||
ID = metadata.ID,
|
||||
Name = metadata.Name,
|
||||
ActionKeywords = metadata.ActionKeywords
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
customizedPluginConfig.ActionKeywords = metadata.ActionKeywords;
|
||||
}
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
public enum OpacityMode
|
||||
|
||||
Reference in New Issue
Block a user