mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
prevent user from using global action keyword for content search
would bring up too many results
This commit is contained in:
parent
b2b98333d5
commit
24fe5a11f9
3 changed files with 13 additions and 1 deletions
|
|
@ -9,6 +9,7 @@
|
|||
<system:String x:Key="plugin_explorer_deletefilefolderconfirm">Are you sure you want to permanently delete this {0}?</system:String>
|
||||
<system:String x:Key="plugin_explorer_deletefilefoldersuccess">Deletion successful</system:String>
|
||||
<system:String x:Key="plugin_explorer_deletefilefoldersuccess_detail">Successfully deleted the {0}</system:String>
|
||||
<system:String x:Key="plugin_explorer_globalActionKeywordInvalid">Assigning the global action keyword could bring up too many results during search. Please choose a specific action keyword</system:String>
|
||||
|
||||
<!--Controls-->
|
||||
<system:String x:Key="plugin_explorer_delete">Delete</system:String>
|
||||
|
|
|
|||
|
|
@ -54,5 +54,7 @@ namespace Flow.Launcher.Plugin.Explorer.ViewModels
|
|||
}
|
||||
|
||||
internal bool IsActionKeywordAlreadyAssigned(string newActionKeyword) => PluginManager.ActionKeywordRegistered(newActionKeyword);
|
||||
|
||||
internal bool IsNewActionKeywordGlobal(string newActionKeyword) => newActionKeyword == Query.GlobalPluginWildcardSign;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,8 +51,17 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
|||
|
||||
return;
|
||||
}
|
||||
|
||||
if (settingsViewModel.IsNewActionKeywordGlobal(newActionKeyword)
|
||||
&& currentActionKeyword.Description
|
||||
== settingsViewModel.Context.API.GetTranslation("plugin_explorer_actionkeywordview_filecontentsearch"))
|
||||
{
|
||||
MessageBox.Show(settingsViewModel.Context.API.GetTranslation("plugin_explorer_globalActionKeywordInvalid"));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if(!settingsViewModel.IsActionKeywordAlreadyAssigned(newActionKeyword))
|
||||
if (!settingsViewModel.IsActionKeywordAlreadyAssigned(newActionKeyword))
|
||||
{
|
||||
settingsViewModel.UpdateActionKeyword(newActionKeyword, currentActionKeyword.Keyword);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue