From d1347dfe337ceeb16c63a545bf7e141756b17e49 Mon Sep 17 00:00:00 2001 From: Kimura Youichi Date: Sun, 6 Nov 2016 20:20:26 +0900 Subject: [PATCH] =?utf8?q?UploadImageTimeout=E3=82=92=E8=A8=AD=E5=AE=9A?= =?utf8?q?=E7=94=BB=E9=9D=A2=E3=81=8B=E3=82=89=E5=A4=89=E6=9B=B4=E5=8F=AF?= =?utf8?q?=E8=83=BD=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- OpenTween/AppendSettingDialog.cs | 3 + OpenTween/Resources/ChangeLog.txt | 2 + .../Setting/Panel/ConnectionPanel.Designer.cs | 19 ++++- OpenTween/Setting/Panel/ConnectionPanel.cs | 4 +- OpenTween/Setting/Panel/ConnectionPanel.en.resx | 9 ++- OpenTween/Setting/Panel/ConnectionPanel.resx | 87 ++++++++++++++++++---- OpenTween/Tween.cs | 1 + 7 files changed, 105 insertions(+), 20 deletions(-) diff --git a/OpenTween/AppendSettingDialog.cs b/OpenTween/AppendSettingDialog.cs index 73eb49e6..5ca9b4ef 100644 --- a/OpenTween/AppendSettingDialog.cs +++ b/OpenTween/AppendSettingDialog.cs @@ -311,6 +311,9 @@ namespace OpenTween var timeout = int.Parse(this.ConnectionPanel.ConnectionTimeOut.Text.Trim()); Networking.DefaultTimeout = TimeSpan.FromSeconds(timeout); + var uploadImageTimeout = int.Parse(this.ConnectionPanel.UploadImageTimeout.Text.Trim()); + Networking.UploadImageTimeout = TimeSpan.FromSeconds(uploadImageTimeout); + Networking.ForceIPv4 = this.ConnectionPanel.checkBoxForceIPv4.Checked; TwitterApiConnection.RestApiHost = this.ConnectionPanel.TwitterAPIText.Text.Trim(); diff --git a/OpenTween/Resources/ChangeLog.txt b/OpenTween/Resources/ChangeLog.txt index b6a3b751..bee89b09 100644 --- a/OpenTween/Resources/ChangeLog.txt +++ b/OpenTween/Resources/ChangeLog.txt @@ -1,6 +1,8 @@ 更新履歴 ==== Ver 1.3.6-dev(2016/xx/xx) + * NEW: 画像アップロード時のタイムアウト時間が変更できるようになりました + - ファイルサイズが大きい画像のアップロードに頻繁に失敗する場合は、長めに設定すると改善する可能性があります * CHG: 非公開アカウントであっても自分自身のツイートを公式RTできるようになりました * FIX: 発言詳細部のプロフィール画像に誤ったユーザーの画像が表示されることがある不具合を修正 * FIX: ツイートURLのコピー時に余分な改行文字が末尾に付く不具合を修正 diff --git a/OpenTween/Setting/Panel/ConnectionPanel.Designer.cs b/OpenTween/Setting/Panel/ConnectionPanel.Designer.cs index ae4a2e43..db06de22 100644 --- a/OpenTween/Setting/Panel/ConnectionPanel.Designer.cs +++ b/OpenTween/Setting/Panel/ConnectionPanel.Designer.cs @@ -35,6 +35,8 @@ this.ConnectionTimeOut = new System.Windows.Forms.TextBox(); this.Label63 = new System.Windows.Forms.Label(); this.checkBoxForceIPv4 = new System.Windows.Forms.CheckBox(); + this.UploadImageTimeout = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // TwitterAPIText @@ -58,7 +60,7 @@ // resources.ApplyResources(this.ConnectionTimeOut, "ConnectionTimeOut"); this.ConnectionTimeOut.Name = "ConnectionTimeOut"; - this.ConnectionTimeOut.Validating += new System.ComponentModel.CancelEventHandler(this.ConnectionTimeOut_Validating); + this.ConnectionTimeOut.Validating += new System.ComponentModel.CancelEventHandler(this.ValidateTimeoutValue); // // Label63 // @@ -71,10 +73,23 @@ this.checkBoxForceIPv4.Name = "checkBoxForceIPv4"; this.checkBoxForceIPv4.UseVisualStyleBackColor = true; // + // UploadImageTimeout + // + resources.ApplyResources(this.UploadImageTimeout, "UploadImageTimeout"); + this.UploadImageTimeout.Name = "UploadImageTimeout"; + this.UploadImageTimeout.Validating += new System.ComponentModel.CancelEventHandler(this.ValidateTimeoutValue); + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.Name = "label2"; + // // ConnectionPanel // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.Controls.Add(this.UploadImageTimeout); + this.Controls.Add(this.label2); this.Controls.Add(this.checkBoxForceIPv4); this.Controls.Add(this.TwitterAPIText); this.Controls.Add(this.Label8); @@ -95,5 +110,7 @@ internal System.Windows.Forms.TextBox ConnectionTimeOut; internal System.Windows.Forms.Label Label63; internal System.Windows.Forms.CheckBox checkBoxForceIPv4; + internal System.Windows.Forms.TextBox UploadImageTimeout; + internal System.Windows.Forms.Label label2; } } diff --git a/OpenTween/Setting/Panel/ConnectionPanel.cs b/OpenTween/Setting/Panel/ConnectionPanel.cs index 9949c8fd..4460b7ff 100644 --- a/OpenTween/Setting/Panel/ConnectionPanel.cs +++ b/OpenTween/Setting/Panel/ConnectionPanel.cs @@ -45,6 +45,7 @@ namespace OpenTween.Setting.Panel public void LoadConfig(SettingCommon settingCommon) { this.ConnectionTimeOut.Text = settingCommon.DefaultTimeOut.ToString(); + this.UploadImageTimeout.Text = settingCommon.UploadImageTimeout.ToString(); this.checkBoxForceIPv4.Checked = settingCommon.ForceIPv4; this.TwitterAPIText.Text = settingCommon.TwitterApiHost; } @@ -52,11 +53,12 @@ namespace OpenTween.Setting.Panel public void SaveConfig(SettingCommon settingCommon) { settingCommon.DefaultTimeOut = int.Parse(this.ConnectionTimeOut.Text); + settingCommon.UploadImageTimeout = int.Parse(this.UploadImageTimeout.Text); settingCommon.ForceIPv4 = this.checkBoxForceIPv4.Checked; settingCommon.TwitterApiHost = this.TwitterAPIText.Text.Trim(); } - private void ConnectionTimeOut_Validating(object sender, CancelEventArgs e) + private void ValidateTimeoutValue(object sender, CancelEventArgs e) { int tm; try diff --git a/OpenTween/Setting/Panel/ConnectionPanel.en.resx b/OpenTween/Setting/Panel/ConnectionPanel.en.resx index 3690e04f..f02b6205 100644 --- a/OpenTween/Setting/Panel/ConnectionPanel.en.resx +++ b/OpenTween/Setting/Panel/ConnectionPanel.en.resx @@ -118,9 +118,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 130, 16 - 371, 12 @@ -139,4 +136,10 @@ Force to use IPv4 to connect to pbs.twimg.com + + 220, 12 + + + Connection timeout(sec, Uploading image) + \ No newline at end of file diff --git a/OpenTween/Setting/Panel/ConnectionPanel.resx b/OpenTween/Setting/Panel/ConnectionPanel.resx index cab491e0..b4367720 100644 --- a/OpenTween/Setting/Panel/ConnectionPanel.resx +++ b/OpenTween/Setting/Panel/ConnectionPanel.resx @@ -119,14 +119,14 @@ - 267, 102 + 267, 127 125, 19 - 5 + 7 api.twitter.com @@ -144,7 +144,7 @@ $this - 1 + 3 True @@ -154,13 +154,13 @@ NoControl - 23, 105 + 23, 130 174, 12 - 4 + 6 Twitter API URL (api.twitter.com) @@ -178,7 +178,7 @@ $this - 2 + 4 True @@ -187,16 +187,19 @@ NoControl - 23, 49 + 23, 75 + + + 3, 3, 3, 3 - 349, 12 + 231, 12 - 2 + 4 - ※タイムアウトが頻発する場合に調整してください。初期設定は20秒です。 + ※タイムアウトが頻発する場合に調整してください Label64 @@ -208,7 +211,7 @@ $this - 3 + 5 Disable @@ -232,7 +235,7 @@ $this - 4 + 6 True @@ -262,19 +265,19 @@ $this - 5 + 7 True - 23, 77 + 23, 102 281, 16 - 3 + 5 pbs.twimg.com への接続に強制的に IPv4 を使用する @@ -289,8 +292,62 @@ $this + 2 + + + Disable + + + 267, 48 + + + 125, 19 + + + 3 + + + UploadImageTimeout + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + 0 + + True + + + NoControl + + + 23, 51 + + + 214, 12 + + + 2 + + + タイムアウトまでの時間(秒, 画像アップロード) + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + True diff --git a/OpenTween/Tween.cs b/OpenTween/Tween.cs index 89574f8c..454e5ce3 100644 --- a/OpenTween/Tween.cs +++ b/OpenTween/Tween.cs @@ -3766,6 +3766,7 @@ namespace OpenTween TwitterApiConnection.RestApiHost = this._cfgCommon.TwitterApiHost; Networking.DefaultTimeout = TimeSpan.FromSeconds(this._cfgCommon.DefaultTimeOut); + Networking.UploadImageTimeout = TimeSpan.FromSeconds(this._cfgCommon.UploadImageTimeout); Networking.SetWebProxy(this._cfgLocal.ProxyType, this._cfgLocal.ProxyAddress, this._cfgLocal.ProxyPort, this._cfgLocal.ProxyUser, this._cfgLocal.ProxyPassword); -- 2.11.0