Add browser path selection for browserbookmark plugin

This commit is contained in:
Jeremy Wu
2019-11-11 21:17:37 +11:00
parent e324856301
commit d7e6f97d9c
3 changed files with 27 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
using Microsoft.Win32;
using System.Windows;
using System.Windows.Controls;
using Wox.Plugin.BrowserBookmark.Models;
@@ -28,5 +29,22 @@ namespace Wox.Plugin.BrowserBookmark.Views
{
_settings.OpenInNewBrowserWindow = false;
}
private void OnApplyBTClick(object sender, RoutedEventArgs e)
{
_settings.BrowserPath = browserPathBox.Text;
}
private void OnChooseClick(object sender, RoutedEventArgs e)
{
var fileBrowserDialog = new OpenFileDialog();
fileBrowserDialog.Filter = "Application(*.exe)|*.exe|All files|*.*";
fileBrowserDialog.CheckFileExists = true;
fileBrowserDialog.CheckPathExists = true;
if (fileBrowserDialog.ShowDialog() == true)
{
browserPathBox.Text = fileBrowserDialog.FileName;
}
}
}
}