• R/O
  • SSH
  • HTTPS

listwi: Commit


Commit MetaInfo

Revision63 (tree)
Time2010-05-29 18:17:49
Authorazyobuzin

Log Message

・ListeningMessenderで入力チェックをするようにした
・ワンクリックで画面を表示するようにした

Change Summary

Incremental Difference

--- Testing/りすにんぐついったー/Forms/ListeningMessender.cs (revision 62)
+++ Testing/りすにんぐついったー/Forms/ListeningMessender.cs (revision 63)
@@ -24,12 +24,19 @@
2424
2525 private void sendBtn_Click(object sender, EventArgs e)
2626 {
27- Program.m_form.tweetBox.Text = string.Format(SettingsXml.Instance.template, textBox1.Text, textBox2.Text, "", "", "");
28- if (!Program.m_form.PostTweet(false))
27+ if (textBox1.Text.Trim().Length != 0 || textBox2.Text.Trim().Length != 0)
2928 {
30- MessageBox.Show("投稿できませんでした。内容を確認してください。", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
29+ Program.m_form.tweetBox.Text = string.Format(SettingsXml.Instance.template, textBox1.Text, textBox2.Text, "", "", "");
30+ if (!Program.m_form.PostTweet(false))
31+ {
32+ MessageBox.Show("投稿できませんでした。内容を確認してください。", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
33+ }
34+ textBox1.Clear(); textBox2.Clear();
3135 }
32- textBox1.Clear(); textBox2.Clear();
36+ else
37+ {
38+ MessageBox.Show("曲名またはアーティスト名を入力してください。", "入力エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
39+ }
3340 }
3441
3542 //インスタンスを作成せずログを表示させるメソッド
--- Testing/りすにんぐついったー/Forms/MainForm.Designer.cs (revision 62)
+++ Testing/りすにんぐついったー/Forms/MainForm.Designer.cs (revision 63)
@@ -40,6 +40,9 @@
4040 this.つぶやきログLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
4141 this.listeningMessenderMToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
4242 this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
43+ this.wikiToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
44+ this.バージョン情報AToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
45+ this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
4346 this.終了XToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
4447 this.label1 = new System.Windows.Forms.Label();
4548 this.postBtn = new System.Windows.Forms.Button();
@@ -47,9 +50,6 @@
4750 this.tweetBox = new System.Windows.Forms.TextBox();
4851 this.OneSecTimer = new System.Windows.Forms.Timer(this.components);
4952 this.charcount = new System.Windows.Forms.Label();
50- this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
51- this.wikiToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
52- this.バージョン情報AToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
5353 this.mainContextMenu.SuspendLayout();
5454 this.SuspendLayout();
5555 //
@@ -57,7 +57,7 @@
5757 //
5858 this.notifyIcon1.ContextMenuStrip = this.mainContextMenu;
5959 this.notifyIcon1.Text = "りすにんぐついったー";
60- this.notifyIcon1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon1_MouseDoubleClick);
60+ this.notifyIcon1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon1_MouseClick);
6161 //
6262 // mainContextMenu
6363 //
@@ -76,7 +76,7 @@
7676 this.toolStripSeparator4,
7777 this.終了XToolStripMenuItem});
7878 this.mainContextMenu.Name = "mainContextMenu";
79- this.mainContextMenu.Size = new System.Drawing.Size(211, 248);
79+ this.mainContextMenu.Size = new System.Drawing.Size(211, 226);
8080 //
8181 // メイン画面を表示VToolStripMenuItem
8282 //
@@ -138,6 +138,25 @@
138138 this.toolStripSeparator3.Name = "toolStripSeparator3";
139139 this.toolStripSeparator3.Size = new System.Drawing.Size(207, 6);
140140 //
141+ // wikiToolStripMenuItem
142+ //
143+ this.wikiToolStripMenuItem.Name = "wikiToolStripMenuItem";
144+ this.wikiToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
145+ this.wikiToolStripMenuItem.Text = "&Wiki";
146+ this.wikiToolStripMenuItem.Click += new System.EventHandler(this.wikiToolStripMenuItem_Click);
147+ //
148+ // バージョン情報AToolStripMenuItem
149+ //
150+ this.バージョン情報AToolStripMenuItem.Name = "バージョン情報AToolStripMenuItem";
151+ this.バージョン情報AToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
152+ this.バージョン情報AToolStripMenuItem.Text = "バージョン情報(&A)";
153+ this.バージョン情報AToolStripMenuItem.Click += new System.EventHandler(this.バージョン情報AToolStripMenuItem_Click);
154+ //
155+ // toolStripSeparator4
156+ //
157+ this.toolStripSeparator4.Name = "toolStripSeparator4";
158+ this.toolStripSeparator4.Size = new System.Drawing.Size(207, 6);
159+ //
141160 // 終了XToolStripMenuItem
142161 //
143162 this.終了XToolStripMenuItem.Name = "終了XToolStripMenuItem";
@@ -206,25 +225,6 @@
206225 this.charcount.Text = "残り140文字";
207226 this.charcount.TextAlign = System.Drawing.ContentAlignment.BottomRight;
208227 //
209- // toolStripSeparator4
210- //
211- this.toolStripSeparator4.Name = "toolStripSeparator4";
212- this.toolStripSeparator4.Size = new System.Drawing.Size(207, 6);
213- //
214- // wikiToolStripMenuItem
215- //
216- this.wikiToolStripMenuItem.Name = "wikiToolStripMenuItem";
217- this.wikiToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
218- this.wikiToolStripMenuItem.Text = "&Wiki";
219- this.wikiToolStripMenuItem.Click += new System.EventHandler(this.wikiToolStripMenuItem_Click);
220- //
221- // バージョン情報AToolStripMenuItem
222- //
223- this.バージョン情報AToolStripMenuItem.Name = "バージョン情報AToolStripMenuItem";
224- this.バージョン情報AToolStripMenuItem.Size = new System.Drawing.Size(210, 22);
225- this.バージョン情報AToolStripMenuItem.Text = "バージョン情報(&A)";
226- this.バージョン情報AToolStripMenuItem.Click += new System.EventHandler(this.バージョン情報AToolStripMenuItem_Click);
227- //
228228 // MainForm
229229 //
230230 this.AcceptButton = this.postBtn;
--- Testing/りすにんぐついったー/Forms/MainForm.cs (revision 62)
+++ Testing/りすにんぐついったー/Forms/MainForm.cs (revision 63)
@@ -50,7 +50,7 @@
5050 bool re = false;
5151 var tweet = tweetBox.Text;
5252
53- if (!(this.Visible && tweetBox.Focused) && tweet != oldData && !string.IsNullOrEmpty(tweet))
53+ if (!(this.Visible && tweetBox.Focused) && tweet != oldData && !string.IsNullOrEmpty(tweet.Trim()))
5454 {
5555 OneSecTimer.Stop();
5656 timeLbl.Text = "Sending...";
@@ -229,11 +229,6 @@
229229 }
230230 }
231231
232- private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
233- {
234- this.Visible = true;
235- }
236-
237232 private void tweetBox_Enter(object sender, EventArgs e)
238233 {
239234 if (!over)
@@ -353,5 +348,13 @@
353348 {
354349 MessageBox.Show("りすにんぐついったー\n\nVersion " + version, "りすにんぐついったー", MessageBoxButtons.OK, MessageBoxIcon.Information);
355350 }
351+
352+ private void notifyIcon1_MouseClick(object sender, MouseEventArgs e)
353+ {
354+ if (e.Button == MouseButtons.Left)
355+ {
356+ this.Visible = true;
357+ }
358+ }
356359 }
357360 }
Show on old repository browser