diff --git a/Plugins/HelloWorldCSharp/App.config b/Plugins/HelloWorldCSharp/App.config deleted file mode 100644 index 88fa4027b..000000000 --- a/Plugins/HelloWorldCSharp/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Plugins/HelloWorldCSharp/HelloWorldCSharp.csproj b/Plugins/HelloWorldCSharp/HelloWorldCSharp.csproj index 46006f098..827c74170 100644 --- a/Plugins/HelloWorldCSharp/HelloWorldCSharp.csproj +++ b/Plugins/HelloWorldCSharp/HelloWorldCSharp.csproj @@ -9,9 +9,9 @@ Properties HelloWorldCSharp HelloWorldCSharp - v4.5.2 + v4.6.2 512 - true + AnyCPU @@ -52,7 +52,6 @@ - PreserveNewest diff --git a/Plugins/Wox.Plugin.BrowserBookmark/Wox.Plugin.BrowserBookmark.csproj b/Plugins/Wox.Plugin.BrowserBookmark/Wox.Plugin.BrowserBookmark.csproj index 413b0aec7..56456892d 100644 --- a/Plugins/Wox.Plugin.BrowserBookmark/Wox.Plugin.BrowserBookmark.csproj +++ b/Plugins/Wox.Plugin.BrowserBookmark/Wox.Plugin.BrowserBookmark.csproj @@ -9,7 +9,7 @@ Properties Wox.Plugin.BrowserBookmark Wox.Plugin.BrowserBookmark - v4.5.2 + v4.6.2 512 ..\..\ true diff --git a/Plugins/Wox.Plugin.BrowserBookmark/app.config b/Plugins/Wox.Plugin.BrowserBookmark/app.config index 376ff2d53..3b7c7ed0a 100644 --- a/Plugins/Wox.Plugin.BrowserBookmark/app.config +++ b/Plugins/Wox.Plugin.BrowserBookmark/app.config @@ -1,22 +1,22 @@ - + -
+
- + - + - - + + - \ No newline at end of file + diff --git a/Plugins/Wox.Plugin.Calculator/Wox.Plugin.Calculator.csproj b/Plugins/Wox.Plugin.Calculator/Wox.Plugin.Calculator.csproj index f24ad118e..06d476ef4 100644 --- a/Plugins/Wox.Plugin.Calculator/Wox.Plugin.Calculator.csproj +++ b/Plugins/Wox.Plugin.Calculator/Wox.Plugin.Calculator.csproj @@ -9,7 +9,7 @@ Properties Wox.Plugin.Caculator Wox.Plugin.Caculator - v4.5.2 + v4.6.2 512 ..\..\ diff --git a/Plugins/Wox.Plugin.Color/Wox.Plugin.Color.csproj b/Plugins/Wox.Plugin.Color/Wox.Plugin.Color.csproj index ca75ed8f3..c7cbc29e5 100644 --- a/Plugins/Wox.Plugin.Color/Wox.Plugin.Color.csproj +++ b/Plugins/Wox.Plugin.Color/Wox.Plugin.Color.csproj @@ -9,7 +9,7 @@ Properties Wox.Plugin.Color Wox.Plugin.Color - v4.5.2 + v4.6.2 512 diff --git a/Plugins/Wox.Plugin.ControlPanel/Wox.Plugin.ControlPanel.csproj b/Plugins/Wox.Plugin.ControlPanel/Wox.Plugin.ControlPanel.csproj index 711cb8e29..97cdc8c02 100644 --- a/Plugins/Wox.Plugin.ControlPanel/Wox.Plugin.ControlPanel.csproj +++ b/Plugins/Wox.Plugin.ControlPanel/Wox.Plugin.ControlPanel.csproj @@ -9,7 +9,7 @@ Properties Wox.Plugin.ControlPanel Wox.Plugin.ControlPanel - v4.5.2 + v4.6.2 512 diff --git a/Plugins/Wox.Plugin.Everything/Wox.Plugin.Everything.csproj b/Plugins/Wox.Plugin.Everything/Wox.Plugin.Everything.csproj index 2ec791bf8..65f4e45e5 100644 --- a/Plugins/Wox.Plugin.Everything/Wox.Plugin.Everything.csproj +++ b/Plugins/Wox.Plugin.Everything/Wox.Plugin.Everything.csproj @@ -9,7 +9,7 @@ Properties Wox.Plugin.Everything Wox.Plugin.Everything - v4.5.2 + v4.6.2 512 ..\Wox\ diff --git a/Plugins/Wox.Plugin.Folder/Wox.Plugin.Folder.csproj b/Plugins/Wox.Plugin.Folder/Wox.Plugin.Folder.csproj index a75fa0ba9..338e550d5 100644 --- a/Plugins/Wox.Plugin.Folder/Wox.Plugin.Folder.csproj +++ b/Plugins/Wox.Plugin.Folder/Wox.Plugin.Folder.csproj @@ -9,7 +9,7 @@ Properties Wox.Plugin.Folder Wox.Plugin.Folder - v4.5.2 + v4.6.2 512 ..\..\ diff --git a/Plugins/Wox.Plugin.PluginIndicator/Wox.Plugin.PluginIndicator.csproj b/Plugins/Wox.Plugin.PluginIndicator/Wox.Plugin.PluginIndicator.csproj index 709016b06..2de1309cd 100644 --- a/Plugins/Wox.Plugin.PluginIndicator/Wox.Plugin.PluginIndicator.csproj +++ b/Plugins/Wox.Plugin.PluginIndicator/Wox.Plugin.PluginIndicator.csproj @@ -9,7 +9,7 @@ Properties Wox.Plugin.PluginIndicator Wox.Plugin.PluginIndicator - v4.5.2 + v4.6.2 512 diff --git a/Plugins/Wox.Plugin.PluginManagement/Wox.Plugin.PluginManagement.csproj b/Plugins/Wox.Plugin.PluginManagement/Wox.Plugin.PluginManagement.csproj index d963ea367..dcf77f487 100644 --- a/Plugins/Wox.Plugin.PluginManagement/Wox.Plugin.PluginManagement.csproj +++ b/Plugins/Wox.Plugin.PluginManagement/Wox.Plugin.PluginManagement.csproj @@ -9,7 +9,7 @@ Properties Wox.Plugin.PluginManagement Wox.Plugin.PluginManagement - v4.5.2 + v4.6.2 512 ..\..\ diff --git a/Plugins/Wox.Plugin.Program/Wox.Plugin.Program.csproj b/Plugins/Wox.Plugin.Program/Wox.Plugin.Program.csproj index 17ccffaba..a5d7700e1 100644 --- a/Plugins/Wox.Plugin.Program/Wox.Plugin.Program.csproj +++ b/Plugins/Wox.Plugin.Program/Wox.Plugin.Program.csproj @@ -9,7 +9,7 @@ Properties Wox.Plugin.Program Wox.Plugin.Program - v4.5.2 + v4.6.2 512 ..\..\ @@ -158,6 +158,9 @@ 10.3.0 + + 10.0.18362.2005 + 9.0.1 @@ -167,9 +170,6 @@ 4.0.0 - - 10.0.14393.3 - - -
+ +
@@ -16,4 +16,4 @@ - \ No newline at end of file + diff --git a/Wox/Converters/QuerySuggestionBoxConverter.cs b/Wox/Converters/QuerySuggestionBoxConverter.cs new file mode 100644 index 000000000..68b891ce6 --- /dev/null +++ b/Wox/Converters/QuerySuggestionBoxConverter.cs @@ -0,0 +1,61 @@ +using System; +using System.Globalization; +using System.Windows.Data; +using Wox.Infrastructure.Logger; +using Wox.ViewModel; + +namespace Wox.Converters +{ + public class QuerySuggestionBoxConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + if (values.Length != 2) + { + return string.Empty; + } + + // first prop is the current query string + var queryText = (string)values[0]; + + if (string.IsNullOrEmpty(queryText)) + return "Type here to search"; + + // second prop is the current selected item result + var val = values[1]; + if (val == null) + { + return string.Empty; + } + if (!(val is ResultViewModel)) + { + return System.Windows.Data.Binding.DoNothing; + } + + try + { + var selectedItem = (ResultViewModel)val; + + var selectedResult = selectedItem.Result; + var selectedResultActionKeyword = string.IsNullOrEmpty(selectedResult.ActionKeywordAssigned) ? "" : selectedResult.ActionKeywordAssigned + " "; + var selectedResultPossibleSuggestion = selectedResultActionKeyword + selectedResult.Title; + + if (!selectedResultPossibleSuggestion.StartsWith(queryText, StringComparison.CurrentCultureIgnoreCase)) + return string.Empty; + + // When user typed lower case and result title is uppercase, we still want to display suggestion + return queryText + selectedResultPossibleSuggestion.Substring(queryText.Length); + } + catch (Exception e) + { + Log.Exception(nameof(QuerySuggestionBoxConverter), "fail to convert text for suggestion box", e); + return string.Empty; + } + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/Wox/MainWindow.xaml b/Wox/MainWindow.xaml index d50411b83..7c5afb3ef 100644 --- a/Wox/MainWindow.xaml +++ b/Wox/MainWindow.xaml @@ -4,7 +4,9 @@ xmlns:wox="clr-namespace:Wox" xmlns:vm="clr-namespace:Wox.ViewModel" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:converters="clr-namespace:Wox.Converters" + mc:Ignorable="d" Title="Wox" Topmost="True" SizeToContent="Height" @@ -25,6 +27,9 @@ PreviewKeyDown="OnKeyDown" Visibility="{Binding MainWindowVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" d:DataContext="{d:DesignInstance vm:MainViewModel}"> + + + @@ -55,29 +60,43 @@ - + + + + + + + + + - - - - - - - - - - + Background="Transparent"> + + + + + + + + + + + - + diff --git a/Wox/Properties/Resources.Designer.cs b/Wox/Properties/Resources.Designer.cs index 20e0fb225..26a9ddff9 100644 --- a/Wox/Properties/Resources.Designer.cs +++ b/Wox/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace Wox.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { diff --git a/Wox/Properties/Settings.Designer.cs b/Wox/Properties/Settings.Designer.cs index a61339f5e..be9020f6e 100644 --- a/Wox/Properties/Settings.Designer.cs +++ b/Wox/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace Wox.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.3.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/Wox/PublicAPIInstance.cs b/Wox/PublicAPIInstance.cs index 58915f87b..6c17be5c5 100644 --- a/Wox/PublicAPIInstance.cs +++ b/Wox/PublicAPIInstance.cs @@ -97,7 +97,12 @@ namespace Wox _mainVM.MainWindowVisibility = Visibility.Visible; } - public void ShowMsg(string title, string subTitle = "", string iconPath = "", bool useMainWindowAsOwner = true) + public void ShowMsg(string title, string subTitle = "", string iconPath = "") + { + ShowMsg(title, subTitle, iconPath, true); + } + + public void ShowMsg(string title, string subTitle, string iconPath, bool useMainWindowAsOwner = true) { Application.Current.Dispatcher.Invoke(() => { diff --git a/Wox/SettingWindow.xaml b/Wox/SettingWindow.xaml index b081cfbf6..7fd9a9300 100644 --- a/Wox/SettingWindow.xaml +++ b/Wox/SettingWindow.xaml @@ -58,7 +58,7 @@ - + @@ -75,8 +75,8 @@ - diff --git a/Wox/SettingWindow.xaml.cs b/Wox/SettingWindow.xaml.cs index 52addf362..df3b363d5 100644 --- a/Wox/SettingWindow.xaml.cs +++ b/Wox/SettingWindow.xaml.cs @@ -40,12 +40,6 @@ namespace Wox #region General - void OnLanguageChanged(object sender, SelectionChangedEventArgs e) - { - var language = (Language)e.AddedItems[0]; - InternationalizationManager.Instance.ChangeLanguage(language); - } - private void OnAutoStartupChecked(object sender, RoutedEventArgs e) { SetStartup(); diff --git a/Wox/Themes/Base.xaml b/Wox/Themes/Base.xaml index ae195feaa..6f6083035 100644 --- a/Wox/Themes/Base.xaml +++ b/Wox/Themes/Base.xaml @@ -8,6 +8,7 @@ + diff --git a/Wox/ViewModel/MainViewModel.cs b/Wox/ViewModel/MainViewModel.cs index acdd7c040..c2a277963 100644 --- a/Wox/ViewModel/MainViewModel.cs +++ b/Wox/ViewModel/MainViewModel.cs @@ -1,5 +1,6 @@ -using System; +using System; using System.Collections.Generic; +using System.ComponentModel; using System.Diagnostics; using System.Linq; using System.Threading; @@ -210,7 +211,7 @@ namespace Wox.ViewModel Query(); } } - + /// /// we need move cursor to end when we manually changed query /// but we don't want to move cursor to end when query is updated from TextBox @@ -455,7 +456,6 @@ namespace Wox.ViewModel } } - private Result ContextMenuTopMost(Result result) { Result menu; diff --git a/Wox/ViewModel/SettingWindowViewModel.cs b/Wox/ViewModel/SettingWindowViewModel.cs index c16d619cd..6898b5a83 100644 --- a/Wox/ViewModel/SettingWindowViewModel.cs +++ b/Wox/ViewModel/SettingWindowViewModel.cs @@ -113,6 +113,33 @@ namespace Wox.ViewModel } } + public string Language + { + get + { + return Settings.Language; + } + set + { + InternationalizationManager.Instance.ChangeLanguage(value); + + if (InternationalizationManager.Instance.PromptShouldUsePinyin(value)) + ShouldUsePinyin = true; + } + } + + public bool ShouldUsePinyin + { + get + { + return Settings.ShouldUsePinyin; + } + set + { + Settings.ShouldUsePinyin = value; + } + } + public List QuerySearchPrecisionStrings { get diff --git a/Wox/Wox.csproj b/Wox/Wox.csproj index 3b942ca65..56a4ed97b 100644 --- a/Wox/Wox.csproj +++ b/Wox/Wox.csproj @@ -9,7 +9,7 @@ Properties Wox Wox - v4.5.2 + v4.6.2 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 4 @@ -93,6 +93,7 @@ + ResultListBox.xaml