mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-13 02:39:22 +08:00
Add system plugin descriptions.
This commit is contained in:
parent
4ee0731472
commit
fad6a406a1
Binary file not shown.
Before Width: | Height: | Size: 4.7 KiB |
@ -13,7 +13,6 @@ namespace Wox.Plugin.BrowserBookmark
|
|||||||
private PluginInitContext context;
|
private PluginInitContext context;
|
||||||
private List<Bookmark> bookmarks = new List<Bookmark>();
|
private List<Bookmark> bookmarks = new List<Bookmark>();
|
||||||
|
|
||||||
|
|
||||||
public void Init(PluginInitContext context)
|
public void Init(PluginInitContext context)
|
||||||
{
|
{
|
||||||
bookmarks.Clear();
|
bookmarks.Clear();
|
||||||
|
@ -64,9 +64,6 @@
|
|||||||
<Content Include="Images\bookmark.png">
|
<Content Include="Images\bookmark.png">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="Images\plugin.png">
|
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
|
||||||
</Content>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
@ -8,5 +8,5 @@
|
|||||||
"Language":"csharp",
|
"Language":"csharp",
|
||||||
"Website":"http://www.getwox.com/plugin",
|
"Website":"http://www.getwox.com/plugin",
|
||||||
"ExecuteFileName":"Wox.Plugin.browserBookmark.dll",
|
"ExecuteFileName":"Wox.Plugin.browserBookmark.dll",
|
||||||
"IcoPath":"Images\\plugin.png"
|
"IcoPath":"Images\\bookmark.png"
|
||||||
}
|
}
|
||||||
|
@ -62,12 +62,6 @@ namespace Wox.Infrastructure.Storage.UserSettings
|
|||||||
[JsonProperty]
|
[JsonProperty]
|
||||||
public bool StartWoxOnSystemStartup { get; set; }
|
public bool StartWoxOnSystemStartup { get; set; }
|
||||||
|
|
||||||
[JsonProperty]
|
|
||||||
public bool EnablePythonPlugins { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty]
|
|
||||||
public bool EnableBookmarkPlugin { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty]
|
[JsonProperty]
|
||||||
public double Opacity { get; set; }
|
public double Opacity { get; set; }
|
||||||
|
|
||||||
@ -105,6 +99,16 @@ namespace Wox.Infrastructure.Storage.UserSettings
|
|||||||
};
|
};
|
||||||
webSearches.Add(wikiWebSearch);
|
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;
|
return webSearches;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,8 +143,6 @@ namespace Wox.Infrastructure.Storage.UserSettings
|
|||||||
|
|
||||||
protected override void LoadDefaultConfig()
|
protected override void LoadDefaultConfig()
|
||||||
{
|
{
|
||||||
EnablePythonPlugins = true;
|
|
||||||
EnableBookmarkPlugin = true;
|
|
||||||
Theme = "Dark";
|
Theme = "Dark";
|
||||||
ReplaceWinR = true;
|
ReplaceWinR = true;
|
||||||
WebSearches = LoadDefaultWebSearches();
|
WebSearches = LoadDefaultWebSearches();
|
||||||
|
@ -160,7 +160,7 @@ namespace Wox.Plugin.SystemPlugins.CMD
|
|||||||
|
|
||||||
public override string Description
|
public override string Description
|
||||||
{
|
{
|
||||||
get { return base.Description; }
|
get { return "Provide executing commands from Wox. Commands should start with >"; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,10 @@ namespace Wox.Plugin.SystemPlugins
|
|||||||
|
|
||||||
public override string Description
|
public override string Description
|
||||||
{
|
{
|
||||||
get { return base.Description; }
|
get
|
||||||
|
{
|
||||||
|
return "Provide mathematical calculations.(Try 5*3-2 in Wox)";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ namespace Wox.Plugin.SystemPlugins
|
|||||||
{
|
{
|
||||||
public sealed class ColorsPlugin : BaseSystemPlugin
|
public sealed class ColorsPlugin : BaseSystemPlugin
|
||||||
{
|
{
|
||||||
private const string DIR_PATH = ".\\Plugins\\Colors\\";
|
private string DIR_PATH = Path.Combine(Path.GetTempPath(), @"Plugins\Colors\");
|
||||||
private const int IMG_SIZE = 32;
|
private const int IMG_SIZE = 32;
|
||||||
|
|
||||||
private DirectoryInfo ColorsDirectory { get; set; }
|
private DirectoryInfo ColorsDirectory { get; set; }
|
||||||
@ -82,7 +82,7 @@ namespace Wox.Plugin.SystemPlugins
|
|||||||
return ColorsDirectory.GetFiles(file, SearchOption.TopDirectoryOnly);
|
return ColorsDirectory.GetFiles(file, SearchOption.TopDirectoryOnly);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string CreateImage(string name)
|
private string CreateImage(string name)
|
||||||
{
|
{
|
||||||
using (var bitmap = new Bitmap(IMG_SIZE, IMG_SIZE))
|
using (var bitmap = new Bitmap(IMG_SIZE, IMG_SIZE))
|
||||||
using (var graphics = Graphics.FromImage(bitmap))
|
using (var graphics = Graphics.FromImage(bitmap))
|
||||||
@ -108,7 +108,10 @@ namespace Wox.Plugin.SystemPlugins
|
|||||||
|
|
||||||
public override string Description
|
public override string Description
|
||||||
{
|
{
|
||||||
get { return string.Empty; }
|
get
|
||||||
|
{
|
||||||
|
return "Provide hex color preview.(Try #000 in Wox)";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string IcoPath
|
public override string IcoPath
|
||||||
|
@ -7,17 +7,23 @@ using System.Windows.Forms;
|
|||||||
using Wox.Infrastructure;
|
using Wox.Infrastructure;
|
||||||
using Wox.Infrastructure.Storage.UserSettings;
|
using Wox.Infrastructure.Storage.UserSettings;
|
||||||
|
|
||||||
namespace Wox.Plugin.SystemPlugins.FileSystem {
|
namespace Wox.Plugin.SystemPlugins.Folder {
|
||||||
|
|
||||||
public class FileSystemPlugin : BaseSystemPlugin, ISettingProvider {
|
public class FolderPlugin : BaseSystemPlugin, ISettingProvider {
|
||||||
|
|
||||||
#region Properties
|
#region Properties
|
||||||
|
|
||||||
private PluginInitContext context;
|
private PluginInitContext context;
|
||||||
private static List<string> driverNames = null;
|
private static List<string> driverNames = null;
|
||||||
private static Dictionary<string, DirectoryInfo[]> parentDirectories = new Dictionary<string, DirectoryInfo[]>();
|
private static Dictionary<string, DirectoryInfo[]> parentDirectories = new Dictionary<string, DirectoryInfo[]>();
|
||||||
public override string Description { get { return base.Description; } }
|
public override string Description {
|
||||||
public override string Name { get { return "File System"; } }
|
get
|
||||||
|
{
|
||||||
|
return "Provide opening folder from wox directorily. You can add your favorite folders.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string Name { get { return "Folder"; } }
|
||||||
public override string IcoPath { get { return @"Images\folder.png"; } }
|
public override string IcoPath { get { return @"Images\folder.png"; } }
|
||||||
|
|
||||||
#endregion Properties
|
#endregion Properties
|
@ -1,4 +1,4 @@
|
|||||||
<UserControl x:Class="Wox.Plugin.SystemPlugins.FileSystem.FileSystemSettings"
|
<UserControl x:Class="Wox.Plugin.SystemPlugins.Folder.FileSystemSettings"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
@ -1,18 +1,18 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using Wox.Infrastructure.Storage.UserSettings;
|
using Wox.Infrastructure.Storage.UserSettings;
|
||||||
|
|
||||||
namespace Wox.Plugin.SystemPlugins.FileSystem {
|
namespace Wox.Plugin.SystemPlugins.Folder {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Interaction logic for FileSystemSettings.xaml
|
/// Interaction logic for FileSystemSettings.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class FileSystemSettings : UserControl {
|
public partial class FileSystemSettings : UserControl {
|
||||||
public FileSystemSettings() {
|
public FileSystemSettings() {
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
lbxFolders.ItemsSource = Wox.Infrastructure.Storage.UserSettings.UserSettingStorage.Instance.FolderLinks;
|
lbxFolders.ItemsSource = UserSettingStorage.Instance.FolderLinks;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnDelete_Click(object sender, RoutedEventArgs e) {
|
private void btnDelete_Click(object sender, RoutedEventArgs e) {
|
||||||
@ -55,7 +55,7 @@ namespace Wox.Plugin.SystemPlugins.FileSystem {
|
|||||||
private void btnAdd_Click(object sender, RoutedEventArgs e) {
|
private void btnAdd_Click(object sender, RoutedEventArgs e) {
|
||||||
var folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog();
|
var folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog();
|
||||||
if (folderBrowserDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) {
|
if (folderBrowserDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) {
|
||||||
var newFolder = new Wox.Infrastructure.Storage.UserSettings.FolderLink() {
|
var newFolder = new FolderLink() {
|
||||||
Path = folderBrowserDialog.SelectedPath
|
Path = folderBrowserDialog.SelectedPath
|
||||||
};
|
};
|
||||||
|
|
@ -147,12 +147,12 @@ namespace Wox.Plugin.SystemPlugins.Program
|
|||||||
|
|
||||||
public override string IcoPath
|
public override string IcoPath
|
||||||
{
|
{
|
||||||
get { return @"Images\app.png"; }
|
get { return @"Images\program.png"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string Description
|
public override string Description
|
||||||
{
|
{
|
||||||
get { return base.Description; }
|
get { return "Provide searching programs in your computer."; }
|
||||||
}
|
}
|
||||||
|
|
||||||
#region ISettingProvider Members
|
#region ISettingProvider Members
|
||||||
|
@ -130,7 +130,7 @@ namespace Wox.Plugin.SystemPlugins
|
|||||||
|
|
||||||
public override string Description
|
public override string Description
|
||||||
{
|
{
|
||||||
get { return base.Description; }
|
get { return "Provide System related commands. e.g. shutdown,lock,setting etc."; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,17 +63,17 @@ namespace Wox.Plugin.SystemPlugins
|
|||||||
|
|
||||||
public override string Name
|
public override string Name
|
||||||
{
|
{
|
||||||
get { return "Plugins"; }
|
get { return "Third-party Plugin Indicator"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string IcoPath
|
public override string IcoPath
|
||||||
{
|
{
|
||||||
get { return @"Images\work.png"; }
|
get { return @"Images\list.png"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string Description
|
public override string Description
|
||||||
{
|
{
|
||||||
get { return base.Description; }
|
get { return "Provide Third-party plugin actionword suggeestion."; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ namespace Wox.Plugin.SystemPlugins
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override string Name { get { return "URL handler"; } }
|
public override string Name { get { return "URL handler"; } }
|
||||||
public override string Description { get { return "Open the typed URL..."; } }
|
public override string Description { get { return "Provide Opening the typed URL from Wox."; } }
|
||||||
public override string IcoPath { get { return "Images/url2.png"; } }
|
public override string IcoPath { get { return "Images/url2.png"; } }
|
||||||
|
|
||||||
protected override void InitInternal(PluginInitContext context)
|
protected override void InitInternal(PluginInitContext context)
|
||||||
|
@ -88,12 +88,12 @@ namespace Wox.Plugin.SystemPlugins
|
|||||||
|
|
||||||
public override string IcoPath
|
public override string IcoPath
|
||||||
{
|
{
|
||||||
get { return @"Images\app.png"; }
|
get { return @"Images\web_search.png"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string Description
|
public override string Description
|
||||||
{
|
{
|
||||||
get { return base.Description; }
|
get { return "Provide the web search ability."; }
|
||||||
}
|
}
|
||||||
|
|
||||||
#region ISettingProvider Members
|
#region ISettingProvider Members
|
||||||
|
@ -1,16 +1,5 @@
|
|||||||
using System;
|
using System.Windows;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
using Wox.Infrastructure.Storage.UserSettings;
|
using Wox.Infrastructure.Storage.UserSettings;
|
||||||
|
|
||||||
namespace Wox.Plugin.SystemPlugins
|
namespace Wox.Plugin.SystemPlugins
|
||||||
|
@ -56,8 +56,8 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="CMD\CMDStorage.cs" />
|
<Compile Include="CMD\CMDStorage.cs" />
|
||||||
<Compile Include="ColorsPlugin.cs" />
|
<Compile Include="ColorsPlugin.cs" />
|
||||||
<Compile Include="FileSystem\FileSystemSettings.xaml.cs">
|
<Compile Include="Folder\FolderPluginSettings.xaml.cs">
|
||||||
<DependentUpon>FileSystemSettings.xaml</DependentUpon>
|
<DependentUpon>FolderPluginSettings.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Program\ProgramSetting.xaml.cs">
|
<Compile Include="Program\ProgramSetting.xaml.cs">
|
||||||
<DependentUpon>ProgramSetting.xaml</DependentUpon>
|
<DependentUpon>ProgramSetting.xaml</DependentUpon>
|
||||||
@ -79,7 +79,7 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="WebSearch\WebSearchPlugin.cs" />
|
<Compile Include="WebSearch\WebSearchPlugin.cs" />
|
||||||
<Compile Include="CMD\CMD.cs" />
|
<Compile Include="CMD\CMD.cs" />
|
||||||
<Compile Include="FileSystem\FileSystemPlugin.cs" />
|
<Compile Include="Folder\FolderPlugin.cs" />
|
||||||
<Compile Include="ISystemPlugin.cs" />
|
<Compile Include="ISystemPlugin.cs" />
|
||||||
<Compile Include="Program\Programs.cs" />
|
<Compile Include="Program\Programs.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
@ -102,7 +102,7 @@
|
|||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Page Include="FileSystem\FileSystemSettings.xaml">
|
<Page Include="Folder\FolderPluginSettings.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
BIN
Wox/Images/list.png
Normal file
BIN
Wox/Images/list.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
BIN
Wox/Images/program.png
Normal file
BIN
Wox/Images/program.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
BIN
Wox/Images/web_search.png
Normal file
BIN
Wox/Images/web_search.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
BIN
Wox/Images/websearch/pictures.png
Normal file
BIN
Wox/Images/websearch/pictures.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
@ -25,10 +25,7 @@ namespace Wox.PluginLoader {
|
|||||||
plugins.Clear();
|
plugins.Clear();
|
||||||
BasePluginLoader.ParsePluginsConfig();
|
BasePluginLoader.ParsePluginsConfig();
|
||||||
|
|
||||||
if (UserSettingStorage.Instance.EnablePythonPlugins) {
|
plugins.AddRange(new PythonPluginLoader().LoadPlugin());
|
||||||
plugins.AddRange(new PythonPluginLoader().LoadPlugin());
|
|
||||||
}
|
|
||||||
|
|
||||||
plugins.AddRange(new CSharpPluginLoader().LoadPlugin());
|
plugins.AddRange(new CSharpPluginLoader().LoadPlugin());
|
||||||
Forker forker = new Forker();
|
Forker forker = new Forker();
|
||||||
foreach (IPlugin plugin in plugins.Select(pluginPair => pluginPair.Plugin)) {
|
foreach (IPlugin plugin in plugins.Select(pluginPair => pluginPair.Plugin)) {
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
@ -27,6 +26,7 @@ namespace Wox
|
|||||||
{
|
{
|
||||||
string woxLinkPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), "wox.lnk");
|
string woxLinkPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), "wox.lnk");
|
||||||
public MainWindow MainWindow;
|
public MainWindow MainWindow;
|
||||||
|
bool settingsLoaded = false;
|
||||||
private Dictionary<ISettingProvider, Control> featureControls = new Dictionary<ISettingProvider, Control>();
|
private Dictionary<ISettingProvider, Control> featureControls = new Dictionary<ISettingProvider, Control>();
|
||||||
|
|
||||||
public SettingWindow()
|
public SettingWindow()
|
||||||
@ -41,7 +41,6 @@ namespace Wox
|
|||||||
Loaded += Setting_Loaded;
|
Loaded += Setting_Loaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool settingsLoaded = false;
|
|
||||||
private void Setting_Loaded(object sender, RoutedEventArgs ev)
|
private void Setting_Loaded(object sender, RoutedEventArgs ev)
|
||||||
{
|
{
|
||||||
ctlHotkey.OnHotkeyChanged += ctlHotkey_OnHotkeyChanged;
|
ctlHotkey.OnHotkeyChanged += ctlHotkey_OnHotkeyChanged;
|
||||||
@ -80,7 +79,13 @@ namespace Wox
|
|||||||
UserSettingStorage.Instance.Save();
|
UserSettingStorage.Instance.Save();
|
||||||
};
|
};
|
||||||
|
|
||||||
#region Load Theme Data
|
cbReplaceWinR.IsChecked = UserSettingStorage.Instance.ReplaceWinR;
|
||||||
|
lvCustomHotkey.ItemsSource = UserSettingStorage.Instance.CustomPluginHotkeys;
|
||||||
|
cbStartWithWindows.IsChecked = File.Exists(woxLinkPath);
|
||||||
|
cbLeaveCmdOpen.IsChecked = UserSettingStorage.Instance.LeaveCmdOpen;
|
||||||
|
cbHideWhenDeactive.IsChecked = UserSettingStorage.Instance.HideWhenDeactive;
|
||||||
|
|
||||||
|
#region Load Theme
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(UserSettingStorage.Instance.QueryBoxFont) &&
|
if (!string.IsNullOrEmpty(UserSettingStorage.Instance.QueryBoxFont) &&
|
||||||
Fonts.SystemFontFamilies.Count(o => o.FamilyNames.Values.Contains(UserSettingStorage.Instance.QueryBoxFont)) > 0)
|
Fonts.SystemFontFamilies.Count(o => o.FamilyNames.Values.Contains(UserSettingStorage.Instance.QueryBoxFont)) > 0)
|
||||||
@ -125,40 +130,37 @@ namespace Wox
|
|||||||
Title = "Search web contents with shortcuts",
|
Title = "Search web contents with shortcuts",
|
||||||
SubTitle = "e.g. search google with g keyword or youtube keyword)",
|
SubTitle = "e.g. search google with g keyword or youtube keyword)",
|
||||||
IcoPath = "Images/work.png",
|
IcoPath = "Images/work.png",
|
||||||
PluginDirectory = Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath)
|
PluginDirectory = Path.GetDirectoryName(Application.ExecutablePath)
|
||||||
},
|
},
|
||||||
new Result()
|
new Result()
|
||||||
{
|
{
|
||||||
Title = "clipboard history ",
|
Title = "clipboard history ",
|
||||||
IcoPath = "Images/work.png",
|
IcoPath = "Images/work.png",
|
||||||
PluginDirectory = Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath)
|
PluginDirectory = Path.GetDirectoryName(Application.ExecutablePath)
|
||||||
},
|
},
|
||||||
new Result()
|
new Result()
|
||||||
{
|
{
|
||||||
Title = "Themes support",
|
Title = "Themes support",
|
||||||
SubTitle = "get more themes from http://www.getwox.com/theme",
|
SubTitle = "get more themes from http://www.getwox.com/theme",
|
||||||
IcoPath = "Images/work.png",
|
IcoPath = "Images/work.png",
|
||||||
PluginDirectory = Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath)
|
PluginDirectory = Path.GetDirectoryName(Application.ExecutablePath)
|
||||||
},
|
},
|
||||||
new Result()
|
new Result()
|
||||||
{
|
{
|
||||||
Title = "Plugins support",
|
Title = "Plugins support",
|
||||||
SubTitle = "get more plugins from http://www.getwox.com/plugin",
|
SubTitle = "get more plugins from http://www.getwox.com/plugin",
|
||||||
IcoPath = "Images/work.png",
|
IcoPath = "Images/work.png",
|
||||||
PluginDirectory = Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath)
|
PluginDirectory = Path.GetDirectoryName(Application.ExecutablePath)
|
||||||
},
|
},
|
||||||
new Result()
|
new Result()
|
||||||
{
|
{
|
||||||
Title = "Wox is an open-source software",
|
Title = "Wox is an open-source software",
|
||||||
SubTitle = "Wox benefits from the open-source community a lot",
|
SubTitle = "Wox benefits from the open-source community a lot",
|
||||||
IcoPath = "Images/work.png",
|
IcoPath = "Images/work.png",
|
||||||
PluginDirectory = Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath)
|
PluginDirectory = Path.GetDirectoryName(Application.ExecutablePath)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
foreach (string theme in LoadAvailableThemes())
|
foreach (string theme in LoadAvailableThemes())
|
||||||
{
|
{
|
||||||
string themeName = System.IO.Path.GetFileNameWithoutExtension(theme);
|
string themeName = System.IO.Path.GetFileNameWithoutExtension(theme);
|
||||||
@ -166,30 +168,6 @@ namespace Wox
|
|||||||
}
|
}
|
||||||
|
|
||||||
themeComboBox.SelectedItem = UserSettingStorage.Instance.Theme;
|
themeComboBox.SelectedItem = UserSettingStorage.Instance.Theme;
|
||||||
cbReplaceWinR.IsChecked = UserSettingStorage.Instance.ReplaceWinR;
|
|
||||||
lvCustomHotkey.ItemsSource = UserSettingStorage.Instance.CustomPluginHotkeys;
|
|
||||||
cbStartWithWindows.IsChecked = File.Exists(woxLinkPath);
|
|
||||||
cbLeaveCmdOpen.IsChecked = UserSettingStorage.Instance.LeaveCmdOpen;
|
|
||||||
cbHideWhenDeactive.IsChecked = UserSettingStorage.Instance.HideWhenDeactive;
|
|
||||||
|
|
||||||
var features = new CompositeCollection
|
|
||||||
{
|
|
||||||
new CollectionContainer()
|
|
||||||
{
|
|
||||||
Collection =
|
|
||||||
PluginLoader.Plugins.AllPlugins.Where(o => o.Metadata.PluginType == PluginType.System)
|
|
||||||
.Select(o => o.Plugin)
|
|
||||||
.Cast<Wox.Plugin.SystemPlugins.ISystemPlugin>()
|
|
||||||
},
|
|
||||||
FindResource("FeatureBoxSeperator"),
|
|
||||||
new CollectionContainer()
|
|
||||||
{
|
|
||||||
Collection =
|
|
||||||
PluginLoader.Plugins.AllPlugins.Where(o => o.Metadata.PluginType == PluginType.ThirdParty)
|
|
||||||
}
|
|
||||||
};
|
|
||||||
lbPlugins.ItemsSource = features;
|
|
||||||
|
|
||||||
slOpacity.Value = UserSettingStorage.Instance.Opacity;
|
slOpacity.Value = UserSettingStorage.Instance.Opacity;
|
||||||
CbOpacityMode.SelectedItem = UserSettingStorage.Instance.OpacityMode;
|
CbOpacityMode.SelectedItem = UserSettingStorage.Instance.OpacityMode;
|
||||||
|
|
||||||
@ -198,13 +176,37 @@ namespace Wox
|
|||||||
{
|
{
|
||||||
var brush = new ImageBrush(new BitmapImage(new Uri(wallpaper)));
|
var brush = new ImageBrush(new BitmapImage(new Uri(wallpaper)));
|
||||||
brush.Stretch = Stretch.UniformToFill;
|
brush.Stretch = Stretch.UniformToFill;
|
||||||
this.PreviewPanel.Background = brush;
|
PreviewPanel.Background = brush;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var wallpaperColor = WallpaperPathRetrieval.GetWallpaperColor();
|
var wallpaperColor = WallpaperPathRetrieval.GetWallpaperColor();
|
||||||
this.PreviewPanel.Background = new SolidColorBrush(wallpaperColor);
|
PreviewPanel.Background = new SolidColorBrush(wallpaperColor);
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Load Plugin
|
||||||
|
|
||||||
|
var plugins = new CompositeCollection
|
||||||
|
{
|
||||||
|
new CollectionContainer
|
||||||
|
{
|
||||||
|
Collection =
|
||||||
|
PluginLoader.Plugins.AllPlugins.Where(o => o.Metadata.PluginType == PluginType.System)
|
||||||
|
.Select(o => o.Plugin)
|
||||||
|
.Cast<ISystemPlugin>()
|
||||||
|
},
|
||||||
|
FindResource("FeatureBoxSeperator"),
|
||||||
|
new CollectionContainer
|
||||||
|
{
|
||||||
|
Collection =
|
||||||
|
PluginLoader.Plugins.AllPlugins.Where(o => o.Metadata.PluginType == PluginType.ThirdParty)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
lbPlugins.ItemsSource = plugins;
|
||||||
|
lbPlugins.SelectedIndex = 0;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
//PreviewPanel
|
//PreviewPanel
|
||||||
settingsLoaded = true;
|
settingsLoaded = true;
|
||||||
@ -213,7 +215,7 @@ namespace Wox
|
|||||||
|
|
||||||
private List<string> LoadAvailableThemes()
|
private List<string> LoadAvailableThemes()
|
||||||
{
|
{
|
||||||
string themePath = Path.Combine(Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath), "Themes");
|
string themePath = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "Themes");
|
||||||
return Directory.GetFiles(themePath).Where(filePath => filePath.EndsWith(".xaml") && !filePath.EndsWith("Default.xaml")).ToList();
|
return Directory.GetFiles(themePath).Where(filePath => filePath.EndsWith(".xaml") && !filePath.EndsWith("Default.xaml")).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -316,18 +318,6 @@ namespace Wox
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private void BtnEnableInstaller_OnClick(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Process.Start("Wox.UAC.exe", "AssociatePluginInstaller");
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
//throw an exception when user click cancel in UAC prompt window.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Theme
|
#region Theme
|
||||||
private void ThemeComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
private void ThemeComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
@ -434,7 +424,11 @@ namespace Wox
|
|||||||
var pair = lbPlugins.SelectedItem as PluginPair;
|
var pair = lbPlugins.SelectedItem as PluginPair;
|
||||||
if (pair != null)
|
if (pair != null)
|
||||||
{
|
{
|
||||||
|
//third-party plugin
|
||||||
provider = pair.Plugin as ISettingProvider;
|
provider = pair.Plugin as ISettingProvider;
|
||||||
|
pluginAuthor.Visibility = Visibility.Visible;
|
||||||
|
pluginActionKeyword.Visibility = Visibility.Visible;
|
||||||
|
pluginWebsite.Visibility = Visibility.Visible;
|
||||||
pluginTitle.Text = pair.Metadata.Name;
|
pluginTitle.Text = pair.Metadata.Name;
|
||||||
pluginActionKeyword.Text = "ActionKeyword: " + pair.Metadata.ActionKeyword;
|
pluginActionKeyword.Text = "ActionKeyword: " + pair.Metadata.ActionKeyword;
|
||||||
pluginAuthor.Text = "Author: " + pair.Metadata.Author;
|
pluginAuthor.Text = "Author: " + pair.Metadata.Author;
|
||||||
@ -442,31 +436,33 @@ namespace Wox
|
|||||||
pluginSubTitle.Text = pair.Metadata.Description;
|
pluginSubTitle.Text = pair.Metadata.Description;
|
||||||
SyntaxSugars.CallOrRescueDefault(
|
SyntaxSugars.CallOrRescueDefault(
|
||||||
() =>
|
() =>
|
||||||
pluginIcon.Source =
|
pluginIcon.Source = (ImageSource)new ImagePathConverter().Convert(
|
||||||
(ImageSource)
|
new object[]
|
||||||
new ImagePathConverter().Convert(
|
{
|
||||||
new object[] {pair.Metadata.IcoPath, pair.Metadata.PluginDirecotry}, null, null,
|
pair.Metadata.IcoPath,
|
||||||
|
pair.Metadata.PluginDirecotry
|
||||||
|
}, null, null,
|
||||||
null));
|
null));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
//system plugin
|
||||||
provider = lbPlugins.SelectedItem as ISettingProvider;
|
provider = lbPlugins.SelectedItem as ISettingProvider;
|
||||||
|
|
||||||
var sys = lbPlugins.SelectedItem as BaseSystemPlugin;
|
var sys = lbPlugins.SelectedItem as BaseSystemPlugin;
|
||||||
if (sys != null)
|
if (sys != null)
|
||||||
{
|
{
|
||||||
pluginTitle.Text = sys.Name;
|
pluginTitle.Text = sys.Name;
|
||||||
pluginSubTitle.Text = sys.Description;
|
pluginSubTitle.Text = sys.Description;
|
||||||
pluginAuthor.Text = "Author: Wox";
|
pluginAuthor.Visibility = Visibility.Collapsed;
|
||||||
pluginActionKeyword.Text = "ActionKeyword: auto trigger";
|
pluginActionKeyword.Visibility = Visibility.Collapsed;
|
||||||
pluginWebsite.Text = "Website: http://www.getwox.com";
|
pluginWebsite.Visibility = Visibility.Collapsed;
|
||||||
SyntaxSugars.CallOrRescueDefault(
|
SyntaxSugars.CallOrRescueDefault(
|
||||||
() =>
|
() =>
|
||||||
pluginIcon.Source =
|
pluginIcon.Source = (ImageSource) new ImagePathConverter().Convert( new object[]
|
||||||
(ImageSource)
|
{
|
||||||
new ImagePathConverter().Convert(
|
sys.IcoPath,
|
||||||
new object[] { sys.IcoPath, sys.PluginDirectory }, null, null,
|
sys.PluginDirectory
|
||||||
null));
|
}, null, null,null));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user