mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge branch 'dev' into administrator_mode
This commit is contained in:
commit
e85c569cfb
17 changed files with 139 additions and 36 deletions
2
.github/workflows/default_plugins.yml
vendored
2
.github/workflows/default_plugins.yml
vendored
|
|
@ -10,7 +10,7 @@ jobs:
|
|||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
|
|
|
|||
2
.github/workflows/dotnet.yml
vendored
2
.github/workflows/dotnet.yml
vendored
|
|
@ -20,7 +20,7 @@ jobs:
|
|||
NUGET_CERT_REVOCATION_MODE: offline
|
||||
BUILD_NUMBER: ${{ github.run_number }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
- name: Set Flow.Launcher.csproj version
|
||||
id: update
|
||||
uses: vers-one/dotnet-project-version-updater@v1.7
|
||||
|
|
|
|||
2
.github/workflows/release_pr.yml
vendored
2
.github/workflows/release_pr.yml
vendored
|
|
@ -11,7 +11,7 @@ jobs:
|
|||
update-pr:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
|
|
|
|||
|
|
@ -39,6 +39,48 @@
|
|||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="RemoveUnnecessaryRuntimesAfterBuild" AfterTargets="Build">
|
||||
<RemoveDir Directories="$(OutputPath)runtimes\browser-wasm;
|
||||
$(OutputPath)runtimes\linux-arm;
|
||||
$(OutputPath)runtimes\linux-arm64;
|
||||
$(OutputPath)runtimes\linux-armel;
|
||||
$(OutputPath)runtimes\linux-mips64;
|
||||
$(OutputPath)runtimes\linux-musl-arm;
|
||||
$(OutputPath)runtimes\linux-musl-arm64;
|
||||
$(OutputPath)runtimes\linux-musl-x64;
|
||||
$(OutputPath)runtimes\linux-musl-s390x;
|
||||
$(OutputPath)runtimes\linux-ppc64le;
|
||||
$(OutputPath)runtimes\linux-s390x;
|
||||
$(OutputPath)runtimes\linux-x64;
|
||||
$(OutputPath)runtimes\linux-x86;
|
||||
$(OutputPath)runtimes\maccatalyst-arm64;
|
||||
$(OutputPath)runtimes\maccatalyst-x64;
|
||||
$(OutputPath)runtimes\osx;
|
||||
$(OutputPath)runtimes\osx-arm64;
|
||||
$(OutputPath)runtimes\osx-x64"/>
|
||||
</Target>
|
||||
|
||||
<Target Name="RemoveUnnecessaryRuntimesAfterPublish" AfterTargets="Publish">
|
||||
<RemoveDir Directories="$(PublishDir)runtimes\browser-wasm;
|
||||
$(PublishDir)runtimes\linux-arm;
|
||||
$(PublishDir)runtimes\linux-arm64;
|
||||
$(PublishDir)runtimes\linux-armel;
|
||||
$(PublishDir)runtimes\linux-mips64;
|
||||
$(PublishDir)runtimes\linux-musl-arm;
|
||||
$(PublishDir)runtimes\linux-musl-arm64;
|
||||
$(PublishDir)runtimes\linux-musl-x64;
|
||||
$(PublishDir)runtimes\linux-musl-s390x;
|
||||
$(PublishDir)runtimes\linux-ppc64le;
|
||||
$(PublishDir)runtimes\linux-s390x;
|
||||
$(PublishDir)runtimes\linux-x64;
|
||||
$(PublishDir)runtimes\linux-x86;
|
||||
$(PublishDir)runtimes\maccatalyst-arm64;
|
||||
$(PublishDir)runtimes\maccatalyst-x64;
|
||||
$(PublishDir)runtimes\osx;
|
||||
$(PublishDir)runtimes\osx-arm64;
|
||||
$(PublishDir)runtimes\osx-x64"/>
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Remove="App.xaml" />
|
||||
</ItemGroup>
|
||||
|
|
|
|||
|
|
@ -534,10 +534,8 @@
|
|||
MinHeight="380"
|
||||
MaxHeight="{Binding ElementName=ResultListBox, Path=ActualHeight}"
|
||||
Padding="0 0 10 10"
|
||||
d:DataContext="{d:DesignInstance vm:ResultViewModel}"
|
||||
DataContext="{Binding PreviewSelectedItem, Mode=OneWay}"
|
||||
Visibility="{Binding ShowCustomizedPreview}">
|
||||
<ContentControl Content="{Binding Result.PreviewPanel.Value}" />
|
||||
<ContentControl Content="{Binding CustomizedPreviewControl}" />
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ using System.Threading.Channels;
|
|||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Threading;
|
||||
using CommunityToolkit.Mvvm.DependencyInjection;
|
||||
|
|
@ -883,6 +884,12 @@ namespace Flow.Launcher.ViewModel
|
|||
}
|
||||
}
|
||||
|
||||
public Visibility ShowCustomizedPreview
|
||||
=> InternalPreviewVisible && PreviewSelectedItem?.Result.PreviewPanel != null ? Visibility.Visible : Visibility.Collapsed;
|
||||
|
||||
public UserControl CustomizedPreviewControl
|
||||
=> ShowCustomizedPreview == Visibility.Visible ? PreviewSelectedItem?.Result.PreviewPanel.Value : null;
|
||||
|
||||
public Visibility ProgressBarVisibility { get; set; }
|
||||
public Visibility MainWindowVisibility { get; set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -37,12 +37,17 @@ namespace Flow.Launcher.ViewModel
|
|||
OnPropertyChanged(nameof(Image));
|
||||
}
|
||||
|
||||
private bool _imageLoaded = false;
|
||||
|
||||
public ImageSource Image
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_image == ImageLoader.MissingImage)
|
||||
if (!_imageLoaded)
|
||||
{
|
||||
_imageLoaded = true;
|
||||
_ = LoadIconAsync();
|
||||
}
|
||||
|
||||
return _image;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,8 +66,6 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
public Visibility ShowDefaultPreview => Result.PreviewPanel == null ? Visibility.Visible : Visibility.Collapsed;
|
||||
|
||||
public Visibility ShowCustomizedPreview => Result.PreviewPanel == null ? Visibility.Collapsed : Visibility.Visible;
|
||||
|
||||
public Visibility ShowIcon
|
||||
{
|
||||
get
|
||||
|
|
|
|||
|
|
@ -36,6 +36,26 @@ public class Main : ISettingProvider, IPlugin, IReloadable, IPluginI18n, IContex
|
|||
_faviconCacheDir = Path.Combine(
|
||||
context.CurrentPluginMetadata.PluginCacheDirectoryPath,
|
||||
"FaviconCache");
|
||||
|
||||
try
|
||||
{
|
||||
if (Directory.Exists(_faviconCacheDir))
|
||||
{
|
||||
var files = Directory.GetFiles(_faviconCacheDir);
|
||||
foreach (var file in files)
|
||||
{
|
||||
var extension = Path.GetExtension(file);
|
||||
if (extension is ".db-shm" or ".db-wal" or ".sqlite-shm" or ".sqlite-wal")
|
||||
{
|
||||
File.Delete(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Context.API.LogException(ClassName, "Failed to clean up orphaned cache files.", e);
|
||||
}
|
||||
|
||||
LoadBookmarksIfEnabled();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
<system:String x:Key="flowlauncher_plugin_websearch_edit">Edit</system:String>
|
||||
<system:String x:Key="flowlauncher_plugin_websearch_add">Add</system:String>
|
||||
<system:String x:Key="flowlauncher_plugin_websearch_enabled_label">Enabled</system:String>
|
||||
<system:String x:Key="flowlauncher_plugin_websearch_private_mode_label">Private Mode</system:String>
|
||||
<system:String x:Key="flowlauncher_plugin_websearch_true">Enabled</system:String>
|
||||
<system:String x:Key="flowlauncher_plugin_websearch_false">Disabled</system:String>
|
||||
<system:String x:Key="flowlauncher_plugin_websearch_confirm">Confirm</system:String>
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ namespace Flow.Launcher.Plugin.WebSearch
|
|||
Score = score,
|
||||
Action = c =>
|
||||
{
|
||||
_context.API.OpenWebUrl(searchSource.Url.Replace("{q}", Uri.EscapeDataString(keyword)));
|
||||
_context.API.OpenWebUrl(searchSource.Url.Replace("{q}", Uri.EscapeDataString(keyword)), searchSource.IsPrivateMode);
|
||||
|
||||
return true;
|
||||
},
|
||||
|
|
@ -135,7 +135,7 @@ namespace Flow.Launcher.Plugin.WebSearch
|
|||
ActionKeywordAssigned = searchSource.ActionKeyword == SearchSourceGlobalPluginWildCardSign ? string.Empty : searchSource.ActionKeyword,
|
||||
Action = c =>
|
||||
{
|
||||
_context.API.OpenWebUrl(searchSource.Url.Replace("{q}", Uri.EscapeDataString(o)));
|
||||
_context.API.OpenWebUrl(searchSource.Url.Replace("{q}", Uri.EscapeDataString(o)), searchSource.IsPrivateMode);
|
||||
|
||||
return true;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ namespace Flow.Launcher.Plugin.WebSearch
|
|||
public class SearchSource : BaseModel
|
||||
{
|
||||
public string Title { get; set; }
|
||||
|
||||
public string ActionKeyword { get; set; }
|
||||
|
||||
[NotNull]
|
||||
|
|
@ -19,21 +20,17 @@ namespace Flow.Launcher.Plugin.WebSearch
|
|||
/// Custom icons are placed in the user data directory
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public string IconPath
|
||||
{
|
||||
get
|
||||
{
|
||||
if (CustomIcon)
|
||||
return Path.Combine(Main.CustomImagesDirectory, Icon);
|
||||
|
||||
return Path.Combine(Main.DefaultImagesDirectory, Icon);
|
||||
}
|
||||
}
|
||||
public string IconPath => CustomIcon
|
||||
? Path.Combine(Main.CustomImagesDirectory, Icon)
|
||||
: Path.Combine(Main.DefaultImagesDirectory, Icon);
|
||||
|
||||
public string Url { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool Status => Enabled;
|
||||
|
||||
public bool IsPrivateMode { get; set; }
|
||||
|
||||
public bool Enabled { get; set; }
|
||||
|
||||
public SearchSource DeepCopy()
|
||||
|
|
@ -45,8 +42,10 @@ namespace Flow.Launcher.Plugin.WebSearch
|
|||
Url = Url,
|
||||
Icon = Icon,
|
||||
CustomIcon = CustomIcon,
|
||||
IsPrivateMode = IsPrivateMode,
|
||||
Enabled = Enabled
|
||||
};
|
||||
|
||||
return webSearch;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@
|
|||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
|
|
@ -181,12 +182,26 @@
|
|||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Text="{DynamicResource flowlauncher_plugin_websearch_enabled_label}" />
|
||||
Text="{DynamicResource flowlauncher_plugin_websearch_private_mode_label}" />
|
||||
<CheckBox
|
||||
Grid.Row="4"
|
||||
Grid.Column="1"
|
||||
Margin="10 10 10 15"
|
||||
VerticalAlignment="Center"
|
||||
IsChecked="{Binding SearchSource.IsPrivateMode}" />
|
||||
<TextBlock
|
||||
Grid.Row="5"
|
||||
Grid.Column="0"
|
||||
Margin="10 0 10 10"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Text="{DynamicResource flowlauncher_plugin_websearch_enabled_label}" />
|
||||
<CheckBox
|
||||
Grid.Row="5"
|
||||
Grid.Column="1"
|
||||
Margin="10 0 10 10"
|
||||
VerticalAlignment="Center"
|
||||
IsChecked="{Binding SearchSource.Enabled}" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
|
|
|||
|
|
@ -191,7 +191,19 @@ namespace Flow.Launcher.Plugin.WebSearch
|
|||
[JsonIgnore]
|
||||
public SearchSource SelectedSearchSource { get; set; }
|
||||
|
||||
public bool EnableSuggestion { get; set; }
|
||||
private bool enableSuggestion;
|
||||
public bool EnableSuggestion
|
||||
{
|
||||
get => enableSuggestion;
|
||||
set
|
||||
{
|
||||
if (enableSuggestion != value)
|
||||
{
|
||||
enableSuggestion = value;
|
||||
OnPropertyChanged(nameof(EnableSuggestion));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public SuggestionSource[] Suggestions { get; set; } = {
|
||||
|
|
@ -221,9 +233,5 @@ namespace Flow.Launcher.Plugin.WebSearch
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string BrowserPath { get; set; }
|
||||
|
||||
public bool OpenInNewBrowser { get; set; } = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,10 +11,6 @@
|
|||
mc:Ignorable="d">
|
||||
|
||||
<UserControl.Resources>
|
||||
<Style x:Key="BrowserPathBoxStyle" TargetType="TextBox">
|
||||
<Setter Property="Height" Value="28" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
</Style>
|
||||
<DataTemplate x:Key="HeaderTemplateArrowUp">
|
||||
<DockPanel>
|
||||
<TextBlock HorizontalAlignment="Center" Text="{Binding}" />
|
||||
|
|
@ -96,6 +92,20 @@
|
|||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
</GridViewColumn>
|
||||
<GridViewColumn
|
||||
Width="120"
|
||||
Header="{DynamicResource flowlauncher_plugin_websearch_private_mode_label}">
|
||||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
IsChecked="{Binding IsPrivateMode}"
|
||||
IsEnabled="False"
|
||||
/>
|
||||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
</GridViewColumn>
|
||||
</GridView>
|
||||
</ListView.View>
|
||||
</ListView>
|
||||
|
|
@ -138,7 +148,7 @@
|
|||
Margin="{StaticResource SettingPanelItemLeftMargin}"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="11"
|
||||
IsEnabled="{Binding ElementName=EnableSuggestion, Path=IsChecked}"
|
||||
IsEnabled="{Binding Settings.EnableSuggestion}"
|
||||
ItemsSource="{Binding Settings.Suggestions}"
|
||||
SelectedItem="{Binding Settings.SelectedSuggestion}" />
|
||||
<CheckBox
|
||||
|
|
@ -149,7 +159,6 @@
|
|||
Content="{DynamicResource flowlauncher_plugin_websearch_enable_suggestion}"
|
||||
IsChecked="{Binding Settings.EnableSuggestion}" />
|
||||
</StackPanel>
|
||||
<!-- Not sure why binding IsEnabled directly to Settings.EnableWebSearchSuggestion is not working -->
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
|
@ -94,7 +94,8 @@ namespace Flow.Launcher.Plugin.WebSearch
|
|||
var columnBinding = headerClicked.Column.DisplayMemberBinding as Binding;
|
||||
var sortBy = columnBinding?.Path.Path ?? headerClicked.Column.Header as string;
|
||||
|
||||
if(sortBy != null) {
|
||||
if (sortBy != null)
|
||||
{
|
||||
Sort(sortBy, direction);
|
||||
|
||||
if (direction == ListSortDirection.Ascending)
|
||||
|
|
|
|||
|
|
@ -141,6 +141,6 @@
|
|||
"Enabled": true
|
||||
}
|
||||
],
|
||||
"EnableWebSearchSuggestion": false,
|
||||
"WebSearchSuggestionSource": "Google"
|
||||
"EnableSuggestion": false,
|
||||
"Suggestion": "Google"
|
||||
}
|
||||
Loading…
Reference in a new issue