Skip to content

Commit ec2aaa8

Browse files
committed
Merge "dev" into "improve-calculator"
2 parents 3d917e0 + 73705be commit ec2aaa8

File tree

98 files changed

+2189
-1189
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+2189
-1189
lines changed

Plugins/Wox.Plugin.BrowserBookmark/Wox.Plugin.BrowserBookmark.csproj

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -37,32 +37,13 @@
3737
<Prefer32Bit>false</Prefer32Bit>
3838
</PropertyGroup>
3939
<ItemGroup>
40-
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
41-
<HintPath>..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll</HintPath>
42-
</Reference>
43-
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
44-
<HintPath>..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
45-
</Reference>
4640
<Reference Include="PresentationCore" />
4741
<Reference Include="PresentationFramework" />
4842
<Reference Include="System" />
4943
<Reference Include="System.ComponentModel.DataAnnotations" />
5044
<Reference Include="System.Core" />
5145
<Reference Include="System.Data" />
52-
<Reference Include="System.Data.SQLite, Version=1.0.111.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
53-
<HintPath>..\..\packages\System.Data.SQLite.Core.1.0.111.0\lib\net451\System.Data.SQLite.dll</HintPath>
54-
</Reference>
55-
<Reference Include="System.Data.SQLite.EF6, Version=1.0.111.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
56-
<HintPath>..\..\packages\System.Data.SQLite.EF6.1.0.111.0\lib\net451\System.Data.SQLite.EF6.dll</HintPath>
57-
</Reference>
58-
<Reference Include="System.Data.SQLite.Linq, Version=1.0.111.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
59-
<HintPath>..\..\packages\System.Data.SQLite.Linq.1.0.111.0\lib\net451\System.Data.SQLite.Linq.dll</HintPath>
60-
</Reference>
6146
<Reference Include="System.Xaml" />
62-
<Reference Include="UnidecodeSharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
63-
<HintPath>..\..\packages\UnidecodeSharp.1.0.0.0\lib\net35\UnidecodeSharp.dll</HintPath>
64-
<Private>True</Private>
65-
</Reference>
6647
<Reference Include="WindowsBase" />
6748
</ItemGroup>
6849
<ItemGroup>
@@ -79,7 +60,6 @@
7960
</ItemGroup>
8061
<ItemGroup>
8162
<None Include="app.config" />
82-
<None Include="packages.config" />
8363
<None Include="plugin.json">
8464
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
8565
</None>
@@ -123,16 +103,19 @@
123103
<SubType>Designer</SubType>
124104
</Page>
125105
</ItemGroup>
126-
<ItemGroup />
106+
<ItemGroup>
107+
<PackageReference Include="System.Data.SQLite">
108+
<Version>1.0.111</Version>
109+
</PackageReference>
110+
<PackageReference Include="System.Data.SQLite.Core">
111+
<Version>1.0.111</Version>
112+
</PackageReference>
113+
<PackageReference Include="UnidecodeSharp">
114+
<Version>1.0.0</Version>
115+
</PackageReference>
116+
</ItemGroup>
127117
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
128118
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
129-
<Import Project="..\..\packages\System.Data.SQLite.Core.1.0.111.0\build\net451\System.Data.SQLite.Core.targets" Condition="Exists('..\..\packages\System.Data.SQLite.Core.1.0.111.0\build\net451\System.Data.SQLite.Core.targets')" />
130-
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
131-
<PropertyGroup>
132-
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
133-
</PropertyGroup>
134-
<Error Condition="!Exists('..\..\packages\System.Data.SQLite.Core.1.0.111.0\build\net451\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\System.Data.SQLite.Core.1.0.111.0\build\net451\System.Data.SQLite.Core.targets'))" />
135-
</Target>
136119
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
137120
Other similar extension points exist, see Microsoft.Common.targets.
138121
<Target Name="BeforeBuild">

Plugins/Wox.Plugin.BrowserBookmark/app.config

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<configSections>
4-
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
4+
55
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
66
</configSections>
77
<startup>
@@ -18,10 +18,5 @@
1818
<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
1919
</providers>
2020
</entityFramework>
21-
<system.data>
22-
<DbProviderFactories>
23-
<remove invariant="System.Data.SQLite.EF6" />
24-
<add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
25-
<remove invariant="System.Data.SQLite" /><add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /></DbProviderFactories>
26-
</system.data>
21+
2722
</configuration>

Plugins/Wox.Plugin.BrowserBookmark/packages.config

Lines changed: 0 additions & 9 deletions
This file was deleted.

Plugins/Wox.Plugin.Calculator/Wox.Plugin.Calculator.csproj

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
</Compile>
6565
</ItemGroup>
6666
<ItemGroup>
67-
<None Include="packages.config" />
6867
<None Include="plugin.json">
6968
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
7069
</None>
@@ -130,6 +129,17 @@
130129
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
131130
</Content>
132131
</ItemGroup>
132+
<ItemGroup>
133+
<PackageReference Include="JetBrains.Annotations">
134+
<Version>10.3.0</Version>
135+
</PackageReference>
136+
<PackageReference Include="Mages">
137+
<Version>1.5.0</Version>
138+
</PackageReference>
139+
<PackageReference Include="System.Runtime">
140+
<Version>4.0.0</Version>
141+
</PackageReference>
142+
</ItemGroup>
133143
<ItemGroup>
134144
<Page Include="Views\CalculatorSettings.xaml">
135145
<SubType>Designer</SubType>

Plugins/Wox.Plugin.Calculator/packages.config

Lines changed: 0 additions & 6 deletions
This file was deleted.

Plugins/Wox.Plugin.Color/Wox.Plugin.Color.csproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
</None>
5656
</ItemGroup>
5757
<ItemGroup>
58-
<None Include="packages.config" />
5958
<None Include="plugin.json">
6059
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
6160
</None>
@@ -112,6 +111,14 @@
112111
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
113112
</Content>
114113
</ItemGroup>
114+
<ItemGroup>
115+
<PackageReference Include="JetBrains.Annotations">
116+
<Version>10.3.0</Version>
117+
</PackageReference>
118+
<PackageReference Include="System.Runtime">
119+
<Version>4.0.0</Version>
120+
</PackageReference>
121+
</ItemGroup>
115122
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
116123
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
117124
Other similar extension points exist, see Microsoft.Common.targets.

Plugins/Wox.Plugin.Color/packages.config

Lines changed: 0 additions & 5 deletions
This file was deleted.

Plugins/Wox.Plugin.ControlPanel/Main.cs

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ public void Init(PluginInitContext context)
2727
Directory.CreateDirectory(iconFolder);
2828
}
2929

30-
3130
foreach (ControlPanelItem item in controlPanelItems)
3231
{
3332
if (!File.Exists(iconFolder + item.GUID + fileType) && item.Icon != null)
@@ -43,7 +42,10 @@ public List<Result> Query(Query query)
4342

4443
foreach (var item in controlPanelItems)
4544
{
46-
item.Score = Score(item, query.Search);
45+
var titleMatch = StringMatcher.FuzzySearch(query.Search, item.LocalizedString);
46+
var subTitleMatch = StringMatcher.FuzzySearch(query.Search, item.InfoTip);
47+
48+
item.Score = Math.Max(titleMatch.Score, subTitleMatch.Score);
4749
if (item.Score > 0)
4850
{
4951
var result = new Result
@@ -66,6 +68,16 @@ public List<Result> Query(Query query)
6668
return true;
6769
}
6870
};
71+
72+
if (item.Score == titleMatch.Score)
73+
{
74+
result.TitleHighlightData = titleMatch.MatchData;
75+
}
76+
else
77+
{
78+
result.SubTitleHighlightData = subTitleMatch.MatchData;
79+
}
80+
6981
results.Add(result);
7082
}
7183
}
@@ -74,26 +86,6 @@ public List<Result> Query(Query query)
7486
return panelItems;
7587
}
7688

77-
private int Score(ControlPanelItem item, string query)
78-
{
79-
var scores = new List<int> {0};
80-
if (!string.IsNullOrEmpty(item.LocalizedString))
81-
{
82-
var score1 = StringMatcher.FuzzySearch(query, item.LocalizedString).ScoreAfterSearchPrecisionFilter();
83-
var score2 = StringMatcher.ScoreForPinyin(item.LocalizedString, query);
84-
scores.Add(score1);
85-
scores.Add(score2);
86-
}
87-
if (!string.IsNullOrEmpty(item.InfoTip))
88-
{
89-
var score1 = StringMatcher.FuzzySearch(query, item.InfoTip).ScoreAfterSearchPrecisionFilter();
90-
var score2 = StringMatcher.ScoreForPinyin(item.InfoTip, query);
91-
scores.Add(score1);
92-
scores.Add(score2);
93-
}
94-
return scores.Max();
95-
}
96-
9789
public string GetTranslatedPluginTitle()
9890
{
9991
return context.API.GetTranslation("wox_plugin_controlpanel_plugin_name");

Plugins/Wox.Plugin.ControlPanel/Wox.Plugin.ControlPanel.csproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
<Compile Include="Properties\AssemblyInfo.cs" />
5353
</ItemGroup>
5454
<ItemGroup>
55-
<None Include="packages.config" />
5655
<None Include="plugin.json">
5756
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
5857
</None>
@@ -114,6 +113,14 @@
114113
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
115114
</Content>
116115
</ItemGroup>
116+
<ItemGroup>
117+
<PackageReference Include="JetBrains.Annotations">
118+
<Version>10.3.0</Version>
119+
</PackageReference>
120+
<PackageReference Include="System.Runtime">
121+
<Version>4.0.0</Version>
122+
</PackageReference>
123+
</ItemGroup>
117124
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
118125
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
119126
Other similar extension points exist, see Microsoft.Common.targets.

Plugins/Wox.Plugin.ControlPanel/packages.config

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)