-
-
Notifications
You must be signed in to change notification settings - Fork 442
Enhancement: Support Custom Browser Path & Open in window / tab & In private for URL Plugin #3944
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from 8 commits
56bdfa7
f848d1b
c9ca9ad
2d5626b
5976dde
48e845c
1dc1643
33a9654
1303ae5
978b185
7ca3769
34a58bc
c17db8c
cdf3905
33aef7e
4f49077
96d7d18
3f6bebd
45bb6e9
c2e7976
3a8c64b
d7d88a9
08bf147
64e9150
ec41ec2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:system="clr-namespace:System;assembly=mscorlib"> | ||
<ResourceDictionary | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:system="clr-namespace:System;assembly=mscorlib"> | ||
|
||
<system:String x:Key="flowlauncher_plugin_url_open_search_in">Open search in:</system:String> | ||
<system:String x:Key="flowlauncher_plugin_new_window">New Window</system:String> | ||
<system:String x:Key="flowlauncher_plugin_new_tab">New Tab</system:String> | ||
|
||
<system:String x:Key="flowlauncher_plugin_url_open_url">Open url:{0}</system:String> | ||
<system:String x:Key="flowlauncher_plugin_url_cannot_open_url">Can't open url:{0}</system:String> | ||
|
||
<system:String x:Key="flowlauncher_plugin_url_plugin_name">URL</system:String> | ||
<system:String x:Key="flowlauncher_plugin_url_plugin_description">Open the typed URL from Flow Launcher</system:String> | ||
|
||
<system:String x:Key="flowlauncher_plugin_url_plugin_set_tip">Please set your browser path:</system:String> | ||
<system:String x:Key="flowlauncher_plugin_url_plugin_choose">Choose</system:String> | ||
<system:String x:Key="flowlauncher_plugin_url_plugin_filter">Application(*.exe)|*.exe|All files|*.*</system:String> | ||
|
||
<system:String x:Key="flowlauncher_plugin_use_custom_browser">Use custom browser</system:String> | ||
<system:String x:Key="flowlauncher_plugin_browser_path">Browser path:</system:String> | ||
<system:String x:Key="flowlauncher_plugin_url_open_in_new_window">Open url in new window</system:String> | ||
<system:String x:Key="flowlauncher_plugin_url_open_in_private">Open url in private</system:String> | ||
</ResourceDictionary> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,25 @@ | ||
namespace Flow.Launcher.Plugin.Url | ||
Jack251970 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
public class Settings | ||
public class Settings : BaseModel | ||
{ | ||
public string BrowserPath { get; set; } | ||
public bool UseCustomBrowser { get; set; } = false; | ||
Jack251970 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
public bool OpenInNewBrowserWindow { get; set; } = true; | ||
private string _browserPath = string.Empty; | ||
public string BrowserPath | ||
{ | ||
get => _browserPath; | ||
set | ||
{ | ||
if (_browserPath != value) | ||
{ | ||
_browserPath = value; | ||
OnPropertyChanged(); | ||
} | ||
} | ||
} | ||
|
||
public bool OpenInNewBrowserWindow { get; set; } = false; | ||
Jack251970 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Jack251970 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
public bool OpenInPrivateMode { get; set; } = false; | ||
Jack251970 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<UserControl | ||
x:Class="Flow.Launcher.Plugin.Url.SettingsControl" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:Flow.Launcher.Plugin.Url" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
d:DesignHeight="450" | ||
d:DesignWidth="800" | ||
DataContext="{Binding RelativeSource={RelativeSource Self}}" | ||
mc:Ignorable="d"> | ||
|
||
<Grid Margin="{StaticResource SettingPanelMargin}"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="auto" /> | ||
<RowDefinition Height="auto" /> | ||
<RowDefinition Height="auto" /> | ||
<RowDefinition Height="auto" /> | ||
</Grid.RowDefinitions> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto" /> | ||
<ColumnDefinition Width="*" /> | ||
</Grid.ColumnDefinitions> | ||
|
||
<CheckBox | ||
Grid.Row="0" | ||
Grid.Column="0" | ||
Grid.ColumnSpan="2" | ||
Margin="{StaticResource SettingPanelItemTopBottomMargin}" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Center" | ||
Content="{DynamicResource flowlauncher_plugin_use_custom_browser}" | ||
IsChecked="{Binding Settings.UseCustomBrowser, Mode=TwoWay}" /> | ||
|
||
<TextBlock | ||
Grid.Row="1" | ||
Grid.Column="0" | ||
Margin="{StaticResource SettingPanelItemRightTopBottomMargin}" | ||
VerticalAlignment="Center" | ||
FontSize="14" | ||
Text="{DynamicResource flowlauncher_plugin_browser_path}" /> | ||
<Grid | ||
Grid.Row="1" | ||
Grid.Column="1" | ||
Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="Auto" /> | ||
</Grid.ColumnDefinitions> | ||
|
||
<TextBox | ||
Grid.Column="0" | ||
HorizontalAlignment="Stretch" | ||
VerticalAlignment="Center" | ||
IsReadOnly="True" | ||
Text="{Binding Settings.BrowserPath, Mode=OneWay}" /> | ||
<Button | ||
Grid.Column="1" | ||
Margin="{StaticResource SettingPanelItemLeftMargin}" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Center" | ||
Click="SelectBrowserPath" | ||
Content="{DynamicResource flowlauncher_plugin_url_plugin_choose}" /> | ||
</Grid> | ||
|
||
<CheckBox | ||
Grid.Row="2" | ||
Grid.Column="0" | ||
Grid.ColumnSpan="2" | ||
Margin="{StaticResource SettingPanelItemTopBottomMargin}" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Center" | ||
Content="{DynamicResource flowlauncher_plugin_url_open_in_new_window}" | ||
IsChecked="{Binding Settings.OpenInNewBrowserWindow, Mode=TwoWay}" /> | ||
|
||
<CheckBox | ||
Grid.Row="3" | ||
Grid.Column="0" | ||
Grid.ColumnSpan="2" | ||
Margin="{StaticResource SettingPanelItemTopBottomMargin}" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Center" | ||
Content="{DynamicResource flowlauncher_plugin_url_open_in_private}" | ||
IsChecked="{Binding Settings.OpenInPrivateMode, Mode=TwoWay}" /> | ||
</Grid> | ||
</UserControl> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
|
||
namespace Flow.Launcher.Plugin.Url; | ||
|
||
public partial class SettingsControl : UserControl | ||
{ | ||
public Settings Settings => Main.Settings; | ||
|
||
public SettingsControl() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void SelectBrowserPath(object sender, RoutedEventArgs e) | ||
{ | ||
var dlg = new Microsoft.Win32.OpenFileDialog | ||
{ | ||
Filter = Main.Context.API.GetTranslation("flowlauncher_plugin_url_plugin_filter") | ||
|
||
}; | ||
|
||
if (dlg.ShowDialog() == true && !string.IsNullOrEmpty(dlg.FileName)) | ||
{ | ||
Settings.BrowserPath = dlg.FileName; | ||
} | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.