2019-11-11 18:17:37 +08:00
|
|
|
using Microsoft.Win32;
|
2019-11-11 05:00:31 +08:00
|
|
|
using System.Windows;
|
|
|
|
using System.Windows.Controls;
|
|
|
|
using Wox.Plugin.BrowserBookmark.Models;
|
|
|
|
|
|
|
|
namespace Wox.Plugin.BrowserBookmark.Views
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Interaction logic for BrowserBookmark.xaml
|
|
|
|
/// </summary>
|
|
|
|
public partial class SettingsControl : UserControl
|
|
|
|
{
|
|
|
|
private readonly Settings _settings;
|
|
|
|
|
|
|
|
public SettingsControl(Settings settings)
|
|
|
|
{
|
|
|
|
InitializeComponent();
|
|
|
|
_settings = settings;
|
|
|
|
NewWindowBrowser.IsChecked = _settings.OpenInNewBrowserWindow;
|
|
|
|
NewTabInBrowser.IsChecked = !_settings.OpenInNewBrowserWindow;
|
|
|
|
}
|
|
|
|
|
|
|
|
private void OnNewBrowserWindowClick(object sender, RoutedEventArgs e)
|
|
|
|
{
|
|
|
|
_settings.OpenInNewBrowserWindow = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
private void OnNewTabClick(object sender, RoutedEventArgs e)
|
|
|
|
{
|
|
|
|
_settings.OpenInNewBrowserWindow = false;
|
|
|
|
}
|
2019-11-11 18:17:37 +08:00
|
|
|
|
|
|
|
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;
|
2019-11-11 19:29:15 +08:00
|
|
|
_settings.BrowserPath = fileBrowserDialog.FileName;
|
2019-11-11 18:17:37 +08:00
|
|
|
}
|
|
|
|
}
|
2019-11-11 05:00:31 +08:00
|
|
|
}
|
|
|
|
}
|