Skip to content

Commit 08d428e

Browse files
authored
Merge pull request #455 from Flow-Launcher/fix_empty_actionkeywords
Fix loading when no action keywords present for a plugin in user plugin setting
2 parents 76159d6 + 3623f88 commit 08d428e

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

Flow.Launcher.Infrastructure/UserSettings/PluginSettings.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ public void UpdatePluginSettings(List<PluginMetadata> metadatas)
3030
metadata.ActionKeywords = settings.ActionKeywords;
3131
metadata.ActionKeyword = settings.ActionKeywords[0];
3232
}
33+
else
34+
{
35+
metadata.ActionKeywords = new List<string>();
36+
metadata.ActionKeyword = string.Empty;
37+
}
3338
metadata.Disabled = settings.Disabled;
3439
metadata.Priority = settings.Priority;
3540
}

Flow.Launcher/ViewModel/PluginViewModel.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System.Windows;
22
using System.Windows.Media;
33
using Flow.Launcher.Plugin;
4-
using Flow.Launcher.Core.Resource;
54
using Flow.Launcher.Infrastructure.Image;
65
using Flow.Launcher.Core.Plugin;
76

@@ -11,8 +10,6 @@ public class PluginViewModel : BaseModel
1110
{
1211
public PluginPair PluginPair { get; set; }
1312

14-
private readonly Internationalization _translator = InternationalizationManager.Instance;
15-
1613
public ImageSource Image => ImageLoader.Load(PluginPair.Metadata.IcoPath);
1714
public bool PluginState
1815
{
@@ -22,7 +19,7 @@ public bool PluginState
2219
PluginPair.Metadata.Disabled = !value;
2320
}
2421
}
25-
public Visibility ActionKeywordsVisibility => PluginPair.Metadata.ActionKeywords.Count > 1 ? Visibility.Collapsed : Visibility.Visible;
22+
public Visibility ActionKeywordsVisibility => PluginPair.Metadata.ActionKeywords.Count == 1 ? Visibility.Visible : Visibility.Collapsed;
2623
public string InitilizaTime => PluginPair.Metadata.InitTime.ToString() + "ms";
2724
public string QueryTime => PluginPair.Metadata.AvgQueryTime + "ms";
2825
public string ActionKeywordsText => string.Join(Query.ActionKeywordSeperater, PluginPair.Metadata.ActionKeywords);

Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@
1313
<system:String x:Key="flowlauncher_plugin_program_reindex">Reindex</system:String>
1414
<system:String x:Key="flowlauncher_plugin_program_indexing">Indexing</system:String>
1515
<system:String x:Key="flowlauncher_plugin_program_index_start">Index Start Menu</system:String>
16+
<system:String x:Key="flowlauncher_plugin_program_index_start_tooltip">When enabled, Flow will load programs from the start menu</system:String>
1617
<system:String x:Key="flowlauncher_plugin_program_index_registry">Index Registry</system:String>
18+
<system:String x:Key="flowlauncher_plugin_program_index_registry_tooltip">When enabled, Flow will load programs from the registry</system:String>
1719
<system:String x:Key="flowlauncher_plugin_program_enable_description">Enable Program Description</system:String>
20+
<system:String x:Key="flowlauncher_plugin_program_enable_description_tooltip">Disabling this will also stop Flow from searching via the program desciption</system:String>
1821
<system:String x:Key="flowlauncher_plugin_program_suffixes_header">Suffixes</system:String>
1922
<system:String x:Key="flowlauncher_plugin_program_max_depth_header">Max Depth</system:String>
2023

Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
</Grid.RowDefinitions>
1717
<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Stretch">
1818
<StackPanel Orientation="Vertical" Width="250">
19-
<CheckBox Name="StartMenuEnabled" IsChecked="{Binding EnableStartMenuSource}" Margin="5" Content="{DynamicResource flowlauncher_plugin_program_index_start}" />
20-
<CheckBox Name="RegistryEnabled" IsChecked="{Binding EnableRegistrySource}" Margin="5" Content="{DynamicResource flowlauncher_plugin_program_index_registry}" />
21-
<CheckBox Name="DescriptionEnabled" IsChecked="{Binding EnableDescription}" Margin="5" Content="{DynamicResource flowlauncher_plugin_program_enable_description}" />
19+
<CheckBox Name="StartMenuEnabled" IsChecked="{Binding EnableStartMenuSource}" Margin="5" Content="{DynamicResource flowlauncher_plugin_program_index_start}" ToolTip="{DynamicResource flowlauncher_plugin_program_index_start_tooltip}" />
20+
<CheckBox Name="RegistryEnabled" IsChecked="{Binding EnableRegistrySource}" Margin="5" Content="{DynamicResource flowlauncher_plugin_program_index_registry}" ToolTip="{DynamicResource flowlauncher_plugin_program_index_registry_tooltip}" />
21+
<CheckBox Name="DescriptionEnabled" IsChecked="{Binding EnableDescription}" Margin="5" Content="{DynamicResource flowlauncher_plugin_program_enable_description}" ToolTip="{DynamicResource flowlauncher_plugin_program_enable_description_tooltip}" />
2222
</StackPanel>
2323
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
2424
<Button Height="31" HorizontalAlignment="Right" Margin="10" Width="100" x:Name="btnLoadAllProgramSource" Click="btnLoadAllProgramSource_OnClick" Content="{DynamicResource flowlauncher_plugin_program_all_programs}" />

Plugins/Flow.Launcher.Plugin.Program/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"Name": "Program",
55
"Description": "Search programs in Flow.Launcher",
66
"Author": "qianlifeng",
7-
"Version": "1.5.1",
7+
"Version": "1.5.2",
88
"Language": "csharp",
99
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
1010
"ExecuteFileName": "Flow.Launcher.Plugin.Program.dll",

0 commit comments

Comments
 (0)