diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml
index 3a1a1fb05..71b16f159 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml
@@ -22,6 +22,8 @@
Index Search Activation:
Path Explore Activation:
File Content Search:
+ Index Only Search:
+ (Disabled)
Explorer
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs
index 1cb82b75f..4ff6070d4 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs
@@ -46,12 +46,12 @@ namespace Flow.Launcher.Plugin.Explorer.Search
var result = new HashSet(PathEqualityComparator.Instance);
- if (ActionKeywordMatch(query, settings.PathSearchActionKeyword))
+ if (ActionKeywordMatch(query, settings.PathSearchActionKeyword) || ActionKeywordMatch(query, settings.SearchActionKeyword))
{
result.UnionWith(await PathSearchAsync(query, token).ConfigureAwait(false));
}
- if (ActionKeywordMatch(query, settings.SearchActionKeyword) &&
+ if ((ActionKeywordMatch(query, settings.IndexOnlySearchActionKeyword) || ActionKeywordMatch(query, settings.SearchActionKeyword)) &&
querySearch.Length > 0 &&
!querySearch.IsLocationPathString())
{
@@ -61,10 +61,15 @@ namespace Flow.Launcher.Plugin.Explorer.Search
return result.ToList();
}
- private bool ActionKeywordMatch(Query query, string actionKeyword)
+ private bool ActionKeywordMatch(Query query, string allowedActionKeyword)
{
- return query.ActionKeyword == actionKeyword ||
- query.ActionKeyword.Length == 0 && actionKeyword == Query.GlobalPluginWildcardSign;
+ if (settings.EnabledIndexOnlySearchKeyword && (settings.IndexOnlySearchActionKeyword == Query.GlobalPluginWildcardSign || query.ActionKeyword == allowedActionKeyword))
+ return true;
+
+ if (settings.EnabledPathSearchKeyword && (settings.PathSearchActionKeyword == Query.GlobalPluginWildcardSign || query.ActionKeyword == allowedActionKeyword))
+ return true;
+
+ return settings.SearchActionKeyword == Query.GlobalPluginWildcardSign || query.ActionKeyword == allowedActionKeyword;
}
public async Task> PathSearchAsync(Query query, CancellationToken token = default)
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs
index e078bca67..0359b00f7 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs
@@ -22,5 +22,11 @@ namespace Flow.Launcher.Plugin.Explorer
public string FileContentSearchActionKeyword { get; set; } = Constants.DefaultContentSearchActionKeyword;
public string PathSearchActionKeyword { get; set; } = Query.GlobalPluginWildcardSign;
+
+ public bool EnabledPathSearchKeyword { get; set; }
+
+ public string IndexOnlySearchActionKeyword { get; set; } = Query.GlobalPluginWildcardSign;
+
+ public bool EnabledIndexOnlySearchKeyword { get; set; }
}
}
\ No newline at end of file
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs
index 9d4019b9a..ae84f92d4 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs
@@ -59,6 +59,9 @@ namespace Flow.Launcher.Plugin.Explorer.ViewModels
case ActionKeywordProperty.FileContentSearchActionKeyword:
Settings.FileContentSearchActionKeyword = newActionKeyword;
break;
+ case ActionKeywordProperty.IndexOnlySearchActionKeyword:
+ Settings.IndexOnlySearchActionKeyword = newActionKeyword;
+ break;
}
}
@@ -71,6 +74,7 @@ namespace Flow.Launcher.Plugin.Explorer.ViewModels
{
SearchActionKeyword,
PathSearchActionKeyword,
- FileContentSearchActionKeyword
+ FileContentSearchActionKeyword,
+ IndexOnlySearchActionKeyword
}
}
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml
index 0e1c7e872..b49ae3465 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml
@@ -16,6 +16,7 @@
+
@@ -23,8 +24,9 @@
Margin="10" Grid.Row="0" Width="105" Grid.Column="1"
VerticalAlignment="Center"
HorizontalAlignment="Left" />
-
-
+
+
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs
index d1040f746..08f162a69 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs
@@ -1,16 +1,7 @@
using Flow.Launcher.Plugin.Explorer.ViewModels;
-using System;
using System.Collections.Generic;
using System.Linq;
-using System.Text;
using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
namespace Flow.Launcher.Plugin.Explorer.Views
{
@@ -23,20 +14,36 @@ namespace Flow.Launcher.Plugin.Explorer.Views
private ActionKeywordView currentActionKeyword;
-
private List actionKeywordListView;
- public ActionKeywordSetting(SettingsViewModel settingsViewModel, List actionKeywordListView, ActionKeywordView selectedActionKeyword)
+ private Settings settings;
+
+ public ActionKeywordSetting(SettingsViewModel settingsViewModel,
+ List actionKeywordListView,
+ ActionKeywordView selectedActionKeyword, Settings settings)
{
InitializeComponent();
this.settingsViewModel = settingsViewModel;
+ this.settings = settings;
+
currentActionKeyword = selectedActionKeyword;
txtCurrentActionKeyword.Text = selectedActionKeyword.Keyword;
this.actionKeywordListView = actionKeywordListView;
+
+ // Search and File Content action keyword are not allowed to be disabled, they are the default search keyword.
+ if (currentActionKeyword.KeywordProperty == ActionKeywordProperty.SearchActionKeyword
+ || currentActionKeyword.KeywordProperty == ActionKeywordProperty.FileContentSearchActionKeyword)
+ chkActionKeywordEnabled.Visibility = Visibility.Collapsed;
+
+ if (currentActionKeyword.KeywordProperty == ActionKeywordProperty.IndexOnlySearchActionKeyword)
+ chkActionKeywordEnabled.IsChecked = this.settings.EnabledIndexOnlySearchKeyword;
+
+ if (currentActionKeyword.KeywordProperty == ActionKeywordProperty.PathSearchActionKeyword)
+ chkActionKeywordEnabled.IsChecked = this.settings.EnabledPathSearchKeyword;
}
private void OnConfirmButtonClick(object sender, RoutedEventArgs e)
@@ -81,5 +88,30 @@ namespace Flow.Launcher.Plugin.Explorer.Views
return;
}
+ private void OnActionKeywordEnabledChecked(object sender, RoutedEventArgs e)
+ {
+ if (currentActionKeyword.KeywordProperty == ActionKeywordProperty.IndexOnlySearchActionKeyword)
+ settings.EnabledIndexOnlySearchKeyword = true;
+
+ if (currentActionKeyword.KeywordProperty == ActionKeywordProperty.PathSearchActionKeyword)
+ settings.EnabledPathSearchKeyword = true;
+ }
+
+ private void OnActionKeywordEnabledUnChecked(object sender, RoutedEventArgs e)
+ {
+ if (currentActionKeyword.Keyword == settings.IndexOnlySearchActionKeyword)
+ {
+ settings.EnabledIndexOnlySearchKeyword = false;
+ // reset to global so it does not take up an action keyword when disabled
+ settings.IndexOnlySearchActionKeyword = Query.GlobalPluginWildcardSign;
+ }
+
+ if (currentActionKeyword.Keyword == settings.PathSearchActionKeyword)
+ {
+ settings.EnabledPathSearchKeyword = false;
+ // reset to global so it does not take up an action keyword when disabled
+ settings.PathSearchActionKeyword = Query.GlobalPluginWildcardSign;
+ }
+ }
}
}
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs
index b8c9a605a..10ea6b3f4 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs
@@ -49,9 +49,21 @@ namespace Flow.Launcher.Plugin.Explorer.Views
},
new ()
{
- Description = viewModel.Context.API.GetTranslation("plugin_explorer_actionkeywordview_path"),
+ Description = viewModel.Settings.EnabledPathSearchKeyword
+ ? viewModel.Context.API.GetTranslation("plugin_explorer_actionkeywordview_path")
+ : viewModel.Context.API.GetTranslation("plugin_explorer_actionkeywordview_path")
+ + " " + viewModel.Context.API.GetTranslation("plugin_explorer_actionkeywordview_brackets_disabled"),
Keyword = this.viewModel.Settings.PathSearchActionKeyword,
KeywordProperty = ActionKeywordProperty.PathSearchActionKeyword
+ },
+ new ()
+ {
+ Description = viewModel.Settings.EnabledIndexOnlySearchKeyword
+ ? viewModel.Context.API.GetTranslation("plugin_explorer_actionkeywordview_indexonlysearch")
+ : viewModel.Context.API.GetTranslation("plugin_explorer_actionkeywordview_indexonlysearch")
+ + " " + viewModel.Context.API.GetTranslation("plugin_explorer_actionkeywordview_brackets_disabled"),
+ Keyword = this.viewModel.Settings.IndexOnlySearchActionKeyword,
+ KeywordProperty = ActionKeywordProperty.IndexOnlySearchActionKeyword
}
};
@@ -199,7 +211,7 @@ namespace Flow.Launcher.Plugin.Explorer.Views
{
var selectedActionKeyword = lbxActionKeywords.SelectedItem as ActionKeywordView;
- var actionKeywordWindow = new ActionKeywordSetting(viewModel, actionKeywordsListView, selectedActionKeyword);
+ var actionKeywordWindow = new ActionKeywordSetting(viewModel, actionKeywordsListView, selectedActionKeyword, viewModel.Settings);
actionKeywordWindow.ShowDialog();
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/plugin.json b/Plugins/Flow.Launcher.Plugin.Explorer/plugin.json
index 6be1ed95d..0b46f9fd7 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/plugin.json
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/plugin.json
@@ -1,8 +1,10 @@
{
"ID": "572be03c74c642baae319fc283e561a8",
"ActionKeywords": [
- "*",
- "doc:"
+ "*",
+ "doc:",
+ "*",
+ "*"
],
"Name": "Explorer",
"Description": "Search and manage files and folders. Explorer utilises Windows Index Search",