mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-10 21:41:51 +02:00
Add title translations
This commit is contained in:
@@ -1,11 +1,13 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Reflection;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using YAMP;
|
using YAMP;
|
||||||
|
|
||||||
namespace Wox.Plugin.Caculator
|
namespace Wox.Plugin.Caculator
|
||||||
{
|
{
|
||||||
public class Calculator : IPlugin
|
public class Calculator : IPlugin, IPluginI18n
|
||||||
{
|
{
|
||||||
private static Regex regValidExpressChar = new Regex(
|
private static Regex regValidExpressChar = new Regex(
|
||||||
@"^(" +
|
@"^(" +
|
||||||
@@ -87,5 +89,20 @@ namespace Wox.Plugin.Caculator
|
|||||||
{
|
{
|
||||||
this.context = context;
|
this.context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string GetLanguagesFolder()
|
||||||
|
{
|
||||||
|
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages");
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetTranslatedPluginTitle()
|
||||||
|
{
|
||||||
|
return context.API.GetTranslation("wox_plugin_caculator_plugin_name");
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetTranslatedPluginDescription()
|
||||||
|
{
|
||||||
|
return context.API.GetTranslation("wox_plugin_caculator_plugin_description");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
8
Plugins/Wox.Plugin.Caculator/Languages/en.xaml
Normal file
8
Plugins/Wox.Plugin.Caculator/Languages/en.xaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||||
|
|
||||||
|
<system:String x:Key="wox_plugin_caculator_plugin_name">Calculator</system:String>
|
||||||
|
<system:String x:Key="wox_plugin_caculator_plugin_description">Provide mathematical calculations.(Try 5*3-2 in Wox)</system:String>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
8
Plugins/Wox.Plugin.Caculator/Languages/zh-cn.xaml
Normal file
8
Plugins/Wox.Plugin.Caculator/Languages/zh-cn.xaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||||
|
|
||||||
|
<system:String x:Key="wox_plugin_caculator_plugin_name">计算器</system:String>
|
||||||
|
<system:String x:Key="wox_plugin_caculator_plugin_description">为Wox提供数学计算能力。(试着在Wox输入 5*3-2)</system:String>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
8
Plugins/Wox.Plugin.Caculator/Languages/zh-tw.xaml
Normal file
8
Plugins/Wox.Plugin.Caculator/Languages/zh-tw.xaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||||
|
|
||||||
|
<system:String x:Key="wox_plugin_caculator_plugin_name">計算器</system:String>
|
||||||
|
<system:String x:Key="wox_plugin_caculator_plugin_description">為Wox提供數學計算能力。(試著在Wox輸入 5*3-2)</system:String>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
@@ -73,6 +73,27 @@
|
|||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Languages\en.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Languages\zh-cn.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Languages\zh-tw.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
|
|||||||
@@ -4,13 +4,15 @@ using System.Drawing;
|
|||||||
using System.Drawing.Imaging;
|
using System.Drawing.Imaging;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
namespace Wox.Plugin.Color
|
namespace Wox.Plugin.Color
|
||||||
{
|
{
|
||||||
public sealed class ColorsPlugin : IPlugin
|
public sealed class ColorsPlugin : IPlugin, IPluginI18n
|
||||||
{
|
{
|
||||||
private string DIR_PATH = Path.Combine(Path.GetTempPath(), @"Plugins\Colors\");
|
private string DIR_PATH = Path.Combine(Path.GetTempPath(), @"Plugins\Colors\");
|
||||||
|
private PluginInitContext context;
|
||||||
private const int IMG_SIZE = 32;
|
private const int IMG_SIZE = 32;
|
||||||
|
|
||||||
private DirectoryInfo ColorsDirectory { get; set; }
|
private DirectoryInfo ColorsDirectory { get; set; }
|
||||||
@@ -103,6 +105,23 @@ namespace Wox.Plugin.Color
|
|||||||
|
|
||||||
public void Init(PluginInitContext context)
|
public void Init(PluginInitContext context)
|
||||||
{
|
{
|
||||||
|
this.context = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public string GetLanguagesFolder()
|
||||||
|
{
|
||||||
|
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages");
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetTranslatedPluginTitle()
|
||||||
|
{
|
||||||
|
return context.API.GetTranslation("wox_plugin_color_plugin_name");
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetTranslatedPluginDescription()
|
||||||
|
{
|
||||||
|
return context.API.GetTranslation("wox_plugin_color_plugin_description");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
8
Plugins/Wox.Plugin.Color/Languages/en.xaml
Normal file
8
Plugins/Wox.Plugin.Color/Languages/en.xaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||||
|
|
||||||
|
<system:String x:Key="wox_plugin_color_plugin_name">Colors</system:String>
|
||||||
|
<system:String x:Key="wox_plugin_color_plugin_description">Provide hex color preview.(Try #000 in Wox)</system:String>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
8
Plugins/Wox.Plugin.Color/Languages/zh-cn.xaml
Normal file
8
Plugins/Wox.Plugin.Color/Languages/zh-cn.xaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||||
|
|
||||||
|
<system:String x:Key="wox_plugin_color_plugin_name">颜色</system:String>
|
||||||
|
<system:String x:Key="wox_plugin_color_plugin_description">提供在Wox查询hex颜色。(尝试在Wox中输入#000)</system:String>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
7
Plugins/Wox.Plugin.Color/Languages/zh-tw.xaml
Normal file
7
Plugins/Wox.Plugin.Color/Languages/zh-tw.xaml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||||
|
|
||||||
|
<system:String x:Key="wox_plugin_color_plugin_name">顏色</system:String>
|
||||||
|
<system:String x:Key="wox_plugin_color_plugin_description">提供在Wox查詢hex顏色。(嘗試在Wox中輸入#000)</system:String>
|
||||||
|
</ResourceDictionary>
|
||||||
@@ -34,6 +34,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="PresentationCore" />
|
<Reference Include="PresentationCore" />
|
||||||
|
<Reference Include="PresentationFramework" />
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
@@ -62,6 +63,27 @@
|
|||||||
<Name>Wox.Plugin</Name>
|
<Name>Wox.Plugin</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Languages\en.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Languages\zh-cn.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Languages\zh-tw.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
</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.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
|||||||
@@ -3,11 +3,12 @@ using System.Collections.Generic;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
using Wox.Infrastructure;
|
using Wox.Infrastructure;
|
||||||
|
|
||||||
namespace Wox.Plugin.ControlPanel
|
namespace Wox.Plugin.ControlPanel
|
||||||
{
|
{
|
||||||
public class ControlPanel : IPlugin
|
public class ControlPanel : IPlugin,IPluginI18n
|
||||||
{
|
{
|
||||||
private PluginInitContext context;
|
private PluginInitContext context;
|
||||||
private List<ControlPanelItem> controlPanelItems = new List<ControlPanelItem>();
|
private List<ControlPanelItem> controlPanelItems = new List<ControlPanelItem>();
|
||||||
@@ -81,5 +82,20 @@ namespace Wox.Plugin.ControlPanel
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string GetLanguagesFolder()
|
||||||
|
{
|
||||||
|
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages");
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetTranslatedPluginTitle()
|
||||||
|
{
|
||||||
|
return context.API.GetTranslation("wox_plugin_controlpanel_plugin_name");
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetTranslatedPluginDescription()
|
||||||
|
{
|
||||||
|
return context.API.GetTranslation("wox_plugin_controlpanel_plugin_description");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
8
Plugins/Wox.Plugin.ControlPanel/Languages/en.xaml
Normal file
8
Plugins/Wox.Plugin.ControlPanel/Languages/en.xaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||||
|
|
||||||
|
<system:String x:Key="wox_plugin_controlpanel_plugin_name">Control Panel</system:String>
|
||||||
|
<system:String x:Key="wox_plugin_controlpanel_plugin_description">Search within the Control Panel</system:String>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
8
Plugins/Wox.Plugin.ControlPanel/Languages/zh-cn.xaml
Normal file
8
Plugins/Wox.Plugin.ControlPanel/Languages/zh-cn.xaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||||
|
|
||||||
|
<system:String x:Key="wox_plugin_controlpanel_plugin_name">控制面板</system:String>
|
||||||
|
<system:String x:Key="wox_plugin_controlpanel_plugin_description">搜索控制面板</system:String>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
8
Plugins/Wox.Plugin.ControlPanel/Languages/zh-tw.xaml
Normal file
8
Plugins/Wox.Plugin.ControlPanel/Languages/zh-tw.xaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||||
|
|
||||||
|
<system:String x:Key="wox_plugin_controlpanel_plugin_name">控制面板</system:String>
|
||||||
|
<system:String x:Key="wox_plugin_controlpanel_plugin_description">搜索控制面板</system:String>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
@@ -33,6 +33,7 @@
|
|||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="PresentationFramework" />
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
@@ -67,6 +68,27 @@
|
|||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Languages\en.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Languages\zh-cn.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Languages\zh-tw.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
</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.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
|||||||
8
Plugins/Wox.Plugin.PluginIndicator/Languages/en.xaml
Normal file
8
Plugins/Wox.Plugin.PluginIndicator/Languages/en.xaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||||
|
|
||||||
|
<system:String x:Key="wox_plugin_pluginindicator_plugin_name">Plugin Indicator</system:String>
|
||||||
|
<system:String x:Key="wox_plugin_pluginindicator_plugin_description">Provide plugin actionword suggestion</system:String>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
8
Plugins/Wox.Plugin.PluginIndicator/Languages/zh-cn.xaml
Normal file
8
Plugins/Wox.Plugin.PluginIndicator/Languages/zh-cn.xaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||||
|
|
||||||
|
<system:String x:Key="wox_plugin_pluginindicator_plugin_name">插件关键词提示</system:String>
|
||||||
|
<system:String x:Key="wox_plugin_pluginindicator_plugin_description">提供插件关键词搜索提示</system:String>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
8
Plugins/Wox.Plugin.PluginIndicator/Languages/zh-tw.xaml
Normal file
8
Plugins/Wox.Plugin.PluginIndicator/Languages/zh-tw.xaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||||
|
|
||||||
|
<system:String x:Key="wox_plugin_pluginindicator_plugin_name">插件關鍵詞提示</system:String>
|
||||||
|
<system:String x:Key="wox_plugin_pluginindicator_plugin_description">提供插件關鍵詞搜索提示</system:String>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
using Wox.Core.Plugin;
|
using Wox.Core.Plugin;
|
||||||
using Wox.Core.UserSettings;
|
using Wox.Core.UserSettings;
|
||||||
|
|
||||||
namespace Wox.Plugin.PluginIndicator
|
namespace Wox.Plugin.PluginIndicator
|
||||||
{
|
{
|
||||||
public class PluginIndicator : IPlugin
|
public class PluginIndicator : IPlugin,IPluginI18n
|
||||||
{
|
{
|
||||||
private List<PluginPair> allPlugins = new List<PluginPair>();
|
private List<PluginPair> allPlugins = new List<PluginPair>();
|
||||||
private PluginInitContext context;
|
private PluginInitContext context;
|
||||||
@@ -52,5 +54,20 @@ namespace Wox.Plugin.PluginIndicator
|
|||||||
{
|
{
|
||||||
this.context = context;
|
this.context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string GetLanguagesFolder()
|
||||||
|
{
|
||||||
|
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages");
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetTranslatedPluginTitle()
|
||||||
|
{
|
||||||
|
return context.API.GetTranslation("wox_plugin_pluginindicator_plugin_name");
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetTranslatedPluginDescription()
|
||||||
|
{
|
||||||
|
return context.API.GetTranslation("wox_plugin_luginindicator_plugin_description");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="PresentationFramework" />
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
@@ -68,6 +69,27 @@
|
|||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Languages\en.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Languages\zh-cn.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Languages\zh-tw.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
</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.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"ID":"6A122269676E40EB86EB543B945932B9",
|
"ID":"6A122269676E40EB86EB543B945932B9",
|
||||||
"ActionKeyword":"*",
|
"ActionKeyword":"*",
|
||||||
"Name":"Plugin Indicator",
|
"Name":"Plugin Indicator",
|
||||||
"Description":"Provide plugin actionword suggestion.",
|
"Description":"Provide plugin actionword suggestion",
|
||||||
"Author":"qianlifeng",
|
"Author":"qianlifeng",
|
||||||
"Version":"1.0.0",
|
"Version":"1.0.0",
|
||||||
"Language":"csharp",
|
"Language":"csharp",
|
||||||
|
|||||||
8
Plugins/Wox.Plugin.PluginManagement/Languages/en.xaml
Normal file
8
Plugins/Wox.Plugin.PluginManagement/Languages/en.xaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||||
|
|
||||||
|
<system:String x:Key="wox_plugin_plugin_management_plugin_name">Wox Plugin Management</system:String>
|
||||||
|
<system:String x:Key="wox_plugin_plugin_management_plugin_description">Install/Remove/Update wox plugins</system:String>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
8
Plugins/Wox.Plugin.PluginManagement/Languages/zh-cn.xaml
Normal file
8
Plugins/Wox.Plugin.PluginManagement/Languages/zh-cn.xaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||||
|
|
||||||
|
<system:String x:Key="wox_plugin_plugin_management_plugin_name">Wox插件管理</system:String>
|
||||||
|
<system:String x:Key="wox_plugin_plugin_management_plugin_description">安装/卸载/更新Wox插件</system:String>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
8
Plugins/Wox.Plugin.PluginManagement/Languages/zh-tw.xaml
Normal file
8
Plugins/Wox.Plugin.PluginManagement/Languages/zh-tw.xaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||||
|
|
||||||
|
<system:String x:Key="wox_plugin_plugin_management_plugin_name">Wox插件管理</system:String>
|
||||||
|
<system:String x:Key="wox_plugin_plugin_management_plugin_description">安裝/卸載/更新Wox插件</system:String>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
@@ -10,7 +11,7 @@ using Newtonsoft.Json;
|
|||||||
|
|
||||||
namespace Wox.Plugin.PluginManagement
|
namespace Wox.Plugin.PluginManagement
|
||||||
{
|
{
|
||||||
public class Main : IPlugin
|
public class Main : IPlugin,IPluginI18n
|
||||||
{
|
{
|
||||||
private static string APIBASE = "https://api.getwox.com";
|
private static string APIBASE = "https://api.getwox.com";
|
||||||
private static string PluginConfigName = "plugin.json";
|
private static string PluginConfigName = "plugin.json";
|
||||||
@@ -256,5 +257,20 @@ namespace Wox.Plugin.PluginManagement
|
|||||||
{
|
{
|
||||||
this.context = context;
|
this.context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string GetLanguagesFolder()
|
||||||
|
{
|
||||||
|
return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages");
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetTranslatedPluginTitle()
|
||||||
|
{
|
||||||
|
return context.API.GetTranslation("wox_plugin_plugin_management_plugin_name");
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetTranslatedPluginDescription()
|
||||||
|
{
|
||||||
|
return context.API.GetTranslation("wox_plugin_plugin_management_plugin_description");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\..\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="PresentationFramework" />
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Windows.Forms" />
|
<Reference Include="System.Windows.Forms" />
|
||||||
@@ -70,6 +71,27 @@
|
|||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Languages\en.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Languages\zh-cn.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Languages\zh-tw.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"ID":"D2D2C23B084D422DB66FE0C79D6C2A6A",
|
"ID":"D2D2C23B084D422DB66FE0C79D6C2A6A",
|
||||||
"ActionKeyword":"wpm",
|
"ActionKeyword":"wpm",
|
||||||
"Name":"Wox Plugin Management",
|
"Name":"Wox Plugin Management",
|
||||||
"Description":"Manage your plugins in Wox",
|
"Description":"Install/Remove/Update wox plugins",
|
||||||
"Author":"qianlifeng",
|
"Author":"qianlifeng",
|
||||||
"Version":"1.0",
|
"Version":"1.0",
|
||||||
"Language":"csharp",
|
"Language":"csharp",
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
</ListBoxItem>
|
</ListBoxItem>
|
||||||
<converters:ImagePathConverter x:Key="ImageConverter" />
|
<converters:ImagePathConverter x:Key="ImageConverter" />
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
<TabControl Height="auto" >
|
<TabControl Height="auto" x:Name="settingTab">
|
||||||
<TabItem Header="{DynamicResource general}">
|
<TabItem Header="{DynamicResource general}">
|
||||||
<StackPanel Orientation="Vertical" Margin="10">
|
<StackPanel Orientation="Vertical" Margin="10">
|
||||||
<CheckBox x:Name="cbStartWithWindows" Unchecked="CbStartWithWindows_OnUnchecked" Checked="CbStartWithWindows_OnChecked" Margin="10">
|
<CheckBox x:Name="cbStartWithWindows" Unchecked="CbStartWithWindows_OnUnchecked" Checked="CbStartWithWindows_OnChecked" Margin="10">
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="{DynamicResource plugin}">
|
<TabItem Header="{DynamicResource plugin}" x:Name="tabPlugin" PreviewMouseLeftButtonDown="TabPlugin_OnPreviewMouseLeftButtonDown">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="200"/>
|
<ColumnDefinition Width="200"/>
|
||||||
@@ -113,7 +113,7 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="{DynamicResource theme}">
|
<TabItem Header="{DynamicResource theme}" PreviewMouseLeftButtonDown="TabTheme_OnPreviewMouseLeftButtonDown" x:Name="tabTheme">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="200"/>
|
<ColumnDefinition Width="200"/>
|
||||||
@@ -210,7 +210,7 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="{DynamicResource hotkey}">
|
<TabItem Header="{DynamicResource hotkey}" x:Name="tabHotkey" PreviewMouseLeftButtonDown="TabHotkey_OnPreviewMouseLeftButtonDown">
|
||||||
<Grid Margin="10">
|
<Grid Margin="10">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="30"/>
|
<RowDefinition Height="30"/>
|
||||||
|
|||||||
@@ -17,19 +17,25 @@ using Application = System.Windows.Forms.Application;
|
|||||||
using File = System.IO.File;
|
using File = System.IO.File;
|
||||||
using MessageBox = System.Windows.MessageBox;
|
using MessageBox = System.Windows.MessageBox;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Forms;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
using Wox.Core.i18n;
|
using Wox.Core.i18n;
|
||||||
using Wox.Core.Theme;
|
using Wox.Core.Theme;
|
||||||
using Wox.Core.Updater;
|
using Wox.Core.Updater;
|
||||||
using Wox.Core.UserSettings;
|
using Wox.Core.UserSettings;
|
||||||
|
using CheckBox = System.Windows.Controls.CheckBox;
|
||||||
|
using Control = System.Windows.Controls.Control;
|
||||||
|
using Cursors = System.Windows.Input.Cursors;
|
||||||
|
using HorizontalAlignment = System.Windows.HorizontalAlignment;
|
||||||
|
|
||||||
namespace Wox
|
namespace Wox
|
||||||
{
|
{
|
||||||
public partial class SettingWindow : Window
|
public partial class SettingWindow : Window
|
||||||
{
|
{
|
||||||
public MainWindow MainWindow;
|
public readonly MainWindow MainWindow;
|
||||||
bool settingsLoaded = false;
|
bool settingsLoaded = false;
|
||||||
private Dictionary<ISettingProvider, Control> featureControls = new Dictionary<ISettingProvider, Control>();
|
private Dictionary<ISettingProvider, Control> featureControls = new Dictionary<ISettingProvider, Control>();
|
||||||
|
private bool themeTabLoaded = false;
|
||||||
|
|
||||||
public SettingWindow(MainWindow mainWindow)
|
public SettingWindow(MainWindow mainWindow)
|
||||||
{
|
{
|
||||||
@@ -74,8 +80,208 @@ namespace Wox
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Theme
|
#region Proxy
|
||||||
|
|
||||||
|
cbEnableProxy.Checked += (o, e) => EnableProxy();
|
||||||
|
cbEnableProxy.Unchecked += (o, e) => DisableProxy();
|
||||||
|
cbEnableProxy.IsChecked = UserSettingStorage.Instance.ProxyEnabled;
|
||||||
|
tbProxyServer.Text = UserSettingStorage.Instance.ProxyServer;
|
||||||
|
tbProxyPort.Text = UserSettingStorage.Instance.ProxyPort.ToString();
|
||||||
|
tbProxyUserName.Text = UserSettingStorage.Instance.ProxyUserName;
|
||||||
|
tbProxyPassword.Password = UserSettingStorage.Instance.ProxyPassword;
|
||||||
|
if (UserSettingStorage.Instance.ProxyEnabled)
|
||||||
|
{
|
||||||
|
EnableProxy();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DisableProxy();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region About
|
||||||
|
|
||||||
|
tbVersion.Text = UpdaterManager.Instance.CurrentVersion.ToString();
|
||||||
|
string activateTimes = string.Format(InternationalizationManager.Instance.GetTranslation("about_activate_times"),
|
||||||
|
UserSettingStorage.Instance.ActivateTimes);
|
||||||
|
tbActivatedTimes.Text = activateTimes;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
settingsLoaded = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region General
|
||||||
|
|
||||||
|
private void LoadLanguages()
|
||||||
|
{
|
||||||
|
cbLanguages.ItemsSource = InternationalizationManager.Instance.LoadAvailableLanguages();
|
||||||
|
cbLanguages.DisplayMemberPath = "Display";
|
||||||
|
cbLanguages.SelectedValuePath = "LanguageCode";
|
||||||
|
cbLanguages.SelectedValue = UserSettingStorage.Instance.Language;
|
||||||
|
cbLanguages.SelectionChanged += cbLanguages_SelectionChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
void cbLanguages_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
InternationalizationManager.Instance.ChangeLanguage(cbLanguages.SelectedItem as Language);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CbStartWithWindows_OnChecked(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
AddApplicationToStartup();
|
||||||
|
UserSettingStorage.Instance.StartWoxOnSystemStartup = true;
|
||||||
|
UserSettingStorage.Instance.Save();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CbStartWithWindows_OnUnchecked(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
RemoveApplicationFromStartup();
|
||||||
|
UserSettingStorage.Instance.StartWoxOnSystemStartup = false;
|
||||||
|
UserSettingStorage.Instance.Save();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AddApplicationToStartup()
|
||||||
|
{
|
||||||
|
using (RegistryKey key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true))
|
||||||
|
{
|
||||||
|
key.SetValue("Wox", "\"" + Application.ExecutablePath + "\" --hidestart");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RemoveApplicationFromStartup()
|
||||||
|
{
|
||||||
|
using (RegistryKey key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true))
|
||||||
|
{
|
||||||
|
key.DeleteValue("Wox", false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool CheckApplicationIsStartupWithWindow()
|
||||||
|
{
|
||||||
|
using (RegistryKey key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true))
|
||||||
|
{
|
||||||
|
return key.GetValue("Wox") != null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Hotkey
|
||||||
|
|
||||||
|
void ctlHotkey_OnHotkeyChanged(object sender, System.EventArgs e)
|
||||||
|
{
|
||||||
|
if (ctlHotkey.CurrentHotkeyAvailable)
|
||||||
|
{
|
||||||
|
MainWindow.SetHotkey(ctlHotkey.CurrentHotkey.ToString(), delegate
|
||||||
|
{
|
||||||
|
if (!MainWindow.IsVisible)
|
||||||
|
{
|
||||||
|
MainWindow.ShowApp();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MainWindow.HideApp();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
MainWindow.RemoveHotkey(UserSettingStorage.Instance.Hotkey);
|
||||||
|
UserSettingStorage.Instance.Hotkey = ctlHotkey.CurrentHotkey.ToString();
|
||||||
|
UserSettingStorage.Instance.Save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void TabHotkey_OnPreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
var tabItem = sender as TabItem;
|
||||||
|
var clickingBody = (tabItem.Content as UIElement).IsMouseOver;
|
||||||
|
if (!clickingBody)
|
||||||
|
{
|
||||||
|
OnHotkeyTabSelected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnHotkeyTabSelected()
|
||||||
|
{
|
||||||
|
ctlHotkey.OnHotkeyChanged += ctlHotkey_OnHotkeyChanged;
|
||||||
|
ctlHotkey.SetHotkey(UserSettingStorage.Instance.Hotkey, false);
|
||||||
|
lvCustomHotkey.ItemsSource = UserSettingStorage.Instance.CustomPluginHotkeys;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnDeleteCustomHotkey_OnClick(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
CustomPluginHotkey item = lvCustomHotkey.SelectedItem as CustomPluginHotkey;
|
||||||
|
if (item == null)
|
||||||
|
{
|
||||||
|
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("pleaseSelectAnItem"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string deleteWarning = string.Format(InternationalizationManager.Instance.GetTranslation("deleteCustomHotkeyWarning"), item.Hotkey);
|
||||||
|
if (MessageBox.Show(deleteWarning, InternationalizationManager.Instance.GetTranslation("delete"), MessageBoxButton.YesNo) == MessageBoxResult.Yes)
|
||||||
|
{
|
||||||
|
UserSettingStorage.Instance.CustomPluginHotkeys.Remove(item);
|
||||||
|
lvCustomHotkey.Items.Refresh();
|
||||||
|
UserSettingStorage.Instance.Save();
|
||||||
|
MainWindow.RemoveHotkey(item.Hotkey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnEditCustomHotkey_OnClick(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
CustomPluginHotkey item = lvCustomHotkey.SelectedItem as CustomPluginHotkey;
|
||||||
|
if (item != null)
|
||||||
|
{
|
||||||
|
CustomQueryHotkeySetting window = new CustomQueryHotkeySetting(this);
|
||||||
|
window.UpdateItem(item);
|
||||||
|
window.ShowDialog();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("pleaseSelectAnItem"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BtnAddCustomeHotkey_OnClick(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
new CustomQueryHotkeySetting(this).ShowDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ReloadCustomPluginHotkeyView()
|
||||||
|
{
|
||||||
|
lvCustomHotkey.Items.Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Theme
|
||||||
|
|
||||||
|
private void tbMoreThemes_MouseUp(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
Process.Start("http://www.getwox.com/theme");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void CbOpacityMode_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
UserSettingStorage.Instance.OpacityMode = (OpacityMode)CbOpacityMode.SelectedItem;
|
||||||
|
UserSettingStorage.Instance.Save();
|
||||||
|
|
||||||
|
spOpacity.Visibility = UserSettingStorage.Instance.OpacityMode == OpacityMode.LayeredWindow ? Visibility.Visible : Visibility.Collapsed;
|
||||||
|
|
||||||
|
if (UserSettingStorage.Instance.OpacityMode == OpacityMode.LayeredWindow)
|
||||||
|
PreviewMainPanel.Opacity = UserSettingStorage.Instance.Opacity;
|
||||||
|
else
|
||||||
|
PreviewMainPanel.Opacity = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void OnThemeTabSelected()
|
||||||
|
{
|
||||||
|
if (themeTabLoaded) return;
|
||||||
|
|
||||||
|
themeTabLoaded = true;
|
||||||
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)
|
||||||
{
|
{
|
||||||
@@ -175,196 +381,18 @@ namespace Wox
|
|||||||
|
|
||||||
//PreviewPanel
|
//PreviewPanel
|
||||||
ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme);
|
ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme);
|
||||||
#endregion
|
}
|
||||||
|
|
||||||
#region Plugin
|
private void TabTheme_OnPreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
ctlHotkey.OnHotkeyChanged += ctlHotkey_OnHotkeyChanged;
|
var tabItem = sender as TabItem;
|
||||||
ctlHotkey.SetHotkey(UserSettingStorage.Instance.Hotkey, false);
|
var clickingBody = (tabItem.Content as UIElement).IsMouseOver;
|
||||||
lvCustomHotkey.ItemsSource = UserSettingStorage.Instance.CustomPluginHotkeys;
|
if (!clickingBody)
|
||||||
|
|
||||||
var plugins = new CompositeCollection
|
|
||||||
{
|
{
|
||||||
new CollectionContainer
|
OnThemeTabSelected();
|
||||||
{
|
|
||||||
Collection = PluginManager.AllPlugins
|
|
||||||
}
|
|
||||||
};
|
|
||||||
lbPlugins.ItemsSource = plugins;
|
|
||||||
lbPlugins.SelectedIndex = 0;
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Proxy
|
|
||||||
|
|
||||||
cbEnableProxy.Checked += (o, e) => EnableProxy();
|
|
||||||
cbEnableProxy.Unchecked += (o, e) => DisableProxy();
|
|
||||||
cbEnableProxy.IsChecked = UserSettingStorage.Instance.ProxyEnabled;
|
|
||||||
tbProxyServer.Text = UserSettingStorage.Instance.ProxyServer;
|
|
||||||
tbProxyPort.Text = UserSettingStorage.Instance.ProxyPort.ToString();
|
|
||||||
tbProxyUserName.Text = UserSettingStorage.Instance.ProxyUserName;
|
|
||||||
tbProxyPassword.Password = UserSettingStorage.Instance.ProxyPassword;
|
|
||||||
if (UserSettingStorage.Instance.ProxyEnabled)
|
|
||||||
{
|
|
||||||
EnableProxy();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DisableProxy();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region About
|
|
||||||
|
|
||||||
tbVersion.Text = UpdaterManager.Instance.CurrentVersion.ToString();
|
|
||||||
string activateTimes = string.Format(InternationalizationManager.Instance.GetTranslation("about_activate_times"),
|
|
||||||
UserSettingStorage.Instance.ActivateTimes);
|
|
||||||
tbActivatedTimes.Text = activateTimes;
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
settingsLoaded = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LoadLanguages()
|
|
||||||
{
|
|
||||||
cbLanguages.ItemsSource = InternationalizationManager.Instance.LoadAvailableLanguages();
|
|
||||||
cbLanguages.DisplayMemberPath = "Display";
|
|
||||||
cbLanguages.SelectedValuePath = "LanguageCode";
|
|
||||||
cbLanguages.SelectedValue = UserSettingStorage.Instance.Language;
|
|
||||||
cbLanguages.SelectionChanged += cbLanguages_SelectionChanged;
|
|
||||||
}
|
|
||||||
|
|
||||||
void cbLanguages_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
||||||
{
|
|
||||||
InternationalizationManager.Instance.ChangeLanguage(cbLanguages.SelectedItem as Language);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void EnableProxy()
|
|
||||||
{
|
|
||||||
tbProxyPassword.IsEnabled = true;
|
|
||||||
tbProxyServer.IsEnabled = true;
|
|
||||||
tbProxyUserName.IsEnabled = true;
|
|
||||||
tbProxyPort.IsEnabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DisableProxy()
|
|
||||||
{
|
|
||||||
tbProxyPassword.IsEnabled = false;
|
|
||||||
tbProxyServer.IsEnabled = false;
|
|
||||||
tbProxyUserName.IsEnabled = false;
|
|
||||||
tbProxyPort.IsEnabled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CbStartWithWindows_OnChecked(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
AddApplicationToStartup();
|
|
||||||
UserSettingStorage.Instance.StartWoxOnSystemStartup = true;
|
|
||||||
UserSettingStorage.Instance.Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CbStartWithWindows_OnUnchecked(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
RemoveApplicationFromStartup();
|
|
||||||
UserSettingStorage.Instance.StartWoxOnSystemStartup = false;
|
|
||||||
UserSettingStorage.Instance.Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AddApplicationToStartup()
|
|
||||||
{
|
|
||||||
using (RegistryKey key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true))
|
|
||||||
{
|
|
||||||
key.SetValue("Wox", "\"" + Application.ExecutablePath + "\" --hidestart");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RemoveApplicationFromStartup()
|
|
||||||
{
|
|
||||||
using (RegistryKey key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true))
|
|
||||||
{
|
|
||||||
key.DeleteValue("Wox", false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool CheckApplicationIsStartupWithWindow()
|
|
||||||
{
|
|
||||||
using (RegistryKey key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true))
|
|
||||||
{
|
|
||||||
return key.GetValue("Wox") != null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ctlHotkey_OnHotkeyChanged(object sender, System.EventArgs e)
|
|
||||||
{
|
|
||||||
if (ctlHotkey.CurrentHotkeyAvailable)
|
|
||||||
{
|
|
||||||
MainWindow.SetHotkey(ctlHotkey.CurrentHotkey.ToString(), delegate
|
|
||||||
{
|
|
||||||
if (!MainWindow.IsVisible)
|
|
||||||
{
|
|
||||||
MainWindow.ShowApp();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MainWindow.HideApp();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
MainWindow.RemoveHotkey(UserSettingStorage.Instance.Hotkey);
|
|
||||||
UserSettingStorage.Instance.Hotkey = ctlHotkey.CurrentHotkey.ToString();
|
|
||||||
UserSettingStorage.Instance.Save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Custom Plugin Hotkey
|
|
||||||
|
|
||||||
private void BtnDeleteCustomHotkey_OnClick(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
CustomPluginHotkey item = lvCustomHotkey.SelectedItem as CustomPluginHotkey;
|
|
||||||
if (item == null)
|
|
||||||
{
|
|
||||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("pleaseSelectAnItem"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
string deleteWarning = string.Format(InternationalizationManager.Instance.GetTranslation("deleteCustomHotkeyWarning"), item.Hotkey);
|
|
||||||
if (MessageBox.Show(deleteWarning, InternationalizationManager.Instance.GetTranslation("delete"), MessageBoxButton.YesNo) == MessageBoxResult.Yes)
|
|
||||||
{
|
|
||||||
UserSettingStorage.Instance.CustomPluginHotkeys.Remove(item);
|
|
||||||
lvCustomHotkey.Items.Refresh();
|
|
||||||
UserSettingStorage.Instance.Save();
|
|
||||||
MainWindow.RemoveHotkey(item.Hotkey);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void BtnEditCustomHotkey_OnClick(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
CustomPluginHotkey item = lvCustomHotkey.SelectedItem as CustomPluginHotkey;
|
|
||||||
if (item != null)
|
|
||||||
{
|
|
||||||
CustomQueryHotkeySetting window = new CustomQueryHotkeySetting(this);
|
|
||||||
window.UpdateItem(item);
|
|
||||||
window.ShowDialog();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("pleaseSelectAnItem"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void BtnAddCustomeHotkey_OnClick(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
new CustomQueryHotkeySetting(this).ShowDialog();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ReloadCustomPluginHotkeyView()
|
|
||||||
{
|
|
||||||
lvCustomHotkey.Items.Refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Theme
|
|
||||||
private void ThemeComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
private void ThemeComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
string themeName = themeComboBox.SelectedItem.ToString();
|
string themeName = themeComboBox.SelectedItem.ToString();
|
||||||
@@ -452,18 +480,8 @@ namespace Wox
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private void CbOpacityMode_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
#region Plugin
|
||||||
{
|
|
||||||
UserSettingStorage.Instance.OpacityMode = (OpacityMode)CbOpacityMode.SelectedItem;
|
|
||||||
UserSettingStorage.Instance.Save();
|
|
||||||
|
|
||||||
spOpacity.Visibility = UserSettingStorage.Instance.OpacityMode == OpacityMode.LayeredWindow ? Visibility.Visible : Visibility.Collapsed;
|
|
||||||
|
|
||||||
if (UserSettingStorage.Instance.OpacityMode == OpacityMode.LayeredWindow)
|
|
||||||
PreviewMainPanel.Opacity = UserSettingStorage.Instance.Opacity;
|
|
||||||
else
|
|
||||||
PreviewMainPanel.Opacity = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void lbPlugins_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
private void lbPlugins_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
{
|
{
|
||||||
@@ -473,7 +491,6 @@ namespace Wox
|
|||||||
|
|
||||||
if (pair != null)
|
if (pair != null)
|
||||||
{
|
{
|
||||||
//third-party plugin
|
|
||||||
provider = pair.Plugin as ISettingProvider;
|
provider = pair.Plugin as ISettingProvider;
|
||||||
pluginAuthor.Visibility = Visibility.Visible;
|
pluginAuthor.Visibility = Visibility.Visible;
|
||||||
pluginActionKeyword.Visibility = Visibility.Visible;
|
pluginActionKeyword.Visibility = Visibility.Visible;
|
||||||
@@ -491,11 +508,6 @@ namespace Wox
|
|||||||
pluginId = pair.Metadata.ID;
|
pluginId = pair.Metadata.ID;
|
||||||
pluginIcon.Source = ImageLoader.ImageLoader.Load(pair.Metadata.FullIcoPath);
|
pluginIcon.Source = ImageLoader.ImageLoader.Load(pair.Metadata.FullIcoPath);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
//system plugin
|
|
||||||
provider = lbPlugins.SelectedItem as ISettingProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
var customizedPluginConfig = UserSettingStorage.Instance.CustomizedPluginConfigs.FirstOrDefault(o => o.ID == pluginId);
|
var customizedPluginConfig = UserSettingStorage.Instance.CustomizedPluginConfigs.FirstOrDefault(o => o.ID == pluginId);
|
||||||
cbDisablePlugin.IsChecked = customizedPluginConfig != null && customizedPluginConfig.Disabled;
|
cbDisablePlugin.IsChecked = customizedPluginConfig != null && customizedPluginConfig.Disabled;
|
||||||
@@ -611,11 +623,33 @@ namespace Wox
|
|||||||
Process.Start("http://www.getwox.com/plugin");
|
Process.Start("http://www.getwox.com/plugin");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void tbMoreThemes_MouseUp(object sender, MouseButtonEventArgs e)
|
private void OnPluginTabSelected()
|
||||||
{
|
{
|
||||||
Process.Start("http://www.getwox.com/theme");
|
var plugins = new CompositeCollection
|
||||||
|
{
|
||||||
|
new CollectionContainer
|
||||||
|
{
|
||||||
|
Collection = PluginManager.AllPlugins
|
||||||
|
}
|
||||||
|
};
|
||||||
|
lbPlugins.ItemsSource = plugins;
|
||||||
|
lbPlugins.SelectedIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void TabPlugin_OnPreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
var tabItem = sender as TabItem;
|
||||||
|
var clickingBody = (tabItem.Content as UIElement).IsMouseOver;
|
||||||
|
if (!clickingBody)
|
||||||
|
{
|
||||||
|
OnPluginTabSelected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Proxy
|
||||||
private void btnSaveProxy_Click(object sender, RoutedEventArgs e)
|
private void btnSaveProxy_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
UserSettingStorage.Instance.ProxyEnabled = cbEnableProxy.IsChecked ?? false;
|
UserSettingStorage.Instance.ProxyEnabled = cbEnableProxy.IsChecked ?? false;
|
||||||
@@ -698,9 +732,31 @@ namespace Wox
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void EnableProxy()
|
||||||
|
{
|
||||||
|
tbProxyPassword.IsEnabled = true;
|
||||||
|
tbProxyServer.IsEnabled = true;
|
||||||
|
tbProxyUserName.IsEnabled = true;
|
||||||
|
tbProxyPort.IsEnabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DisableProxy()
|
||||||
|
{
|
||||||
|
tbProxyPassword.IsEnabled = false;
|
||||||
|
tbProxyServer.IsEnabled = false;
|
||||||
|
tbProxyUserName.IsEnabled = false;
|
||||||
|
tbProxyPort.IsEnabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region About
|
||||||
|
|
||||||
private void tbWebsite_MouseUp(object sender, MouseButtonEventArgs e)
|
private void tbWebsite_MouseUp(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
Process.Start("http://www.getwox.com");
|
Process.Start("http://www.getwox.com");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user