コミットメタ情報

リビジョン3828aebaa9064b93a24076f1989494b5f3d89b95 (tree)
日時2018-01-27 20:47:12
作者Kazuhiro Fujieda <fujieda@user...>
コミッターKazuhiro Fujieda

ログメッセージ

通知の予告の有無をチェックボックスで設定できるようにする

変更サマリ

差分

--- a/KancolleSniffer/Config.cs
+++ b/KancolleSniffer/Config.cs
@@ -124,7 +124,8 @@ namespace KancolleSniffer
124124 Pushbullet = 1 << 3,
125125 Push = 1 << 4,
126126 Repeat = 1 << 5,
127- Cont = 1 << 6
127+ Cont = 1 << 6,
128+ Preliminary = 1 << 7
128129 }
129130
130131
--- a/KancolleSniffer/MainForm.cs
+++ b/KancolleSniffer/MainForm.cs
@@ -906,7 +906,9 @@ namespace KancolleSniffer
906906
907907 private void SetPreNotification(string key, int fleet, string subject)
908908 {
909- _notificationManager.Enqueue(key, fleet, subject, 0, true);
909+ var spec = _config.Notifications[_notificationManager.KeyToName(key)];
910+ if ((spec.Flags & NotificationType.Preliminary) != 0)
911+ _notificationManager.Enqueue(key, fleet, subject, 0, true);
910912 }
911913
912914 private void UpdateRepairList()
--- a/KancolleSniffer/NotificationConfigDialog.Designer.cs
+++ b/KancolleSniffer/NotificationConfigDialog.Designer.cs
@@ -40,6 +40,7 @@
4040 this.checkBoxCont = new System.Windows.Forms.CheckBox();
4141 this.textBoxPreliminary = new System.Windows.Forms.TextBox();
4242 this.labelPreliminary = new System.Windows.Forms.Label();
43+ this.checkBoxPreliminary = new System.Windows.Forms.CheckBox();
4344 this.SuspendLayout();
4445 //
4546 // listBoxNotifications
@@ -112,7 +113,7 @@
112113 // checkBoxRepeat
113114 //
114115 this.checkBoxRepeat.AutoSize = true;
115- this.checkBoxRepeat.Location = new System.Drawing.Point(117, 133);
116+ this.checkBoxRepeat.Location = new System.Drawing.Point(12, 133);
116117 this.checkBoxRepeat.Name = "checkBoxRepeat";
117118 this.checkBoxRepeat.Size = new System.Drawing.Size(58, 16);
118119 this.checkBoxRepeat.TabIndex = 8;
@@ -122,7 +123,7 @@
122123 //
123124 // textBoxRepeat
124125 //
125- this.textBoxRepeat.Location = new System.Drawing.Point(172, 131);
126+ this.textBoxRepeat.Location = new System.Drawing.Point(67, 131);
126127 this.textBoxRepeat.Name = "textBoxRepeat";
127128 this.textBoxRepeat.Size = new System.Drawing.Size(26, 19);
128129 this.textBoxRepeat.TabIndex = 9;
@@ -131,7 +132,7 @@
131132 // labelRepeat
132133 //
133134 this.labelRepeat.AutoSize = true;
134- this.labelRepeat.Location = new System.Drawing.Point(199, 134);
135+ this.labelRepeat.Location = new System.Drawing.Point(96, 134);
135136 this.labelRepeat.Name = "labelRepeat";
136137 this.labelRepeat.Size = new System.Drawing.Size(29, 12);
137138 this.labelRepeat.TabIndex = 10;
@@ -140,7 +141,7 @@
140141 // checkBoxCont
141142 //
142143 this.checkBoxCont.AutoSize = true;
143- this.checkBoxCont.Location = new System.Drawing.Point(228, 133);
144+ this.checkBoxCont.Location = new System.Drawing.Point(67, 155);
144145 this.checkBoxCont.Name = "checkBoxCont";
145146 this.checkBoxCont.Size = new System.Drawing.Size(48, 16);
146147 this.checkBoxCont.TabIndex = 11;
@@ -150,7 +151,7 @@
150151 //
151152 // textBoxPreliminary
152153 //
153- this.textBoxPreliminary.Location = new System.Drawing.Point(21, 131);
154+ this.textBoxPreliminary.Location = new System.Drawing.Point(180, 131);
154155 this.textBoxPreliminary.Name = "textBoxPreliminary";
155156 this.textBoxPreliminary.Size = new System.Drawing.Size(26, 19);
156157 this.textBoxPreliminary.TabIndex = 12;
@@ -159,11 +160,22 @@
159160 // labelPreliminary
160161 //
161162 this.labelPreliminary.AutoSize = true;
162- this.labelPreliminary.Location = new System.Drawing.Point(49, 134);
163+ this.labelPreliminary.Location = new System.Drawing.Point(208, 134);
163164 this.labelPreliminary.Name = "labelPreliminary";
164- this.labelPreliminary.Size = new System.Drawing.Size(62, 12);
165+ this.labelPreliminary.Size = new System.Drawing.Size(29, 12);
165166 this.labelPreliminary.TabIndex = 13;
166- this.labelPreliminary.Text = "秒前に予告";
167+ this.labelPreliminary.Text = "秒前";
168+ //
169+ // checkBoxPreliminary
170+ //
171+ this.checkBoxPreliminary.AutoSize = true;
172+ this.checkBoxPreliminary.Location = new System.Drawing.Point(134, 133);
173+ this.checkBoxPreliminary.Name = "checkBoxPreliminary";
174+ this.checkBoxPreliminary.Size = new System.Drawing.Size(48, 16);
175+ this.checkBoxPreliminary.TabIndex = 14;
176+ this.checkBoxPreliminary.Text = "予告";
177+ this.checkBoxPreliminary.UseVisualStyleBackColor = true;
178+ this.checkBoxPreliminary.CheckedChanged += new System.EventHandler(this.checkBox_CheckedChanged);
167179 //
168180 // NotificationConfigDialog
169181 //
@@ -172,8 +184,9 @@
172184 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
173185 this.CancelButton = this.buttonClose;
174186 this.ClientSize = new System.Drawing.Size(288, 195);
175- this.Controls.Add(this.labelPreliminary);
176187 this.Controls.Add(this.textBoxPreliminary);
188+ this.Controls.Add(this.checkBoxPreliminary);
189+ this.Controls.Add(this.labelPreliminary);
177190 this.Controls.Add(this.checkBoxCont);
178191 this.Controls.Add(this.labelRepeat);
179192 this.Controls.Add(this.textBoxRepeat);
@@ -211,5 +224,6 @@
211224 private System.Windows.Forms.CheckBox checkBoxCont;
212225 private System.Windows.Forms.TextBox textBoxPreliminary;
213226 private System.Windows.Forms.Label labelPreliminary;
227+ private System.Windows.Forms.CheckBox checkBoxPreliminary;
214228 }
215229 }
\ No newline at end of file
--- a/KancolleSniffer/NotificationConfigDialog.cs
+++ b/KancolleSniffer/NotificationConfigDialog.cs
@@ -24,6 +24,7 @@ namespace KancolleSniffer
2424 checkBoxPush.Tag = NotificationType.Push;
2525 checkBoxRepeat.Tag = NotificationType.Repeat;
2626 checkBoxCont.Tag = NotificationType.Cont;
27+ checkBoxPreliminary.Tag = NotificationType.Preliminary;
2728
2829 // ReSharper disable once CoVariantArrayConversion
2930 listBoxNotifications.Items.AddRange(Config.NotificationNames);
@@ -39,15 +40,17 @@ namespace KancolleSniffer
3940 case "艦娘数超過":
4041 case "装備数超過":
4142 case "大破警告":
42- textBoxPreliminary.Visible = labelPreliminary.Visible = textBoxRepeat.Visible =
43- labelRepeat.Visible = checkBoxRepeat.Visible = checkBoxCont.Visible = false;
43+ textBoxPreliminary.Visible = labelPreliminary.Visible = checkBoxPreliminary.Visible =
44+ textBoxRepeat.Visible = labelRepeat.Visible = checkBoxRepeat.Visible =
45+ checkBoxCont.Visible = false;
4446 break;
4547 default:
4648 textBoxRepeat.Visible = labelRepeat.Visible = checkBoxRepeat.Visible = true;
4749 checkBoxRepeat.Enabled = _configCheckBoxs[NotificationType.Repeat].Checked;
4850 textBoxRepeat.Text = notification.RepeatInterval.ToString();
4951 checkBoxCont.Visible = IsContAvailable;
50- textBoxPreliminary.Visible = labelPreliminary.Visible = IspreliminaryAvailable;
52+ textBoxPreliminary.Visible =
53+ labelPreliminary.Visible = checkBoxPreliminary.Visible = IspreliminaryAvailable;
5154 textBoxPreliminary.Text = notification.PreliminaryPeriod.ToString();
5255 break;
5356 }
@@ -57,8 +60,10 @@ namespace KancolleSniffer
5760 checkBoxPush.Checked = (notification.Flags & NotificationType.Push) != 0;
5861 checkBoxRepeat.Checked = (notification.Flags & NotificationType.Repeat) != 0;
5962 _tooltip.SetToolTip(checkBoxCont,
60- !IsContAvailable ? "" : notification.Name == "遠征終了" ? "再度遠征に出すまでリピートする。" : "再度入渠させるまでリピートする。");
63+ !IsContAvailable ? "" :
64+ notification.Name == "遠征終了" ? "再度遠征に出すまでリピートする。" : "再度入渠させるまでリピートする。");
6165 checkBoxCont.Checked = (notification.Flags & NotificationType.Cont) != 0;
66+ checkBoxPreliminary.Checked = (notification.Flags & NotificationType.Preliminary) != 0;
6267 }
6368
6469 private void checkBox_CheckedChanged(object sender, EventArgs e)
@@ -72,6 +77,8 @@ namespace KancolleSniffer
7277 textBoxRepeat.Enabled = labelRepeat.Enabled = checkBoxCont.Enabled =
7378 _configCheckBoxs[NotificationType.Repeat].Checked && checkBox.Checked;
7479 }
80+ if (type == NotificationType.Preliminary)
81+ textBoxPreliminary.Enabled = labelPreliminary.Enabled = checkBox.Checked;
7582 }
7683
7784 private bool IsContAvailable =>
@@ -94,6 +101,7 @@ namespace KancolleSniffer
94101 checkBoxRepeat.Enabled = _configCheckBoxs[NotificationType.Repeat].Checked;
95102 textBoxRepeat.Enabled = labelRepeat.Enabled = checkBoxCont.Enabled =
96103 checkBoxRepeat.Enabled && checkBoxRepeat.Checked;
104+ textBoxPreliminary.Enabled = checkBoxPreliminary.Checked;
97105
98106 if (listBoxNotifications.SelectedIndex == -1)
99107 listBoxNotifications.SelectedIndex = 0;
旧リポジトリブラウザで表示