diff --git a/MainForm.cs b/MainForm.cs index 48d4920..f3fb0bf 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -129,6 +129,13 @@ public MainForm() SelectedIndex = 0, ToolTip = Resources.PROTOCOL_FOR_TRACEROUTING }; + protocolSelection.SelectedKey = UserSettings.selectedProtocol; + protocolSelection.SelectedKeyChanged += (sender, e) => + { + UserSettings.selectedProtocol = protocolSelection.SelectedKey; + UserSettings.SaveSettings(); + }; + dataProviderSelection = new DropDown { Items = { @@ -147,11 +154,24 @@ public MainForm() if (UserSettings.enable_ip2region == true) dataProviderSelection.Items.Add(new ListItem { Text = "Ip2region", Key = "--data-provider Ip2region" }); if (UserSettings.enable_ipinfolocal == true) dataProviderSelection.Items.Add(new ListItem { Text = "IPInfoLocal", Key = "--data-provider IPInfoLocal" }); + dataProviderSelection.SelectedKey = UserSettings.selectedDataProvider; + dataProviderSelection.SelectedKeyChanged += (sender, e) => + { + UserSettings.selectedDataProvider = dataProviderSelection.SelectedKey; + UserSettings.SaveSettings(); + }; + if (UserSettings.localDBPath != "") IPDBLoader.Load(); dnsResolverSelection = new DropDown(); dnsResolverSelection.SelectedKeyChanged += resolveParamChanged; LoadDNSResolvers(); + dnsResolverSelection.SelectedKey = UserSettings.selectedDnsResolver; + dnsResolverSelection.SelectedKeyChanged += (sender, e) => + { + UserSettings.selectedDnsResolver = dnsResolverSelection.SelectedKey; + UserSettings.SaveSettings(); + }; tracerouteGridView = new GridView { DataStore = tracerouteResultCollection }; tracerouteGridView.MouseUp += Dragging_MouseUp; diff --git a/PreferencesDialog.xeto b/PreferencesDialog.xeto index 013836b..590dbf6 100644 --- a/PreferencesDialog.xeto +++ b/PreferencesDialog.xeto @@ -149,7 +149,6 @@ - diff --git a/UserSettings.cs b/UserSettings.cs index ce5024a..475c57b 100644 --- a/UserSettings.cs +++ b/UserSettings.cs @@ -126,5 +126,14 @@ internal class UserSettings : Advexp.Settings [Setting(Name = "maskedHopsMode", Default = "ip_half")] public static string maskedHopsMode { get; set; } + + [Setting(Name = "selectedDnsResolver", Default = "system")] + public static string selectedDnsResolver { get; set; } + + [Setting(Name = "selectedProtocol", Default = "")] + public static string selectedProtocol { get; set; } + + [Setting(Name = "selectedDataProvider", Default = "")] + public static string selectedDataProvider { get; set; } } }