OSDN Git Service

設定画面から「FoursquareのURLからプレビューを表示する」の項目を削除
authorKimura Youichi <kim.upsilon@bucyou.net>
Sat, 19 Apr 2014 16:56:05 +0000 (01:56 +0900)
committerKimura Youichi <kim.upsilon@bucyou.net>
Sat, 19 Apr 2014 17:04:45 +0000 (02:04 +0900)
ベニュー情報の取得が非同期に行えるようになり動作に支障を来す恐れが無くなったため

OpenTween.Tests/Thumbnail/Services/FoursquareCheckinTest.cs
OpenTween/AppendSettingDialog.cs
OpenTween/Resources/ChangeLog.txt
OpenTween/Setting/Panel/CooperatePanel.Designer.cs
OpenTween/Setting/Panel/CooperatePanel.en.resx
OpenTween/Setting/Panel/CooperatePanel.resx
OpenTween/Setting/SettingCommon.cs
OpenTween/Thumbnail/Services/FoursquareCheckin.cs
OpenTween/Tween.cs

index a8bcd54..82d6ea1 100644 (file)
@@ -42,15 +42,9 @@ namespace OpenTween.Thumbnail.Services
     {
         public FoursquareCheckinTest()
         {
-            this.SettingsSetup();
             this.MyCommonSetup();
         }
 
-        public void SettingsSetup()
-        {
-            AppendSettingDialog.Instance.IsPreviewFoursquare = true;
-        }
-
         public void MyCommonSetup()
         {
             var mockAssembly = Substitute.For<_Assembly>();
@@ -155,32 +149,6 @@ namespace OpenTween.Thumbnail.Services
         }
 
         [Fact]
-        public async Task GetThumbnailInfoAsync_DisabledTest()
-        {
-            var handler = new HttpMessageHandlerMock();
-            var service = new FoursquareCheckin(new HttpClient(handler));
-
-            handler.Queue.Enqueue(async x =>
-            {
-                // このリクエストは実行されないはず
-                Assert.True(false);
-                return new HttpResponseMessage(HttpStatusCode.NotFound);
-            });
-
-            var post = new PostClass
-            {
-                PostGeo = new PostClass.StatusGeo { },
-            };
-
-            // 設定により無効化されている場合は何もしない
-            AppendSettingDialog.Instance.IsPreviewFoursquare = false;
-
-            var thumb = await service.GetThumbnailInfoAsync(
-                "https://foursquare.com/checkin/hogehoge/xxxxxxxx",
-                post, CancellationToken.None);
-        }
-
-        [Fact]
         public void ParseInLocation_Test()
         {
             var json = @"{
index bbca2f5..a352fbc 100644 (file)
@@ -56,7 +56,6 @@ namespace OpenTween
 
         public bool EnableImgAzyobuziNet { get; set; }
         public bool ImgAzyobuziNetDisabledInDM { get; set; }
-        public bool IsPreviewFoursquare;
         public MapProvider MapThumbnailProvider;
         public int MapThumbnailHeight;
         public int MapThumbnailWidth;
@@ -475,7 +474,6 @@ namespace OpenTween
                 this.HideDuplicatedRetweets = this.TweetPrvPanel.HideDuplicatedRetweetsCheck.Checked;
                 this.EnableImgAzyobuziNet = this.CooperatePanel.EnableImgAzyobuziNetCheckBox.Checked;
                 this.ImgAzyobuziNetDisabledInDM = this.CooperatePanel.ImgAzyobuziNetDisabledInDMCheckBox.Checked;
-                this.IsPreviewFoursquare = this.CooperatePanel.IsPreviewFoursquareCheckBox.Checked;
                 this.MapThumbnailProvider = (MapProvider)this.CooperatePanel.MapThumbnailProviderComboBox.SelectedIndex;
                 this.MapThumbnailHeight = int.Parse(this.CooperatePanel.MapThumbnailHeightTextBox.Text);
                 this.MapThumbnailWidth = int.Parse(this.CooperatePanel.MapThumbnailWidthTextBox.Text);
@@ -856,7 +854,6 @@ namespace OpenTween
             this.TweetPrvPanel.HideDuplicatedRetweetsCheck.Checked = this.HideDuplicatedRetweets;
             this.CooperatePanel.EnableImgAzyobuziNetCheckBox.Checked = this.EnableImgAzyobuziNet;
             this.CooperatePanel.ImgAzyobuziNetDisabledInDMCheckBox.Checked = this.ImgAzyobuziNetDisabledInDM;
-            this.CooperatePanel.IsPreviewFoursquareCheckBox.Checked = this.IsPreviewFoursquare;
             this.CooperatePanel.MapThumbnailProviderComboBox.SelectedIndex = (int)this.MapThumbnailProvider;
             this.CooperatePanel.MapThumbnailHeightTextBox.Text = this.MapThumbnailHeight.ToString();
             this.CooperatePanel.MapThumbnailWidthTextBox.Text = this.MapThumbnailWidth.ToString();
index e77747a..e3c689c 100644 (file)
@@ -10,6 +10,9 @@
  * CHG: 使用する.NET Frameworkのバージョンが 4.0 から 4.5.1 に変更されました
  * CHG: 画像ファイルをD&Dした際の動作を変更しました
   - 投稿先がD&Dしたファイルに対応していない場合、勝手に投稿先を切り替えず、エラーダイアログを表示するだけにします
+ * CHG: 設定画面から「FoursquareのURLからプレビューを表示する」の項目を削除しました
+  - ベニュー情報の取得が非同期に行えるようになり動作に支障を来す恐れが無くなったため
+  - 以前の設定に関わらずチェックインURLが含まれているツイートはサムネイルに地図が表示されるようになります
  * FIX: PublicSearchタブでの再検索時に、特定の条件下でエラーが発生する問題を修正 (thx @Lolitapple!)
  * FIX: FoursquareのチェックインURLのサムネイル表示が動作しなくなっていたのを修正
 
index 0432a1e..c05ed51 100644 (file)
@@ -29,7 +29,6 @@
         private void InitializeComponent()
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CooperatePanel));
-            this.IsPreviewFoursquareCheckBox = new System.Windows.Forms.CheckBox();
             this.MapThumbnailGroupBox = new System.Windows.Forms.GroupBox();
             this.MapThumbnailProviderComboBox = new System.Windows.Forms.ComboBox();
             this.label48 = new System.Windows.Forms.Label();
             this.MapThumbnailGroupBox.SuspendLayout();
             this.SuspendLayout();
             // 
-            // IsPreviewFoursquareCheckBox
-            // 
-            resources.ApplyResources(this.IsPreviewFoursquareCheckBox, "IsPreviewFoursquareCheckBox");
-            this.IsPreviewFoursquareCheckBox.Name = "IsPreviewFoursquareCheckBox";
-            this.IsPreviewFoursquareCheckBox.UseVisualStyleBackColor = true;
-            // 
             // MapThumbnailGroupBox
             // 
             this.MapThumbnailGroupBox.Controls.Add(this.MapThumbnailProviderComboBox);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
             this.Controls.Add(this.ImgAzyobuziNetDisabledInDMCheckBox);
             this.Controls.Add(this.EnableImgAzyobuziNetCheckBox);
-            this.Controls.Add(this.IsPreviewFoursquareCheckBox);
             this.Controls.Add(this.MapThumbnailGroupBox);
             this.Controls.Add(this.Label39);
             this.Controls.Add(this.UserAppointUrlText);
 
         #endregion
 
-        internal System.Windows.Forms.CheckBox IsPreviewFoursquareCheckBox;
         internal System.Windows.Forms.GroupBox MapThumbnailGroupBox;
         private System.Windows.Forms.Label label48;
         internal System.Windows.Forms.Label Label42;
index 1f901da..57fb830 100644 (file)
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-  <data name="IsPreviewFoursquareCheckBox.Size" type="System.Drawing.Size, System.Drawing">
-    <value>239, 16</value>
-  </data>
-  <data name="IsPreviewFoursquareCheckBox.Text" xml:space="preserve">
-    <value>Get map thumbnails from Foursquare urls.</value>
-  </data>
   <data name="label48.Size" type="System.Drawing.Size, System.Drawing">
     <value>72, 12</value>
   </data>
index b244d55..abbd0b7 100644 (file)
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
   <assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-  <data name="IsPreviewFoursquareCheckBox.AutoSize" type="System.Boolean, mscorlib">
-    <value>True</value>
-  </data>
   <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
-  <data name="IsPreviewFoursquareCheckBox.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
-    <value>NoControl</value>
-  </data>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-  <data name="IsPreviewFoursquareCheckBox.Location" type="System.Drawing.Point, System.Drawing">
-    <value>23, 181</value>
-  </data>
-  <data name="IsPreviewFoursquareCheckBox.Size" type="System.Drawing.Size, System.Drawing">
-    <value>327, 16</value>
-  </data>
-  <data name="IsPreviewFoursquareCheckBox.TabIndex" type="System.Int32, mscorlib">
-    <value>7</value>
-  </data>
-  <data name="IsPreviewFoursquareCheckBox.Text" xml:space="preserve">
-    <value>FoursquareのURLからプレビューを表示する(非常に重くなります)</value>
-  </data>
-  <data name="&gt;&gt;IsPreviewFoursquareCheckBox.Name" xml:space="preserve">
-    <value>IsPreviewFoursquareCheckBox</value>
-  </data>
-  <data name="&gt;&gt;IsPreviewFoursquareCheckBox.Type" xml:space="preserve">
-    <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name="&gt;&gt;IsPreviewFoursquareCheckBox.Parent" xml:space="preserve">
-    <value>$this</value>
-  </data>
-  <data name="&gt;&gt;IsPreviewFoursquareCheckBox.ZOrder" xml:space="preserve">
-    <value>2</value>
-  </data>
   <data name="MapThumbnailProviderComboBox.Items" xml:space="preserve">
     <value>OpenStreetMap</value>
   </data>
     <value>473, 80</value>
   </data>
   <data name="MapThumbnailGroupBox.TabIndex" type="System.Int32, mscorlib">
-    <value>8</value>
+    <value>7</value>
   </data>
   <data name="MapThumbnailGroupBox.Text" xml:space="preserve">
     <value>地図サムネイル</value>
     <value>$this</value>
   </data>
   <data name="&gt;&gt;MapThumbnailGroupBox.ZOrder" xml:space="preserve">
-    <value>3</value>
+    <value>2</value>
   </data>
   <data name="Label39.AutoSize" type="System.Boolean, mscorlib">
     <value>True</value>
     <value>$this</value>
   </data>
   <data name="&gt;&gt;Label39.ZOrder" xml:space="preserve">
-    <value>4</value>
+    <value>3</value>
   </data>
   <data name="UserAppointUrlText.Location" type="System.Drawing.Point, System.Drawing">
     <value>218, 102</value>
     <value>$this</value>
   </data>
   <data name="&gt;&gt;UserAppointUrlText.ZOrder" xml:space="preserve">
-    <value>5</value>
+    <value>4</value>
   </data>
   <data name="ComboBoxTranslateLanguage.Items" xml:space="preserve">
     <value>Afrikaans</value>
     <value>$this</value>
   </data>
   <data name="&gt;&gt;ComboBoxTranslateLanguage.ZOrder" xml:space="preserve">
-    <value>6</value>
+    <value>5</value>
   </data>
   <data name="Label29.AutoSize" type="System.Boolean, mscorlib">
     <value>True</value>
     <value>$this</value>
   </data>
   <data name="&gt;&gt;Label29.ZOrder" xml:space="preserve">
-    <value>7</value>
+    <value>6</value>
   </data>
   <data name="CheckNicoms.AutoSize" type="System.Boolean, mscorlib">
     <value>True</value>
     <value>$this</value>
   </data>
   <data name="&gt;&gt;CheckNicoms.ZOrder" xml:space="preserve">
-    <value>8</value>
+    <value>7</value>
   </data>
   <data name="EnableImgAzyobuziNetCheckBox.AutoSize" type="System.Boolean, mscorlib">
     <value>True</value>
index 61a96b3..b999812 100644 (file)
@@ -205,7 +205,6 @@ namespace OpenTween
         public bool HideDuplicatedRetweets = false;
         public bool EnableImgAzyobuziNet = true;
         public bool ImgAzyobuziNetDisabledInDM = true;
-        public bool IsPreviewFoursquare = false;
         public int MapThumbnailHeight = 200;
         public int MapThumbnailWidth = 200;
         public int MapThumbnailZoom = 15;
index 04b1b96..e025041 100644 (file)
@@ -53,9 +53,6 @@ namespace OpenTween.Thumbnail.Services
 
         public override async Task<ThumbnailInfo> GetThumbnailInfoAsync(string url, PostClass post, CancellationToken token)
         {
-            if (!AppendSettingDialog.Instance.IsPreviewFoursquare)
-                return null;
-
             // ツイートに位置情報が付与されている場合は何もしない
             if (post.PostGeo.Lat != 0 || post.PostGeo.Lng != 0)
                 return null;
index 6591e29..4106ee6 100644 (file)
@@ -921,7 +921,6 @@ namespace OpenTween
 
             SettingDialog.EnableImgAzyobuziNet = _cfgCommon.EnableImgAzyobuziNet;
             SettingDialog.ImgAzyobuziNetDisabledInDM = _cfgCommon.ImgAzyobuziNetDisabledInDM;
-            SettingDialog.IsPreviewFoursquare = _cfgCommon.IsPreviewFoursquare;
             SettingDialog.MapThumbnailProvider = _cfgCommon.MapThumbnailProvider;
             SettingDialog.MapThumbnailHeight = _cfgCommon.MapThumbnailHeight;
             SettingDialog.MapThumbnailWidth = _cfgCommon.MapThumbnailWidth;
@@ -7859,7 +7858,6 @@ namespace OpenTween
                 _cfgCommon.HideDuplicatedRetweets = SettingDialog.HideDuplicatedRetweets;
                 _cfgCommon.EnableImgAzyobuziNet = SettingDialog.EnableImgAzyobuziNet;
                 _cfgCommon.ImgAzyobuziNetDisabledInDM = SettingDialog.ImgAzyobuziNetDisabledInDM;
-                _cfgCommon.IsPreviewFoursquare = SettingDialog.IsPreviewFoursquare;
                 _cfgCommon.MapThumbnailProvider = SettingDialog.MapThumbnailProvider;
                 _cfgCommon.MapThumbnailHeight = SettingDialog.MapThumbnailHeight;
                 _cfgCommon.MapThumbnailWidth = SettingDialog.MapThumbnailWidth;