Merge branch 'master' into dev/crutkas/updatingNugetPackages

This commit is contained in:
Clint Rutkas
2020-04-03 19:54:50 -07:00
committed by GitHub
8 changed files with 77 additions and 12 deletions

View File

@@ -92,7 +92,7 @@ namespace Wox.Plugin.Indexer
results.Add(new Result results.Add(new Result
{ {
// TODO: Localize the string // TODO: Localize the string
Title = "Windows indexer plugin is not running", Title = ex.ToString(),
IcoPath = "Images\\WindowsIndexerImg.bmp" IcoPath = "Images\\WindowsIndexerImg.bmp"
}); });
} }

View File

@@ -32,10 +32,11 @@ namespace Wox.Plugin.Indexer.SearchHelper
while (WDSResults.Read()) while (WDSResults.Read())
{ {
// col 0 is our path in display format // col 0 is our path in display format
Console.WriteLine("{0}", WDSResults.GetString(0)); if (WDSResults.GetString(0) != null)
var result = new SearchResult { Path = WDSResults.GetString(0) }; {
var result = new SearchResult { Path = WDSResults.GetString(0) };
yield return result; yield return result;
}
} }
} }

View File

@@ -1,13 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<ProjectGuid>{F8B870EB-D5F5-45BA-9CF7-A5C459818820}</ProjectGuid>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Wox.Plugin.Indexer</RootNamespace>
<AssemblyName>Wox.Plugin.Indexer</AssemblyName>
<UseWindowsForms>true</UseWindowsForms>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<Platforms>x64</Platforms> <Platforms>x64</Platforms>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<OutputPath>..\..\..\..\..\x64\Debug\modules\launcher\Plugins\Wox.Plugin.Folder\</OutputPath> <OutputPath>..\..\..\..\..\x64\Debug\modules\launcher\Plugins\Wox.Plugin.Indexer\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
@@ -19,7 +26,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutputPath>..\..\..\..\..\x64\Release\modules\launcher\Plugins\Wox.Plugin.Folder\</OutputPath> <OutputPath>..\..\..\..\..\x64\Release\modules\launcher\Plugins\Wox.Plugin.Indexer\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
@@ -39,4 +46,17 @@
<ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj" /> <ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Update="Images\WindowsIndexerImg.bmp">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="plugin.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
</Project> </Project>

View File

@@ -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() private void RemoveOldLanguageFiles()
{ {
var dicts = Application.Current.Resources.MergedDictionaries; var dicts = Application.Current.Resources.MergedDictionaries;

View File

@@ -162,7 +162,7 @@ namespace Wox.Infrastructure
if (word.Length > 40) 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; return false;
} }

View File

@@ -25,8 +25,7 @@ namespace Wox.Infrastructure.UserSettings
/// <summary> /// <summary>
/// when false Alphabet static service will always return empty results /// when false Alphabet static service will always return empty results
/// </summary> /// </summary>
public bool ShouldUsePinyin { get; set; } = true; public bool ShouldUsePinyin { get; set; } = false;
internal StringMatcher.SearchPrecisionScore QuerySearchPrecision { get; private set; } = StringMatcher.SearchPrecisionScore.Regular; internal StringMatcher.SearchPrecisionScore QuerySearchPrecision { get; private set; } = StringMatcher.SearchPrecisionScore.Regular;

View File

@@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; 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<string> QuerySearchPrecisionStrings public List<string> QuerySearchPrecisionStrings
{ {
get get

View File

@@ -71,6 +71,8 @@
<PackageReference Include="System.Data.SQLite" Version="1.0.112" /> <PackageReference Include="System.Data.SQLite" Version="1.0.112" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.112" /> <PackageReference Include="System.Data.SQLite.Core" Version="1.0.112" />
<PackageReference Include="System.Runtime" Version="4.3.1" /> <PackageReference Include="System.Runtime" Version="4.3.1" />
<PackageReference Include="System.Data.OleDb" Version="5.0.0-preview.2.20160.6" />
<PackageReference Include="tlbimp-Microsoft.Search.Interop" Version="1.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>