mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 19:26:39 +02:00
Move web search setting to its own project
This commit is contained in:
@@ -121,13 +121,10 @@ namespace Wox.Core.Plugin
|
||||
public static bool IsUserPluginQuery(Query query)
|
||||
{
|
||||
if (string.IsNullOrEmpty(query.RawQuery)) return false;
|
||||
|
||||
var strings = query.RawQuery.Split(' ');
|
||||
var actionKeyword = string.Empty;
|
||||
if (strings.Length > 0)
|
||||
{
|
||||
actionKeyword = strings[0].Trim();
|
||||
}
|
||||
if(strings.Length == 1) return false;
|
||||
|
||||
var actionKeyword = strings[0].Trim();
|
||||
if (string.IsNullOrEmpty(actionKeyword)) return false;
|
||||
|
||||
return plugins.Any(o => o.Metadata.PluginType == PluginType.User && o.Metadata.ActionKeyword == actionKeyword);
|
||||
|
||||
@@ -55,9 +55,6 @@ namespace Wox.Core.UserSettings
|
||||
[JsonProperty]
|
||||
public string ResultItemFontStretch { get; set; }
|
||||
|
||||
[JsonProperty]
|
||||
public List<WebSearch> WebSearches { get; set; }
|
||||
|
||||
[JsonProperty]
|
||||
public double WindowLeft { get; set; }
|
||||
|
||||
@@ -72,18 +69,14 @@ namespace Wox.Core.UserSettings
|
||||
[JsonProperty]
|
||||
public bool StartWoxOnSystemStartup { get; set; }
|
||||
|
||||
[Obsolete]
|
||||
[JsonProperty]
|
||||
public double Opacity { get; set; }
|
||||
|
||||
[Obsolete]
|
||||
[JsonProperty]
|
||||
public OpacityMode OpacityMode { get; set; }
|
||||
|
||||
[JsonProperty]
|
||||
public bool EnableWebSearchSuggestion { get; set; }
|
||||
|
||||
[JsonProperty]
|
||||
public string WebSearchSuggestionSource { get; set; }
|
||||
|
||||
[JsonProperty]
|
||||
public bool LeaveCmdOpen { get; set; }
|
||||
|
||||
@@ -105,44 +98,6 @@ namespace Wox.Core.UserSettings
|
||||
[JsonProperty]
|
||||
public string ProxyPassword { get; set; }
|
||||
|
||||
public List<WebSearch> LoadDefaultWebSearches()
|
||||
{
|
||||
List<WebSearch> webSearches = new List<WebSearch>();
|
||||
|
||||
WebSearch googleWebSearch = new WebSearch()
|
||||
{
|
||||
Title = "Google",
|
||||
ActionWord = "g",
|
||||
IconPath = Path.GetDirectoryName(Application.ExecutablePath) + @"\Images\websearch\google.png",
|
||||
Url = "https://www.google.com/search?q={q}",
|
||||
Enabled = true
|
||||
};
|
||||
webSearches.Add(googleWebSearch);
|
||||
|
||||
|
||||
WebSearch wikiWebSearch = new WebSearch()
|
||||
{
|
||||
Title = "Wikipedia",
|
||||
ActionWord = "wiki",
|
||||
IconPath = Path.GetDirectoryName(Application.ExecutablePath) + @"\Images\websearch\wiki.png",
|
||||
Url = "http://en.wikipedia.org/wiki/{q}",
|
||||
Enabled = true
|
||||
};
|
||||
webSearches.Add(wikiWebSearch);
|
||||
|
||||
WebSearch findIcon = new WebSearch()
|
||||
{
|
||||
Title = "FindIcon",
|
||||
ActionWord = "findicon",
|
||||
IconPath = Path.GetDirectoryName(Application.ExecutablePath) + @"\Images\websearch\pictures.png",
|
||||
Url = "http://findicons.com/search/{q}",
|
||||
Enabled = true
|
||||
};
|
||||
webSearches.Add(findIcon);
|
||||
|
||||
return webSearches;
|
||||
}
|
||||
|
||||
protected override string ConfigFolder
|
||||
{
|
||||
get { return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Config"); }
|
||||
@@ -167,7 +122,6 @@ namespace Wox.Core.UserSettings
|
||||
DontPromptUpdateMsg = false;
|
||||
Theme = "Dark";
|
||||
Language = "en";
|
||||
WebSearches = LoadDefaultWebSearches();
|
||||
CustomizedPluginConfigs = new List<CustomizedPluginConfig>();
|
||||
Hotkey = "Alt + Space";
|
||||
QueryBoxFont = FontFamily.GenericSansSerif.Name;
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Wox.Core.UserSettings
|
||||
{
|
||||
[Serializable]
|
||||
public class WebSearch
|
||||
{
|
||||
public string Title { get; set; }
|
||||
public string ActionWord { get; set; }
|
||||
public string IconPath { get; set; }
|
||||
public string Url { get; set; }
|
||||
public bool Enabled { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -99,7 +99,6 @@
|
||||
<Compile Include="UserSettings\CustomizedPluginConfig.cs" />
|
||||
<Compile Include="UserSettings\PluginHotkey.cs" />
|
||||
<Compile Include="UserSettings\UserSettingStorage.cs" />
|
||||
<Compile Include="UserSettings\WebSearch.cs" />
|
||||
<Compile Include="Version\SemanticVersion.cs" />
|
||||
<Compile Include="Version\VersionManager.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user