OSDN Git Service

通知の予告の有無をチェックボックスで設定できるようにする
[kancollesniffer/KancolleSniffer.git] / KancolleSniffer / NotificationConfigDialog.cs
index 7025d65..a4b10e9 100644 (file)
@@ -24,6 +24,7 @@ namespace KancolleSniffer
             checkBoxPush.Tag = NotificationType.Push;\r
             checkBoxRepeat.Tag = NotificationType.Repeat;\r
             checkBoxCont.Tag = NotificationType.Cont;\r
+            checkBoxPreliminary.Tag = NotificationType.Preliminary;\r
 \r
             // ReSharper disable once CoVariantArrayConversion\r
             listBoxNotifications.Items.AddRange(Config.NotificationNames);\r
@@ -39,15 +40,17 @@ namespace KancolleSniffer
                 case "艦娘数超過":\r
                 case "装備数超過":\r
                 case "大破警告":\r
-                    textBoxPreliminary.Visible = labelPreliminary.Visible = textBoxRepeat.Visible =\r
-                        labelRepeat.Visible = checkBoxRepeat.Visible = checkBoxCont.Visible = false;\r
+                    textBoxPreliminary.Visible = labelPreliminary.Visible = checkBoxPreliminary.Visible =\r
+                        textBoxRepeat.Visible = labelRepeat.Visible = checkBoxRepeat.Visible =\r
+                            checkBoxCont.Visible = false;\r
                     break;\r
                 default:\r
                     textBoxRepeat.Visible = labelRepeat.Visible = checkBoxRepeat.Visible = true;\r
                     checkBoxRepeat.Enabled = _configCheckBoxs[NotificationType.Repeat].Checked;\r
                     textBoxRepeat.Text = notification.RepeatInterval.ToString();\r
                     checkBoxCont.Visible = IsContAvailable;\r
-                    textBoxPreliminary.Visible = labelPreliminary.Visible = IspreliminaryAvailable;\r
+                    textBoxPreliminary.Visible =\r
+                        labelPreliminary.Visible = checkBoxPreliminary.Visible = IspreliminaryAvailable;\r
                     textBoxPreliminary.Text = notification.PreliminaryPeriod.ToString();\r
                     break;\r
             }\r
@@ -57,8 +60,10 @@ namespace KancolleSniffer
             checkBoxPush.Checked = (notification.Flags & NotificationType.Push) != 0;\r
             checkBoxRepeat.Checked = (notification.Flags & NotificationType.Repeat) != 0;\r
             _tooltip.SetToolTip(checkBoxCont,\r
-                !IsContAvailable ? "" : notification.Name == "遠征終了" ? "再度遠征に出すまでリピートする。" : "再度入渠させるまでリピートする。");\r
+                !IsContAvailable ? "" :\r
+                notification.Name == "遠征終了" ? "再度遠征に出すまでリピートする。" : "再度入渠させるまでリピートする。");\r
             checkBoxCont.Checked = (notification.Flags & NotificationType.Cont) != 0;\r
+            checkBoxPreliminary.Checked = (notification.Flags & NotificationType.Preliminary) != 0;\r
         }\r
 \r
         private void checkBox_CheckedChanged(object sender, EventArgs e)\r
@@ -72,6 +77,8 @@ namespace KancolleSniffer
                 textBoxRepeat.Enabled = labelRepeat.Enabled = checkBoxCont.Enabled =\r
                     _configCheckBoxs[NotificationType.Repeat].Checked && checkBox.Checked;\r
             }\r
+            if (type == NotificationType.Preliminary)\r
+                textBoxPreliminary.Enabled = labelPreliminary.Enabled = checkBox.Checked;\r
         }\r
 \r
         private bool IsContAvailable =>\r
@@ -94,6 +101,7 @@ namespace KancolleSniffer
             checkBoxRepeat.Enabled = _configCheckBoxs[NotificationType.Repeat].Checked;\r
             textBoxRepeat.Enabled = labelRepeat.Enabled = checkBoxCont.Enabled =\r
                 checkBoxRepeat.Enabled && checkBoxRepeat.Checked;\r
+            textBoxPreliminary.Enabled = checkBoxPreliminary.Checked;\r
 \r
             if (listBoxNotifications.SelectedIndex == -1)\r
                 listBoxNotifications.SelectedIndex = 0;\r