Skip to content

Commit

Permalink
ステータスバーに各タブの更新回数(起動時からの回数)の表示を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
upsilon committed Jan 27, 2024
1 parent 9d24cc3 commit ac3b40d
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* NEW: Cookie使用時のReplyタブの更新に対応(/statuses/mentions_timeline.json 廃止に伴う対応)
* NEW: Cookie使用時のFavoritesタブの更新に対応
* NEW: Cookie使用時のFav追加・削除に対応
* NEW: ステータスバーに各タブの更新回数(起動時からの回数)の表示を追加
* NEW: 設定画面の更新間隔ページに24時間分の取得回数目安の表示を追加
* CHG: 更新間隔の初期設定を変更
* FIX: Cookie使用時にツイート検索の言語指定が効かない不具合を修正
Expand Down
7 changes: 7 additions & 0 deletions OpenTween/Models/TabModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,15 @@ public PostClass? AnchorPost
set => this.AnchorStatusId = value?.StatusId;
}

public int UpdateCount
=> this.updateCount;

private IndexedSortedSet<PostId> ids = new();
private ConcurrentQueue<TemporaryId> addQueue = new();
private readonly ConcurrentQueue<PostId> removeQueue = new();
private SortedSet<PostId> unreadIds = new();
private List<PostId> selectedStatusIds = new();
private int updateCount = 0;

private readonly object lockObj = new();

Expand Down Expand Up @@ -450,5 +454,8 @@ public IEnumerable<int> SearchPostsAll(Func<string, bool> stringComparer, int st
}
}
}

public void IncrementUpdateCount()
=> Interlocked.Increment(ref this.updateCount);
}
}
9 changes: 9 additions & 0 deletions OpenTween/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions OpenTween/Properties/Resources.en.resx
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ Available service: {1}</value></data>
<data name="SetStatusLabelText1"><value>[Tab: {0}/{1} All: {2}/{3} (Reply: {4})] [Spd: Pst {5}/ Fav {6}/ TL {7}] [Interval: </value></data>
<data name="SetStatusLabelText2"><value>-]</value></data>
<data name="SetStatusLabelText3"><value>]</value></data>
<data name="SetStatusLabelText4"><value>[Updates: {0:#,0}]</value></data>
<data name="Setting_FormClosing1"><value>Press [Start Authentication] button and [Authorize App]. Key in PIN then press [Finish] button. Will you exit application without validating your account?</value></data>
<data name="SettingPath_Relocation"><value>Failed to write settings to {0}.

Expand Down
1 change: 1 addition & 0 deletions OpenTween/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@
<data name="SetStatusLabelText1"><value>[タブ: {0}/{1} 全体: {2}/{3} (返信: {4})] [時速: 投 {5}/ ☆ {6}/ 流 {7}] [間隔: </value></data>
<data name="SetStatusLabelText2"><value>-]</value></data>
<data name="SetStatusLabelText3"><value>]</value></data>
<data name="SetStatusLabelText4"><value>[更新: {0:#,0}]</value></data>
<data name="Setting_FormClosing1"><value>「認証開始」ボタンを押すとブラウザが開きます。「連携アプリを認証」し、表示されたPINを画面上部に入力後、「Finish」ボタンを押してください。認証せずに終了してもよろしいですか?</value></data>
<data name="SettingPath_Relocation"><value>{0} での設定の書き込みに失敗しました。

Expand Down
3 changes: 3 additions & 0 deletions OpenTween/Tween.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1303,6 +1303,7 @@ private async Task RefreshTabAsync(TabModel tab, bool backward)
{
this.RefreshTasktrayIcon();
await Task.Run(() => tab.RefreshAsync(this.tw, backward, this.initial, this.workerProgress));
tab.IncrementUpdateCount();
}
catch (WebApiException ex)
{
Expand Down Expand Up @@ -6938,6 +6939,8 @@ private string GetStatusLabelText()
{
slbl.Append(this.settings.Common.TimelinePeriod + Properties.Resources.SetStatusLabelText3);
}
slbl.Append(" ");
slbl.AppendFormat(Properties.Resources.SetStatusLabelText4, this.CurrentTab.UpdateCount);
return slbl.ToString();
}

Expand Down

0 comments on commit ac3b40d

Please sign in to comment.