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:
bao-qian
2015-11-09 03:20:02 +00:00
parent da5a930e89
commit 8aee2858ea
14 changed files with 1286 additions and 174 deletions

View File

@@ -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