Skip to content

Commit c7f3283

Browse files
Add UI to select browser engine
1 parent fe5da58 commit c7f3283

File tree

4 files changed

+29
-18
lines changed

4 files changed

+29
-18
lines changed

Plugins/Flow.Launcher.Plugin.BrowserBookmark/CustomFirefoxBookmarkLoader.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
1+
using System.Collections.Generic;
62
using Flow.Launcher.Plugin.BrowserBookmark.Models;
73

84
namespace Flow.Launcher.Plugin.BrowserBookmark

Plugins/Flow.Launcher.Plugin.BrowserBookmark/Languages/en.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@
2222
<system:String x:Key="flowlauncher_plugin_browserbookmark_addBrowserBookmark">Add</system:String>
2323
<system:String x:Key="flowlauncher_plugin_browserbookmark_removeBrowserBookmark">Delete</system:String>
2424
<system:String x:Key="flowlauncher_plugin_browserbookmark_others">Others</system:String>
25+
<system:String x:Key="flowlauncher_plugin_browserbookmark_browserEngine">Browser Engine</system:String>
2526
</ResourceDictionary>

Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/CustomBrowserSetting.xaml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:local="clr-namespace:Flow.Launcher.Plugin.BrowserBookmark.Models"
77
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8+
xmlns:ui="clr-namespace:Flow.Launcher.Infrastructure.UI;assembly=Flow.Launcher.Infrastructure"
89
Title="{DynamicResource flowlauncher_plugin_browserbookmark_bookmarkDataSetting}"
910
Width="520"
1011
Background="{DynamicResource PopuBGColor}"
@@ -79,6 +80,7 @@
7980
<Grid.RowDefinitions>
8081
<RowDefinition />
8182
<RowDefinition />
83+
<RowDefinition />
8284
</Grid.RowDefinitions>
8385
<TextBlock
8486
Grid.Row="0"
@@ -104,9 +106,28 @@
104106
HorizontalAlignment="Left"
105107
VerticalAlignment="Center"
106108
FontSize="14"
109+
Text="{DynamicResource flowlauncher_plugin_browserbookmark_browserEngine}" />
110+
<ComboBox
111+
Grid.Row="1"
112+
Grid.Column="1"
113+
Width="120"
114+
Height="34"
115+
Margin="5,10,10,0"
116+
HorizontalAlignment="Left"
117+
VerticalAlignment="Center"
118+
ItemsSource="{Binding Source={ui:EnumBindingSource {x:Type local:BrowserType}}}"
119+
SelectedItem="{Binding BrowserType}">
120+
</ComboBox>
121+
<TextBlock
122+
Grid.Row="2"
123+
Grid.Column="0"
124+
Margin="5,10,20,0"
125+
HorizontalAlignment="Left"
126+
VerticalAlignment="Center"
127+
FontSize="14"
107128
Text="{DynamicResource flowlauncher_plugin_browserbookmark_browserBookmarkDataDirectory}" />
108129
<TextBox
109-
Grid.Row="1"
130+
Grid.Row="2"
110131
Grid.Column="1"
111132
Height="34"
112133
Margin="5,10,0,0"

Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/CustomBrowserSetting.xaml.cs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
11
using Flow.Launcher.Plugin.BrowserBookmark.Models;
2-
using System;
3-
using System.Collections.Generic;
4-
using System.Linq;
5-
using System.Text;
6-
using System.Threading.Tasks;
72
using System.Windows;
83
using System.Windows.Controls;
9-
using System.Windows.Data;
10-
using System.Windows.Documents;
114
using System.Windows.Input;
12-
using System.Windows.Media;
13-
using System.Windows.Media.Imaging;
14-
using System.Windows.Shapes;
155

166
namespace Flow.Launcher.Plugin.BrowserBookmark.Views
177
{
@@ -27,7 +17,9 @@ public CustomBrowserSettingWindow(CustomBrowser browser)
2717
currentCustomBrowser = browser;
2818
DataContext = new CustomBrowser
2919
{
30-
Name = browser.Name, DataDirectoryPath = browser.DataDirectoryPath
20+
Name = browser.Name,
21+
DataDirectoryPath = browser.DataDirectoryPath,
22+
BrowserType = browser.BrowserType,
3123
};
3224
}
3325

@@ -39,6 +31,7 @@ private void ConfirmCancelEditCustomBrowser(object sender, RoutedEventArgs e)
3931
{
4032
currentCustomBrowser.Name = editBrowser.Name;
4133
currentCustomBrowser.DataDirectoryPath = editBrowser.DataDirectoryPath;
34+
currentCustomBrowser.BrowserType = editBrowser.BrowserType;
4235
Close();
4336
}
4437
}
@@ -54,4 +47,4 @@ private void WindowKeyDown(object sender, KeyEventArgs e)
5447
}
5548
}
5649
}
57-
}
50+
}

0 commit comments

Comments
 (0)