mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-01-18 22:43:31 +08:00
commit
7aca726c33
2
.gitignore
vendored
2
.gitignore
vendored
@ -117,3 +117,5 @@ UpgradeLog*.XML
|
||||
Wox/Images/websearch/Thumbs.db
|
||||
Wox/Images/Thumbs.db
|
||||
Wox/Wox.csproj
|
||||
|
||||
*.sublime-*
|
||||
|
@ -44,6 +44,12 @@ namespace Wox.Infrastructure.Storage.UserSettings
|
||||
[JsonProperty]
|
||||
public List<WebSearch> WebSearches { get; set; }
|
||||
|
||||
[JsonProperty]
|
||||
public double WindowLeft { get; set; }
|
||||
|
||||
[JsonProperty]
|
||||
public double WindowTop { get; set; }
|
||||
|
||||
[JsonProperty]
|
||||
public List<ProgramSource> ProgramSources { get; set; }
|
||||
|
||||
|
@ -19,7 +19,7 @@ namespace Wox.Plugin.SystemPlugins
|
||||
|
||||
protected override List<Result> QueryInternal(Query query)
|
||||
{
|
||||
if (string.IsNullOrEmpty(query.RawQuery) || query.RawQuery.EndsWith(" ") || query.RawQuery.Length <= 1) return new List<Result>();
|
||||
if (query.RawQuery.EndsWith(" ") || query.RawQuery.Length <= 1) return new List<Result>();
|
||||
|
||||
var fuzzyMather = FuzzyMatcher.Create(query.RawQuery);
|
||||
List<Bookmark> returnList = bookmarks.Where(o => MatchProgram(o, fuzzyMather)).ToList();
|
||||
|
@ -33,8 +33,7 @@ namespace Wox.Plugin.SystemPlugins
|
||||
|
||||
protected override List<Result> QueryInternal(Query query)
|
||||
{
|
||||
if (string.IsNullOrEmpty(query.RawQuery)
|
||||
|| query.RawQuery.Length <= 2 // don't affect when user only input "e" or "i" keyword
|
||||
if (query.RawQuery.Length <= 2 // don't affect when user only input "e" or "i" keyword
|
||||
|| !regValidExpressChar.IsMatch(query.RawQuery)
|
||||
|| !IsBracketComplete(query.RawQuery)) return new List<Result>();
|
||||
|
||||
|
@ -51,7 +51,7 @@ namespace Wox.Plugin.SystemPlugins.Program
|
||||
|
||||
protected override List<Result> QueryInternal(Query query)
|
||||
{
|
||||
if (string.IsNullOrEmpty(query.RawQuery) || query.RawQuery.EndsWith(" ") || query.RawQuery.Length <= 1) return new List<Result>();
|
||||
if (query.RawQuery.EndsWith(" ") || query.RawQuery.Length <= 1) return new List<Result>();
|
||||
|
||||
var fuzzyMather = FuzzyMatcher.Create(query.RawQuery);
|
||||
List<Program> returnList = installedList.Where(o => MatchProgram(o, fuzzyMather)).ToList();
|
||||
|
@ -25,7 +25,7 @@ namespace Wox.Plugin.SystemPlugins
|
||||
|
||||
protected override List<Result> QueryInternal(Query query)
|
||||
{
|
||||
if (string.IsNullOrEmpty(query.RawQuery) || query.RawQuery.EndsWith(" ") || query.RawQuery.Length <= 1) return new List<Result>();
|
||||
if (query.RawQuery.EndsWith(" ") || query.RawQuery.Length <= 1) return new List<Result>();
|
||||
|
||||
List<Result> results = new List<Result>();
|
||||
|
||||
@ -94,7 +94,7 @@ namespace Wox.Plugin.SystemPlugins
|
||||
Action = (c) =>
|
||||
{
|
||||
ProcessStartInfo Info = new ProcessStartInfo();
|
||||
Info.Arguments = "/C ping 127.0.0.1 -n 1 && \"" + Application.ExecutablePath + "\"";
|
||||
Info.Arguments = "/C sleep 1 && \"" + Application.ExecutablePath + "\"";
|
||||
Info.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
Info.CreateNoWindow = true;
|
||||
Info.FileName = "cmd.exe";
|
||||
|
@ -16,7 +16,6 @@ namespace Wox.Plugin.SystemPlugins
|
||||
protected override List<Result> QueryInternal(Query query)
|
||||
{
|
||||
List<Result> results = new List<Result>();
|
||||
if (string.IsNullOrEmpty(query.RawQuery)) return results;
|
||||
|
||||
foreach (PluginMetadata metadata in allPlugins.Select(o => o.Metadata))
|
||||
{
|
||||
|
@ -18,7 +18,6 @@ namespace Wox.Plugin.SystemPlugins
|
||||
protected override List<Result> QueryInternal(Query query)
|
||||
{
|
||||
List<Result> results = new List<Result>();
|
||||
if (string.IsNullOrEmpty(query.ActionName)) return results;
|
||||
|
||||
WebSearch webSearch =
|
||||
UserSettingStorage.Instance.WebSearches.FirstOrDefault(o => o.ActionWord == query.ActionName && o.Enabled);
|
||||
|
@ -140,13 +140,26 @@ namespace Wox {
|
||||
}
|
||||
|
||||
void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) {
|
||||
UserSettingStorage.Instance.WindowLeft = Left;
|
||||
UserSettingStorage.Instance.WindowTop = Top;
|
||||
UserSettingStorage.Instance.Save();
|
||||
this.HideWox();
|
||||
e.Cancel = true;
|
||||
}
|
||||
|
||||
private void MainWindow_OnLoaded(object sender, RoutedEventArgs e) {
|
||||
Left = (SystemParameters.PrimaryScreenWidth - ActualWidth) / 2;
|
||||
Top = (SystemParameters.PrimaryScreenHeight - ActualHeight) / 3;
|
||||
if (UserSettingStorage.Instance.WindowLeft == 0
|
||||
&& UserSettingStorage.Instance.WindowTop == 0)
|
||||
{
|
||||
Left = UserSettingStorage.Instance.WindowLeft
|
||||
= (SystemParameters.PrimaryScreenWidth - ActualWidth) / 2;
|
||||
Top = UserSettingStorage.Instance.WindowTop
|
||||
= (SystemParameters.PrimaryScreenHeight - ActualHeight) / 5;
|
||||
}
|
||||
else {
|
||||
Left = UserSettingStorage.Instance.WindowLeft;
|
||||
Top = UserSettingStorage.Instance.WindowTop;
|
||||
}
|
||||
|
||||
Plugins.Init();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user