Mercurial > servermonitor
comparison ServerMonitor/Forms/SettingsForm.cs @ 6:c1dffaac66fa
- Don't show multiple password dialogs for the same key if the first one was cancelled.
- Add option to trim log files.
author | Brad Greco <brad@bgreco.net> |
---|---|
date | Fri, 01 Mar 2019 21:38:22 -0500 |
parents | 3142e52cbe69 |
children | 052aa62cb42a |
comparison
equal
deleted
inserted
replaced
5:b6fe203af9d5 | 6:c1dffaac66fa |
---|---|
24 foreach (ComboBox comboBox in new object[] { ErrorComboBox, WarningComboBox, InformationComboBox }) | 24 foreach (ComboBox comboBox in new object[] { ErrorComboBox, WarningComboBox, InformationComboBox }) |
25 { | 25 { |
26 comboBox.DataSource = Enum.GetValues(typeof(FailAction)); | 26 comboBox.DataSource = Enum.GetValues(typeof(FailAction)); |
27 comboBox.Format += FailActionComboBox_Format; | 27 comboBox.Format += FailActionComboBox_Format; |
28 } | 28 } |
29 KeepLogDaysInput.Value = Settings.Default.KeepLogDays; | |
29 ErrorComboBox.SelectedItem = Settings.Default.ErrorAction; | 30 ErrorComboBox.SelectedItem = Settings.Default.ErrorAction; |
30 WarningComboBox.SelectedItem = Settings.Default.WarningAction; | 31 WarningComboBox.SelectedItem = Settings.Default.WarningAction; |
31 InformationComboBox.SelectedItem = Settings.Default.InformationAction; | 32 InformationComboBox.SelectedItem = Settings.Default.InformationAction; |
32 } | 33 } |
33 | 34 |
36 e.Value = e.Value.ToString().Substring(0, 1) + Regex.Replace(e.Value.ToString(), "(\\B[A-Z])", " $1").ToLower().Substring(1); | 37 e.Value = e.Value.ToString().Substring(0, 1) + Regex.Replace(e.Value.ToString(), "(\\B[A-Z])", " $1").ToLower().Substring(1); |
37 } | 38 } |
38 | 39 |
39 private void OkButton_Click(object sender, EventArgs e) | 40 private void OkButton_Click(object sender, EventArgs e) |
40 { | 41 { |
42 Settings.Default.KeepLogDays = (int)KeepLogDaysInput.Value; | |
41 Settings.Default.ErrorAction = (FailAction)ErrorComboBox.SelectedItem; | 43 Settings.Default.ErrorAction = (FailAction)ErrorComboBox.SelectedItem; |
42 Settings.Default.WarningAction = (FailAction)WarningComboBox.SelectedItem; | 44 Settings.Default.WarningAction = (FailAction)WarningComboBox.SelectedItem; |
43 Settings.Default.InformationAction = (FailAction)InformationComboBox.SelectedItem; | 45 Settings.Default.InformationAction = (FailAction)InformationComboBox.SelectedItem; |
44 Settings.Default.Save(); | 46 Settings.Default.Save(); |
45 Close(); | 47 Close(); |