diff --git a/Plugins/Wox.Plugin.CMD/CMD.cs b/Plugins/Wox.Plugin.CMD/CMD.cs index 786ad9ab67..99b18559d8 100644 --- a/Plugins/Wox.Plugin.CMD/CMD.cs +++ b/Plugins/Wox.Plugin.CMD/CMD.cs @@ -176,8 +176,7 @@ namespace Wox.Plugin.CMD private void OnWinRPressed() { context.API.ShowApp(); - // todo don't hardcode action keywords. - context.API.ChangeQuery($">{Plugin.Query.TermSeperater}"); + context.API.ChangeQuery($"{context.CurrentPluginMetadata.ActionKeywords[0]}{Plugin.Query.TermSeperater}"); } public Control CreateSettingPanel() diff --git a/Plugins/Wox.Plugin.CMD/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.CMD/Properties/AssemblyInfo.cs index fac890b6dd..c1968c12aa 100644 --- a/Plugins/Wox.Plugin.CMD/Properties/AssemblyInfo.cs +++ b/Plugins/Wox.Plugin.CMD/Properties/AssemblyInfo.cs @@ -1,36 +1,5 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// 有关程序集的常规信息通过以下 -// 特性集控制。更改这些特性值可修改 -// 与程序集关联的信息。 [assembly: AssemblyTitle("Wox.Plugin.CMD")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox.Plugin.CMD")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// 将 ComVisible 设置为 false 使此程序集中的类型 -// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, -// 则将该类型上的 ComVisible 特性设置为 true。 -[assembly: ComVisible(false)] - -// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID -[assembly: Guid("9283a32d-5d3c-4231-96e0-2150ed4716b9")] - -// 程序集的版本信息由下面四个值组成: -// -// 主版本 -// 次版本 -// 生成号 -// 修订号 -// -// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, -// 方法是按如下所示使用“*”: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: Guid("9283a32d-5d3c-4231-96e0-2150ed4716b9")] \ No newline at end of file diff --git a/Plugins/Wox.Plugin.CMD/Wox.Plugin.CMD.csproj b/Plugins/Wox.Plugin.CMD/Wox.Plugin.CMD.csproj index cb10d95247..2471444bd4 100644 --- a/Plugins/Wox.Plugin.CMD/Wox.Plugin.CMD.csproj +++ b/Plugins/Wox.Plugin.CMD/Wox.Plugin.CMD.csproj @@ -34,8 +34,8 @@ false - - ..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll + + ..\..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll True @@ -55,6 +55,9 @@ + + Properties\SolutionAssemblyInfo.cs + CMDSetting.xaml diff --git a/Plugins/Wox.Plugin.CMD/packages.config b/Plugins/Wox.Plugin.CMD/packages.config index 0be4b18f6f..0b696a5146 100644 --- a/Plugins/Wox.Plugin.CMD/packages.config +++ b/Plugins/Wox.Plugin.CMD/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Caculator/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.Caculator/Properties/AssemblyInfo.cs index a4ddfc5313..dd66d50a78 100644 --- a/Plugins/Wox.Plugin.Caculator/Properties/AssemblyInfo.cs +++ b/Plugins/Wox.Plugin.Caculator/Properties/AssemblyInfo.cs @@ -1,36 +1,5 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// 有关程序集的常规信息通过以下 -// 特性集控制。更改这些特性值可修改 -// 与程序集关联的信息。 [assembly: AssemblyTitle("Wox.Plugin.Caculator")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox.Plugin.Caculator")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// 将 ComVisible 设置为 false 使此程序集中的类型 -// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, -// 则将该类型上的 ComVisible 特性设置为 true。 -[assembly: ComVisible(false)] - -// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID -[assembly: Guid("ba698b90-59ed-4c2e-bce1-497eb2f9e76f")] - -// 程序集的版本信息由下面四个值组成: -// -// 主版本 -// 次版本 -// 生成号 -// 修订号 -// -// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, -// 方法是按如下所示使用“*”: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: Guid("ba698b90-59ed-4c2e-bce1-497eb2f9e76f")] \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Caculator/Wox.Plugin.Caculator.csproj b/Plugins/Wox.Plugin.Caculator/Wox.Plugin.Caculator.csproj index e28fab5d13..e80e10107d 100644 --- a/Plugins/Wox.Plugin.Caculator/Wox.Plugin.Caculator.csproj +++ b/Plugins/Wox.Plugin.Caculator/Wox.Plugin.Caculator.csproj @@ -44,6 +44,9 @@ + + Properties\SolutionAssemblyInfo.cs + diff --git a/Plugins/Wox.Plugin.Color/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.Color/Properties/AssemblyInfo.cs index 7578ccd763..1df9ed6e49 100644 --- a/Plugins/Wox.Plugin.Color/Properties/AssemblyInfo.cs +++ b/Plugins/Wox.Plugin.Color/Properties/AssemblyInfo.cs @@ -1,36 +1,5 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// 有关程序集的常规信息通过以下 -// 特性集控制。更改这些特性值可修改 -// 与程序集关联的信息。 [assembly: AssemblyTitle("Wox.Plugin.Color")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox.Plugin.Color")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// 将 ComVisible 设置为 false 使此程序集中的类型 -// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, -// 则将该类型上的 ComVisible 特性设置为 true。 -[assembly: ComVisible(false)] - -// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID -[assembly: Guid("46b03f84-5bf7-4ed4-a69b-f0274c8b3776")] - -// 程序集的版本信息由下面四个值组成: -// -// 主版本 -// 次版本 -// 生成号 -// 修订号 -// -// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, -// 方法是按如下所示使用“*”: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: Guid("46b03f84-5bf7-4ed4-a69b-f0274c8b3776")] \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Color/Wox.Plugin.Color.csproj b/Plugins/Wox.Plugin.Color/Wox.Plugin.Color.csproj index eebd501f0f..b2f9af335b 100644 --- a/Plugins/Wox.Plugin.Color/Wox.Plugin.Color.csproj +++ b/Plugins/Wox.Plugin.Color/Wox.Plugin.Color.csproj @@ -38,6 +38,9 @@ + + Properties\SolutionAssemblyInfo.cs + diff --git a/Plugins/Wox.Plugin.ControlPanel/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.ControlPanel/Properties/AssemblyInfo.cs index dbbad24f59..10e8283a21 100644 --- a/Plugins/Wox.Plugin.ControlPanel/Properties/AssemblyInfo.cs +++ b/Plugins/Wox.Plugin.ControlPanel/Properties/AssemblyInfo.cs @@ -1,36 +1,5 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// 有关程序集的常规信息通过以下 -// 特性集控制。更改这些特性值可修改 -// 与程序集关联的信息。 [assembly: AssemblyTitle("Wox.Plugin.ControlPanel")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox.Plugin.ControlPanel")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// 将 ComVisible 设置为 false 使此程序集中的类型 -// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, -// 则将该类型上的 ComVisible 特性设置为 true。 -[assembly: ComVisible(false)] - -// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID -[assembly: Guid("59141b10-8941-4e90-a0a6-bc9385a04cc6")] - -// 程序集的版本信息由下面四个值组成: -// -// 主版本 -// 次版本 -// 生成号 -// 修订号 -// -// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, -// 方法是按如下所示使用“*”: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: Guid("59141b10-8941-4e90-a0a6-bc9385a04cc6")] \ No newline at end of file diff --git a/Plugins/Wox.Plugin.ControlPanel/Wox.Plugin.ControlPanel.csproj b/Plugins/Wox.Plugin.ControlPanel/Wox.Plugin.ControlPanel.csproj index 9b19f29657..de5b9a90a2 100644 --- a/Plugins/Wox.Plugin.ControlPanel/Wox.Plugin.ControlPanel.csproj +++ b/Plugins/Wox.Plugin.ControlPanel/Wox.Plugin.ControlPanel.csproj @@ -38,6 +38,9 @@ + + Properties\SolutionAssemblyInfo.cs + diff --git a/Plugins/Wox.Plugin.Everything/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.Everything/Properties/AssemblyInfo.cs index a6ff8af12c..22f46590a5 100644 --- a/Plugins/Wox.Plugin.Everything/Properties/AssemblyInfo.cs +++ b/Plugins/Wox.Plugin.Everything/Properties/AssemblyInfo.cs @@ -1,36 +1,5 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// 有关程序集的常规信息通过以下 -// 特性集控制。更改这些特性值可修改 -// 与程序集关联的信息。 [assembly: AssemblyTitle("Wox.Plugin.Everything")] -[assembly: AssemblyDescription("https://github.com/qianlifeng/Wox")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox.Plugin.Everything")] -[assembly: AssemblyCopyright("The MIT License (MIT)")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// 将 ComVisible 设置为 false 使此程序集中的类型 -// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, -// 则将该类型上的 ComVisible 特性设置为 true。 -[assembly: ComVisible(false)] - -// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID -[assembly: Guid("97f6ccd0-e9dc-4aa2-b4ce-6b9f14ea20a7")] - -// 程序集的版本信息由下面四个值组成: -// -// 主版本 -// 次版本 -// 生成号 -// 修订号 -// -// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, -// 方法是按如下所示使用“*”: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: Guid("97f6ccd0-e9dc-4aa2-b4ce-6b9f14ea20a7")] \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Everything/Wox.Plugin.Everything.csproj b/Plugins/Wox.Plugin.Everything/Wox.Plugin.Everything.csproj index 3df41be678..66ca99783e 100644 --- a/Plugins/Wox.Plugin.Everything/Wox.Plugin.Everything.csproj +++ b/Plugins/Wox.Plugin.Everything/Wox.Plugin.Everything.csproj @@ -38,12 +38,8 @@ - - ..\..\packages\Exceptionless.Portable.3.1.1416\lib\net45\Exceptionless.Portable.dll - True - - - ..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll + + ..\..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll True @@ -52,6 +48,9 @@ + + Properties\SolutionAssemblyInfo.cs + diff --git a/Plugins/Wox.Plugin.Everything/packages.config b/Plugins/Wox.Plugin.Everything/packages.config index 654e648df6..64b5d8efe5 100644 --- a/Plugins/Wox.Plugin.Everything/packages.config +++ b/Plugins/Wox.Plugin.Everything/packages.config @@ -1,5 +1,4 @@  - - + \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Folder/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.Folder/Properties/AssemblyInfo.cs index 5cf2f0b6e8..17473b64d8 100644 --- a/Plugins/Wox.Plugin.Folder/Properties/AssemblyInfo.cs +++ b/Plugins/Wox.Plugin.Folder/Properties/AssemblyInfo.cs @@ -1,36 +1,5 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// 有关程序集的常规信息通过以下 -// 特性集控制。更改这些特性值可修改 -// 与程序集关联的信息。 [assembly: AssemblyTitle("Wox.Plugin.Folder")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox.Plugin.Folder")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// 将 ComVisible 设置为 false 使此程序集中的类型 -// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, -// 则将该类型上的 ComVisible 特性设置为 true。 -[assembly: ComVisible(false)] - -// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID -[assembly: Guid("e047418e-f7b0-4a3a-b855-0bef7178179f")] - -// 程序集的版本信息由下面四个值组成: -// -// 主版本 -// 次版本 -// 生成号 -// 修订号 -// -// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, -// 方法是按如下所示使用“*”: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: Guid("e047418e-f7b0-4a3a-b855-0bef7178179f")] \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Folder/Wox.Plugin.Folder.csproj b/Plugins/Wox.Plugin.Folder/Wox.Plugin.Folder.csproj index e4cc76f35b..8f4daf0796 100644 --- a/Plugins/Wox.Plugin.Folder/Wox.Plugin.Folder.csproj +++ b/Plugins/Wox.Plugin.Folder/Wox.Plugin.Folder.csproj @@ -34,8 +34,8 @@ false - - ..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll + + ..\..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll True @@ -51,6 +51,9 @@ + + Properties\SolutionAssemblyInfo.cs + diff --git a/Plugins/Wox.Plugin.Folder/packages.config b/Plugins/Wox.Plugin.Folder/packages.config index 0b84f87d4d..64b5d8efe5 100644 --- a/Plugins/Wox.Plugin.Folder/packages.config +++ b/Plugins/Wox.Plugin.Folder/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Plugins/Wox.Plugin.PluginIndicator/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.PluginIndicator/Properties/AssemblyInfo.cs index 81a83a2dcd..5323b0bc14 100644 --- a/Plugins/Wox.Plugin.PluginIndicator/Properties/AssemblyInfo.cs +++ b/Plugins/Wox.Plugin.PluginIndicator/Properties/AssemblyInfo.cs @@ -1,36 +1,5 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// 有关程序集的常规信息通过以下 -// 特性集控制。更改这些特性值可修改 -// 与程序集关联的信息。 [assembly: AssemblyTitle("Wox.Plugin.PluginIndicator")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox.Plugin.PluginIndicator")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// 将 ComVisible 设置为 false 使此程序集中的类型 -// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, -// 则将该类型上的 ComVisible 特性设置为 true。 -[assembly: ComVisible(false)] - -// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID -[assembly: Guid("27f6d9fc-340b-47be-90ea-2a86bfca7bad")] - -// 程序集的版本信息由下面四个值组成: -// -// 主版本 -// 次版本 -// 生成号 -// 修订号 -// -// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, -// 方法是按如下所示使用“*”: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: Guid("27f6d9fc-340b-47be-90ea-2a86bfca7bad")] \ No newline at end of file diff --git a/Plugins/Wox.Plugin.PluginIndicator/Wox.Plugin.PluginIndicator.csproj b/Plugins/Wox.Plugin.PluginIndicator/Wox.Plugin.PluginIndicator.csproj index 5ec360cd3d..d68a2a81cd 100644 --- a/Plugins/Wox.Plugin.PluginIndicator/Wox.Plugin.PluginIndicator.csproj +++ b/Plugins/Wox.Plugin.PluginIndicator/Wox.Plugin.PluginIndicator.csproj @@ -36,6 +36,9 @@ + + Properties\SolutionAssemblyInfo.cs + diff --git a/Plugins/Wox.Plugin.PluginManagement/Main.cs b/Plugins/Wox.Plugin.PluginManagement/Main.cs index 934caea04a..785d280173 100644 --- a/Plugins/Wox.Plugin.PluginManagement/Main.cs +++ b/Plugins/Wox.Plugin.PluginManagement/Main.cs @@ -14,7 +14,7 @@ namespace Wox.Plugin.PluginManagement { public class Main : IPlugin, IPluginI18n { - private static string APIBASE = "https://api.getwox.com"; + private static string APIBASE = "http://api.getwox.com"; private static string PluginConfigName = "plugin.json"; private static string pluginSearchUrl = APIBASE + "/plugin/search/"; private const string ListCommand = "list"; @@ -205,22 +205,19 @@ namespace Wox.Plugin.PluginManagement private void UnInstallPlugin(PluginMetadata plugin) { - string content = string.Format("Do you want to uninstall following plugin?\r\n\r\nName: {0}\r\nVersion: {1}\r\nAuthor: {2}", plugin.Name, plugin.Version, plugin.Author); + string content = $"Do you want to uninstall following plugin?{Environment.NewLine}{Environment.NewLine}" + + $"Name: {plugin.Name}{Environment.NewLine}" + + $"Version: {plugin.Version}{Environment.NewLine}" + + $"Author: {plugin.Author}"; if (MessageBox.Show(content, "Wox", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { File.Create(Path.Combine(plugin.PluginDirectory, "NeedDelete.txt")).Close(); - if (MessageBox.Show( - "You have uninstalled plugin " + plugin.Name + " successfully.\r\n Restart Wox to take effect?", - "Install plugin", - MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) + var result = MessageBox.Show($"You have uninstalled plugin {plugin.Name} successfully.{Environment.NewLine}" + + "Restart Wox to take effect?", + "Install plugin", MessageBoxButton.YesNo, MessageBoxImage.Question); + if (result == MessageBoxResult.Yes) { - ProcessStartInfo Info = new ProcessStartInfo(); - Info.Arguments = "/C ping 127.0.0.1 -n 1 && \"" + Assembly.GetExecutingAssembly().Location + "\""; - Info.WindowStyle = ProcessWindowStyle.Hidden; - Info.CreateNoWindow = true; - Info.FileName = "cmd.exe"; - Process.Start(Info); - context.API.CloseApp(); + context.API.RestarApp(); } } } diff --git a/Plugins/Wox.Plugin.PluginManagement/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.PluginManagement/Properties/AssemblyInfo.cs index df6fc9c007..6fa58f5d18 100644 --- a/Plugins/Wox.Plugin.PluginManagement/Properties/AssemblyInfo.cs +++ b/Plugins/Wox.Plugin.PluginManagement/Properties/AssemblyInfo.cs @@ -1,36 +1,5 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// 有关程序集的常规信息通过以下 -// 特性集控制。更改这些特性值可修改 -// 与程序集关联的信息。 [assembly: AssemblyTitle("Wox.Plugin.PluginManagement")] -[assembly: AssemblyDescription("https://github.com/qianlifeng/Wox")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox.Plugin.PluginManagement")] -[assembly: AssemblyCopyright("The MIT License (MIT)")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// 将 ComVisible 设置为 false 使此程序集中的类型 -// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, -// 则将该类型上的 ComVisible 特性设置为 true。 -[assembly: ComVisible(false)] - -// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID -[assembly: Guid("92b59bab-5c8c-414b-a8d7-326c7be3a11d")] - -// 程序集的版本信息由下面四个值组成: -// -// 主版本 -// 次版本 -// 生成号 -// 修订号 -// -// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, -// 方法是按如下所示使用“*”: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: Guid("92b59bab-5c8c-414b-a8d7-326c7be3a11d")] \ No newline at end of file diff --git a/Plugins/Wox.Plugin.PluginManagement/Wox.Plugin.PluginManagement.csproj b/Plugins/Wox.Plugin.PluginManagement/Wox.Plugin.PluginManagement.csproj index 870bf34574..8ee89613dd 100644 --- a/Plugins/Wox.Plugin.PluginManagement/Wox.Plugin.PluginManagement.csproj +++ b/Plugins/Wox.Plugin.PluginManagement/Wox.Plugin.PluginManagement.csproj @@ -34,16 +34,21 @@ false - - ..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll + + ..\..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll True + + + + Properties\SolutionAssemblyInfo.cs + diff --git a/Plugins/Wox.Plugin.PluginManagement/packages.config b/Plugins/Wox.Plugin.PluginManagement/packages.config index 0b84f87d4d..64b5d8efe5 100644 --- a/Plugins/Wox.Plugin.PluginManagement/packages.config +++ b/Plugins/Wox.Plugin.PluginManagement/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Program/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.Program/Properties/AssemblyInfo.cs index c2465d39d9..70b369ef5d 100644 --- a/Plugins/Wox.Plugin.Program/Properties/AssemblyInfo.cs +++ b/Plugins/Wox.Plugin.Program/Properties/AssemblyInfo.cs @@ -1,36 +1,5 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// 有关程序集的常规信息通过以下 -// 特性集控制。更改这些特性值可修改 -// 与程序集关联的信息。 [assembly: AssemblyTitle("Wox.Plugin.Program")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox.Plugin.Program")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// 将 ComVisible 设置为 false 使此程序集中的类型 -// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, -// 则将该类型上的 ComVisible 特性设置为 true。 -[assembly: ComVisible(false)] - -// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID -[assembly: Guid("82f60d9a-9280-4b6a-8b21-f3c694cb7e1d")] - -// 程序集的版本信息由下面四个值组成: -// -// 主版本 -// 次版本 -// 生成号 -// 修订号 -// -// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, -// 方法是按如下所示使用“*”: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: Guid("82f60d9a-9280-4b6a-8b21-f3c694cb7e1d")] \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Program/Wox.Plugin.Program.csproj b/Plugins/Wox.Plugin.Program/Wox.Plugin.Program.csproj index 4294512e26..6ffb3aecdf 100644 --- a/Plugins/Wox.Plugin.Program/Wox.Plugin.Program.csproj +++ b/Plugins/Wox.Plugin.Program/Wox.Plugin.Program.csproj @@ -34,9 +34,8 @@ false - - - ..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll + + ..\..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll True @@ -50,6 +49,9 @@ + + Properties\SolutionAssemblyInfo.cs + AddProgramSource.xaml diff --git a/Plugins/Wox.Plugin.Program/packages.config b/Plugins/Wox.Plugin.Program/packages.config index 0b84f87d4d..64b5d8efe5 100644 --- a/Plugins/Wox.Plugin.Program/packages.config +++ b/Plugins/Wox.Plugin.Program/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Sys/Images/recyclebin.png b/Plugins/Wox.Plugin.Sys/Images/recyclebin.png new file mode 100644 index 0000000000..ba1f2703c7 Binary files /dev/null and b/Plugins/Wox.Plugin.Sys/Images/recyclebin.png differ diff --git a/Plugins/Wox.Plugin.Sys/Images/restartcomp.png b/Plugins/Wox.Plugin.Sys/Images/restartcomp.png new file mode 100644 index 0000000000..fdbee813d9 Binary files /dev/null and b/Plugins/Wox.Plugin.Sys/Images/restartcomp.png differ diff --git a/Plugins/Wox.Plugin.Sys/Languages/en.xaml b/Plugins/Wox.Plugin.Sys/Languages/en.xaml index be6dbbbd72..65b50edcb8 100644 --- a/Plugins/Wox.Plugin.Sys/Languages/en.xaml +++ b/Plugins/Wox.Plugin.Sys/Languages/en.xaml @@ -6,12 +6,14 @@ Description Shutdown Computer + Restart Computer Log off Lock this computer Close Wox Restart Wox Tweak this app Put computer to sleep + Empty recycle bin System Commands Provide System related commands. e.g. shutdown,lock,setting etc. diff --git a/Plugins/Wox.Plugin.Sys/Languages/zh-cn.xaml b/Plugins/Wox.Plugin.Sys/Languages/zh-cn.xaml index 099003ebb1..e18fc8a832 100644 --- a/Plugins/Wox.Plugin.Sys/Languages/zh-cn.xaml +++ b/Plugins/Wox.Plugin.Sys/Languages/zh-cn.xaml @@ -6,12 +6,14 @@ 描述 关闭电脑 + Restart Computer 注销 锁定这台电脑 退出Wox 重启Wox 设置 休眠这台电脑 + Empty recycle bin 系统命令 系统系统相关的命令。例如,关机,锁定,设置等 diff --git a/Plugins/Wox.Plugin.Sys/Languages/zh-tw.xaml b/Plugins/Wox.Plugin.Sys/Languages/zh-tw.xaml index 0fa2694af7..9772142b29 100644 --- a/Plugins/Wox.Plugin.Sys/Languages/zh-tw.xaml +++ b/Plugins/Wox.Plugin.Sys/Languages/zh-tw.xaml @@ -6,12 +6,14 @@ 描述 關閉電腦 + Restart Computer 註銷 鎖定這臺電腦 退出Wox 重啟Wox 設置 休眠这台电脑 + Empty recycle bin 系統命令 系統系統相關的命令。例如,關機,鎖定,設置等 diff --git a/Plugins/Wox.Plugin.Sys/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.Sys/Properties/AssemblyInfo.cs index c0e3221b08..db9072038a 100644 --- a/Plugins/Wox.Plugin.Sys/Properties/AssemblyInfo.cs +++ b/Plugins/Wox.Plugin.Sys/Properties/AssemblyInfo.cs @@ -1,36 +1,5 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// 有关程序集的常规信息通过以下 -// 特性集控制。更改这些特性值可修改 -// 与程序集关联的信息。 [assembly: AssemblyTitle("Wox.Plugin.Sys")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox.Plugin.Sys")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// 将 ComVisible 设置为 false 使此程序集中的类型 -// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, -// 则将该类型上的 ComVisible 特性设置为 true。 -[assembly: ComVisible(false)] - -// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID -[assembly: Guid("e1eecff6-3f25-424d-9bbd-cbd7d6e1e11e")] - -// 程序集的版本信息由下面四个值组成: -// -// 主版本 -// 次版本 -// 生成号 -// 修订号 -// -// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, -// 方法是按如下所示使用“*”: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: Guid("e1eecff6-3f25-424d-9bbd-cbd7d6e1e11e")] \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Sys/Sys.cs b/Plugins/Wox.Plugin.Sys/Sys.cs index d3a0db1da6..9b2f838e67 100644 --- a/Plugins/Wox.Plugin.Sys/Sys.cs +++ b/Plugins/Wox.Plugin.Sys/Sys.cs @@ -1,10 +1,14 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.InteropServices; -using System.Windows.Forms; +using System.Windows; +using System.Windows.Interop; using Wox.Infrastructure; +using FormsApplication = System.Windows.Forms.Application; +using PowerState = System.Windows.Forms.PowerState; using Control = System.Windows.Controls.Control; namespace Wox.Plugin.Sys @@ -22,11 +26,23 @@ namespace Wox.Plugin.Sys internal const int EWX_FORCE = 0x00000004; internal const int EWX_POWEROFF = 0x00000008; internal const int EWX_FORCEIFHUNG = 0x00000010; + [DllImport("user32")] private static extern bool ExitWindowsEx(uint uFlags, uint dwReason); + [DllImport("user32")] private static extern void LockWorkStation(); + [DllImport("Shell32.dll", CharSet = CharSet.Unicode)] + private static extern uint SHEmptyRecycleBin(IntPtr hWnd, uint dwFlags); + + // http://www.pinvoke.net/default.aspx/Enums/HRESULT.html + private enum HRESULT : uint + { + S_FALSE = 0x0001, + S_OK = 0x0000 + } + #endregion public Control CreateSettingPanel() @@ -58,7 +74,8 @@ namespace Wox.Plugin.Sys private void LoadCommands() { - availableResults.AddRange(new Result[] { + availableResults.AddRange(new Result[] + { new Result { Title = "Shutdown", @@ -66,13 +83,32 @@ namespace Wox.Plugin.Sys IcoPath = "Images\\exit.png", Action = (c) => { - if (MessageBox.Show("Are you sure you want to shut the computer down?","Shutdown Computer?",MessageBoxButtons.YesNo,MessageBoxIcon.Warning) == DialogResult.Yes) { + var reuslt = MessageBox.Show("Are you sure you want to shut the computer down?", + "Shutdown Computer?", MessageBoxButton.YesNo, MessageBoxImage.Warning); + if (reuslt == MessageBoxResult.Yes) + { Process.Start("shutdown", "/s /t 0"); } return true; } }, new Result + { + Title = "Restart", + SubTitle = context.API.GetTranslation("wox_plugin_sys_restart_computer"), + IcoPath = "Images\\restartcomp.png", + Action = (c) => + { + var result = MessageBox.Show("Are you sure you want to restart the computer?", + "Restart Computer?", MessageBoxButton.YesNo, MessageBoxImage.Warning); + if (result == MessageBoxResult.Yes) + { + Process.Start("shutdown", "/r /t 0"); + } + return true; + } + }, + new Result { Title = "Log off", SubTitle = context.API.GetTranslation("wox_plugin_sys_log_off"), @@ -89,13 +125,33 @@ namespace Wox.Plugin.Sys LockWorkStation(); return true; } - }, + }, new Result { Title = "Sleep", SubTitle = context.API.GetTranslation("wox_plugin_sys_sleep"), IcoPath = "Images\\sleep.png", - Action = (c) => Application.SetSuspendState(PowerState.Suspend, false, false) + Action = (c) => FormsApplication.SetSuspendState(PowerState.Suspend, false, false) + }, + new Result + { + Title = "Empty Recycle Bin", + SubTitle = context.API.GetTranslation("wox_plugin_sys_emptyrecyclebin"), + IcoPath = "Images\\recyclebin.png", + Action = (c) => + { + // http://www.pinvoke.net/default.aspx/shell32/SHEmptyRecycleBin.html + // 0 for nothing + var result = SHEmptyRecycleBin(new WindowInteropHelper(Application.Current.MainWindow).Handle, 0); + if (result != (uint) HRESULT.S_OK) + { + MessageBox.Show($"Error emptying recycle bin, error code: {result}\n" + + "please refer to https://msdn.microsoft.com/en-us/library/windows/desktop/aa378137", + "Error", + MessageBoxButton.OK, MessageBoxImage.Error); + } + return true; + } }, new Result { @@ -115,14 +171,8 @@ namespace Wox.Plugin.Sys IcoPath = "Images\\restart.png", Action = (c) => { - ProcessStartInfo Info = new ProcessStartInfo(); - Info.Arguments = "/C ping 127.0.0.1 -n 1 && \"" + Application.ExecutablePath + "\""; - Info.WindowStyle = ProcessWindowStyle.Hidden; - Info.CreateNoWindow = true; - Info.FileName = "cmd.exe"; - Process.Start(Info); - context.API.CloseApp(); - return true; + context.API.RestarApp(); + return false; } }, new Result @@ -142,7 +192,6 @@ namespace Wox.Plugin.Sys public string GetLanguagesFolder() { return Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages"); - } public string GetTranslatedPluginTitle() @@ -155,4 +204,4 @@ namespace Wox.Plugin.Sys return context.API.GetTranslation("wox_plugin_sys_plugin_description"); } } -} +} \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Sys/Wox.Plugin.Sys.csproj b/Plugins/Wox.Plugin.Sys/Wox.Plugin.Sys.csproj index 1b303bcb7d..3be9f8c30f 100644 --- a/Plugins/Wox.Plugin.Sys/Wox.Plugin.Sys.csproj +++ b/Plugins/Wox.Plugin.Sys/Wox.Plugin.Sys.csproj @@ -47,6 +47,9 @@ + + Properties\SolutionAssemblyInfo.cs + @@ -64,6 +67,12 @@ + + PreserveNewest + + + PreserveNewest + PreserveNewest diff --git a/Plugins/Wox.Plugin.Url/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.Url/Properties/AssemblyInfo.cs index 894c83bff0..83520f2f11 100644 --- a/Plugins/Wox.Plugin.Url/Properties/AssemblyInfo.cs +++ b/Plugins/Wox.Plugin.Url/Properties/AssemblyInfo.cs @@ -1,36 +1,5 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// 有关程序集的常规信息通过以下 -// 特性集控制。更改这些特性值可修改 -// 与程序集关联的信息。 [assembly: AssemblyTitle("Wox.Plugin.Url")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox.Plugin.Url")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// 将 ComVisible 设置为 false 使此程序集中的类型 -// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, -// 则将该类型上的 ComVisible 特性设置为 true。 -[assembly: ComVisible(false)] - -// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID -[assembly: Guid("ea42b60d-34ff-4656-8ee1-012afa397d3e")] - -// 程序集的版本信息由下面四个值组成: -// -// 主版本 -// 次版本 -// 生成号 -// 修订号 -// -// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, -// 方法是按如下所示使用“*”: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: Guid("ea42b60d-34ff-4656-8ee1-012afa397d3e")] \ No newline at end of file diff --git a/Plugins/Wox.Plugin.Url/Wox.Plugin.Url.csproj b/Plugins/Wox.Plugin.Url/Wox.Plugin.Url.csproj index ef17910a3c..676bf001b5 100644 --- a/Plugins/Wox.Plugin.Url/Wox.Plugin.Url.csproj +++ b/Plugins/Wox.Plugin.Url/Wox.Plugin.Url.csproj @@ -37,6 +37,9 @@ + + Properties\SolutionAssemblyInfo.cs + diff --git a/Plugins/Wox.Plugin.WebSearch/Properties/AssemblyInfo.cs b/Plugins/Wox.Plugin.WebSearch/Properties/AssemblyInfo.cs index 23f84e286a..26736bdf44 100644 --- a/Plugins/Wox.Plugin.WebSearch/Properties/AssemblyInfo.cs +++ b/Plugins/Wox.Plugin.WebSearch/Properties/AssemblyInfo.cs @@ -1,36 +1,5 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// 有关程序集的常规信息通过以下 -// 特性集控制。更改这些特性值可修改 -// 与程序集关联的信息。 [assembly: AssemblyTitle("Wox.Plugin.WebSearch")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox.Plugin.WebSearch")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// 将 ComVisible 设置为 false 使此程序集中的类型 -// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, -// 则将该类型上的 ComVisible 特性设置为 true。 -[assembly: ComVisible(false)] - -// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID -[assembly: Guid("42c17706-44ba-4549-ab66-7bd994706cd1")] - -// 程序集的版本信息由下面四个值组成: -// -// 主版本 -// 次版本 -// 生成号 -// 修订号 -// -// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, -// 方法是按如下所示使用“*”: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: Guid("42c17706-44ba-4549-ab66-7bd994706cd1")] \ No newline at end of file diff --git a/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj b/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj index 7bb0a95ac1..667253e6af 100644 --- a/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj +++ b/Plugins/Wox.Plugin.WebSearch/Wox.Plugin.WebSearch.csproj @@ -34,8 +34,8 @@ false - - ..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll + + ..\..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll True @@ -50,6 +50,9 @@ + + Properties\SolutionAssemblyInfo.cs + diff --git a/Plugins/Wox.Plugin.WebSearch/packages.config b/Plugins/Wox.Plugin.WebSearch/packages.config index 0b84f87d4d..64b5d8efe5 100644 --- a/Plugins/Wox.Plugin.WebSearch/packages.config +++ b/Plugins/Wox.Plugin.WebSearch/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/README.md b/README.md index dee8e49ea2..82639722aa 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,6 @@ -Wox [![Build status](https://ci.appveyor.com/api/projects/status/bfktntbivg32e103)](https://ci.appveyor.com/project/qianlifeng/wox) [![Bountysource](https://www.bountysource.com/badge/team?team_id=39433&style=raised)](https://www.bountysource.com/teams/wox?utm_source=Wox&utm_medium=shield&utm_campaign=raised) +Wox [![Build status](https://ci.appveyor.com/api/projects/status/bfktntbivg32e103)](https://ci.appveyor.com/project/qianlifeng/wox) [![Bountysource](https://www.bountysource.com/badge/team?team_id=39433&style=raised)](https://www.bountysource.com/teams/wox?utm_source=Wox&utm_medium=shield&utm_campaign=raised) [![Issue Stats](http://issuestats.com/github/Wox-launcher/Wox/badge/pr)](http://issuestats.com/github/Wox-launcher/Wox) ========= -[Wox](https://www.getwox.com/) is a launcher for Windows, inspired by [Alfred](https://www.alfredapp.com/) and [Launchy](http://www.launchy.net/). You can launch everything with just a few keystrokes!. - -Features -========= -1. Search all applications, folders, files, [bookmarks](https://www.getwox.com/plugin/16). -2. Search Web using keyword (e.g. search google with `g search_term`) -3. Build custom themes in [https://www.getwox.com/theme/builder](https://www.getwox.com/theme/builder) -4. Install plugins from [https://www.getwox.com/plugin](https://www.getwox.com/plugin) +[Wox](http://www.getwox.com/) is a launcher for Windows, an alternative to [Alfred](https://www.alfredapp.com/) or [Launchy](http://www.launchy.net/). You can launch everything with just a few keystrokes! Screenshot ========= @@ -15,6 +8,13 @@ Screenshot More screenshots +Features +========= +1. Search all applications, folders, files, [bookmarks](http://www.getwox.com/plugin/16). +2. Search Web using keyword (e.g. search google with `g search_term`) +3. Build custom themes in [http://www.getwox.com/theme/builder](http://www.getwox.com/theme/builder) +4. Install plugins from [http://www.getwox.com/plugin](http://www.getwox.com/plugin) + Installation ========= @@ -33,7 +33,7 @@ Simple Usage Contribute ========= -If you are a developer, please feel free to send a pull request to the **Dev** branch. We still have a lot of features and bugs to resolve. Take a look at [issues page](https://github.com/Wox-launcher/Wox/issues) if you want to contribute :) +If you are a developer, please feel free to send a pull request to the **Dev** branch. We still have a lot of features and bugs to resolve. Take a look at [issues page](https://github.com/Wox-launcher/Wox/issues), especially for [help_needed](https://github.com/Wox-launcher/Wox/issues?q=is%3Aopen+is%3Aissue+label%3Ahelp_needed) labeled issue. :) If you are not a developer, please install the [Latest build](https://ci.appveyor.com/project/qianlifeng/wox/history) and report bugs (how to: [English](https://github.com/Wox-launcher/Wox/wiki/FAQ-English) [中文](https://github.com/Wox-launcher/Wox/wiki/FAQ-%E4%B8%AD%E6%96%87)). Feedback is always welcome! diff --git a/SolutionAssemblyInfo.cs b/SolutionAssemblyInfo.cs new file mode 100644 index 0000000000..58182e660b --- /dev/null +++ b/SolutionAssemblyInfo.cs @@ -0,0 +1,21 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +#if DEBUG +[assembly: AssemblyConfiguration("Debug")] +[assembly: AssemblyDescription("Debug build, https://github.com/Wox-launcher/Wox")] +#else +[assembly: AssemblyConfiguration("Release")] +[assembly: AssemblyDescription("Release build, https://github.com/Wox-launcher/Wox")] +#endif + +[assembly: AssemblyCompany("Wox-launcher")] +[assembly: AssemblyProduct("Wox")] +[assembly: AssemblyCopyright("The MIT License (MIT)")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: ComVisible(false)] +[assembly: AssemblyVersion("1.2.0")] +[assembly: AssemblyFileVersion("1.2.0.0")] +[assembly: AssemblyInformationalVersion("1.2-beta.2")] \ No newline at end of file diff --git a/Wox.Core/Plugin/PluginInstaller.cs b/Wox.Core/Plugin/PluginInstaller.cs index ce6318a81b..f20f2fd079 100644 --- a/Wox.Core/Plugin/PluginInstaller.cs +++ b/Wox.Core/Plugin/PluginInstaller.cs @@ -1,10 +1,10 @@ using System; using System.Diagnostics; using System.IO; -using System.Windows.Forms; using ICSharpCode.SharpZipLib.Zip; using Newtonsoft.Json; using Wox.Plugin; +using System.Windows; namespace Wox.Core.Plugin { @@ -47,22 +47,24 @@ namespace Wox.Core.Plugin .Replace("*", "_") .Replace("|", "_") + "-" + Guid.NewGuid(); - string newPluginPath = Path.Combine(pluginFolerPath,newPluginName); - string content = string.Format( - "Do you want to install following plugin?\r\n\r\nName: {0}\r\nVersion: {1}\r\nAuthor: {2}", - plugin.Name, plugin.Version, plugin.Author); + string newPluginPath = Path.Combine(pluginFolerPath, newPluginName); + string content = $"Do you want to install following plugin?{Environment.NewLine}{Environment.NewLine}" + + $"Name: {plugin.Name}{Environment.NewLine}" + + $"Version: {plugin.Version}{Environment.NewLine}" + + $"Author: {plugin.Author}"; PluginPair existingPlugin = PluginManager.GetPluginForId(plugin.ID); if (existingPlugin != null) { - content = string.Format( - "Do you want to update following plugin?\r\n\r\nName: {0}\r\nOld Version: {1}\r\nNew Version: {2}\r\nAuthor: {3}", - plugin.Name, existingPlugin.Metadata.Version, plugin.Version, plugin.Author); + content = $"Do you want to update following plugin?{Environment.NewLine}{Environment.NewLine}" + + $"Name: {plugin.Name}{Environment.NewLine}" + + $"Old Version: {existingPlugin.Metadata.Version}" + + $"{Environment.NewLine}New Version: {plugin.Version}" + + $"{Environment.NewLine}Author: {plugin.Author}"; } - DialogResult result = System.Windows.Forms.MessageBox.Show(content, "Install plugin", MessageBoxButtons.YesNo, - MessageBoxIcon.Question); - if (result == DialogResult.Yes) + var result = MessageBox.Show(content, "Install plugin", MessageBoxButton.YesNo, MessageBoxImage.Question); + if (result == MessageBoxResult.Yes) { if (existingPlugin != null && Directory.Exists(existingPlugin.Metadata.PluginDirectory)) { @@ -81,17 +83,11 @@ namespace Wox.Core.Plugin //{ // Plugins.Init(); //} - if (MessageBox.Show("You have installed plugin " + plugin.Name + " successfully.\r\n Restart Wox to take effect?", "Install plugin", - MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) + if (MessageBox.Show($"You have installed plugin {plugin.Name} successfully.{Environment.NewLine}" + + " Restart Wox to take effect?", + "Install plugin", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) { - ProcessStartInfo Info = new ProcessStartInfo(); - Info.Arguments = "/C ping 127.0.0.1 -n 1 && \"" + - System.Windows.Forms.Application.ExecutablePath + "\""; - Info.WindowStyle = ProcessWindowStyle.Hidden; - Info.CreateNoWindow = true; - Info.FileName = "cmd.exe"; - Process.Start(Info); - PluginManager.API.CloseApp(); + PluginManager.API.RestarApp(); } } } @@ -114,7 +110,7 @@ namespace Wox.Core.Plugin } catch (System.Exception) { - string error = string.Format("Parse plugin config {0} failed: json format is not valid", configPath); + string error = $"Parse plugin config {configPath} failed: json format is not valid"; #if (DEBUG) { throw new System.Exception(error); @@ -126,8 +122,7 @@ namespace Wox.Core.Plugin if (!AllowedLanguage.IsAllowed(metadata.Language)) { - string error = string.Format("Parse plugin config {0} failed: invalid language {1}", configPath, - metadata.Language); + string error = $"Parse plugin config {configPath} failed: invalid language {metadata.Language}"; #if (DEBUG) { throw new System.Exception(error); @@ -137,8 +132,7 @@ namespace Wox.Core.Plugin } if (!File.Exists(metadata.ExecuteFilePath)) { - string error = string.Format("Parse plugin config {0} failed: ExecuteFile {1} didn't exist", configPath, - metadata.ExecuteFilePath); + string error = $"Parse plugin config {configPath} failed: ExecuteFile {metadata.ExecuteFilePath} didn't exist"; #if (DEBUG) { throw new System.Exception(error); diff --git a/Wox.Core/Plugin/PluginManager.cs b/Wox.Core/Plugin/PluginManager.cs index db05467dd6..5bcabee4fe 100644 --- a/Wox.Core/Plugin/PluginManager.cs +++ b/Wox.Core/Plugin/PluginManager.cs @@ -79,7 +79,7 @@ namespace Wox.Core.Plugin Concat(new JsonRPCPluginLoader().LoadPlugin(metadatas)); //load plugin i18n languages - ResourceMerger.ApplyPluginLanguages(); + ResourceMerger.UpdatePluginLanguages(); foreach (PluginPair pluginPair in AllPlugins) { diff --git a/Wox.Core/Properties/AssemblyInfo.cs b/Wox.Core/Properties/AssemblyInfo.cs index 0ca99a503a..7a4635b29e 100644 --- a/Wox.Core/Properties/AssemblyInfo.cs +++ b/Wox.Core/Properties/AssemblyInfo.cs @@ -1,36 +1,5 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. [assembly: AssemblyTitle("Wox.Core")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox.Core")] -[assembly: AssemblyCopyright("The MIT License (MIT)")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("693aa0e5-741b-4759-b740-fdbb011a3280")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: Guid("693aa0e5-741b-4759-b740-fdbb011a3280")] \ No newline at end of file diff --git a/Wox.Core/Theme/ITheme.cs b/Wox.Core/Theme/ITheme.cs deleted file mode 100644 index 34409068e6..0000000000 --- a/Wox.Core/Theme/ITheme.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Collections.Generic; - -namespace Wox.Core.Theme -{ - interface ITheme - { - void ChangeTheme(string themeName); - List LoadAvailableThemes(); - } -} diff --git a/Wox.Core/Theme/Theme.cs b/Wox.Core/Theme/Theme.cs index 9d937b51b1..1317b5f9cc 100644 --- a/Wox.Core/Theme/Theme.cs +++ b/Wox.Core/Theme/Theme.cs @@ -3,8 +3,10 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; +using System.Runtime.InteropServices; using System.Windows; using System.Windows.Controls; +using System.Windows.Interop; using System.Windows.Media; using Wox.Core.UI; using Wox.Core.UserSettings; @@ -12,7 +14,7 @@ using Wox.Infrastructure.Logger; namespace Wox.Core.Theme { - public class Theme : IUIResource,ITheme + public class Theme : IUIResource { public const string DirectoryName = "Themes"; private static List themeDirectories = new List(); @@ -55,8 +57,14 @@ namespace Wox.Core.Theme UserSettingStorage.Instance.Theme = themeName; UserSettingStorage.Instance.Save(); + ResourceMerger.UpdateResource(this); - ResourceMerger.ApplyThemeResource(this); + // Exception of FindResource can't be cathed if global exception handle is set + var isBlur = Application.Current.TryFindResource("ThemeBlurEnabled"); + if (isBlur is bool) + { + SetBlurForWindow(Application.Current.MainWindow, (bool)isBlur); + } } public ResourceDictionary GetResourceDictionary() @@ -89,7 +97,6 @@ namespace Wox.Core.Theme Setter[] setters = new Setter[] { fontFamily, fontStyle, fontWeight, fontStretch }; Array.ForEach(new Style[] { resultItemStyle, resultSubItemStyle, resultItemSelectedStyle, resultSubItemSelectedStyle }, o => Array.ForEach(setters, p => o.Setters.Add(p))); } - return dict; } @@ -119,5 +126,77 @@ namespace Wox.Core.Theme return string.Empty; } + + #region Blur Handling + /* + Found on https://github.com/riverar/sample-win10-aeroglass + */ + private enum AccentState + { + ACCENT_DISABLED = 0, + ACCENT_ENABLE_GRADIENT = 1, + ACCENT_ENABLE_TRANSPARENTGRADIENT = 2, + ACCENT_ENABLE_BLURBEHIND = 3, + ACCENT_INVALID_STATE = 4 + } + + [StructLayout(LayoutKind.Sequential)] + private struct AccentPolicy + { + public AccentState AccentState; + public int AccentFlags; + public int GradientColor; + public int AnimationId; + } + + [StructLayout(LayoutKind.Sequential)] + private struct WindowCompositionAttributeData + { + public WindowCompositionAttribute Attribute; + public IntPtr Data; + public int SizeOfData; + } + + private enum WindowCompositionAttribute + { + WCA_ACCENT_POLICY = 19 + } + [DllImport("user32.dll")] + private static extern int SetWindowCompositionAttribute(IntPtr hwnd, ref WindowCompositionAttributeData data); + + /// + /// Sets the blur for a window via SetWindowCompositionAttribute + /// + /// window to blur + /// true/false - on or off correspondingly + private void SetBlurForWindow(Window wind, bool isBlur) + { + if (isBlur) + { + SetWindowAccent(wind, AccentState.ACCENT_ENABLE_BLURBEHIND); + } + } + + private void SetWindowAccent(Window wind, AccentState themeAccentMode) + { + var windowHelper = new WindowInteropHelper(wind); + var accent = new AccentPolicy { AccentState = themeAccentMode }; + var accentStructSize = Marshal.SizeOf(accent); + + var accentPtr = Marshal.AllocHGlobal(accentStructSize); + Marshal.StructureToPtr(accent, accentPtr, false); + + var data = new WindowCompositionAttributeData + { + Attribute = WindowCompositionAttribute.WCA_ACCENT_POLICY, + SizeOfData = accentStructSize, + Data = accentPtr + }; + + SetWindowCompositionAttribute(windowHelper.Handle, ref data); + + Marshal.FreeHGlobal(accentPtr); + } + #endregion } } diff --git a/Wox.Core/UI/ResourceMerger.cs b/Wox.Core/UI/ResourceMerger.cs index 2be07e50c6..9ce07a97ee 100644 --- a/Wox.Core/UI/ResourceMerger.cs +++ b/Wox.Core/UI/ResourceMerger.cs @@ -1,4 +1,5 @@ using System; +using System.IO; using System.Linq; using System.Windows; using Wox.Core.i18n; @@ -9,34 +10,34 @@ namespace Wox.Core.UI { public static class ResourceMerger { - private static void RemoveResource(string resourceDirectoryName) + private static void RemoveResource(string directoryName) { - var mergedDictionaries = Application.Current.Resources.MergedDictionaries; - foreach (var resource in mergedDictionaries) + directoryName = $"{Path.DirectorySeparatorChar}{directoryName}"; + var dictionaries = Application.Current.Resources.MergedDictionaries; + foreach (var resource in dictionaries) { - int directoryPosition = resource.Source.Segments.Length - 2; - string currentDirectoryName = resource.Source.Segments[directoryPosition]; - if (currentDirectoryName == resourceDirectoryName) + string currentDirectoryName = Path.GetDirectoryName(resource.Source.AbsolutePath); + if (currentDirectoryName == directoryName) { - mergedDictionaries.Remove(resource); + dictionaries.Remove(resource); break; } } } - public static void ApplyThemeResource(Theme.Theme t) + public static void UpdateResource(Theme.Theme t) { RemoveResource(Theme.Theme.DirectoryName); Application.Current.Resources.MergedDictionaries.Add(t.GetResourceDictionary()); } - public static void ApplyLanguageResources(Internationalization i) + public static void UpdateResources(Internationalization i) { RemoveResource(Internationalization.DirectoryName); Application.Current.Resources.MergedDictionaries.Add(i.GetResourceDictionary()); } - internal static void ApplyPluginLanguages() + internal static void UpdatePluginLanguages() { RemoveResource(PluginManager.DirectoryName); foreach (var languageFile in PluginManager.GetPluginsForInterface(). diff --git a/Wox.Core/Updater/UpdaterManager.cs b/Wox.Core/Updater/UpdaterManager.cs index 65778896a0..b9284a5caa 100644 --- a/Wox.Core/Updater/UpdaterManager.cs +++ b/Wox.Core/Updater/UpdaterManager.cs @@ -18,7 +18,7 @@ namespace Wox.Core.Updater public class UpdaterManager { private static UpdaterManager instance; - private const string VersionCheckURL = "https://api.getwox.com/release/latest/"; + private const string VersionCheckURL = "http://api.getwox.com/release/latest/"; private const string UpdateFeedURL = "http://upgrade.getwox.com/update.xml"; //private const string UpdateFeedURL = "http://127.0.0.1:8888/update.xml"; private static SemanticVersion currentVersion; diff --git a/Wox.Core/UserSettings/UserSettingStorage.cs b/Wox.Core/UserSettings/UserSettingStorage.cs index 32b3a20cc7..13017c6ea1 100644 --- a/Wox.Core/UserSettings/UserSettingStorage.cs +++ b/Wox.Core/UserSettings/UserSettingStorage.cs @@ -117,6 +117,8 @@ namespace Wox.Core.UserSettings get { return "config"; } } + + public void IncreaseActivateTimes() { ActivateTimes++; diff --git a/Wox.Core/Wox.Core.csproj b/Wox.Core/Wox.Core.csproj index 95315cf378..6856a93632 100644 --- a/Wox.Core/Wox.Core.csproj +++ b/Wox.Core/Wox.Core.csproj @@ -42,8 +42,8 @@ ..\packages\NAppUpdate.Framework.0.3.2.0\lib\net20\NAppUpdate.Framework.dll True - - ..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll True @@ -57,6 +57,9 @@ + + Properties\SolutionAssemblyInfo.cs + @@ -67,7 +70,6 @@ - diff --git a/Wox.Core/i18n/AvailableLanguages.cs b/Wox.Core/i18n/AvailableLanguages.cs index 3879fc9cd8..6523829430 100644 --- a/Wox.Core/i18n/AvailableLanguages.cs +++ b/Wox.Core/i18n/AvailableLanguages.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace Wox.Core.i18n { @@ -8,6 +8,7 @@ namespace Wox.Core.i18n public static Language Chinese = new Language("zh-cn", "中文"); public static Language Chinese_TW = new Language("zh-tw", "中文(繁体)"); public static Language Russian = new Language("ru", "Русский"); + public static Language French = new Language("fr", "Français"); public static List GetAvailableLanguages() { @@ -17,6 +18,7 @@ namespace Wox.Core.i18n Chinese, Chinese_TW, Russian, + French, }; return languages; } diff --git a/Wox.Core/i18n/Internationalization.cs b/Wox.Core/i18n/Internationalization.cs index 0cfea890a3..f2ad412da2 100644 --- a/Wox.Core/i18n/Internationalization.cs +++ b/Wox.Core/i18n/Internationalization.cs @@ -70,7 +70,7 @@ namespace Wox.Core.i18n UserSettingStorage.Instance.Language = language.LanguageCode; UserSettingStorage.Instance.Save(); - ResourceMerger.ApplyLanguageResources(this); + ResourceMerger.UpdateResources(this); } public ResourceDictionary GetResourceDictionary() @@ -88,20 +88,15 @@ namespace Wox.Core.i18n public string GetTranslation(string key) { - try + var translation = Application.Current.TryFindResource(key); + if (translation is string) { - object translation = Application.Current.FindResource(key); - if (translation == null) - { - return "NoTranslation"; - } return translation.ToString(); } - catch + else { return "NoTranslation"; } - } private string GetLanguagePath(string languageCode) diff --git a/Wox.Core/packages.config b/Wox.Core/packages.config index 93b11a0396..0a18f6284d 100644 --- a/Wox.Core/packages.config +++ b/Wox.Core/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/Wox.CrashReporter/Properties/AssemblyInfo.cs b/Wox.CrashReporter/Properties/AssemblyInfo.cs index 3a41b0898d..87313ef761 100644 --- a/Wox.CrashReporter/Properties/AssemblyInfo.cs +++ b/Wox.CrashReporter/Properties/AssemblyInfo.cs @@ -1,19 +1,5 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// 有关程序集的常规信息通过以下 -// 特性集控制。更改这些特性值可修改 -// 与程序集关联的信息。 [assembly: AssemblyTitle("Wox.CrashReporter")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox.CrashReporter")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: ComVisible(false)] -[assembly: Guid("0ea3743c-2c0d-4b13-b9ce-e5e1f85aea23")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file +[assembly: Guid("0ea3743c-2c0d-4b13-b9ce-e5e1f85aea23")] \ No newline at end of file diff --git a/Wox.CrashReporter/Wox.CrashReporter.csproj b/Wox.CrashReporter/Wox.CrashReporter.csproj index dd3f3b3160..9bb3e653d6 100644 --- a/Wox.CrashReporter/Wox.CrashReporter.csproj +++ b/Wox.CrashReporter/Wox.CrashReporter.csproj @@ -54,6 +54,9 @@ + + Properties\SolutionAssemblyInfo.cs + diff --git a/Wox.Infrastructure/Properties/AssemblyInfo.cs b/Wox.Infrastructure/Properties/AssemblyInfo.cs index 092a409147..a75487010a 100644 --- a/Wox.Infrastructure/Properties/AssemblyInfo.cs +++ b/Wox.Infrastructure/Properties/AssemblyInfo.cs @@ -1,17 +1,5 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - [assembly: AssemblyTitle("Wox.Infrastructure")] -[assembly: AssemblyDescription("https://github.com/qianlifeng/Wox")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox.Infrastructure")] -[assembly: AssemblyCopyright("The MIT License (MIT)")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: ComVisible(false)] -[assembly: Guid("aee57a31-29e5-4f03-a41f-7917910fe90f")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file +[assembly: Guid("aee57a31-29e5-4f03-a41f-7917910fe90f")] \ No newline at end of file diff --git a/Wox.Infrastructure/Wox.Infrastructure.csproj b/Wox.Infrastructure/Wox.Infrastructure.csproj index 279aa3a4e3..070d2992b3 100644 --- a/Wox.Infrastructure/Wox.Infrastructure.csproj +++ b/Wox.Infrastructure/Wox.Infrastructure.csproj @@ -36,8 +36,8 @@ false - - ..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll True @@ -50,6 +50,9 @@ + + Properties\SolutionAssemblyInfo.cs + diff --git a/Wox.Infrastructure/packages.config b/Wox.Infrastructure/packages.config index 3023f2583f..1a48622862 100644 --- a/Wox.Infrastructure/packages.config +++ b/Wox.Infrastructure/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/Wox.Plugin/IPublicAPI.cs b/Wox.Plugin/IPublicAPI.cs index e4ebb3f96b..1672ec9919 100644 --- a/Wox.Plugin/IPublicAPI.cs +++ b/Wox.Plugin/IPublicAPI.cs @@ -51,6 +51,11 @@ namespace Wox.Plugin /// void CloseApp(); + /// + /// Restart Wox + /// + void RestarApp(); + /// /// Hide Wox /// diff --git a/Wox.Plugin/Properties/AssemblyInfo.cs b/Wox.Plugin/Properties/AssemblyInfo.cs index a7fb46756c..a5d51b0033 100644 --- a/Wox.Plugin/Properties/AssemblyInfo.cs +++ b/Wox.Plugin/Properties/AssemblyInfo.cs @@ -3,18 +3,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Wox.Plugin")] -[assembly: AssemblyDescription("https://github.com/qianlifeng/Wox")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox.Plugin")] -[assembly: AssemblyCopyright("The MIT License (MIT)")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: ComVisible(false)] [assembly: Guid("c22be00d-a6f5-4e45-8ecc-09ebf297c812")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] - [assembly: InternalsVisibleTo("Wox")] [assembly: InternalsVisibleTo("Wox.Core")] [assembly: InternalsVisibleTo("Wox.Test")] diff --git a/Wox.Plugin/Wox.Plugin.csproj b/Wox.Plugin/Wox.Plugin.csproj index 5c4fb10f00..559f6cf463 100644 --- a/Wox.Plugin/Wox.Plugin.csproj +++ b/Wox.Plugin/Wox.Plugin.csproj @@ -42,6 +42,9 @@ + + Properties\SolutionAssemblyInfo.cs + diff --git a/Wox.Test/Properties/AssemblyInfo.cs b/Wox.Test/Properties/AssemblyInfo.cs index 799c988baf..e92ae08bb7 100644 --- a/Wox.Test/Properties/AssemblyInfo.cs +++ b/Wox.Test/Properties/AssemblyInfo.cs @@ -1,36 +1,5 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// 有关程序集的常规信息通过以下 -// 特性集控制。更改这些特性值可修改 -// 与程序集关联的信息。 [assembly: AssemblyTitle("Wox.Test")] -[assembly: AssemblyDescription("https://github.com/qianlifeng/Wox")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox.Test")] -[assembly: AssemblyCopyright("The MIT License (MIT)")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// 将 ComVisible 设置为 false 使此程序集中的类型 -// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, -// 则将该类型上的 ComVisible 特性设置为 true。 -[assembly: ComVisible(false)] - -// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID -[assembly: Guid("c42c2b1b-ead4-498c-a06d-7cbde85760e4")] - -// 程序集的版本信息由下面四个值组成: -// -// 主版本 -// 次版本 -// 生成号 -// 修订号 -// -// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, -// 方法是按如下所示使用“*”: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: Guid("c42c2b1b-ead4-498c-a06d-7cbde85760e4")] \ No newline at end of file diff --git a/Wox.Test/Wox.Test.csproj b/Wox.Test/Wox.Test.csproj index 867c3ac771..e1b65e45b5 100644 --- a/Wox.Test/Wox.Test.csproj +++ b/Wox.Test/Wox.Test.csproj @@ -45,6 +45,9 @@ + + Properties\SolutionAssemblyInfo.cs + diff --git a/Wox.UpdateFeedGenerator/Properties/AssemblyInfo.cs b/Wox.UpdateFeedGenerator/Properties/AssemblyInfo.cs index d0f4268282..33c0c07f30 100644 --- a/Wox.UpdateFeedGenerator/Properties/AssemblyInfo.cs +++ b/Wox.UpdateFeedGenerator/Properties/AssemblyInfo.cs @@ -1,36 +1,5 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// 有关程序集的常规信息通过以下 -// 特性集控制。更改这些特性值可修改 -// 与程序集关联的信息。 [assembly: AssemblyTitle("Wox.UpdateFeedGenerator")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox.UpdateFeedGenerator")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// 将 ComVisible 设置为 false 使此程序集中的类型 -// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, -// 则将该类型上的 ComVisible 特性设置为 true。 -[assembly: ComVisible(false)] - -// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID -[assembly: Guid("2f3420c0-2c21-4f71-a45d-a47b5305fe20")] - -// 程序集的版本信息由下面四个值组成: -// -// 主版本 -// 次版本 -// 生成号 -// 修订号 -// -// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, -// 方法是按如下所示使用“*”: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: Guid("2f3420c0-2c21-4f71-a45d-a47b5305fe20")] \ No newline at end of file diff --git a/Wox.UpdateFeedGenerator/Wox.UpdateFeedGenerator.csproj b/Wox.UpdateFeedGenerator/Wox.UpdateFeedGenerator.csproj index b05de76110..b4f7c27f2d 100644 --- a/Wox.UpdateFeedGenerator/Wox.UpdateFeedGenerator.csproj +++ b/Wox.UpdateFeedGenerator/Wox.UpdateFeedGenerator.csproj @@ -40,8 +40,8 @@ ..\packages\NAppUpdate.Framework.0.3.2.0\lib\net20\NAppUpdate.Framework.dll True - - ..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll True @@ -52,6 +52,9 @@ + + Properties\SolutionAssemblyInfo.cs + diff --git a/Wox.UpdateFeedGenerator/packages.config b/Wox.UpdateFeedGenerator/packages.config index 23f4f18934..aba1c6d1b0 100644 --- a/Wox.UpdateFeedGenerator/packages.config +++ b/Wox.UpdateFeedGenerator/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/Wox.sln b/Wox.sln index d50b7e3b37..5d162ebc43 100644 --- a/Wox.sln +++ b/Wox.sln @@ -61,6 +61,16 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.UpdateFeedGenerator", " EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.Everything", "Plugins\Wox.Plugin.Everything\Wox.Plugin.Everything.csproj", "{230AE83F-E92E-4E69-8355-426B305DA9C0}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FFD651C7-0546-441F-BC8C-D4EE8FD01EA7}" + ProjectSection(SolutionItems) = preProject + .gitattributes = .gitattributes + .gitignore = .gitignore + appveyor.yml = appveyor.yml + LICENSE = LICENSE + README.md = README.md + SolutionAssemblyInfo.cs = SolutionAssemblyInfo.cs + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/Wox/App.xaml.cs b/Wox/App.xaml.cs index 4e87e6a4db..2d950b6892 100644 --- a/Wox/App.xaml.cs +++ b/Wox/App.xaml.cs @@ -50,10 +50,16 @@ namespace Wox AppDomain.CurrentDomain.UnhandledException += ErrorReporting.UnhandledExceptionHandle; } - public bool OnActivate(IList args) + public void OnActivate(IList args) { - CommandArgsFactory.Execute(args); - return true; + if (args.Count > 0 && args[0] == SingleInstance.Restart) + { + Window.CloseApp(); + } + else + { + CommandArgsFactory.Execute(args); + } } } } diff --git a/Wox/CommandArgs/CommandArgsFactory.cs b/Wox/CommandArgs/CommandArgsFactory.cs index 7f2fdfc98b..e6e4a91b74 100644 --- a/Wox/CommandArgs/CommandArgsFactory.cs +++ b/Wox/CommandArgs/CommandArgsFactory.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; +using Wox.Helper; namespace Wox.CommandArgs { @@ -20,7 +21,8 @@ namespace Wox.CommandArgs public static void Execute(IList args) { - if (args.Count > 0) + // todo restart command line args? + if (args.Count > 0 && args[0] != SingleInstance.Restart) { string command = args[0]; ICommandArg cmd = commandArgs.FirstOrDefault(o => o.Command.ToLower() == command); diff --git a/Wox/Helper/SingleInstance.cs b/Wox/Helper/SingleInstance.cs index c01d7e1085..c62fefc0ad 100644 --- a/Wox/Helper/SingleInstance.cs +++ b/Wox/Helper/SingleInstance.cs @@ -1,14 +1,4 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// -// This class checks to make sure that only one instance of -// this application is running at a time. -// -//----------------------------------------------------------------------- - -using System; +using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; @@ -23,7 +13,8 @@ using System.Threading; using System.Windows; using System.Windows.Threading; -//http://blogs.microsoft.co.il/arik/2010/05/28/wpf-single-instance-application/ +// http://blogs.microsoft.co.il/arik/2010/05/28/wpf-single-instance-application/ +// modified to allow single instace restart namespace Wox.Helper { internal enum WM @@ -194,7 +185,7 @@ namespace Wox.Helper public interface ISingleInstanceApp { - bool OnActivate(IList args); + void OnActivate(IList args); } /// @@ -212,6 +203,8 @@ namespace Wox.Helper where TApplication: Application , ISingleInstanceApp { + public const string Restart = "Restart"; + #region Private Fields /// @@ -237,7 +230,7 @@ namespace Wox.Helper /// /// Application mutex. /// - private static Mutex singleInstanceMutex; + internal static Mutex singleInstanceMutex; /// /// IPC channel for communications. @@ -273,6 +266,8 @@ namespace Wox.Helper public static bool InitializeAsFirstInstance( string uniqueName ) { commandLineArgs = GetCommandLineArgs(uniqueName); + //remove execute path itself + commandLineArgs.RemoveAt(0); // Build unique application Id and the IPC channel name. string applicationIdentifier = uniqueName + Environment.UserName; @@ -285,13 +280,21 @@ namespace Wox.Helper if (firstInstance) { CreateRemoteService(channelName); + return true; + } + // Restart + else if (commandLineArgs.Count > 0 && commandLineArgs[0] == Restart) + { + SignalFirstInstance(channelName, commandLineArgs); + singleInstanceMutex.WaitOne(TimeSpan.FromSeconds(10)); + CreateRemoteService(channelName); + return true; } else { SignalFirstInstance(channelName, commandLineArgs); + return false; } - - return firstInstance; } /// @@ -299,11 +302,7 @@ namespace Wox.Helper /// public static void Cleanup() { - if (singleInstanceMutex != null) - { - singleInstanceMutex.Close(); - singleInstanceMutex = null; - } + singleInstanceMutex?.ReleaseMutex(); if (channel != null) { @@ -442,8 +441,7 @@ namespace Wox.Helper { return; } - //remove execute path itself - args.RemoveAt(0); + ((TApplication)Application.Current).OnActivate(args); } diff --git a/Wox/Languages/en.xaml b/Wox/Languages/en.xaml index 71b8cccf6a..8040ad6bc7 100644 --- a/Wox/Languages/en.xaml +++ b/Wox/Languages/en.xaml @@ -44,6 +44,7 @@ Window Mode Opacity + Hotkey Wox Hotkey diff --git a/Wox/Languages/fr.xaml b/Wox/Languages/fr.xaml new file mode 100644 index 0000000000..839fae4f23 --- /dev/null +++ b/Wox/Languages/fr.xaml @@ -0,0 +1,128 @@ + + + Échec lors de l'enregistrement du raccourci : {0} + Impossible de lancer {0} + Le format de fichier n'est pas un plugin wox valide + Définir en tant que favori pour cette requête + Annuler le favori + Lancer la requête : {0} + Dernière exécution : {0} + Ouvrir + Paramètres + À propos + Quitter + + + Paramètres - Wox + Général + Lancer Wox au démarrage du système + Cacher Wox lors de la perte de focus + Ne pas afficher le message de mise à jour pour les nouvelles versions + Se souvenir du dernier emplacement de la fenêtre + Langue + Résultats à afficher + Ignore les raccourcis lorsqu'une application est en plein écran + + + Modules + Trouver plus de modules + Désactivé + Mot-clé d'action : + Répertoire + Auteur + Chargement : {0}ms + Utilisation : {0}ms + + + Thème + Trouver plus de thèmes + Hello Wox + Police (barre de recherche) + Police (liste des résultats) + Mode fenêtré + Opacité + + + Raccourcis + Ouvrir Wox + Requêtes personnalisées + Supprimer + Éditer + Ajouter + Veuillez sélectionner un élément + Voulez-vous vraiment supprimer {0} raccourci(s) ? + + + Proxy + Activer le proxy + Serveur + Port + Utilisateur + Mot de passe + Tester + Sauvegarder + Un serveur doit être indiqué + Un port doit être indiqué + Format invalide pour : port + Proxy sauvegardé avec succès + Le proxy est valide + Connection au proxy échouée + + + À propos + Site Web + Version + Vous avez utilisé Wox {0} fois + + + Ancien mot-clé d'action + Nouveau mot-clé d'action + Annuler + Terminé + Impossible de trouver le module spécifié + Le nouveau mot-clé d'action doit être spécifié + Le nouveau mot-clé d'action a été assigné à un autre module, veuillez en choisir un autre + Ajouté + Utilisez * si vous ne souhaitez pas utiliser de mot-clé spécifique + + + + Aperçu + Le raccourci n'est pas disponible, choisissez en un autre + Raccourci invalide + Actualiser + + + Raccourci non disponible + + + + Version + Time + Please tell us how application crashed so we can fix it + Send Report + Cancel + General + Exceptions + Exception Type + Source + Stack Trace + Sending + Report succeed + Report failed + Wox a rencontré une erreur + + + Wox version v{0} est disponible + Une erreur s'est produite lors de l'installation de la mise à jour + Mettre à jour + Annuler + Wox doit redémarrer pour installer cette mise à jour + Les fichiers suivants seront mis à jour + Fichiers mis à jour + Description de la mise à jour + + + \ No newline at end of file diff --git a/Wox/Languages/zh-cn.xaml b/Wox/Languages/zh-cn.xaml index 0823b5f3e0..40860846b0 100644 --- a/Wox/Languages/zh-cn.xaml +++ b/Wox/Languages/zh-cn.xaml @@ -43,7 +43,7 @@ 结果项字体 窗口模式 透明度 - + 热键 Wox激活热键 diff --git a/Wox/MainWindow.xaml b/Wox/MainWindow.xaml index e3754d4119..e4873a677a 100644 --- a/Wox/MainWindow.xaml +++ b/Wox/MainWindow.xaml @@ -13,7 +13,9 @@ AllowDrop="True" ShowInTaskbar="False" Style="{DynamicResource WindowStyle}" - Icon="Images\app.png"> + Icon="Images\app.png" + AllowsTransparency="True" + > + notifyIcon.Visible = false; + Application.Current.Shutdown(); + } + + public void RestarApp() + { + ProcessStartInfo info = new ProcessStartInfo { - notifyIcon.Visible = false; - Close(); - Environment.Exit(0); - })); + FileName = Application.ResourceAssembly.Location, + Arguments = SingleInstance.Restart + }; + Process.Start(info); } public void HideApp() @@ -198,16 +199,12 @@ namespace Wox pnlResult.ItemDropEvent += pnlResult_ItemDropEvent; pnlContextMenu.LeftMouseClickEvent += SelectResult; pnlResult.RightMouseClickEvent += pnlResult_RightMouseClickEvent; + Closing += MainWindow_Closing; - ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme); - InternationalizationManager.Instance.ChangeLanguage(UserSettingStorage.Instance.Language); SetHotkey(UserSettingStorage.Instance.Hotkey, OnHotkey); SetCustomPluginHotkey(); InitialTray(); - - Closing += MainWindow_Closing; - } void pnlResult_ItemDropEvent(Result result, IDataObject dropDataObject, DragEventArgs args) @@ -250,6 +247,9 @@ namespace Wox private void MainWindow_OnLoaded(object sender, RoutedEventArgs e) { + ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme); + InternationalizationManager.Instance.ChangeLanguage(UserSettingStorage.Instance.Language); + Left = GetWindowsLeft(); Top = GetWindowsTop(); diff --git a/Wox/Properties/AssemblyInfo.cs b/Wox/Properties/AssemblyInfo.cs index b4d5aea913..aebbd6d320 100644 --- a/Wox/Properties/AssemblyInfo.cs +++ b/Wox/Properties/AssemblyInfo.cs @@ -1,23 +1,9 @@ using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; using System.Windows; - [assembly: AssemblyTitle("Wox")] -[assembly: AssemblyDescription("https://github.com/qianlifeng/Wox")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Wox")] -[assembly: AssemblyCopyright("The MIT License (MIT)")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] -[assembly: ComVisible(false)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly )] -[assembly: AssemblyVersion("1.1.0")] -[assembly: AssemblyFileVersion("1.1.0")] [assembly: Exceptionless.Configuration.Exceptionless("e0b256fbe9384498ba89aae2a6b7f8ab")] \ No newline at end of file diff --git a/Wox/SettingWindow.xaml.cs b/Wox/SettingWindow.xaml.cs index 4546d8f797..36e8b7f3a1 100644 --- a/Wox/SettingWindow.xaml.cs +++ b/Wox/SettingWindow.xaml.cs @@ -440,9 +440,7 @@ namespace Wox private void ThemeComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { string themeName = themeComboBox.SelectedItem.ToString(); - UserSettingStorage.Instance.Theme = themeName; - DelayChangeTheme(); - UserSettingStorage.Instance.Save(); + ThemeManager.Theme.ChangeTheme(themeName); } private void CbQueryBoxFont_OnSelectionChanged(object sender, SelectionChangedEventArgs e) @@ -451,16 +449,8 @@ namespace Wox string queryBoxFontName = cbQueryBoxFont.SelectedItem.ToString(); UserSettingStorage.Instance.QueryBoxFont = queryBoxFontName; this.cbQueryBoxFontFaces.SelectedItem = ((FontFamily)cbQueryBoxFont.SelectedItem).ChooseRegularFamilyTypeface(); - DelayChangeTheme(); UserSettingStorage.Instance.Save(); - } - - private void DelayChangeTheme() - { - Dispatcher.DelayInvoke("delayChangeTheme", () => - { - ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme); - }, TimeSpan.FromMilliseconds(100)); + ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme); } private void CbQueryBoxFontFaces_OnSelectionChanged(object sender, SelectionChangedEventArgs e) @@ -480,7 +470,7 @@ namespace Wox UserSettingStorage.Instance.QueryBoxFontWeight = typeface.Weight.ToString(); UserSettingStorage.Instance.QueryBoxFontStyle = typeface.Style.ToString(); UserSettingStorage.Instance.Save(); - DelayChangeTheme(); + ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme); } } @@ -490,9 +480,8 @@ namespace Wox string resultItemFont = cbResultItemFont.SelectedItem.ToString(); UserSettingStorage.Instance.ResultItemFont = resultItemFont; this.cbResultItemFontFaces.SelectedItem = ((FontFamily)cbResultItemFont.SelectedItem).ChooseRegularFamilyTypeface(); - UserSettingStorage.Instance.Save(); - DelayChangeTheme(); + ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme); } private void CbResultItemFontFaces_OnSelectionChanged(object sender, SelectionChangedEventArgs e) @@ -510,7 +499,7 @@ namespace Wox UserSettingStorage.Instance.ResultItemFontWeight = typeface.Weight.ToString(); UserSettingStorage.Instance.ResultItemFontStyle = typeface.Style.ToString(); UserSettingStorage.Instance.Save(); - DelayChangeTheme(); + ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme); } } diff --git a/Wox/Themes/BlurBlack.xaml b/Wox/Themes/BlurBlack.xaml new file mode 100644 index 0000000000..dc1c5ec540 --- /dev/null +++ b/Wox/Themes/BlurBlack.xaml @@ -0,0 +1,58 @@ + + + + + + True + + + + + + + + + + + + + + + #356ef3 + + + + + + diff --git a/Wox/Themes/BlurWhite.xaml b/Wox/Themes/BlurWhite.xaml new file mode 100644 index 0000000000..f7dbaceab5 --- /dev/null +++ b/Wox/Themes/BlurWhite.xaml @@ -0,0 +1,58 @@ + + + + + + True + + + + + + + + + + + + + + + #356ef3 + + + + + + diff --git a/Wox/Themes/Dark.xaml b/Wox/Themes/Dark.xaml index e2d1679787..1b3d31f509 100644 --- a/Wox/Themes/Dark.xaml +++ b/Wox/Themes/Dark.xaml @@ -14,6 +14,8 @@ + + diff --git a/Wox/Wox.csproj b/Wox/Wox.csproj index 24d22a56b1..52f54db55c 100644 --- a/Wox/Wox.csproj +++ b/Wox/Wox.csproj @@ -76,8 +76,8 @@ ..\packages\MarkdownSharp.1.13.0.0\lib\35\MarkdownSharp.dll True - - ..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll True @@ -114,6 +114,9 @@ + + Properties\SolutionAssemblyInfo.cs + @@ -217,6 +220,11 @@ Designer PreserveNewest + + MSBuild:Compile + Designer + PreserveNewest + MSBuild:Compile Designer @@ -272,6 +280,16 @@ Designer PreserveNewest + + MSBuild:Compile + Designer + PreserveNewest + + + MSBuild:Compile + Designer + PreserveNewest + Designer MSBuild:Compile diff --git a/Wox/packages.config b/Wox/packages.config index ed8b710f14..c9c320e58b 100644 --- a/Wox/packages.config +++ b/Wox/packages.config @@ -3,7 +3,7 @@ - + diff --git a/appveyor.yml b/appveyor.yml index 935d638447..d281487a50 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 1.2.0.{build} +version: 1.2.{build} os: Visual Studio 2015 configuration: Release platform: Any CPU @@ -7,7 +7,7 @@ assembly_info: file: AssemblyInfo.* assembly_version: '{version}' assembly_file_version: '{version}' - assembly_informational_version: '{version}-$(APPVEYOR_REPO_COMMIT)' + assembly_informational_version: '{version}-beta.2-$(APPVEYOR_REPO_COMMIT)' before_build: - ps: nuget restore build: