diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj
index c42378a9a36..25577d96b60 100644
--- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj
+++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj
@@ -11,6 +11,7 @@
true
false
false
+ true
@@ -66,12 +67,8 @@
-
-
+
+
diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Languages/en.xaml
index 5dbe925c1cd..e5f3d541e11 100644
--- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Languages/en.xaml
+++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Languages/en.xaml
@@ -20,7 +20,11 @@
Browser Name
Data Directory Path
Add
+ Edit
Delete
+ Browse
Others
Browser Engine
+ If you are not using Chrome, Firefox or Edge, or you are using their portable version, you need to add bookmarks data directory and select correct browser engine to make this plugin work.
+ For example: Brave's engine is Chromium; and its default bookmarks data location is: "%LOCALAPPDATA%\BraveSoftware\Brave-Browser\UserData". For Firefox engine, the bookmarks directory is the userdata folder contains the places.sqlite file.
\ No newline at end of file
diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs
index d072a362d0e..d9a719272b5 100644
--- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs
@@ -17,16 +17,16 @@ namespace Flow.Launcher.Plugin.BrowserBookmark
{
public class Main : ISettingProvider, IPlugin, IReloadable, IPluginI18n, IContextMenu, IDisposable
{
- private PluginInitContext context;
+ private static PluginInitContext context;
- private List cachedBookmarks = new List();
-
- private Settings _settings { get; set; }
+ private static List cachedBookmarks = new List();
+ private static Settings _settings;
+
public void Init(PluginInitContext context)
{
- this.context = context;
-
+ Main.context = context;
+
_settings = context.API.LoadSettingJsonStorage();
cachedBookmarks = BookmarkLoader.LoadAllBookmarks(_settings);
@@ -136,6 +136,11 @@ internal static void RegisterBookmarkFile(string path)
}
public void ReloadData()
+ {
+ ReloadAllBookmarks();
+ }
+
+ public static void ReloadAllBookmarks()
{
cachedBookmarks.Clear();
diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/CustomBrowserSetting.xaml b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/CustomBrowserSetting.xaml
index 499d2283449..392c9e0a78c 100644
--- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/CustomBrowserSetting.xaml
+++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/CustomBrowserSetting.xaml
@@ -7,7 +7,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="clr-namespace:Flow.Launcher.Infrastructure.UI;assembly=Flow.Launcher.Infrastructure"
Title="{DynamicResource flowlauncher_plugin_browserbookmark_bookmarkDataSetting}"
- Width="520"
+ Width="550"
Background="{DynamicResource PopuBGColor}"
Foreground="{DynamicResource PopupTextColor}"
KeyDown="WindowKeyDown"
@@ -39,7 +39,7 @@
+
diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml.cs
index e67c73923f6..2947c2cb56f 100644
--- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml.cs
+++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml.cs
@@ -2,16 +2,46 @@
using Flow.Launcher.Plugin.BrowserBookmark.Models;
using System.Windows.Input;
using System.ComponentModel;
-using System.Windows.Controls;
+using System.Threading.Tasks;
namespace Flow.Launcher.Plugin.BrowserBookmark.Views
{
public partial class SettingsControl : INotifyPropertyChanged
{
public Settings Settings { get; }
-
+
public CustomBrowser SelectedCustomBrowser { get; set; }
-
+
+ public bool LoadChromeBookmark
+ {
+ get => Settings.LoadChromeBookmark;
+ set
+ {
+ Settings.LoadChromeBookmark = value;
+ _ = Task.Run(() => Main.ReloadAllBookmarks());
+ }
+ }
+
+ public bool LoadFirefoxBookmark
+ {
+ get => Settings.LoadFirefoxBookmark;
+ set
+ {
+ Settings.LoadFirefoxBookmark = value;
+ _ = Task.Run(() => Main.ReloadAllBookmarks());
+ }
+ }
+
+ public bool LoadEdgeBookmark
+ {
+ get => Settings.LoadEdgeBookmark;
+ set
+ {
+ Settings.LoadEdgeBookmark = value;
+ _ = Task.Run(() => Main.ReloadAllBookmarks());
+ }
+ }
+
public bool OpenInNewBrowserWindow
{
get => Settings.OpenInNewBrowserWindow;
@@ -42,6 +72,7 @@ private void NewCustomBrowser(object sender, RoutedEventArgs e)
})
{
Settings.CustomChromiumBrowsers.Add(newBrowser);
+ _ = Task.Run(() => Main.ReloadAllBookmarks());
}
}
@@ -50,16 +81,15 @@ private void DeleteCustomBrowser(object sender, RoutedEventArgs e)
if (CustomBrowsers.SelectedItem is CustomBrowser selectedCustomBrowser)
{
Settings.CustomChromiumBrowsers.Remove(selectedCustomBrowser);
+ _ = Task.Run(() => Main.ReloadAllBookmarks());
}
}
+
private void MouseDoubleClickOnSelectedCustomBrowser(object sender, MouseButtonEventArgs e)
{
- if (SelectedCustomBrowser is null)
- return;
-
- var window = new CustomBrowserSettingWindow(SelectedCustomBrowser);
- window.ShowDialog();
+ EditSelectedCustomBrowser();
}
+
private void Others_Click(object sender, RoutedEventArgs e)
{
@@ -70,5 +100,23 @@ private void Others_Click(object sender, RoutedEventArgs e)
else
CustomBrowsersList.Visibility = Visibility.Collapsed;
}
+
+ private void EditCustomBrowser(object sender, RoutedEventArgs e)
+ {
+ EditSelectedCustomBrowser();
+ }
+
+ private void EditSelectedCustomBrowser()
+ {
+ if (SelectedCustomBrowser is null)
+ return;
+
+ var window = new CustomBrowserSettingWindow(SelectedCustomBrowser);
+ var result = window.ShowDialog() ?? false;
+ if (result)
+ {
+ _ = Task.Run(() => Main.ReloadAllBookmarks());
+ }
+ }
}
}