Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search delay #1677

Draft
wants to merge 14 commits into
base: dev
Choose a base branch
from
Draft
2 changes: 1 addition & 1 deletion Flow.Launcher.Core/Plugin/PluginManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public static ICollection<PluginPair> ValidPluginsForQuery(Query query)
return Array.Empty<PluginPair>();

if (!NonGlobalPlugins.ContainsKey(query.ActionKeyword))
return GlobalPlugins;
return GlobalPlugins.Where(x=>!x.Metadata.Disabled).ToList();


var plugin = NonGlobalPlugins[query.ActionKeyword];
Expand Down
2 changes: 2 additions & 0 deletions Flow.Launcher.Infrastructure/UserSettings/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public string Theme
public string TimeFormat { get; set; } = "hh:mm tt";
public string DateFormat { get; set; } = "MM'/'dd ddd";
public bool FirstLaunch { get; set; } = true;

public int GlobalSearchDelay { get; set; } = 50;

public double SettingWindowWidth { get; set; } = 1000;
public double SettingWindowHeight { get; set; } = 700;
Expand Down
57 changes: 57 additions & 0 deletions Flow.Launcher.Plugin/PluginMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,51 @@ namespace Flow.Launcher.Plugin
public class PluginMetadata : BaseModel
{
private string _pluginDirectory;
/// <summary>
/// Unique ID of the plugin
/// </summary>
public string ID { get; set; }
/// <summary>
/// Name of the plugin
/// </summary>
public string Name { get; set; }
/// <summary>
/// Author of the plugin
/// </summary>
public string Author { get; set; }
/// <summary>
/// Plugin Version
/// </summary>
public string Version { get; set; }
/// <summary>
/// Programming Language of the plugin
/// </summary>
public string Language { get; set; }
/// <summary>
/// Description of the plugin
/// </summary>
public string Description { get; set; }
/// <summary>
/// Website of the plugin
/// </summary>
public string Website { get; set; }
/// <summary>
/// Whether the plugin is enabled
/// </summary>
public bool Disabled { get; set; }
/// <summary>
/// Executable file path of the plugin
/// </summary>
public string ExecuteFilePath { get; private set;}

/// <summary>
/// Plugin Specified Search Delay
/// </summary>
public int? SearchDelay { get; set; } = null;

/// <summary>
/// Executable file Name of the plugin
/// </summary>
public string ExecuteFileName { get; set; }

public string PluginDirectory
Expand All @@ -31,17 +66,33 @@ internal set
}
}

/// <summary>
/// Action keyword of the plugin (Obsolete)
/// </summary>
public string ActionKeyword { get; set; }

/// <summary>
/// Action keywords of the plugin
/// </summary>
public List<string> ActionKeywords { get; set; }

/// <summary>
/// Icon path of the plugin
/// </summary>
public string IcoPath { get; set;}

/// <summary>
/// Metadata ToString
/// </summary>
/// <returns>Full Name of Plugin</returns>
public override string ToString()
{
return Name;
}

/// <summary>
/// Plugin Priority
/// </summary>
[JsonIgnore]
public int Priority { get; set; }

Expand All @@ -50,8 +101,14 @@ public override string ToString()
/// </summary>
[JsonIgnore]
public long InitTime { get; set; }
/// <summary>
/// Plugin Average Query Time (Statistics)
/// </summary>
[JsonIgnore]
public long AvgQueryTime { get; set; }
/// <summary>
/// Plugin Query Count (Statistics)
/// </summary>
[JsonIgnore]
public int QueryCount { get; set; }
}
Expand Down
2 changes: 2 additions & 0 deletions Flow.Launcher/Languages/en.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
<system:String x:Key="hideOnStartup">Hide Flow Launcher on startup</system:String>
<system:String x:Key="hideNotifyIcon">Hide tray icon</system:String>
<system:String x:Key="hideNotifyIconToolTip">When the icon is hidden from the tray, the Settings menu can be opened by right-clicking on the search window.</system:String>
<system:String x:Key="querySearchDelay">Global Search Delay</system:String>
<system:String x:Key="querySearchDelayToolTip">Sets the speed at which search results appear when typing is stopped. Default is 50ms.</system:String>
<system:String x:Key="querySearchPrecision">Query Search Precision</system:String>
<system:String x:Key="querySearchPrecisionToolTip">Changes minimum match score required for results.</system:String>
<system:String x:Key="ShouldUsePinyin">Search with Pinyin</system:String>
Expand Down
9 changes: 7 additions & 2 deletions Flow.Launcher/Languages/ko.xaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?xml version="1.0"?>
<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">
<?xml version="1.0" ?>
<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">단축키 등록 실패: {0}</system:String>
<system:String x:Key="couldnotStartCmd">{0}을 실행할 수 없습니다.</system:String>
Expand Down Expand Up @@ -66,6 +69,8 @@
<system:String x:Key="hideOnStartup">시작 시 Flow Launcher 숨김</system:String>
<system:String x:Key="hideNotifyIcon">트레이 아이콘 숨기기</system:String>
<system:String x:Key="hideNotifyIconToolTip">트레이에서 아이콘을 숨길 경우, 검색창 우클릭으로 설정창을 열 수 있습니다.</system:String>
<system:String x:Key="querySearchDelay">검색 지연 시간</system:String>
<system:String x:Key="querySearchDelayToolTip">타이핑이 멈췄을 때 검색 결과가 표시되는 속도를 지정합니다. 빠를수록 타이핑 도중 결과가 갱신됩니다. 기본값은 50ms입니다.</system:String>
<system:String x:Key="querySearchPrecision">쿼리 검색 정밀도</system:String>
<system:String x:Key="querySearchPrecisionToolTip">검색 결과에 필요한 최소 매치 점수를 변경합니다.</system:String>
<system:String x:Key="ShouldUsePinyin">항상 Pinyin 사용</system:String>
Expand Down
33 changes: 33 additions & 0 deletions Flow.Launcher/SettingWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,40 @@
Padding="0"
CornerRadius="5"
Style="{DynamicResource SettingGroupBox}">

<StackPanel Orientation="Vertical">
<Border
Margin="0"
BorderThickness="0"
Style="{DynamicResource SettingGroupBox}">
<ItemsControl Style="{StaticResource SettingGrid}">
<StackPanel Style="{StaticResource TextPanel}">
<TextBlock
Grid.Column="1"
VerticalAlignment="Center"
Style="{DynamicResource SettingTitleLabel}"
Text="{DynamicResource querySearchDelay}" />
<TextBlock Style="{DynamicResource SettingSubTitleLabel}" Text="{DynamicResource querySearchDelayToolTip}" />
</StackPanel>
<ComboBox
Grid.Column="2"
MinWidth="95"
Margin="0,0,18,0"
VerticalAlignment="Center"
DisplayMemberPath="Display"
FontSize="14"
ItemsSource="{Binding SearchDelays}"
SelectedValue="{Binding Settings.GlobalSearchDelay}"
SelectedValuePath="Value" />
<TextBlock Style="{StaticResource Glyph}">
&#xe916;
</TextBlock>
</ItemsControl>
</Border>
<Separator
Width="Auto"
BorderThickness="1"
Style="{StaticResource SettingSeparatorStyle}" />
<Border
Margin="0"
BorderThickness="0"
Expand Down
Loading