Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Plugins/Flow.Launcher.Plugin.WebSearch/Languages/de.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<system:String x:Key="flowlauncher_plugin_websearch_url">URL</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_search">Suche</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_enable_suggestion">Autovervollständigung von Suchanfragen verwenden</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_max_suggestions">Max. Vorschläge:</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_enable_suggestion_provider">Autovervollständigung der Daten aus:</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_pls_select_web_search">Bitte wählen Sie eine Websuche aus</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_delete_warning">Sind Sie sicher, dass Sie {0} löschen wollen?</system:String>
Expand Down
1 change: 1 addition & 0 deletions Plugins/Flow.Launcher.Plugin.WebSearch/Languages/en.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<system:String x:Key="flowlauncher_plugin_websearch_url">URL</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_search">Search</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_enable_suggestion">Use Search Query Autocomplete</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_max_suggestions">Max Suggestions:</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_enable_suggestion_provider">Autocomplete Data from:</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_pls_select_web_search">Please select a web search</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_delete_warning">Are you sure you want to delete {0}?</system:String>
Expand Down
1 change: 1 addition & 0 deletions Plugins/Flow.Launcher.Plugin.WebSearch/Languages/es.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<system:String x:Key="flowlauncher_plugin_websearch_url">URL</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_search">Busca en</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_enable_suggestion">Usar autocompletado en consultas de búsqueda</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_max_suggestions">Max sugerencias:</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_enable_suggestion_provider">Autocompletar datos desde:</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_pls_select_web_search">Por favor, seleccione una búsqueda web</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_delete_warning">¿Está seguro de que desea eliminar {0}?</system:String>
Expand Down
1 change: 1 addition & 0 deletions Plugins/Flow.Launcher.Plugin.WebSearch/Languages/fr.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<system:String x:Key="flowlauncher_plugin_websearch_url">URL</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_search">Rechercher sur</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_enable_suggestion">Utiliser la fonction d'auto-complétion des requêtes de recherche</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_max_suggestions">Max suggestions :</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_enable_suggestion_provider">Saisir automatiquement les données à partir de :</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_pls_select_web_search">Veuillez sélectionner une recherche web</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_delete_warning">Êtes-vous sûr de vouloir supprimer {0} ?</system:String>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<system:String x:Key="flowlauncher_plugin_websearch_url">URL</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_search">Search</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_enable_suggestion">Use Search Query Autocomplete</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_max_suggestions">Qtd Sugestões:</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_enable_suggestion_provider">Autocomplete Data from:</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_pls_select_web_search">Please select a web search</system:String>
<system:String x:Key="flowlauncher_plugin_websearch_delete_warning">Are you sure you want to delete {0}?</system:String>
Expand Down
5 changes: 3 additions & 2 deletions Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -44,7 +44,7 @@
var title = keyword;
string subtitle = _context.API.GetTranslation("flowlauncher_plugin_websearch_search") + " " + searchSource.Title;

// Action Keyword match apear on top

Check warning on line 47 in Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`apear` is not a recognized word. (unrecognized-spelling)
var score = searchSource.ActionKeyword == SearchSourceGlobalPluginWildCardSign ? scoreStandard : scoreStandard + 1;

// This populates the associated action keyword search entry
Expand Down Expand Up @@ -91,6 +91,7 @@

if (token.IsCancellationRequested)
return null;

}

return results;
Expand Down Expand Up @@ -126,7 +127,7 @@

token.ThrowIfCancellationRequested();

var resultsFromSuggestion = suggestions?.Select(o => new Result
var resultsFromSuggestion = suggestions?.Take(_settings.MaxSuggestions).Select(o => new Result
{
Title = o,
SubTitle = subtitle,
Expand All @@ -152,7 +153,7 @@
{
Title = _context.API.GetTranslation("flowlauncher_plugin_websearch_copyurl_title"),
SubTitle = _context.API.GetTranslation("flowlauncher_plugin_websearch_copyurl_subtitle"),
IcoPath = "Images/copylink.png",

Check warning on line 156 in Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`copylink` is not a recognized word. (unrecognized-spelling)
Action = c =>
{
_context.API.CopyToClipboard(selected.ContextData as string);
Expand Down
14 changes: 14 additions & 0 deletions Plugins/Flow.Launcher.Plugin.WebSearch/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
{
Title = "Google Scholar",
ActionKeyword = "sc",
Icon = "google.png",

Check warning on line 33 in Plugins/Flow.Launcher.Plugin.WebSearch/Settings.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`google` is not a recognized word. (unrecognized-spelling)
Url = "https://scholar.google.com/scholar?q={q}",
Enabled = true
},
Expand Down Expand Up @@ -70,7 +70,7 @@
{
Title = "Google Maps",
ActionKeyword = "maps",
Icon = "google_maps.png",

Check warning on line 73 in Plugins/Flow.Launcher.Plugin.WebSearch/Settings.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`google` is not a recognized word. (unrecognized-spelling)
Url = "https://maps.google.com/maps?q={q}",
Enabled = true
},
Expand All @@ -78,7 +78,7 @@
{
Title = "Google Translate",
ActionKeyword = "translate",
Icon = "google_translate.png",

Check warning on line 81 in Plugins/Flow.Launcher.Plugin.WebSearch/Settings.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`google` is not a recognized word. (unrecognized-spelling)
Url = "https://translate.google.com/#auto|en|{q}",
Enabled = true
},
Expand Down Expand Up @@ -118,7 +118,7 @@
{
Title = "Google Drive",
ActionKeyword = "drive",
Icon = "google_drive.png",

Check warning on line 121 in Plugins/Flow.Launcher.Plugin.WebSearch/Settings.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`google` is not a recognized word. (unrecognized-spelling)
Url = "https://drive.google.com/?hl=en&tab=bo#search/{q}",
Enabled = true
},
Expand Down Expand Up @@ -205,6 +205,20 @@
}
}

private int maxSuggestions = 1;
public int MaxSuggestions
{
get => maxSuggestions;
set
{
if (maxSuggestions != value)
{
maxSuggestions = Math.Max(1, Math.Min(value, 10));
OnPropertyChanged(nameof(MaxSuggestions));
}
}
}

[JsonIgnore]
public SuggestionSource[] Suggestions { get; set; } = {
new Google(),
Expand Down
14 changes: 14 additions & 0 deletions Plugins/Flow.Launcher.Plugin.WebSearch/SettingsControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
</GridViewColumn.CellTemplate>
</GridViewColumn>

<!-- Margin="0 6" is a workaround to set this TextBlock to vertially center -->

Check warning on line 75 in Plugins/Flow.Launcher.Plugin.WebSearch/SettingsControl.xaml

View workflow job for this annotation

GitHub Actions / Check Spelling

`vertially` is not a recognized word. (unrecognized-spelling)
<GridViewColumn Width="135" Header="{DynamicResource flowlauncher_plugin_websearch_action_keyword}">
<GridViewColumn.CellTemplate>
<DataTemplate>
Expand Down Expand Up @@ -106,7 +106,7 @@
</GridViewColumn.CellTemplate>
</GridViewColumn>

<!-- CheckBox is vertially center by default -->

Check warning on line 109 in Plugins/Flow.Launcher.Plugin.WebSearch/SettingsControl.xaml

View workflow job for this annotation

GitHub Actions / Check Spelling

`vertially` is not a recognized word. (unrecognized-spelling)
<GridViewColumn Width="123" Header="{DynamicResource flowlauncher_plugin_websearch_private_mode_label}">
<GridViewColumn.CellTemplate>
<DataTemplate>
Expand Down Expand Up @@ -154,6 +154,20 @@
<Label
HorizontalAlignment="Right"
VerticalAlignment="Center"
Content="{DynamicResource flowlauncher_plugin_websearch_max_suggestions}" />
<TextBox
Width="40"
Height="30"
Margin="{StaticResource SettingPanelItemLeftMargin}"
VerticalAlignment="Center"
HorizontalAlignment="Center"
TextAlignment="Center"
FontSize="11"
Text="{Binding Settings.MaxSuggestions, UpdateSourceTrigger=PropertyChanged}" />
<Label
HorizontalAlignment="Right"
VerticalAlignment="Center"
Margin="{StaticResource SettingPanelItemLeftMargin}"
Content="{DynamicResource flowlauncher_plugin_websearch_enable_suggestion_provider}" />
<ComboBox
Height="30"
Expand Down
Loading