{
public FoursquareCheckinTest()
{
- this.SettingsSetup();
this.MyCommonSetup();
}
- public void SettingsSetup()
- {
- AppendSettingDialog.Instance.IsPreviewFoursquare = true;
- }
-
public void MyCommonSetup()
{
var mockAssembly = Substitute.For<_Assembly>();
}
[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 = @"{
public bool EnableImgAzyobuziNet { get; set; }
public bool ImgAzyobuziNetDisabledInDM { get; set; }
- public bool IsPreviewFoursquare;
public MapProvider MapThumbnailProvider;
public int MapThumbnailHeight;
public int MapThumbnailWidth;
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);
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();
* CHG: 使用する.NET Frameworkのバージョンが 4.0 から 4.5.1 に変更されました
* CHG: 画像ファイルをD&Dした際の動作を変更しました
- 投稿先がD&Dしたファイルに対応していない場合、勝手に投稿先を切り替えず、エラーダイアログを表示するだけにします
+ * CHG: 設定画面から「FoursquareのURLからプレビューを表示する」の項目を削除しました
+ - ベニュー情報の取得が非同期に行えるようになり動作に支障を来す恐れが無くなったため
+ - 以前の設定に関わらずチェックインURLが含まれているツイートはサムネイルに地図が表示されるようになります
* FIX: PublicSearchタブでの再検索時に、特定の条件下でエラーが発生する問題を修正 (thx @Lolitapple!)
* FIX: FoursquareのチェックインURLのサムネイル表示が動作しなくなっていたのを修正
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;
<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>
<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=">>IsPreviewFoursquareCheckBox.Name" xml:space="preserve">
- <value>IsPreviewFoursquareCheckBox</value>
- </data>
- <data name=">>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=">>IsPreviewFoursquareCheckBox.Parent" xml:space="preserve">
- <value>$this</value>
- </data>
- <data name=">>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=">>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=">>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=">>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=">>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=">>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=">>CheckNicoms.ZOrder" xml:space="preserve">
- <value>8</value>
+ <value>7</value>
</data>
<data name="EnableImgAzyobuziNetCheckBox.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
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;
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;
SettingDialog.EnableImgAzyobuziNet = _cfgCommon.EnableImgAzyobuziNet;
SettingDialog.ImgAzyobuziNetDisabledInDM = _cfgCommon.ImgAzyobuziNetDisabledInDM;
- SettingDialog.IsPreviewFoursquare = _cfgCommon.IsPreviewFoursquare;
SettingDialog.MapThumbnailProvider = _cfgCommon.MapThumbnailProvider;
SettingDialog.MapThumbnailHeight = _cfgCommon.MapThumbnailHeight;
SettingDialog.MapThumbnailWidth = _cfgCommon.MapThumbnailWidth;
_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;