mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
Add everything plugin context menu and add settings in Url plugin (#2299)
1. Add useful context menu items in everything 2. Add settings in Url plugin, can set browser path * let url plugin support multi Languages
This commit is contained in:
53
Plugins/Wox.Plugin.Url/SettingsControl.xaml.cs
Normal file
53
Plugins/Wox.Plugin.Url/SettingsControl.xaml.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using Microsoft.Win32;
|
||||
|
||||
|
||||
namespace Wox.Plugin.Url
|
||||
{
|
||||
/// <summary>
|
||||
/// SettingsControl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SettingsControl : UserControl
|
||||
{
|
||||
private Settings _settings;
|
||||
private IPublicAPI _woxAPI;
|
||||
|
||||
public SettingsControl(IPublicAPI woxAPI,Settings settings)
|
||||
{
|
||||
InitializeComponent();
|
||||
_settings = settings;
|
||||
_woxAPI = woxAPI;
|
||||
browserPathBox.Text = _settings.BrowserPath;
|
||||
}
|
||||
|
||||
private void OnApplyBTClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_settings.BrowserPath = browserPathBox.Text;
|
||||
}
|
||||
|
||||
private void OnChooseClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var fileBrowserDialog = new OpenFileDialog();
|
||||
fileBrowserDialog.Filter = _woxAPI.GetTranslation("wox_plugin_url_plugin_filter"); ;
|
||||
fileBrowserDialog.CheckFileExists = true;
|
||||
fileBrowserDialog.CheckPathExists = true;
|
||||
if (fileBrowserDialog.ShowDialog() == true)
|
||||
{
|
||||
browserPathBox.Text = fileBrowserDialog.FileName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user