Merge branch 'master' into add_reindix_program_suffix

This commit is contained in:
Jeremy Wu
2019-10-14 21:49:06 +11:00
87 changed files with 1200 additions and 262 deletions

View File

@@ -6,7 +6,7 @@
"Author":"happlebao",
"Version":"1.0",
"Language":"python",
"Website":"https://github.com/Wox-launche/Wox",
"Website":"https://github.com/Wox-launcher/Wox",
"IcoPath":"Images\\app.png",
"ExecuteFileName":"main.py"
}

View File

@@ -0,0 +1,35 @@
using System.Collections.Generic;
using System.Linq;
using Wox.Infrastructure;
namespace Wox.Plugin.BrowserBookmark.Commands
{
internal static class Bookmarks
{
internal static bool MatchProgram(Bookmark bookmark, string queryString)
{
if (StringMatcher.FuzzySearch(queryString, bookmark.Name, new MatchOption()).IsSearchPrecisionScoreMet()) return true;
if (StringMatcher.FuzzySearch(queryString, bookmark.PinyinName, new MatchOption()).IsSearchPrecisionScoreMet()) return true;
if (StringMatcher.FuzzySearch(queryString, bookmark.Url, new MatchOption()).IsSearchPrecisionScoreMet()) return true;
return false;
}
internal static List<Bookmark> LoadAllBookmarks()
{
var allbookmarks = new List<Bookmark>();
var chromeBookmarks = new ChromeBookmarks();
var mozBookmarks = new FirefoxBookmarks();
//TODO: Let the user select which browser's bookmarks are displayed
// Add Firefox bookmarks
mozBookmarks.GetBookmarks().ForEach(x => allbookmarks.Add(x));
// Add Chrome bookmarks
chromeBookmarks.GetBookmarks().ForEach(x => allbookmarks.Add(x));
return allbookmarks.Distinct().ToList();
}
}
}

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Data.SQLite;
using System.IO;
@@ -27,20 +27,25 @@ namespace Wox.Plugin.BrowserBookmark
if (string.IsNullOrEmpty(PlacesPath) || !File.Exists(PlacesPath))
return new List<Bookmark>();
var bookmarList = new List<Bookmark>();
// create the connection string and init the connection
string dbPath = string.Format(dbPathFormat, PlacesPath);
var dbConnection = new SQLiteConnection(dbPath);
// Open connection to the database file and execute the query
dbConnection.Open();
var reader = new SQLiteCommand(queryAllBookmarks, dbConnection).ExecuteReader();
// return results in List<Bookmark> format
return reader.Select(x => new Bookmark()
string dbPath = string.Format(dbPathFormat, PlacesPath);
using (var dbConnection = new SQLiteConnection(dbPath))
{
Name = (x["title"] is DBNull) ? string.Empty : x["title"].ToString(),
Url = x["url"].ToString()
}).ToList();
// Open connection to the database file and execute the query
dbConnection.Open();
var reader = new SQLiteCommand(queryAllBookmarks, dbConnection).ExecuteReader();
// return results in List<Bookmark> format
bookmarList = reader.Select(x => new Bookmark()
{
Name = (x["title"] is DBNull) ? string.Empty : x["title"].ToString(),
Url = x["url"].ToString()
}).ToList();
}
return bookmarList;
}
/// <summary>
@@ -61,17 +66,52 @@ namespace Wox.Plugin.BrowserBookmark
using (var sReader = new StreamReader(profileIni)) {
ini = sReader.ReadToEnd();
}
/*
Current profiles.ini structure example as of Firefox version 69.0.1
[Install736426B0AF4A39CB]
Default=Profiles/7789f565.default-release <== this is the default profile this plugin will get the bookmarks from. When opened Firefox will load the default profile
Locked=1
[Profile2]
Name=newblahprofile
IsRelative=0
Path=C:\t6h2yuq8.newblahprofile <== Note this is a custom location path for the profile user can set, we need to cater for this in code.
[Profile1]
Name=default
IsRelative=1
Path=Profiles/cydum7q4.default
Default=1
[Profile0]
Name=default-release
IsRelative=1
Path=Profiles/7789f565.default-release
[General]
StartWithLastProfile=1
Version=2
*/
var lines = ini.Split(new string[] { "\r\n" }, StringSplitOptions.None).ToList();
var index = lines.IndexOf("Default=1");
if (index > 3) {
var relative = lines[index - 2].Split('=')[1];
var profiePath = lines[index - 1].Split('=')[1];
return relative == "0"
? profiePath + @"\places.sqlite"
: Path.Combine(profileFolderPath, profiePath) + @"\places.sqlite";
}
return string.Empty;
var defaultProfileFolderNameRaw = lines.Where(x => x.Contains("Default=") && x != "Default=1").FirstOrDefault() ?? string.Empty;
if (string.IsNullOrEmpty(defaultProfileFolderNameRaw))
return string.Empty;
var defaultProfileFolderName = defaultProfileFolderNameRaw.Split('=').Last();
var indexOfDefaultProfileAtttributePath = lines.IndexOf("Path="+ defaultProfileFolderName);
// Seen in the example above, the IsRelative attribute is always above the Path attribute
var relativeAttribute = lines[indexOfDefaultProfileAtttributePath - 1];
return relativeAttribute == "0" // See above, the profile is located in a custom location, path is not relative, so IsRelative=0
? defaultProfileFolderName + @"\places.sqlite"
: Path.Combine(profileFolderPath, defaultProfileFolderName) + @"\places.sqlite";
}
}
}

View File

@@ -0,0 +1,9 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<!--Plugin Info-->
<system:String x:Key="wox_plugin_browserbookmark_plugin_name">Browser Bookmarks</system:String>
<system:String x:Key="wox_plugin_browserbookmark_plugin_description">Search your browser bookmarks</system:String>
</ResourceDictionary>

View File

@@ -0,0 +1,9 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<!--Eklenti Bilgisi-->
<system:String x:Key="wox_plugin_browserbookmark_plugin_name">Yer İşaretleri</system:String>
<system:String x:Key="wox_plugin_browserbookmark_plugin_description">Tarayıcılarınızdaki yer işaretlerini arayın.</system:String>
</ResourceDictionary>

View File

@@ -1,32 +1,21 @@
using System.Collections.Generic;
using System.Linq;
using Wox.Infrastructure;
using Wox.Plugin.BrowserBookmark.Commands;
using Wox.Plugin.SharedCommands;
namespace Wox.Plugin.BrowserBookmark
{
public class Main : IPlugin
public class Main : IPlugin, IReloadable, IPluginI18n
{
private PluginInitContext context;
// TODO: periodically refresh the Cache?
private List<Bookmark> cachedBookmarks = new List<Bookmark>();
public void Init(PluginInitContext context)
{
this.context = context;
// Cache all bookmarks
var chromeBookmarks = new ChromeBookmarks();
var mozBookmarks = new FirefoxBookmarks();
//TODO: Let the user select which browser's bookmarks are displayed
// Add Firefox bookmarks
cachedBookmarks.AddRange(mozBookmarks.GetBookmarks());
// Add Chrome bookmarks
cachedBookmarks.AddRange(chromeBookmarks.GetBookmarks());
cachedBookmarks = cachedBookmarks.Distinct().ToList();
cachedBookmarks = Bookmarks.LoadAllBookmarks();
}
public List<Result> Query(Query query)
@@ -40,16 +29,15 @@ namespace Wox.Plugin.BrowserBookmark
if (!topResults)
{
// Since we mixed chrome and firefox bookmarks, we should order them again
var fuzzyMatcher = FuzzyMatcher.Create(param);
returnList = cachedBookmarks.Where(o => MatchProgram(o, fuzzyMatcher)).ToList();
// Since we mixed chrome and firefox bookmarks, we should order them again
returnList = cachedBookmarks.Where(o => Bookmarks.MatchProgram(o, param)).ToList();
returnList = returnList.OrderByDescending(o => o.Score).ToList();
}
return returnList.Select(c => new Result()
{
Title = c.Name,
SubTitle = "Bookmark: " + c.Url,
SubTitle = c.Url,
IcoPath = @"Images\bookmark.png",
Score = 5,
Action = (e) =>
@@ -61,13 +49,22 @@ namespace Wox.Plugin.BrowserBookmark
}).ToList();
}
private bool MatchProgram(Bookmark bookmark, FuzzyMatcher matcher)
public void ReloadData()
{
if ((bookmark.Score = matcher.Evaluate(bookmark.Name).Score) > 0) return true;
if ((bookmark.Score = matcher.Evaluate(bookmark.PinyinName).Score) > 0) return true;
if ((bookmark.Score = matcher.Evaluate(bookmark.Url).Score / 10) > 0) return true;
cachedBookmarks.Clear();
return false;
cachedBookmarks = Bookmarks.LoadAllBookmarks();
}
public string GetTranslatedPluginTitle()
{
return context.API.GetTranslation("wox_plugin_browserbookmark_plugin_name");
}
public string GetTranslatedPluginDescription()
{
return context.API.GetTranslation("wox_plugin_browserbookmark_plugin_description");
}
}
}

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
@@ -14,6 +14,8 @@
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -35,14 +37,26 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll</HintPath>
</Reference>
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Data.SQLite, Version=1.0.93.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Data.SQLite.Core.1.0.93.0\lib\net20\System.Data.SQLite.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Data.SQLite, Version=1.0.111.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Data.SQLite.Core.1.0.111.0\lib\net451\System.Data.SQLite.dll</HintPath>
</Reference>
<Reference Include="System.Data.SQLite.EF6, Version=1.0.111.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Data.SQLite.EF6.1.0.111.0\lib\net451\System.Data.SQLite.EF6.dll</HintPath>
</Reference>
<Reference Include="System.Data.SQLite.Linq, Version=1.0.111.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Data.SQLite.Linq.1.0.111.0\lib\net451\System.Data.SQLite.Linq.dll</HintPath>
</Reference>
<Reference Include="UnidecodeSharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\UnidecodeSharp.1.0.0.0\lib\net35\UnidecodeSharp.dll</HintPath>
<Private>True</Private>
@@ -52,6 +66,7 @@
<ItemGroup>
<Compile Include="Bookmark.cs" />
<Compile Include="ChromeBookmarks.cs" />
<Compile Include="Commands\Bookmarks.cs" />
<Compile Include="FirefoxBookmarks.cs" />
<Compile Include="Main.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -67,6 +82,11 @@
<Content Include="Images\bookmark.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Languages\en.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="x64\SQLite.Interop.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
@@ -84,8 +104,22 @@
<Name>Wox.Plugin</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Languages\tr.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<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')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<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>
</PropertyGroup>
<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'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

View File

@@ -1,4 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.data><DbProviderFactories><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></system.data><startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/></startup></configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite.EF6" />
<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" />
<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>
</system.data>
</configuration>

View File

@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.Data.SQLite" version="1.0.93.0" targetFramework="net35" />
<package id="System.Data.SQLite.Core" version="1.0.93.0" targetFramework="net35" requireReinstallation="true" />
<package id="System.Data.SQLite.Linq" version="1.0.93.0" targetFramework="net35" requireReinstallation="true" />
<package id="EntityFramework" version="6.2.0" targetFramework="net452" />
<package id="System.Data.SQLite" version="1.0.111.0" targetFramework="net452" />
<package id="System.Data.SQLite.Core" version="1.0.111.0" targetFramework="net452" />
<package id="System.Data.SQLite.EF6" version="1.0.111.0" targetFramework="net452" />
<package id="System.Data.SQLite.Linq" version="1.0.111.0" targetFramework="net452" />
<package id="UnidecodeSharp" version="1.0.0.0" targetFramework="net452" />
</packages>

View File

@@ -0,0 +1,10 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<system:String x:Key="wox_plugin_caculator_plugin_name">Hesap Makinesi</system:String>
<system:String x:Key="wox_plugin_caculator_plugin_description">Matematiksel hesaplamalar yapmaya yarar. (5*3-2 yazmayı deneyin)</system:String>
<system:String x:Key="wox_plugin_calculator_not_a_number">Sayı değil (NaN)</system:String>
<system:String x:Key="wox_plugin_calculator_expression_not_complete">İfade hatalı ya da eksik. (Parantez koymayı mı unuttunuz?)</system:String>
<system:String x:Key="wox_plugin_calculator_copy_number_to_clipboard">Bu sayıyı panoya kopyala</system:String>
</ResourceDictionary>

View File

@@ -111,6 +111,13 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Languages\tr.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>

View File

@@ -0,0 +1,8 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<system:String x:Key="wox_plugin_color_plugin_name">Renkler</system:String>
<system:String x:Key="wox_plugin_color_plugin_description">Hex kodunu girdiğiniz renkleri görüntülemeye yarar.(#000 yazmayı deneyin)</system:String>
</ResourceDictionary>

View File

@@ -105,6 +105,13 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Languages\tr.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -0,0 +1,8 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<system:String x:Key="wox_plugin_controlpanel_plugin_name">Denetim Masası</system:String>
<system:String x:Key="wox_plugin_controlpanel_plugin_description">Denetim Masası'nda arama yapın.</system:String>
</ResourceDictionary>

View File

@@ -77,16 +77,16 @@ namespace Wox.Plugin.ControlPanel
private int Score(ControlPanelItem item, string query)
{
var scores = new List<int> {0};
if (string.IsNullOrEmpty(item.LocalizedString))
if (!string.IsNullOrEmpty(item.LocalizedString))
{
var score1 = StringMatcher.Score(item.LocalizedString, query);
var score1 = StringMatcher.FuzzySearch(query, item.LocalizedString).ScoreAfterSearchPrecisionFilter();
var score2 = StringMatcher.ScoreForPinyin(item.LocalizedString, query);
scores.Add(score1);
scores.Add(score2);
}
if (!string.IsNullOrEmpty(item.InfoTip))
{
var score1 = StringMatcher.Score(item.InfoTip, query);
var score1 = StringMatcher.FuzzySearch(query, item.InfoTip).ScoreAfterSearchPrecisionFilter();
var score2 = StringMatcher.ScoreForPinyin(item.InfoTip, query);
scores.Add(score1);
scores.Add(score2);

View File

@@ -107,6 +107,13 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Languages\tr.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -0,0 +1,22 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<system:String x:Key="wox_plugin_everything_is_not_running">Everything Servisi çalışmıyor</system:String>
<system:String x:Key="wox_plugin_everything_query_error">Sorgu Everything üzerinde çalıştırılırken hata oluştu</system:String>
<system:String x:Key="wox_plugin_everything_copied">Kopyalandı</system:String>
<system:String x:Key="wox_plugin_everything_canot_start">{0} başlatılamıyor</system:String>
<system:String x:Key="wox_plugin_everything_open_containing_folder">İçeren klasörü aç</system:String>
<system:String x:Key="wox_plugin_everything_open_with_editor">{0} ile aç</system:String>
<system:String x:Key="wox_plugin_everything_editor_path">Düzenleyici Konumu</system:String>
<system:String x:Key="wox_plugin_everything_copy_path">Konumu Kopyala</system:String>
<system:String x:Key="wox_plugin_everything_copy">Kopyala</system:String>
<system:String x:Key="wox_plugin_everything_delete">Sil</system:String>
<system:String x:Key="wox_plugin_everything_canot_delete">{0} silinemiyor</system:String>
<system:String x:Key="wox_plugin_everything_plugin_name">Everything</system:String>
<system:String x:Key="wox_plugin_everything_plugin_description">Everything programı yardımıyla diskteki dosyalarınızı arayın.</system:String>
<system:String x:Key="wox_plugin_everything_use_location_as_working_dir">Programın çalışma klasörü olarak sonuç klasörünü kullan</system:String>
</ResourceDictionary>

View File

@@ -157,6 +157,11 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Content Include="Languages\tr.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>

View File

@@ -0,0 +1,15 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<system:String x:Key="wox_plugin_folder_delete">Sil</system:String>
<system:String x:Key="wox_plugin_folder_edit">Düzenle</system:String>
<system:String x:Key="wox_plugin_folder_add">Ekle</system:String>
<system:String x:Key="wox_plugin_folder_folder_path">Klasör Konumu</system:String>
<system:String x:Key="wox_plugin_folder_select_folder_link_warning">Lütfen bir klasör bağlantısı seçin</system:String>
<system:String x:Key="wox_plugin_folder_delete_folder_link">{0} bağlantısını silmek istediğinize emin misiniz?</system:String>
<system:String x:Key="wox_plugin_folder_plugin_name">Klasör</system:String>
<system:String x:Key="wox_plugin_folder_plugin_description">Favori klasörünüzü doğrudan Wox'tan açın</system:String>
</ResourceDictionary>

View File

@@ -105,6 +105,11 @@
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Languages\tr.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Wox.Infrastructure\Wox.Infrastructure.csproj">

View File

@@ -0,0 +1,8 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<system:String x:Key="wox_plugin_pluginindicator_plugin_name">Eklenti Göstergesi</system:String>
<system:String x:Key="wox_plugin_pluginindicator_plugin_description">Eklenti eylemleri hakkında kelime önerileri sunar</system:String>
</ResourceDictionary>

View File

@@ -108,6 +108,13 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Languages\tr.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -0,0 +1,8 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<system:String x:Key="wox_plugin_plugin_management_plugin_name">Wox Eklenti Yöneticisi</system:String>
<system:String x:Key="wox_plugin_plugin_management_plugin_description">Wox eklentilerini kurun, kaldırın ya da güncelleyin</system:String>
</ResourceDictionary>

View File

@@ -113,6 +113,13 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Languages\tr.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>

View File

@@ -0,0 +1,40 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<!--Program setting-->
<system:String x:Key="wox_plugin_program_delete">Sil</system:String>
<system:String x:Key="wox_plugin_program_edit">Düzenle</system:String>
<system:String x:Key="wox_plugin_program_add">Ekle</system:String>
<system:String x:Key="wox_plugin_program_location">Konum</system:String>
<system:String x:Key="wox_plugin_program_suffixes">İndekslenecek Uzantılar</system:String>
<system:String x:Key="wox_plugin_program_reindex">Yeniden İndeksle</system:String>
<system:String x:Key="wox_plugin_program_indexing">İndeksleniyor</system:String>
<system:String x:Key="wox_plugin_program_index_start">Başlat Menüsünü İndeksle</system:String>
<system:String x:Key="wox_plugin_program_index_registry">Registry'i İndeksle</system:String>
<system:String x:Key="wox_plugin_program_suffixes_header">Uzantılar</system:String>
<system:String x:Key="wox_plugin_program_max_depth_header">Derinlik</system:String>
<system:String x:Key="wox_plugin_program_directory">Dizin:</system:String>
<system:String x:Key="wox_plugin_program_browse">Gözat</system:String>
<system:String x:Key="wox_plugin_program_file_suffixes">Dosya Uzantıları:</system:String>
<system:String x:Key="wox_plugin_program_max_search_depth">Maksimum Arama Derinliği (Limitsiz için -1):</system:String>
<system:String x:Key="wox_plugin_program_pls_select_program_source">İşlem yapmak istediğiniz klasörü seçin.</system:String>
<system:String x:Key="wox_plugin_program_delete_program_source">{0} klasörünü silmek istediğinize emin misiniz?</system:String>
<system:String x:Key="wox_plugin_program_update">Güncelle</system:String>
<system:String x:Key="wox_plugin_program_only_index_tip">Wox yalnızca aşağıdaki uzantılara sahip dosyaları indeksleyecektir:</system:String>
<system:String x:Key="wox_plugin_program_split_by_tip">(Her uzantıyı ; işareti ile ayırın)</system:String>
<system:String x:Key="wox_plugin_program_update_file_suffixes">Dosya uzantıları başarıyla güncellendi</system:String>
<system:String x:Key="wox_plugin_program_suffixes_cannot_empty">Dosya uzantıları boş olamaz</system:String>
<system:String x:Key="wox_plugin_program_run_as_administrator">Yönetici Olarak Çalıştır</system:String>
<system:String x:Key="wox_plugin_program_open_containing_folder">İçeren Klasörü Aç</system:String>
<system:String x:Key="wox_plugin_program_plugin_name">Program</system:String>
<system:String x:Key="wox_plugin_program_plugin_description">Programları Wox'tan arayın</system:String>
<system:String x:Key="wox_plugin_program_invalid_path">Geçersiz Konum</system:String>
</ResourceDictionary>

View File

@@ -13,7 +13,7 @@ using Stopwatch = Wox.Infrastructure.Stopwatch;
namespace Wox.Plugin.Program
{
public class Main : ISettingProvider, IPlugin, IPluginI18n, IContextMenu, ISavable
public class Main : ISettingProvider, IPlugin, IPluginI18n, IContextMenu, ISavable, IReloadable
{
private static readonly object IndexLock = new object();
private static Win32[] _win32s;
@@ -145,5 +145,10 @@ namespace Wox.Plugin.Program
}
return hide;
}
public void ReloadData()
{
IndexPrograms();
}
}
}

View File

@@ -240,9 +240,9 @@ namespace Wox.Plugin.Program.Programs
private int Score(string query)
{
var score1 = StringMatcher.Score(DisplayName, query);
var score1 = StringMatcher.FuzzySearch(query, DisplayName).ScoreAfterSearchPrecisionFilter();
var score2 = StringMatcher.ScoreForPinyin(DisplayName, query);
var score3 = StringMatcher.Score(Description, query);
var score3 = StringMatcher.FuzzySearch(query, Description).ScoreAfterSearchPrecisionFilter();
var score4 = StringMatcher.ScoreForPinyin(Description, query);
var score = new[] { score1, score2, score3, score4 }.Max();
return score;

View File

@@ -31,11 +31,11 @@ namespace Wox.Plugin.Program.Programs
private int Score(string query)
{
var score1 = StringMatcher.Score(Name, query);
var score1 = StringMatcher.FuzzySearch(query, Name).ScoreAfterSearchPrecisionFilter();
var score2 = StringMatcher.ScoreForPinyin(Name, query);
var score3 = StringMatcher.Score(Description, query);
var score3 = StringMatcher.FuzzySearch(query, Description).ScoreAfterSearchPrecisionFilter();
var score4 = StringMatcher.ScoreForPinyin(Description, query);
var score5 = StringMatcher.Score(ExecutableName, query);
var score5 = StringMatcher.FuzzySearch(query, ExecutableName).ScoreAfterSearchPrecisionFilter();
var score = new[] { score1, score2, score3, score4, score5 }.Max();
return score;
}

View File

@@ -130,6 +130,11 @@
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Languages\tr.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Page Include="ProgramSetting.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>

View File

@@ -0,0 +1,12 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<system:String x:Key="wox_plugin_cmd_relace_winr">Win+R kısayolunu kullan</system:String>
<system:String x:Key="wox_plugin_cmd_leave_cmd_open">Çalıştırma sona erdikten sonra komut istemini kapatma</system:String>
<system:String x:Key="wox_plugin_cmd_plugin_name">Kabuk</system:String>
<system:String x:Key="wox_plugin_cmd_plugin_description">Wox üzerinden komut istemini kullanmanızı sağlar. Komutlar > işareti ile başlamalıdır.</system:String>
<system:String x:Key="wox_plugin_cmd_cmd_has_been_executed_times">Bu komut {0} kez çalıştırıldı</system:String>
<system:String x:Key="wox_plugin_cmd_execute_through_shell">Komut isteminde çalıştır</system:String>
<system:String x:Key="wox_plugin_cmd_run_as_administrator">Yönetici Olarak Çalıştır</system:String>
</ResourceDictionary>

View File

@@ -118,6 +118,11 @@
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Languages\tr.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Page Include="ShellSetting.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>

View File

@@ -2,6 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<!--Command List-->
<system:String x:Key="wox_plugin_sys_command">Command</system:String>
<system:String x:Key="wox_plugin_sys_desc">Description</system:String>
@@ -14,6 +15,16 @@
<system:String x:Key="wox_plugin_sys_setting">Tweak this app</system:String>
<system:String x:Key="wox_plugin_sys_sleep">Put computer to sleep</system:String>
<system:String x:Key="wox_plugin_sys_emptyrecyclebin">Empty recycle bin</system:String>
<system:String x:Key="wox_plugin_sys_hibernate">Hibernate computer</system:String>
<system:String x:Key="wox_plugin_sys_save_all_settings">Save all Wox settings</system:String>
<system:String x:Key="wox_plugin_sys_reload_plugin_data">Reloads plugin data with new content added after Wox started. Plugins need to have this feature already added.</system:String>
<!--Dialogs-->
<system:String x:Key="wox_plugin_sys_dlgtitle_success">Success</system:String>
<system:String x:Key="wox_plugin_sys_dlgtext_all_settings_saved">All Wox settings saved</system:String>
<system:String x:Key="wox_plugin_sys_dlgtext_all_applicableplugins_reloaded">Reloaded all applicable plugin data</system:String>
<system:String x:Key="wox_plugin_sys_dlgtext_shutdown_computer">Are you sure you want to shut the computer down?</system:String>
<system:String x:Key="wox_plugin_sys_dlgtext_restart_computer">Are you sure you want to restart the computer?</system:String>
<system:String x:Key="wox_plugin_sys_plugin_name">System Commands</system:String>
<system:String x:Key="wox_plugin_sys_plugin_description">Provides System related commands. e.g. shutdown, lock, settings etc.</system:String>

View File

@@ -0,0 +1,32 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<!--Komut Listesi-->
<system:String x:Key="wox_plugin_sys_command">Komut</system:String>
<system:String x:Key="wox_plugin_sys_desc">Açıklama</system:String>
<system:String x:Key="wox_plugin_sys_shutdown_computer">Bilgisayarı Kapat</system:String>
<system:String x:Key="wox_plugin_sys_restart_computer">Yeniden Başlat</system:String>
<system:String x:Key="wox_plugin_sys_log_off">Oturumu Kapat</system:String>
<system:String x:Key="wox_plugin_sys_lock">Bilgisayarı Kilitle</system:String>
<system:String x:Key="wox_plugin_sys_exit">Wox'u Kapat</system:String>
<system:String x:Key="wox_plugin_sys_restart">Wox'u Yeniden Başlat</system:String>
<system:String x:Key="wox_plugin_sys_setting">Wox Ayarlarını Aç</system:String>
<system:String x:Key="wox_plugin_sys_sleep">Bilgisayarı Uyku Moduna Al</system:String>
<system:String x:Key="wox_plugin_sys_emptyrecyclebin">Geri Dönüşüm Kutusunu Boşalt</system:String>
<system:String x:Key="wox_plugin_sys_hibernate">Bilgisayarı Askıya Al</system:String>
<system:String x:Key="wox_plugin_sys_save_all_settings">Tüm Wox Ayarlarını Kaydet</system:String>
<system:String x:Key="wox_plugin_sys_reload_plugin_data">Eklentilerin verilerini Wox'un açılışından sonra yapılan değişiklikleri için günceller. Eklentilerin bu özelliği zaten eklemiş olması gerekir.</system:String>
<!--Diyaloglar-->
<system:String x:Key="wox_plugin_sys_dlgtitle_success">Başarılı</system:String>
<system:String x:Key="wox_plugin_sys_dlgtext_all_settings_saved">Tüm Wox ayarları kaydedildi.</system:String>
<system:String x:Key="wox_plugin_sys_dlgtext_shutdown_computer">Bilgisayarı kapatmak istediğinize emin misiniz?</system:String>
<system:String x:Key="wox_plugin_sys_dlgtext_restart_computer">Bilgisayarı yeniden başlatmak istediğinize emin misiniz?</system:String>
<!--Eklenti Bilgisi-->
<system:String x:Key="wox_plugin_sys_plugin_name">Sistem Komutları</system:String>
<system:String x:Key="wox_plugin_sys_plugin_description">Sistem ile ilgili komutlara erişim sağlar. ör. shutdown, lock, settings vb.</system:String>
</ResourceDictionary>

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.InteropServices;
@@ -56,8 +56,8 @@ namespace Wox.Plugin.Sys
var results = new List<Result>();
foreach (var c in commands)
{
var titleScore = StringMatcher.Score(c.Title, query.Search);
var subTitleScore = StringMatcher.Score(c.SubTitle, query.Search);
var titleScore = StringMatcher.FuzzySearch(query.Search, c.Title).ScoreAfterSearchPrecisionFilter();
var subTitleScore = StringMatcher.FuzzySearch(query.Search, c.SubTitle).ScoreAfterSearchPrecisionFilter();
var score = Math.Max(titleScore, subTitleScore);
if (score > 0)
{
@@ -85,8 +85,9 @@ namespace Wox.Plugin.Sys
IcoPath = "Images\\shutdown.png",
Action = c =>
{
var reuslt = MessageBox.Show("Are you sure you want to shut the computer down?",
"Shutdown Computer?", MessageBoxButton.YesNo, MessageBoxImage.Warning);
var reuslt = MessageBox.Show(context.API.GetTranslation("wox_plugin_sys_dlgtext_shutdown_computer"),
context.API.GetTranslation("wox_plugin_sys_shutdown_computer"),
MessageBoxButton.YesNo, MessageBoxImage.Warning);
if (reuslt == MessageBoxResult.Yes)
{
Process.Start("shutdown", "/s /t 0");
@@ -101,8 +102,9 @@ namespace Wox.Plugin.Sys
IcoPath = "Images\\restart.png",
Action = c =>
{
var result = MessageBox.Show("Are you sure you want to restart the computer?",
"Restart Computer?", MessageBoxButton.YesNo, MessageBoxImage.Warning);
var result = MessageBox.Show(context.API.GetTranslation("wox_plugin_sys_dlgtext_restart_computer"),
context.API.GetTranslation("wox_plugin_sys_restart_computer"),
MessageBoxButton.YesNo, MessageBoxImage.Warning);
if (result == MessageBoxResult.Yes)
{
Process.Start("shutdown", "/r /t 0");
@@ -112,7 +114,7 @@ namespace Wox.Plugin.Sys
},
new Result
{
Title = "Log off",
Title = "Log Off",
SubTitle = context.API.GetTranslation("wox_plugin_sys_log_off"),
IcoPath = "Images\\logoff.png",
Action = c => ExitWindowsEx(EWX_LOGOFF, 0)
@@ -136,6 +138,13 @@ namespace Wox.Plugin.Sys
Action = c => FormsApplication.SetSuspendState(PowerState.Suspend, false, false)
},
new Result
{
Title = "Hibernate",
SubTitle = context.API.GetTranslation("wox_plugin_sys_hibernate"),
IcoPath = "Images\\sleep.png", // Icon change needed
Action = c => FormsApplication.SetSuspendState(PowerState.Hibernate, false, false)
},
new Result
{
Title = "Empty Recycle Bin",
SubTitle = context.API.GetTranslation("wox_plugin_sys_emptyrecyclebin"),
@@ -168,6 +177,19 @@ namespace Wox.Plugin.Sys
}
},
new Result
{
Title = "Save Settings",
SubTitle = context.API.GetTranslation("wox_plugin_sys_save_all_settings"),
IcoPath = "Images\\app.png",
Action = c =>
{
context.API.SaveAppAllSettings();
context.API.ShowMsg(context.API.GetTranslation("wox_plugin_sys_dlgtitle_success"),
context.API.GetTranslation("wox_plugin_sys_dlgtext_all_settings_saved"));
return true;
}
},
new Result
{
Title = "Restart Wox",
SubTitle = context.API.GetTranslation("wox_plugin_sys_restart"),
@@ -188,6 +210,21 @@ namespace Wox.Plugin.Sys
context.API.OpenSettingDialog();
return true;
}
},
new Result
{
Title = "Reload Plugin Data",
SubTitle = context.API.GetTranslation("wox_plugin_sys_reload_plugin_data"),
IcoPath = "Images\\app.png",
Action = c =>
{
// Hide the window first then show msg after done because sometimes the reload could take a while, so not to make user think it's frozen.
Application.Current.MainWindow.Hide();
context.API.ReloadAllPluginData();
context.API.ShowMsg(context.API.GetTranslation("wox_plugin_sys_dlgtitle_success"),
context.API.GetTranslation("wox_plugin_sys_dlgtext_all_applicableplugins_reloaded"));
return true;
}
}
});
return results;

View File

@@ -102,6 +102,11 @@
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Languages\tr.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Page Include="SysSettings.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>

View File

@@ -0,0 +1,15 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<system:String x:Key="wox_plugin_url_open_url">URL'yi Aç: {0}</system:String>
<system:String x:Key="wox_plugin_url_canot_open_url">URL Açılamıyor: {0}</system:String>
<system:String x:Key="wox_plugin_url_plugin_name">URL</system:String>
<system:String x:Key="wox_plugin_url_plugin_description">Wox'a yazılan URL'leri açar</system:String>
<system:String x:Key="wox_plugin_url_plugin_set_tip">Tarayıcınızın konumunu ayarlayın:</system:String>
<system:String x:Key="wox_plugin_url_plugin_choose">Seç</system:String>
<system:String x:Key="wox_plugin_url_plugin_apply">Uygula</system:String>
<system:String x:Key="wox_plugin_url_plugin_filter">Programlar (*.exe)|*.exe|Tüm Dosyalar|*.*</system:String>
</ResourceDictionary>

View File

@@ -112,6 +112,11 @@
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Languages\tr.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Page Include="SettingsControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>

View File

@@ -0,0 +1,32 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<system:String x:Key="wox_plugin_websearch_delete">Sil</system:String>
<system:String x:Key="wox_plugin_websearch_edit">Düzenle</system:String>
<system:String x:Key="wox_plugin_websearch_add">Ekle</system:String>
<system:String x:Key="wox_plugin_websearch_confirm">Onayla</system:String>
<system:String x:Key="wox_plugin_websearch_action_keyword">Anahtar Kelime</system:String>
<system:String x:Key="wox_plugin_websearch_url">URL</system:String>
<system:String x:Key="wox_plugin_websearch_search">Ara:</system:String>
<system:String x:Key="wox_plugin_websearch_enable_suggestion">Arama önerilerini etkinleştir</system:String>
<system:String x:Key="wox_plugin_websearch_pls_select_web_search">Lütfen bir web araması seçin</system:String>
<system:String x:Key="wox_plugin_websearch_delete_warning">{0} aramasını silmek istediğinize emin misiniz?</system:String>
<!--web search edit-->
<system:String x:Key="wox_plugin_websearch_title">Başlık</system:String>
<system:String x:Key="wox_plugin_websearch_enable">Etkin</system:String>
<system:String x:Key="wox_plugin_websearch_select_icon">Simge Seç</system:String>
<system:String x:Key="wox_plugin_websearch_icon">Simge</system:String>
<system:String x:Key="wox_plugin_websearch_cancel">İptal</system:String>
<system:String x:Key="wox_plugin_websearch_invalid_web_search">Geçersiz web araması</system:String>
<system:String x:Key="wox_plugin_websearch_input_title">Lütfen bir başlık giriniz</system:String>
<system:String x:Key="wox_plugin_websearch_input_action_keyword">Lütfen anahtar kelime giriniz</system:String>
<system:String x:Key="wox_plugin_websearch_input_url">Lütfen bir URL giriniz</system:String>
<system:String x:Key="wox_plugin_websearch_action_keyword_exist">Anahtar kelime zaten mevcut. Lütfen yeni bir tane seçiniz.</system:String>
<system:String x:Key="wox_plugin_websearch_succeed">Başarılı</system:String>
<system:String x:Key="wox_plugin_websearch_plugin_name">Web Araması</system:String>
<system:String x:Key="wox_plugin_websearch_plugin_description">Web üzerinde arama yapmanızı sağlar</system:String>
</ResourceDictionary>

View File

@@ -49,10 +49,11 @@ namespace Wox.Plugin.WebSearch
{
foreach (SearchSource searchSource in searchSourceList)
{
string keyword = query.Search;
string title = keyword;
string subtitle = _context.API.GetTranslation("wox_plugin_websearch_search") + " " +
searchSource.Title;
string keyword = string.Empty;
keyword = searchSource.ActionKeyword == SearchSourceGlobalPluginWildCardSign ? query.ToString() : query.Search;
var title = keyword;
string subtitle = _context.API.GetTranslation("wox_plugin_websearch_search") + " " + searchSource.Title;
if (string.IsNullOrEmpty(keyword))
{
var result = new Result
@@ -78,7 +79,14 @@ namespace Wox.Plugin.WebSearch
return true;
}
};
results.Add(result);
ResultsUpdated?.Invoke(this, new ResultUpdatedEventArgs
{
Results = results,
Query = query
});
UpdateResultsFromSuggestion(results, keyword, subtitle, searchSource, query);
}
}

View File

@@ -83,7 +83,7 @@ namespace Wox.Plugin.WebSearch
_searchSources.Add(_searchSource);
var info = _api.GetTranslation("succeed");
var info = _api.GetTranslation("success");
MessageBox.Show(info);
Close();
}
@@ -106,7 +106,7 @@ namespace Wox.Plugin.WebSearch
var index = _searchSources.IndexOf(_oldSearchSource);
_searchSources[index] = _searchSource;
var info = _api.GetTranslation("succeed");
var info = _api.GetTranslation("success");
MessageBox.Show(info);
Close();
}

View File

@@ -154,6 +154,11 @@
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Languages\tr.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Page Include="SettingsControl.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>

View File

@@ -1,6 +1,10 @@
WoX
===
![Maintenance](https://img.shields.io/maintenance/yes/2019)
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/jjw24/wox)](https://github.com/jjw24/Wox/releases/latest)
![GitHub Release Date](https://img.shields.io/github/release-date/jjw24/wox)
![GitHub commits since latest release](https://img.shields.io/github/commits-since/jjw24/wox/v1.3.524)
[![Build status](https://ci.appveyor.com/api/projects/status/bfktntbivg32e103/branch/master?svg=true)](https://ci.appveyor.com/project/happlebao/wox/branch/master)
[![Github All Releases](https://img.shields.io/github/downloads/Wox-launcher/Wox/total.svg)](https://github.com/Wox-launcher/Wox/releases)
[![RamenBless](https://cdn.rawgit.com/LunaGao/BlessYourCodeTag/master/tags/ramen.svg)](https://github.com/LunaGao/BlessYourCodeTag)
@@ -24,6 +28,10 @@ Features
Installation
------------
To install this fork's version of Wox, you can **download** it [here](https://github.com/jjw24/Wox/releases/latest).
To install the upstream version:
Download `Wox-xxx.exe` from [releases](https://github.com/Wox-launcher/Wox/releases). Latest as of now is [`1.3.524`](https://github.com/Wox-launcher/Wox/releases/download/v1.3.524/Wox-1.3.524.exe) ([`1.3.578`](https://github.com/Wox-launcher/Wox/releases/download/v1.3.578/Wox-1.3.578.exe) for preview channel)
Windows may complain about security due to code not being signed. This will be fixed later.

View File

@@ -3,9 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Wox.Core.Resource;
using Wox.Infrastructure;
using Wox.Infrastructure.Exception;
using Wox.Infrastructure.Logger;
using Wox.Infrastructure.Storage;
using Wox.Infrastructure.UserSettings;
@@ -66,6 +64,15 @@ namespace Wox.Core.Plugin
}
}
public static void ReloadData()
{
foreach(var plugin in AllPlugins)
{
var reloadablePlugin = plugin.Plugin as IReloadable;
reloadablePlugin?.ReloadData();
}
}
static PluginManager()
{
ValidateUserDirectory();

View File

@@ -21,6 +21,7 @@ namespace Wox.Core.Resource
public static Language Italian = new Language("it", "Italiano");
public static Language Norwegian_Bokmal = new Language("nb-NO", "Norsk Bokmål");
public static Language Slovak = new Language("sk", "Slovenský");
public static Language Turkish = new Language("tr", "Türkçe");
public static List<Language> GetAvailableLanguages()
{
@@ -42,7 +43,8 @@ namespace Wox.Core.Resource
Portuguese_BR,
Italian,
Norwegian_Bokmal,
Slovak
Slovak,
Turkish
};
return languages;
}

View File

@@ -69,7 +69,7 @@ namespace Wox.Core
var newVersionTips = Translater.GetTranslation("newVersionTips");
newVersionTips = string.Format(newVersionTips, fr.Version);
MessageBox.Show(newVersionTips);
Log.Info($"|Updater.UpdateApp|Update succeed:{newVersionTips}");
Log.Info($"|Updater.UpdateApp|Update success:{newVersionTips}");
}
// always dispose UpdateManager

View File

@@ -1,10 +1,8 @@
using System.Text;
using System;
namespace Wox.Infrastructure
{
/// <summary>
/// refer to https://github.com/mattyork/fuzzy
/// </summary>
[Obsolete("This class is obsolete and should not be used. Please use the static function StringMatcher.FuzzySearch")]
public class FuzzyMatcher
{
private string query;
@@ -28,99 +26,7 @@ namespace Wox.Infrastructure
public MatchResult Evaluate(string str)
{
if (string.IsNullOrEmpty(str) || string.IsNullOrEmpty(query)) return new MatchResult { Success = false };
var len = str.Length;
var compareString = opt.IgnoreCase ? str.ToLower() : str;
var pattern = opt.IgnoreCase ? query.ToLower() : query;
var sb = new StringBuilder(str.Length + (query.Length * (opt.Prefix.Length + opt.Suffix.Length)));
var patternIdx = 0;
var firstMatchIndex = -1;
var lastMatchIndex = 0;
char ch;
for (var idx = 0; idx < len; idx++)
{
ch = str[idx];
if (compareString[idx] == pattern[patternIdx])
{
if (firstMatchIndex < 0)
firstMatchIndex = idx;
lastMatchIndex = idx + 1;
sb.Append(opt.Prefix + ch + opt.Suffix);
patternIdx += 1;
}
else
{
sb.Append(ch);
}
// match success, append remain char
if (patternIdx == pattern.Length && (idx + 1) != compareString.Length)
{
sb.Append(str.Substring(idx + 1));
break;
}
}
// return rendered string if we have a match for every char
if (patternIdx == pattern.Length)
{
return new MatchResult
{
Success = true,
Value = sb.ToString(),
Score = CalScore(str, firstMatchIndex, lastMatchIndex - firstMatchIndex)
};
}
return new MatchResult { Success = false };
return StringMatcher.FuzzySearch(query, str, opt);
}
private int CalScore(string str, int firstIndex, int matchLen)
{
//a match found near the beginning of a string is scored more than a match found near the end
//a match is scored more if the characters in the patterns are closer to each other, while the score is lower if they are more spread out
var score = 100 * (query.Length + 1) / ((1 + firstIndex) + (matchLen + 1));
//a match with less characters assigning more weights
if (str.Length - query.Length < 5)
score = score + 20;
else if (str.Length - query.Length < 10)
score = score + 10;
return score;
}
}
public class MatchResult
{
public bool Success { get; set; }
public int Score { get; set; }
/// <summary>
/// hightlight string
/// </summary>
public string Value { get; set; }
}
public class MatchOption
{
public MatchOption()
{
Prefix = "";
Suffix = "";
IgnoreCase = true;
}
/// <summary>
/// prefix of match char, use for hightlight
/// </summary>
public string Prefix { get; set; }
/// <summary>
/// suffix of match char, use for hightlight
/// </summary>
public string Suffix { get; set; }
public bool IgnoreCase { get; set; }
}
}

View File

@@ -1,4 +1,4 @@
using System.Diagnostics;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
using NLog;
@@ -22,8 +22,7 @@ namespace Wox.Infrastructure.Logger
var configuration = new LoggingConfiguration();
var target = new FileTarget();
configuration.AddTarget("file", target);
target.FileName = "${specialfolder:folder=ApplicationData}/" + Constant.Wox + "/" + DirectoryName + "/" +
Constant.Version + "/${shortdate}.txt";
target.FileName = path.Replace(@"\", "/") + "/${shortdate}.txt";
#if DEBUG
var rule = new LoggingRule("*", LogLevel.Debug, target);
#else

View File

@@ -1,20 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Wox.Infrastructure;
using System.Text;
using Wox.Infrastructure.Logger;
using Wox.Infrastructure.UserSettings;
namespace Wox.Infrastructure
{
public static class StringMatcher
{
public static string UserSettingSearchPrecision { get; set; }
[Obsolete("This method is obsolete and should not be used. Please use the static function StringMatcher.FuzzySearch")]
public static int Score(string source, string target)
{
if (!string.IsNullOrEmpty(source) && !string.IsNullOrEmpty(target))
{
FuzzyMatcher matcher = FuzzyMatcher.Create(target);
var score = matcher.Evaluate(source).Score;
return score;
return FuzzySearch(target, source, new MatchOption()).Score;
}
else
{
@@ -22,6 +23,108 @@ namespace Wox.Infrastructure
}
}
[Obsolete("This method is obsolete and should not be used. Please use the static function StringMatcher.FuzzySearch")]
public static bool IsMatch(string source, string target)
{
return FuzzySearch(target, source, new MatchOption()).Score > 0;
}
public static MatchResult FuzzySearch(string query, string stringToCompare)
{
return FuzzySearch(query, stringToCompare, new MatchOption());
}
/// <summary>
/// refer to https://github.com/mattyork/fuzzy
/// </summary>
public static MatchResult FuzzySearch(string query, string stringToCompare, MatchOption opt)
{
if (string.IsNullOrEmpty(stringToCompare) || string.IsNullOrEmpty(query)) return new MatchResult { Success = false };
query.Trim();
var len = stringToCompare.Length;
var compareString = opt.IgnoreCase ? stringToCompare.ToLower() : stringToCompare;
var pattern = opt.IgnoreCase ? query.ToLower() : query;
var sb = new StringBuilder(stringToCompare.Length + (query.Length * (opt.Prefix.Length + opt.Suffix.Length)));
var patternIdx = 0;
var firstMatchIndex = -1;
var lastMatchIndex = 0;
char ch;
for (var idx = 0; idx < len; idx++)
{
ch = stringToCompare[idx];
if (compareString[idx] == pattern[patternIdx])
{
if (firstMatchIndex < 0)
firstMatchIndex = idx;
lastMatchIndex = idx + 1;
sb.Append(opt.Prefix + ch + opt.Suffix);
patternIdx += 1;
}
else
{
sb.Append(ch);
}
// match success, append remain char
if (patternIdx == pattern.Length && (idx + 1) != compareString.Length)
{
sb.Append(stringToCompare.Substring(idx + 1));
break;
}
}
// return rendered string if we have a match for every char
if (patternIdx == pattern.Length)
{
return new MatchResult
{
Success = true,
Value = sb.ToString(),
Score = CalScore(query, stringToCompare, firstMatchIndex, lastMatchIndex - firstMatchIndex)
};
}
return new MatchResult { Success = false };
}
private static int CalScore(string query, string stringToCompare, int firstIndex, int matchLen)
{
//a match found near the beginning of a string is scored more than a match found near the end
//a match is scored more if the characters in the patterns are closer to each other, while the score is lower if they are more spread out
var score = 100 * (query.Length + 1) / ((1 + firstIndex) + (matchLen + 1));
//a match with less characters assigning more weights
if (stringToCompare.Length - query.Length < 5)
score = score + 20;
else if (stringToCompare.Length - query.Length < 10)
score = score + 10;
return score;
}
public enum SearchPrecisionScore
{
Regular = 50,
Low = 20,
None = 0
}
public static bool IsSearchPrecisionScoreMet(this MatchResult matchResult)
{
var precisionScore = (SearchPrecisionScore)Enum.Parse(typeof(SearchPrecisionScore),
UserSettingSearchPrecision ?? SearchPrecisionScore.Regular.ToString());
return matchResult.Score >= (int)precisionScore;
}
public static int ScoreAfterSearchPrecisionFilter(this MatchResult matchResult)
{
return matchResult.IsSearchPrecisionScoreMet() ? matchResult.Score : 0;
}
public static int ScoreForPinyin(string source, string target)
{
if (!string.IsNullOrEmpty(source) && !string.IsNullOrEmpty(target))
@@ -34,12 +137,12 @@ namespace Wox.Infrastructure
if (Alphabet.ContainsChinese(source))
{
FuzzyMatcher matcher = FuzzyMatcher.Create(target);
var combination = Alphabet.PinyinComination(source);
var pinyinScore = combination.Select(pinyin => matcher.Evaluate(string.Join("", pinyin)).Score)
var combination = Alphabet.PinyinComination(source);
var pinyinScore = combination
.Select(pinyin => FuzzySearch(target, string.Join("", pinyin), new MatchOption()).Score)
.Max();
var acronymScore = combination.Select(Alphabet.Acronym)
.Select(pinyin => matcher.Evaluate(pinyin).Score)
var acronymScore = combination.Select(Alphabet.Acronym)
.Select(pinyin => FuzzySearch(target, pinyin, new MatchOption()).Score)
.Max();
var score = Math.Max(pinyinScore, acronymScore);
return score;
@@ -53,11 +156,37 @@ namespace Wox.Infrastructure
{
return 0;
}
}
}
public class MatchResult
{
public bool Success { get; set; }
public int Score { get; set; }
/// <summary>
/// hightlight string
/// </summary>
public string Value { get; set; }
}
public class MatchOption
{
public MatchOption()
{
Prefix = "";
Suffix = "";
IgnoreCase = true;
}
public static bool IsMatch(string source, string target)
{
return Score(source, target) > 0;
}
/// <summary>
/// prefix of match char, use for hightlight
/// </summary>
public string Prefix { get; set; }
/// <summary>
/// suffix of match char, use for hightlight
/// </summary>
public string Suffix { get; set; }
public bool IgnoreCase { get; set; }
}
}

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.ObjectModel;
using System.Drawing;
using Newtonsoft.Json;
@@ -21,7 +21,18 @@ namespace Wox.Infrastructure.UserSettings
public string ResultFontWeight { get; set; }
public string ResultFontStretch { get; set; }
public bool AutoUpdates { get; set; } = true;
private string _querySearchPrecision { get; set; } = StringMatcher.SearchPrecisionScore.Regular.ToString();
public string QuerySearchPrecision
{
get { return _querySearchPrecision; }
set
{
_querySearchPrecision = value;
StringMatcher.UserSettingSearchPrecision = value;
}
}
public bool AutoUpdates { get; set; } = false;
public double WindowLeft { get; set; }
public double WindowTop { get; set; }
@@ -63,7 +74,6 @@ namespace Wox.Infrastructure.UserSettings
[JsonConverter(typeof(StringEnumConverter))]
public LastQueryMode LastQueryMode { get; set; } = LastQueryMode.Selected;
}
public enum LastQueryMode

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
@@ -7,13 +7,26 @@ namespace Wox.Infrastructure
{
public static class Constant
{
public static string DetermineDataDirectory()
{
string portableDataPath = Path.Combine(ProgramDirectory, "UserData");
if (Directory.Exists(portableDataPath))
{
return portableDataPath;
}
else
{
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Wox);
}
}
public const string Wox = "Wox";
public const string Plugins = "Plugins";
private static readonly Assembly Assembly = Assembly.GetExecutingAssembly();
public static readonly string ProgramDirectory = Directory.GetParent(Assembly.Location.NonNull()).ToString();
public static readonly string ExecutablePath = Path.Combine(ProgramDirectory, Wox + ".exe");
public static readonly string DataDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Wox);
public static readonly string DataDirectory = DetermineDataDirectory();
public static readonly string PluginsDirectory = Path.Combine(DataDirectory, Plugins);
public static readonly string PreinstalledDirectory = Path.Combine(ProgramDirectory, Plugins);
public const string Repository = "https://github.com/Wox-launcher/Wox";

View File

@@ -57,6 +57,19 @@ namespace Wox.Plugin
[Obsolete]
void ShowApp();
/// <summary>
/// Save all Wox settings
/// </summary>
void SaveAppAllSettings();
/// <summary>
/// Reloads any Plugins that have the
/// IReloadable implemented. It refeshes
/// Plugin's in memory data with new content
/// added by user.
/// </summary>
void ReloadAllPluginData();
/// <summary>
/// Show message box
/// </summary>

View File

@@ -0,0 +1,18 @@
namespace Wox.Plugin
{
/// <summary>
/// This interface is to indicate and allow plugins to reload their
/// in memory data cache or other mediums when user makes a new change
/// that is not immediately captured. For example, for BrowserBookmark and Program
/// plugin does not automatically detect when a user added a new bookmark or program,
/// so this interface's function is exposed to allow user manually do the reloading after
/// those new additions.
///
/// The command that allows user to manual reload is exposed via Plugin.Sys, and
/// it will call the plugins that have implemented this interface.
/// </summary>
public interface IReloadable
{
void ReloadData();
}
}

View File

@@ -1,5 +1,6 @@
What does Wox.Plugin do?
====
* Define base objects and interfaces for plugins
* Plugin Author who making C# plugin should reference this DLL via nuget
* Defines base objects and interfaces for plugins
* Plugin authors making C# plugins should reference this DLL via nuget
* Contains base commands used by all plugins

View File

@@ -65,17 +65,13 @@ namespace Wox.Plugin
public override bool Equals(object obj)
{
Result r = obj as Result;
if (r != null)
{
var equality = string.Equals(r.Title, Title) &&
string.Equals(r.SubTitle, SubTitle);
return equality;
}
else
{
return false;
}
var r = obj as Result;
var equality = string.Equals(r?.Title, Title) &&
string.Equals(r?.SubTitle, SubTitle) &&
string.Equals(r?.IcoPath, IcoPath);
return equality;
}
public override int GetHashCode()

View File

@@ -66,6 +66,7 @@
<Compile Include="Features\IContextMenu.cs" />
<Compile Include="Features\IExclusiveQuery.cs" />
<Compile Include="Features\IInstantQuery.cs" />
<Compile Include="Interfaces\IReloadable.cs" />
<Compile Include="IPlugin.cs" />
<Compile Include="IPublicAPI.cs" />
<Compile Include="ISettingProvider.cs" />

View File

@@ -1,4 +1,6 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using NUnit.Framework;
using Wox.Infrastructure;
@@ -9,6 +11,31 @@ namespace Wox.Test
[TestFixture]
public class FuzzyMatcherTest
{
public List<string> GetSearchStrings()
=> new List<string>
{
"Chrome",
"Choose which programs you want Windows to use for activities like web browsing, editing photos, sending e-mail, and playing music.",
"Help cure hope raise on mind entity Chrome ",
"Candy Crush Saga from King",
"Uninstall or change programs on your computer",
"Add, change, and manage fonts on your computer",
"Last is chrome",
"1111"
};
public List<int> GetPrecisionScores()
{
var listToReturn = new List<int>();
Enum.GetValues(typeof(StringMatcher.SearchPrecisionScore))
.Cast<StringMatcher.SearchPrecisionScore>()
.ToList()
.ForEach(x => listToReturn.Add((int)x));
return listToReturn;
}
[Test]
public void MatchTest()
{
@@ -28,7 +55,7 @@ namespace Wox.Test
results.Add(new Result
{
Title = str,
Score = FuzzyMatcher.Create("inst").Evaluate(str).Score
Score = StringMatcher.FuzzySearch("inst", str, new MatchOption()).Score
});
}
@@ -39,5 +66,124 @@ namespace Wox.Test
Assert.IsTrue(results[1].Title == "Install Package");
Assert.IsTrue(results[2].Title == "file open in browser-test");
}
[TestCase("Chrome")]
public void WhenGivenNotAllCharactersFoundInSearchStringThenShouldReturnZeroScore(string searchString)
{
var compareString = "Can have rum only in my glass";
var scoreResult = StringMatcher.FuzzySearch(searchString, compareString, new MatchOption()).Score;
Assert.True(scoreResult == 0);
}
[TestCase("chr")]
[TestCase("chrom")]
[TestCase("chrome")]
[TestCase("cand")]
[TestCase("cpywa")]
[TestCase("ccs")]
public void WhenGivenStringsAndAppliedPrecisionFilteringThenShouldReturnGreaterThanPrecisionScoreResults(string searchTerm)
{
var results = new List<Result>();
foreach (var str in GetSearchStrings())
{
results.Add(new Result
{
Title = str,
Score = StringMatcher.FuzzySearch(searchTerm, str, new MatchOption()).Score
});
}
foreach (var precisionScore in GetPrecisionScores())
{
var filteredResult = results.Where(result => result.Score >= precisionScore).Select(result => result).OrderByDescending(x => x.Score).ToList();
Debug.WriteLine("");
Debug.WriteLine("###############################################");
Debug.WriteLine("SEARCHTERM: " + searchTerm + ", GreaterThanSearchPrecisionScore: " + precisionScore);
foreach (var item in filteredResult)
{
Debug.WriteLine("SCORE: " + item.Score.ToString() + ", FoundString: " + item.Title);
}
Debug.WriteLine("###############################################");
Debug.WriteLine("");
Assert.IsFalse(filteredResult.Any(x => x.Score < precisionScore));
}
}
[TestCase("chrome")]
public void WhenGivenStringsForCalScoreMethodThenShouldReturnCurrentScoring(string searchTerm)
{
var searchStrings = new List<string>
{
"Chrome",//SCORE: 107
"Last is chrome",//SCORE: 53
"Help cure hope raise on mind entity Chrome",//SCORE: 21
"Uninstall or change programs on your computer", //SCORE: 15
"Candy Crush Saga from King"//SCORE: 0
}
.OrderByDescending(x => x)
.ToList();
var results = new List<Result>();
foreach (var str in searchStrings)
{
results.Add(new Result
{
Title = str,
Score = StringMatcher.FuzzySearch(searchTerm, str, new MatchOption()).Score
});
}
var orderedResults = results.OrderByDescending(x => x.Title).ToList();
Debug.WriteLine("");
Debug.WriteLine("###############################################");
Debug.WriteLine("SEARCHTERM: " + searchTerm);
foreach (var item in orderedResults)
{
Debug.WriteLine("SCORE: " + item.Score.ToString() + ", FoundString: " + item.Title);
}
Debug.WriteLine("###############################################");
Debug.WriteLine("");
Assert.IsTrue(orderedResults[0].Score == 15 && orderedResults[0].Title == searchStrings[0]);
Assert.IsTrue(orderedResults[1].Score == 53 && orderedResults[1].Title == searchStrings[1]);
Assert.IsTrue(orderedResults[2].Score == 21 && orderedResults[2].Title == searchStrings[2]);
Assert.IsTrue(orderedResults[3].Score == 107 && orderedResults[3].Title == searchStrings[3]);
Assert.IsTrue(orderedResults[4].Score == 0 && orderedResults[4].Title == searchStrings[4]);
}
[TestCase("goo", "Google Chrome", (int)StringMatcher.SearchPrecisionScore.Regular, true)]
[TestCase("chr", "Google Chrome", (int)StringMatcher.SearchPrecisionScore.Low, true)]
[TestCase("chr", "Chrome", (int)StringMatcher.SearchPrecisionScore.Regular, true)]
[TestCase("chr", "Help cure hope raise on mind entity Chrome", (int)StringMatcher.SearchPrecisionScore.Regular, false)]
[TestCase("chr", "Help cure hope raise on mind entity Chrome", (int)StringMatcher.SearchPrecisionScore.Low, true)]
[TestCase("chr", "Candy Crush Saga from King", (int)StringMatcher.SearchPrecisionScore.Regular, false)]
[TestCase("chr", "Candy Crush Saga from King", (int)StringMatcher.SearchPrecisionScore.None, true)]
[TestCase("ccs", "Candy Crush Saga from King", (int)StringMatcher.SearchPrecisionScore.Low, true)]
[TestCase("cand", "Candy Crush Saga from King", (int)StringMatcher.SearchPrecisionScore.Regular, true)]
[TestCase("cand", "Help cure hope raise on mind entity Chrome", (int)StringMatcher.SearchPrecisionScore.Regular, false)]
public void WhenGivenDesiredPrecisionThenShouldReturnAllResultsGreaterOrEqual(string queryString, string compareString,
int expectedPrecisionScore, bool expectedPrecisionResult)
{
var expectedPrecisionString = (StringMatcher.SearchPrecisionScore)expectedPrecisionScore;
StringMatcher.UserSettingSearchPrecision = expectedPrecisionString.ToString();
var matchResult = StringMatcher.FuzzySearch(queryString, compareString, new MatchOption());
Debug.WriteLine("");
Debug.WriteLine("###############################################");
Debug.WriteLine($"SearchTerm: {queryString} PrecisionLevelSetAt: {expectedPrecisionString} ({expectedPrecisionScore})");
Debug.WriteLine($"SCORE: {matchResult.Score.ToString()}, ComparedString: {compareString}");
Debug.WriteLine("###############################################");
Debug.WriteLine("");
var matchPrecisionResult = matchResult.IsSearchPrecisionScoreMet();
Assert.IsTrue(matchPrecisionResult == expectedPrecisionResult);
}
}
}

View File

@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\NUnit3TestAdapter.3.15.1\build\net35\NUnit3TestAdapter.props" Condition="Exists('..\packages\NUnit3TestAdapter.3.15.1\build\net35\NUnit3TestAdapter.props')" />
<Import Project="..\packages\NUnit.3.12.0\build\NUnit.props" Condition="Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -13,6 +15,8 @@
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -38,10 +42,10 @@
<HintPath>..\packages\Moq.4.2.1409.1722\lib\net40\Moq.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
<Private>True</Private>
<Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.12.0\lib\net45\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
@@ -76,6 +80,13 @@
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<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>
</PropertyGroup>
<Error Condition="!Exists('..\packages\NUnit.3.12.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit.3.12.0\build\NUnit.props'))" />
<Error Condition="!Exists('..\packages\NUnit3TestAdapter.3.15.1\build\net35\NUnit3TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NUnit3TestAdapter.3.15.1\build\net35\NUnit3TestAdapter.props'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Moq" version="4.2.1409.1722" targetFramework="net452" />
<package id="NUnit" version="2.6.4" targetFramework="net452" />
<package id="NUnit" version="3.12.0" targetFramework="net452" />
<package id="NUnit3TestAdapter" version="3.15.1" targetFramework="net452" />
</packages>

View File

@@ -45,7 +45,7 @@ namespace Wox
{
var id = _plugin.Metadata.ID;
PluginManager.ReplaceActionKeyword(id, oldActionKeyword, newActionKeyword);
MessageBox.Show(_translater.GetTranslation("succeed"));
MessageBox.Show(_translater.GetTranslation("success"));
Close();
}
else

View File

@@ -54,6 +54,8 @@ namespace Wox
_settingsVM = new SettingWindowViewModel();
_settings = _settingsVM.Settings;
StringMatcher.UserSettingSearchPrecision = _settings.QuerySearchPrecision;
PluginManager.LoadPlugins(_settings.PluginSettings);
_mainVM = new MainViewModel(_settings);
var window = new MainWindow(_settings, _mainVM);

View File

@@ -57,7 +57,7 @@ namespace Wox
App.API.ChangeQuery(pluginHotkey.ActionKeyword);
Application.Current.MainWindow.Visibility = Visibility.Visible;
});
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("succeed"));
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("success"));
}
else
{
@@ -76,7 +76,7 @@ namespace Wox
App.API.ChangeQuery(updateCustomHotkey.ActionKeyword);
Application.Current.MainWindow.Visibility = Visibility.Visible;
});
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("succeed"));
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("success"));
}
Close();

View File

@@ -78,7 +78,7 @@ namespace Wox
else
{
tbMsg.Foreground = new SolidColorBrush(Colors.Green);
tbMsg.Text = InternationalizationManager.Instance.GetTranslation("succeed");
tbMsg.Text = InternationalizationManager.Instance.GetTranslation("success");
}
tbMsg.Visibility = Visibility.Visible;
OnHotkeyChanged();

View File

@@ -91,7 +91,7 @@
<system:String x:Key="cannotFindSpecifiedPlugin">Kan ikke finde det valgte plugin</system:String>
<system:String x:Key="newActionKeywordsCannotBeEmpty">Nyt nøgleord må ikke være tomt</system:String>
<system:String x:Key="newActionKeywordsHasBeenAssigned">Nyt nøgleord er tilknyttet et andet plugin, tilknyt venligst et andet nyt nøgeleord</system:String>
<system:String x:Key="succeed">Fortsæt</system:String>
<system:String x:Key="success">Fortsæt</system:String>
<system:String x:Key="actionkeyword_tips">Brug * hvis du ikke vil angive et nøgleord</system:String>
<!--Custom Query Hotkey Dialog-->

View File

@@ -91,7 +91,7 @@
<system:String x:Key="cannotFindSpecifiedPlugin">Kann das angegebene Plugin nicht finden</system:String>
<system:String x:Key="newActionKeywordsCannotBeEmpty">Neues Aktionsschlüsselwort darf nicht leer sein</system:String>
<system:String x:Key="newActionKeywordsHasBeenAssigned">Aktionsschlüsselwort ist schon bei einem anderen Plugin in verwendung. Bitte stellen Sie ein anderes Aktionsschlüsselwort ein.</system:String>
<system:String x:Key="succeed">Erfolgreich</system:String>
<system:String x:Key="success">Erfolgreich</system:String>
<system:String x:Key="actionkeyword_tips">Benutzen Sie * wenn Sie ein Aktionsschlüsselwort definieren wollen.</system:String>
<!--Custom Query Hotkey Dialog-->

View File

@@ -33,6 +33,7 @@
<system:String x:Key="selectPythonDirectory">Select</system:String>
<system:String x:Key="hideOnStartup">Hide Wox on startup</system:String>
<system:String x:Key="hideNotifyIcon">Hide tray icon</system:String>
<system:String x:Key="querySearchPrecision">Query Search Precision</system:String>
<!--Setting Plugin-->
<system:String x:Key="plugin">Plugin</system:String>
@@ -103,7 +104,7 @@
<system:String x:Key="cannotFindSpecifiedPlugin">Can't find specified plugin</system:String>
<system:String x:Key="newActionKeywordsCannotBeEmpty">New Action Keyword can't be empty</system:String>
<system:String x:Key="newActionKeywordsHasBeenAssigned">New Action Keywords have been assigned to another plugin, please assign other new action keyword</system:String>
<system:String x:Key="succeed">Succeed</system:String>
<system:String x:Key="success">Success</system:String>
<system:String x:Key="actionkeyword_tips">Use * if you don't want to specify an action keyword</system:String>
<!--Custom Query Hotkey Dialog-->

View File

@@ -97,7 +97,7 @@
<system:String x:Key="cannotFindSpecifiedPlugin">Impossible de trouver le module spécifié</system:String>
<system:String x:Key="newActionKeywordsCannotBeEmpty">Le nouveau mot-clé d'action doit être spécifié</system:String>
<system:String x:Key="newActionKeywordsHasBeenAssigned">Le nouveau mot-clé d'action a été assigné à un autre module, veuillez en choisir un autre</system:String>
<system:String x:Key="succeed">Ajouté</system:String>
<system:String x:Key="success">Ajouté</system:String>
<system:String x:Key="actionkeyword_tips">Saisissez * si vous ne souhaitez pas utiliser de mot-clé spécifique</system:String>
<!--Custom Query Hotkey Dialog-->

View File

@@ -100,7 +100,7 @@
<system:String x:Key="cannotFindSpecifiedPlugin">Impossibile trovare il plugin specificato</system:String>
<system:String x:Key="newActionKeywordsCannotBeEmpty">La nuova parola chiave d'azione non può essere vuota</system:String>
<system:String x:Key="newActionKeywordsHasBeenAssigned">La nuova parola chiave d'azione è stata assegnata ad un altro plugin, per favore sceglierne una differente</system:String>
<system:String x:Key="succeed">Successo</system:String>
<system:String x:Key="success">Successo</system:String>
<system:String x:Key="actionkeyword_tips">Usa * se non vuoi specificare una parola chiave d'azione</system:String>
<!--Custom Query Hotkey Dialog-->

View File

@@ -103,7 +103,7 @@
<system:String x:Key="cannotFindSpecifiedPlugin">プラグインが見つかりません</system:String>
<system:String x:Key="newActionKeywordsCannotBeEmpty">新しいアクションキーボードを空にすることはできません</system:String>
<system:String x:Key="newActionKeywordsHasBeenAssigned">新しいアクションキーボードは他のプラグインに割り当てられています。他のアクションキーボードを指定してください</system:String>
<system:String x:Key="succeed">成功しました</system:String>
<system:String x:Key="success">成功しました</system:String>
<system:String x:Key="actionkeyword_tips">アクションキーボードを指定しない場合、* を使用してください</system:String>
<!--Custom Query Hotkey Dialog-->

View File

@@ -95,7 +95,7 @@
<system:String x:Key="cannotFindSpecifiedPlugin">플러그인을 찾을 수 없습니다.</system:String>
<system:String x:Key="newActionKeywordsCannotBeEmpty">새 액션 키워드를 입력하세요.</system:String>
<system:String x:Key="newActionKeywordsHasBeenAssigned">새 액션 키워드가 할당된 플러그인이 이미 있습니다. 다른 액션 키워드를 입력하세요.</system:String>
<system:String x:Key="succeed">성공</system:String>
<system:String x:Key="success">성공</system:String>
<system:String x:Key="actionkeyword_tips">액션 키워드를 지정하지 않으려면 *를 사용하세요.</system:String>
<!--Custom Query Hotkey Dialog-->

View File

@@ -100,7 +100,7 @@
<system:String x:Key="cannotFindSpecifiedPlugin">Kan ikke finne den angitte utvidelsen</system:String>
<system:String x:Key="newActionKeywordsCannotBeEmpty">Nytt handlingsnøkkelord kan ikke være tomt</system:String>
<system:String x:Key="newActionKeywordsHasBeenAssigned">De nye handlingsnøkkelordene er tildelt en annen utvidelse, vennligst velg et annet nøkkelord</system:String>
<system:String x:Key="succeed">Vellykket</system:String>
<system:String x:Key="success">Vellykket</system:String>
<system:String x:Key="actionkeyword_tips">Bruk * hvis du ikke ønsker å angi et handlingsnøkkelord</system:String>
<!--Custom Query Hotkey Dialog-->

View File

@@ -91,7 +91,7 @@
<system:String x:Key="cannotFindSpecifiedPlugin">Kan plugin niet vinden</system:String>
<system:String x:Key="newActionKeywordsCannotBeEmpty">Nieuwe actie sneltoets moet ingevuld worden</system:String>
<system:String x:Key="newActionKeywordsHasBeenAssigned">Nieuwe actie sneltoets is toegewezen aan een andere plugin, wijs een nieuwe actie sneltoets aan</system:String>
<system:String x:Key="succeed">Succesvol</system:String>
<system:String x:Key="success">Succesvol</system:String>
<system:String x:Key="actionkeyword_tips">Gebruik * wanneer je geen nieuwe actie sneltoets wilt specificeren</system:String>
<!--Custom Query Hotkey Dialog-->

View File

@@ -91,7 +91,7 @@
<system:String x:Key="cannotFindSpecifiedPlugin">Nie można odnaleźć podanej wtyczki</system:String>
<system:String x:Key="newActionKeywordsCannotBeEmpty">Nowy wyzwalacz nie może być pusty</system:String>
<system:String x:Key="newActionKeywordsHasBeenAssigned">Ten wyzwalacz został już przypisany do innej wtyczki, musisz podać inny wyzwalacz.</system:String>
<system:String x:Key="succeed">Sukces</system:String>
<system:String x:Key="success">Sukces</system:String>
<system:String x:Key="actionkeyword_tips">Użyj * jeżeli nie chcesz podawać wyzwalacza</system:String>
<!--Custom Query Hotkey Dialog-->

View File

@@ -100,7 +100,7 @@
<system:String x:Key="cannotFindSpecifiedPlugin">Não foi possível encontrar o plugin especificado</system:String>
<system:String x:Key="newActionKeywordsCannotBeEmpty">A nova palavra-chave da ação não pode ser vazia</system:String>
<system:String x:Key="newActionKeywordsHasBeenAssigned">A nova palavra-chave da ação já foi atribuída a outro plugin, por favor tente outra</system:String>
<system:String x:Key="succeed">Sucesso</system:String>
<system:String x:Key="success">Sucesso</system:String>
<system:String x:Key="actionkeyword_tips">Use * se não quiser especificar uma palavra-chave de ação</system:String>
<!--Custom Query Hotkey Dialog-->

View File

@@ -91,7 +91,7 @@
<system:String x:Key="cannotFindSpecifiedPlugin">Не удалось найти заданный плагин</system:String>
<system:String x:Key="newActionKeywordsCannotBeEmpty">Новая горячая клавиша не может быть пустой</system:String>
<system:String x:Key="newActionKeywordsHasBeenAssigned">Новая горячая клавиша уже используется другим плагином. Пожалуйста, задайте новую</system:String>
<system:String x:Key="succeed">Сохранено</system:String>
<system:String x:Key="success">Сохранено</system:String>
<system:String x:Key="actionkeyword_tips">Используйте * в случае, если вы не хотите задавать конкретную горячую клавишу</system:String>
<!--Custom Query Hotkey Dialog-->

View File

@@ -101,7 +101,7 @@
<system:String x:Key="cannotFindSpecifiedPlugin">Nepodarilo sa nájsť zadaný plugin</system:String>
<system:String x:Key="newActionKeywordsCannotBeEmpty">Nová skratka pre akciu nemôže byť prázdna</system:String>
<system:String x:Key="newActionKeywordsHasBeenAssigned">Nová skratka pre akciu bola priradená pre iný plugin, prosím, zvoľte inú skratku</system:String>
<system:String x:Key="succeed">Úspešné</system:String>
<system:String x:Key="success">Úspešné</system:String>
<system:String x:Key="actionkeyword_tips">Použite * ak nechcete určiť skratku pre akciu</system:String>
<!--Custom Query Hotkey Dialog-->

View File

@@ -100,7 +100,7 @@
<system:String x:Key="cannotFindSpecifiedPlugin">Navedeni plugin nije moguće pronaći</system:String>
<system:String x:Key="newActionKeywordsCannotBeEmpty">Prečica za novu radnju ne može da bude prazna</system:String>
<system:String x:Key="newActionKeywordsHasBeenAssigned">Prečica za novu radnju je dodeljena drugom plugin-u, molim Vas dodelite drugu prečicu</system:String>
<system:String x:Key="succeed">Uspešno</system:String>
<system:String x:Key="success">Uspešno</system:String>
<system:String x:Key="actionkeyword_tips">Koristite * ako ne želite da navedete prečicu za radnju</system:String>
<!--Custom Query Hotkey Dialog-->

145
Wox/Languages/tr.xaml Normal file
View File

@@ -0,0 +1,145 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<!--MainWindow-->
<system:String x:Key="registerHotkeyFailed">Kısayol tuşu ataması başarısız oldu: {0}</system:String>
<system:String x:Key="couldnotStartCmd">{0} başlatılamıyor</system:String>
<system:String x:Key="invalidWoxPluginFileFormat">Geçersiz Wox eklenti dosyası formatı</system:String>
<system:String x:Key="setAsTopMostInThisQuery">Bu sorgu için başa sabitle</system:String>
<system:String x:Key="cancelTopMostInThisQuery">Sabitlemeyi kaldır</system:String>
<system:String x:Key="executeQuery">Sorguyu çalıştır: {0}</system:String>
<system:String x:Key="lastExecuteTime">Son çalıştırma zamanı: {0}</system:String>
<system:String x:Key="iconTrayOpen">Aç</system:String>
<system:String x:Key="iconTraySettings">Ayarlar</system:String>
<system:String x:Key="iconTrayAbout">Hakkında</system:String>
<system:String x:Key="iconTrayExit">Çıkış</system:String>
<!--Setting General-->
<system:String x:Key="wox_settings">Wox Ayarları</system:String>
<system:String x:Key="general">Genel</system:String>
<system:String x:Key="startWoxOnSystemStartup">Wox'u başlangıçta başlat</system:String>
<system:String x:Key="hideWoxWhenLoseFocus">Odak pencereden ayrıldığında Wox'u gizle</system:String>
<system:String x:Key="dontPromptUpdateMsg">Güncelleme bildirimlerini gösterme</system:String>
<system:String x:Key="rememberLastLocation">Pencere konumunu hatırla</system:String>
<system:String x:Key="language">Dil</system:String>
<system:String x:Key="lastQueryMode">Pencere açıldığında</system:String>
<system:String x:Key="LastQueryPreserved">Son sorguyu sakla</system:String>
<system:String x:Key="LastQuerySelected">Son sorguyu sakla ve tümünü seç</system:String>
<system:String x:Key="LastQueryEmpty">Sorgu kutusunu temizle</system:String>
<system:String x:Key="maxShowResults">Maksimum sonuç sayısı</system:String>
<system:String x:Key="ignoreHotkeysOnFullscreen">Tam ekran modunda kısayol tuşunu gözardı et</system:String>
<system:String x:Key="pythonDirectory">Python Konumu</system:String>
<system:String x:Key="autoUpdates">Otomatik Güncelle</system:String>
<system:String x:Key="selectPythonDirectory">Seç</system:String>
<system:String x:Key="hideOnStartup">Başlangıçta Wox'u gizle</system:String>
<system:String x:Key="hideNotifyIcon">Sistem çekmecesi simgesini gizle</system:String>
<system:String x:Key="querySearchPrecision">Sorgu Arama Hassasiyeti</system:String>
<!--Setting Plugin-->
<system:String x:Key="plugin">Eklentiler</system:String>
<system:String x:Key="browserMorePlugins">Daha fazla eklenti bul</system:String>
<system:String x:Key="disable">Devre Dışı</system:String>
<system:String x:Key="actionKeywords">Anahtar Kelimeler</system:String>
<system:String x:Key="pluginDirectory">Eklenti Klasörü</system:String>
<system:String x:Key="author">Yapımcı</system:String>
<system:String x:Key="plugin_init_time">Açılış Süresi: {0}ms</system:String>
<system:String x:Key="plugin_query_time">Sorgu Süresi: {0}ms</system:String>
<!--Setting Theme-->
<system:String x:Key="theme">Temalar</system:String>
<system:String x:Key="browserMoreThemes">Daha fazla tema bul</system:String>
<system:String x:Key="helloWox">Merhaba Wox</system:String>
<system:String x:Key="queryBoxFont">Pencere Yazı Tipi</system:String>
<system:String x:Key="resultItemFont">Sonuç Yazı Tipi</system:String>
<system:String x:Key="windowMode">Pencere Modu</system:String>
<system:String x:Key="opacity">Saydamlık</system:String>
<system:String x:Key="theme_load_failure_path_not_exists">{0} isimli tema bulunamadı, varsayılan temaya dönülüyor.</system:String>
<system:String x:Key="theme_load_failure_parse_error">{0} isimli tema yüklenirken hata oluştu, varsayılan temaya dönülüyor.</system:String>
<!--Setting Hotkey-->
<system:String x:Key="hotkey">Kısayol Tuşu</system:String>
<system:String x:Key="woxHotkey">Wox Kısayolu</system:String>
<system:String x:Key="customQueryHotkey">Özel Sorgu Kısayolları</system:String>
<system:String x:Key="delete">Sil</system:String>
<system:String x:Key="edit">Düzenle</system:String>
<system:String x:Key="add">Ekle</system:String>
<system:String x:Key="pleaseSelectAnItem">Lütfen bir öğe seçin</system:String>
<system:String x:Key="deleteCustomHotkeyWarning">{0} eklentisi için olan kısayolu silmek istediğinize emin misiniz?</system:String>
<!--Setting Proxy-->
<system:String x:Key="proxy">Vekil Sunucu</system:String>
<system:String x:Key="enableProxy">HTTP vekil sunucuyu etkinleştir.</system:String>
<system:String x:Key="server">Sunucu Adresi</system:String>
<system:String x:Key="port">Port</system:String>
<system:String x:Key="userName">Kullanıcı Adı</system:String>
<system:String x:Key="password">Parola</system:String>
<system:String x:Key="testProxy">Ayarları Sına</system:String>
<system:String x:Key="save">Kaydet</system:String>
<system:String x:Key="serverCantBeEmpty">Sunucu adresi boş olamaz</system:String>
<system:String x:Key="portCantBeEmpty">Port boş olamaz</system:String>
<system:String x:Key="invalidPortFormat">Port biçimi geçersiz</system:String>
<system:String x:Key="saveProxySuccessfully">Vekil sunucu ayarları başarıyla kaydedildi</system:String>
<system:String x:Key="proxyIsCorrect">Vekil sunucu doğru olarak ayarlandı</system:String>
<system:String x:Key="proxyConnectFailed">Vekil sunucuya bağlanılırken hata oluştu</system:String>
<!--Setting About-->
<system:String x:Key="about">Hakkında</system:String>
<system:String x:Key="website">Web Sitesi</system:String>
<system:String x:Key="version">Sürüm</system:String>
<system:String x:Key="about_activate_times">Şu ana kadar Wox'u {0} kez aktifleştirdiniz.</system:String>
<system:String x:Key="checkUpdates">Güncellemeleri Kontrol Et</system:String>
<system:String x:Key="newVersionTips">Uygulamanın yeni sürümü ({0}) mevcut, Lütfen Wox'u yeniden başlatın.</system:String>
<system:String x:Key="checkUpdatesFailed">Güncelleme kontrolü başarısız oldu. Lütfen bağlantınız ve vekil sunucu ayarlarınızın api.github.com adresine ulaşabilir olduğunu kontrol edin.</system:String>
<system:String x:Key="downloadUpdatesFailed">
Güncellemenin yüklenmesi başarısız oldu. Lütfen bağlantınız ve vekil sunucu ayarlarınızın github-cloud.s3.amazonaws.com
adresine ulaşabilir olduğunu kontrol edin ya da https://github.com/Wox-launcher/Wox/releases adresinden güncellemeyi elle indirin.
</system:String>
<system:String x:Key="releaseNotes">Sürüm Notları:</system:String>
<!--Action Keyword Setting Dialog-->
<system:String x:Key="oldActionKeywords">Eski Anahtar Kelime</system:String>
<system:String x:Key="newActionKeywords">Yeni Anahtar Kelime</system:String>
<system:String x:Key="cancel">İptal</system:String>
<system:String x:Key="done">Tamam</system:String>
<system:String x:Key="cannotFindSpecifiedPlugin">Belirtilen eklenti bulunamadı</system:String>
<system:String x:Key="newActionKeywordsCannotBeEmpty">Yeni anahtar kelime boş olamaz</system:String>
<system:String x:Key="newActionKeywordsHasBeenAssigned">Yeni anahtar kelime başka bir eklentiye atanmış durumda. Lütfen başka bir anahtar kelime seçin</system:String>
<system:String x:Key="success">Başarılı</system:String>
<system:String x:Key="actionkeyword_tips">Anahtar kelime belirlemek istemiyorsanız * kullanın</system:String>
<!--Custom Query Hotkey Dialog-->
<system:String x:Key="preview">Önizleme</system:String>
<system:String x:Key="hotkeyIsNotUnavailable">Kısayol tuşu kullanılabilir değil, lütfen başka bir kısayol tuşu seçin</system:String>
<system:String x:Key="invalidPluginHotkey">Geçersiz eklenti kısayol tuşu</system:String>
<system:String x:Key="update">Güncelle</system:String>
<!--Hotkey Control-->
<system:String x:Key="hotkeyUnavailable">Kısayol tuşu kullanılabilir değil</system:String>
<!--Crash Reporter-->
<system:String x:Key="reportWindow_version">Sürüm</system:String>
<system:String x:Key="reportWindow_time">Tarih</system:String>
<system:String x:Key="reportWindow_reproduce">Sorunu çözebilmemiz için lütfen uygulamanın ne yaparken çöktüğünü belirtin.</system:String>
<system:String x:Key="reportWindow_send_report">Raporu Gönder</system:String>
<system:String x:Key="reportWindow_cancel">İptal</system:String>
<system:String x:Key="reportWindow_general">Genel</system:String>
<system:String x:Key="reportWindow_exceptions">Özel Durumlar</system:String>
<system:String x:Key="reportWindow_exception_type">Özel Durum Tipi</system:String>
<system:String x:Key="reportWindow_source">Kaynak</system:String>
<system:String x:Key="reportWindow_stack_trace">Yığın İzleme</system:String>
<system:String x:Key="reportWindow_sending">Gönderiliyor</system:String>
<system:String x:Key="reportWindow_report_succeed">Hata raporu başarıyla gönderildi</system:String>
<system:String x:Key="reportWindow_report_failed">Hata raporu gönderimi başarısız oldu</system:String>
<system:String x:Key="reportWindow_wox_got_an_error">Wox'ta bir hata oluştu</system:String>
<!--update-->
<system:String x:Key="update_wox_update_new_version_available">Wox'un yeni bir sürümü ({0}) mevcut</system:String>
<system:String x:Key="update_wox_update_error">Güncellemelerin kurulması sırasında bir hata oluştu</system:String>
<system:String x:Key="update_wox_update">Güncelle</system:String>
<system:String x:Key="update_wox_update_cancel">İptal</system:String>
<system:String x:Key="update_wox_update_restart_wox_tip">Bu güncelleme Wox'u yeniden başlatacaktır</system:String>
<system:String x:Key="update_wox_update_upadte_files">Aşağıdaki dosyalar güncelleştirilecektir</system:String>
<system:String x:Key="update_wox_update_files">Güncellenecek dosyalar</system:String>
<system:String x:Key="update_wox_update_upadte_description">Güncelleme açıklaması</system:String>
</ResourceDictionary>

View File

@@ -91,7 +91,7 @@
<system:String x:Key="cannotFindSpecifiedPlugin">Не вдалося знайти вказаний плагін</system:String>
<system:String x:Key="newActionKeywordsCannotBeEmpty">Нова гаряча клавіша не може бути порожньою</system:String>
<system:String x:Key="newActionKeywordsHasBeenAssigned">Нова гаряча клавіша вже використовується іншим плагіном. Будь ласка, вкажіть нову</system:String>
<system:String x:Key="succeed">Збережено</system:String>
<system:String x:Key="success">Збережено</system:String>
<system:String x:Key="actionkeyword_tips">Використовуйте * у разі, якщо ви не хочете ставити конкретну гарячу клавішу</system:String>
<!--Custom Query Hotkey Dialog-->

View File

@@ -98,7 +98,7 @@
<system:String x:Key="cannotFindSpecifiedPlugin">找不到指定的插件</system:String>
<system:String x:Key="newActionKeywordsCannotBeEmpty">新触发关键字不能为空</system:String>
<system:String x:Key="newActionKeywordsHasBeenAssigned">新触发关键字已经被指派给其他插件了,请重新选择一个关键字</system:String>
<system:String x:Key="succeed">成功</system:String>
<system:String x:Key="success">成功</system:String>
<system:String x:Key="actionkeyword_tips">如果你不想设置触发关键字,可以使用*代替</system:String>
<!--Custom Query Hotkey 对话框-->

View File

@@ -91,7 +91,7 @@
<system:String x:Key="cannotFindSpecifiedPlugin">找不到指定的外掛</system:String>
<system:String x:Key="newActionKeywordsCannotBeEmpty">新觸發關鍵字不能為空白</system:String>
<system:String x:Key="newActionKeywordsHasBeenAssigned">新觸發關鍵字已經被指派給另一外掛,請設定其他關鍵字。</system:String>
<system:String x:Key="succeed">成功</system:String>
<system:String x:Key="success">成功</system:String>
<system:String x:Key="actionkeyword_tips">如果不想設定觸發關鍵字,可以使用*代替</system:String>
<!--Custom Query Hotkey 對話框-->

View File

@@ -59,13 +59,23 @@ namespace Wox
// we must manually save
// UpdateManager.RestartApp() will call Environment.Exit(0)
// which will cause ungraceful exit
SaveAppAllSettings();
UpdateManager.RestartApp();
}
public void SaveAppAllSettings()
{
_mainVM.Save();
_settingsVM.Save();
PluginManager.Save();
ImageLoader.Save();
Alphabet.Save();
}
UpdateManager.RestartApp();
public void ReloadAllPluginData()
{
PluginManager.ReloadData();
}
[Obsolete]

View File

@@ -55,6 +55,12 @@
Checked="OnAutoStartupChecked" Unchecked="OnAutoStartupUncheck">
<TextBlock Text="{DynamicResource autoUpdates}" />
</CheckBox>
<StackPanel Margin="10" Orientation="Horizontal">
<TextBlock Text="{DynamicResource querySearchPrecision}" />
<ComboBox Margin="10 0 0 0" Width="120"
ItemsSource="{Binding QuerySearchPrecisionStrings}"
SelectedItem="{Binding Settings.QuerySearchPrecision}" />
</StackPanel>
<StackPanel Margin="10" Orientation="Horizontal">
<TextBlock Text="{DynamicResource lastQueryMode}" />
<ComboBox Margin="10 0 0 0" Width="120"

View File

@@ -318,6 +318,7 @@ namespace Wox
private void OnClosed(object sender, EventArgs e)
{
_viewModel.Save();
PluginManager.Save();
}
private void OnCloseExecuted(object sender, ExecutedRoutedEventArgs e)

View File

@@ -305,8 +305,8 @@ namespace Wox.ViewModel
{
var filtered = results.Where
(
r => StringMatcher.IsMatch(r.Title, query) ||
StringMatcher.IsMatch(r.SubTitle, query)
r => StringMatcher.FuzzySearch(query, r.Title).IsSearchPrecisionScoreMet()
|| StringMatcher.FuzzySearch(query, r.SubTitle).IsSearchPrecisionScoreMet()
).ToList();
ContextMenu.AddResults(filtered, id);
}
@@ -348,8 +348,8 @@ namespace Wox.ViewModel
{
var filtered = results.Where
(
r => StringMatcher.IsMatch(r.Title, query) ||
StringMatcher.IsMatch(r.SubTitle, query)
r => StringMatcher.FuzzySearch(query, r.Title).IsSearchPrecisionScoreMet() ||
StringMatcher.FuzzySearch(query, r.SubTitle).IsSearchPrecisionScoreMet()
).ToList();
History.AddResults(filtered, id);
}
@@ -440,7 +440,7 @@ namespace Wox.ViewModel
Action = _ =>
{
_topMostRecord.Remove(result);
App.API.ShowMsg("Succeed");
App.API.ShowMsg("Success");
return false;
}
};
@@ -455,7 +455,7 @@ namespace Wox.ViewModel
Action = _ =>
{
_topMostRecord.AddOrUpdate(result);
App.API.ShowMsg("Succeed");
App.API.ShowMsg("Success");
return false;
}
};

View File

@@ -148,25 +148,28 @@ namespace Wox.ViewModel
private List<ResultViewModel> NewResults(List<Result> newRawResults, string resultId)
{
var newResults = newRawResults.Select(r => new ResultViewModel(r)).ToList();
var results = Results.ToList();
var newResults = newRawResults.Select(r => new ResultViewModel(r)).ToList();
var oldResults = results.Where(r => r.Result.PluginID == resultId).ToList();
// intersection of A (old results) and B (new newResults)
var intersection = oldResults.Intersect(newResults).ToList();
// Find the same results in A (old results) and B (new newResults)
var sameResults = oldResults
.Where(t1 => newResults.Any(x => x.Result.Equals(t1.Result)))
.Select(t1 => t1)
.ToList();
// remove result of relative complement of B in A
foreach (var result in oldResults.Except(intersection))
foreach (var result in oldResults.Except(sameResults))
{
results.Remove(result);
}
// update index for result in intersection of A and B
foreach (var commonResult in intersection)
// update result with B's score and index position
foreach (var sameResult in sameResults)
{
int oldIndex = results.IndexOf(commonResult);
int oldIndex = results.IndexOf(sameResult);
int oldScore = results[oldIndex].Result.Score;
var newResult = newResults[newResults.IndexOf(commonResult)];
var newResult = newResults[newResults.IndexOf(sameResult)];
int newScore = newResult.Result.Score;
if (newScore != oldScore)
{
@@ -182,7 +185,7 @@ namespace Wox.ViewModel
}
// insert result in relative complement of A in B
foreach (var result in newResults.Except(intersection))
foreach (var result in newResults.Except(sameResults))
{
int newIndex = InsertIndexOf(result.Result.Score, results);
results.Insert(newIndex, result);

View File

@@ -70,6 +70,20 @@ namespace Wox.ViewModel
}
}
public List<string> QuerySearchPrecisionStrings
{
get
{
var precisionStrings = new List<string>();
var enumList = Enum.GetValues(typeof(StringMatcher.SearchPrecisionScore)).Cast<StringMatcher.SearchPrecisionScore>().ToList();
enumList.ForEach(x => precisionStrings.Add(x.ToString()));
return precisionStrings;
}
}
private Internationalization _translater => InternationalizationManager.Instance;
public List<Language> Languages => _translater.LoadAvailableLanguages();
public IEnumerable<int> MaxResultsRange => Enumerable.Range(2, 16);

View File

@@ -313,6 +313,11 @@
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Languages\tr.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -377,7 +382,7 @@
<Page Include="Themes\BlackAndWhite.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Page>
<Page Include="Themes\BlurBlack.xaml">
<Generator>MSBuild:Compile</Generator>