diff --git a/src/modules/launcher/Plugins/Wox.Plugin.Indexer/Main.cs b/src/modules/launcher/Plugins/Wox.Plugin.Indexer/Main.cs index 652af40c40..8d6af797e9 100644 --- a/src/modules/launcher/Plugins/Wox.Plugin.Indexer/Main.cs +++ b/src/modules/launcher/Plugins/Wox.Plugin.Indexer/Main.cs @@ -92,7 +92,7 @@ namespace Wox.Plugin.Indexer results.Add(new Result { // TODO: Localize the string - Title = "Windows indexer plugin is not running", + Title = ex.ToString(), IcoPath = "Images\\WindowsIndexerImg.bmp" }); } diff --git a/src/modules/launcher/Plugins/Wox.Plugin.Indexer/SearchHelper/WindowsSearchAPI.cs b/src/modules/launcher/Plugins/Wox.Plugin.Indexer/SearchHelper/WindowsSearchAPI.cs index 64875595a1..fb7b6ffcd1 100644 --- a/src/modules/launcher/Plugins/Wox.Plugin.Indexer/SearchHelper/WindowsSearchAPI.cs +++ b/src/modules/launcher/Plugins/Wox.Plugin.Indexer/SearchHelper/WindowsSearchAPI.cs @@ -32,10 +32,11 @@ namespace Wox.Plugin.Indexer.SearchHelper while (WDSResults.Read()) { // col 0 is our path in display format - Console.WriteLine("{0}", WDSResults.GetString(0)); - var result = new SearchResult { Path = WDSResults.GetString(0) }; - - yield return result; + if (WDSResults.GetString(0) != null) + { + var result = new SearchResult { Path = WDSResults.GetString(0) }; + yield return result; + } } } diff --git a/src/modules/launcher/Plugins/Wox.Plugin.Indexer/Wox.Plugin.Indexer.csproj b/src/modules/launcher/Plugins/Wox.Plugin.Indexer/Wox.Plugin.Indexer.csproj index 37f4a2e7bd..eb9676e683 100644 --- a/src/modules/launcher/Plugins/Wox.Plugin.Indexer/Wox.Plugin.Indexer.csproj +++ b/src/modules/launcher/Plugins/Wox.Plugin.Indexer/Wox.Plugin.Indexer.csproj @@ -1,13 +1,20 @@ - + netcoreapp3.1 + {F8B870EB-D5F5-45BA-9CF7-A5C459818820} + Properties + Wox.Plugin.Indexer + Wox.Plugin.Indexer + true + false + false x64 true - ..\..\..\..\..\x64\Debug\modules\launcher\Plugins\Wox.Plugin.Folder\ + ..\..\..\..\..\x64\Debug\modules\launcher\Plugins\Wox.Plugin.Indexer\ DEBUG;TRACE full x64 @@ -19,7 +26,7 @@ - ..\..\..\..\..\x64\Release\modules\launcher\Plugins\Wox.Plugin.Folder\ + ..\..\..\..\..\x64\Release\modules\launcher\Plugins\Wox.Plugin.Indexer\ TRACE true pdbonly @@ -39,4 +46,17 @@ + + + PreserveNewest + + + PreserveNewest + + + + + + + diff --git a/src/modules/launcher/Wox.Core/Resource/Internationalization.cs b/src/modules/launcher/Wox.Core/Resource/Internationalization.cs index 9f865cb539..53cce9174c 100644 --- a/src/modules/launcher/Wox.Core/Resource/Internationalization.cs +++ b/src/modules/launcher/Wox.Core/Resource/Internationalization.cs @@ -99,6 +99,22 @@ namespace Wox.Core.Resource } + public bool PromptShouldUsePinyin(string languageCodeToSet) + { + var languageToSet = GetLanguageByLanguageCode(languageCodeToSet); + + if (Settings.ShouldUsePinyin) + return false; + + if (languageToSet != AvailableLanguages.Chinese && languageToSet != AvailableLanguages.Chinese_TW) + return false; + + if (MessageBox.Show("Do you want to turn on search with Pinyin?", string.Empty, MessageBoxButton.YesNo) == MessageBoxResult.No) + return false; + + return true; + } + private void RemoveOldLanguageFiles() { var dicts = Application.Current.Resources.MergedDictionaries; diff --git a/src/modules/launcher/Wox.Infrastructure/Alphabet.cs b/src/modules/launcher/Wox.Infrastructure/Alphabet.cs index 487c0a4b0a..4754394cbc 100644 --- a/src/modules/launcher/Wox.Infrastructure/Alphabet.cs +++ b/src/modules/launcher/Wox.Infrastructure/Alphabet.cs @@ -162,7 +162,7 @@ namespace Wox.Infrastructure if (word.Length > 40) { - Log.Debug($"|Wox.Infrastructure.StringMatcher.ScoreForPinyin|skip too long string: {word}"); + //Skip strings that are too long string for Pinyin conversion. return false; } diff --git a/src/modules/launcher/Wox.Infrastructure/UserSettings/Settings.cs b/src/modules/launcher/Wox.Infrastructure/UserSettings/Settings.cs index 7714768f00..94a1639d65 100644 --- a/src/modules/launcher/Wox.Infrastructure/UserSettings/Settings.cs +++ b/src/modules/launcher/Wox.Infrastructure/UserSettings/Settings.cs @@ -25,8 +25,7 @@ namespace Wox.Infrastructure.UserSettings /// /// when false Alphabet static service will always return empty results /// - public bool ShouldUsePinyin { get; set; } = true; - + public bool ShouldUsePinyin { get; set; } = false; internal StringMatcher.SearchPrecisionScore QuerySearchPrecision { get; private set; } = StringMatcher.SearchPrecisionScore.Regular; diff --git a/src/modules/launcher/Wox/ViewModel/SettingWindowViewModel.cs b/src/modules/launcher/Wox/ViewModel/SettingWindowViewModel.cs index 504e7bdfae..f9160df9f0 100644 --- a/src/modules/launcher/Wox/ViewModel/SettingWindowViewModel.cs +++ b/src/modules/launcher/Wox/ViewModel/SettingWindowViewModel.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -77,6 +77,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/src/modules/launcher/Wox/Wox.csproj b/src/modules/launcher/Wox/Wox.csproj index b9d29e01dd..09aa86d774 100644 --- a/src/modules/launcher/Wox/Wox.csproj +++ b/src/modules/launcher/Wox/Wox.csproj @@ -71,6 +71,8 @@ + +