diff --git a/Plugins/Flow.Launcher.Plugin.Url/Main.cs b/Plugins/Flow.Launcher.Plugin.Url/Main.cs index 61dd0bb15..669ee09d4 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Url/Main.cs @@ -1,11 +1,12 @@ using System; using System.Collections.Generic; using System.Text.RegularExpressions; +using System.Windows.Controls; using Flow.Launcher.Plugin.SharedCommands; namespace Flow.Launcher.Plugin.Url { - public class Main : IPlugin, IPluginI18n + public class Main : IPlugin, IPluginI18n, ISettingProvider { //based on https://gist.github.com/dperini/729294 private const string UrlPattern = "^" + @@ -123,5 +124,10 @@ namespace Flow.Launcher.Plugin.Url { return Context.API.GetTranslation("flowlauncher_plugin_url_plugin_description"); } + + public Control CreateSettingPanel() + { + return new SettingsControl(); + } } } diff --git a/Plugins/Flow.Launcher.Plugin.Url/Settings.cs b/Plugins/Flow.Launcher.Plugin.Url/Settings.cs index c0b96b7a4..a5d15a603 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.Url/Settings.cs @@ -1,10 +1,22 @@ namespace Flow.Launcher.Plugin.Url { - public class Settings + public class Settings : BaseModel { public bool UseCustomBrowser { get; set; } = false; - public string BrowserPath { get; set; } = string.Empty; + private string _browserPath = string.Empty; + public string BrowserPath + { + get => _browserPath; + set + { + if (_browserPath != value) + { + _browserPath = value; + OnPropertyChanged(); + } + } + } public bool OpenInNewBrowserWindow { get; set; } = false; diff --git a/Plugins/Flow.Launcher.Plugin.Url/SettingsControl.xaml b/Plugins/Flow.Launcher.Plugin.Url/SettingsControl.xaml new file mode 100644 index 000000000..e8b1e3689 --- /dev/null +++ b/Plugins/Flow.Launcher.Plugin.Url/SettingsControl.xaml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + +