[Tween-svn] [1246] [ 、 ] でのリプライ移動時でリプライ先のポストが見付からなかったときに、探索範囲を全てのタブに広げるように変更

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2010年 12月 23日 (木) 16:13:13 JST


Revision: 1246
          http://sourceforge.jp/projects/tween/svn/view?view=rev&revision=1246
Author:   anis774
Date:     2010-12-23 16:13:13 +0900 (Thu, 23 Dec 2010)

Log Message:
-----------
[、]でのリプライ移動時でリプライ先のポストが見付からなかったときに、探索範囲を全てのタブに広げるように変更

Modified Paths:
--------------
    trunk/Tween/Tween.vb

Property Changed:
----------------
    trunk/


-------------- next part --------------

Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/APIchangeevent:723-746
/branches/FixedImage:787-910
/branches/SettingDialog:1216-1230
/branches/UserStream:1077-1144
/branches/editlist:667-697
/branches/panelswitch:447-572
/branches/tm:782-794
   + /branches/tm:782-794
/branches/editlist:667-697
/branches/SettingDialog:1216-1230
/branches/panelswitch:447-572
/branches/APIchangeevent:723-746
/branches/UserStream:1077-1144
/branches/FixedImage:787-910


Modified: trunk/Tween/Tween.vb
===================================================================
--- trunk/Tween/Tween.vb	2010-12-22 12:22:31 UTC (rev 1245)
+++ trunk/Tween/Tween.vb	2010-12-23 07:13:13 UTC (rev 1246)
@@ -39,6 +39,7 @@
 Imports System.Xml
 Imports System.Timers
 Imports System.Threading
+Imports System.Linq
 
 Public Class TweenMain
 
@@ -5420,6 +5421,28 @@
 
     Private Sub GoInReplyToPost()
         If _curPost IsNot Nothing AndAlso _curPost.InReplyToUser IsNot Nothing AndAlso _curPost.InReplyToId > 0 Then
+            Dim searchInReplyToPostFromAllTab = Sub()
+                                                    Dim inReplyToPosts = From tab In _statuses.Tabs.Values
+                                                                         From post In DirectCast(IIf(tab.IsInnerStorageTabType, tab.Posts, _statuses.Posts), Dictionary(Of Long, PostClass)).Values
+                                                                         Where post.Id = _curPost.InReplyToId
+
+                                                    Try
+                                                        Dim r = inReplyToPosts.First()
+                                                        If replyChains Is Nothing OrElse (replyChains.Count > 0 AndAlso replyChains.Peek().InReplyToId <> _curPost.Id) Then
+                                                            replyChains = New Stack(Of ReplyChain)
+                                                        End If
+                                                        replyChains.Push(New ReplyChain(_curPost.Id, _curPost.InReplyToId, _curTab))
+                                                        Dim tabPage As TabPage = Me.ListTab.TabPages.Cast(Of TabPage).First(Function(tp) tp.Text = r.tab.TabName)
+                                                        Dim listView = DirectCast(tabPage.Tag, DetailsListView)
+                                                        Dim idx = r.tab.IndexOf(r.post.Id)
+                                                        Me.ListTab.SelectedTab = tabPage
+                                                        SelectListItem(listView, idx)
+                                                        listView.EnsureVisible(idx)
+                                                    Catch ex As InvalidOperationException
+                                                        OpenUriAsync("http://twitter.com/" + _curPost.InReplyToUser + "/statuses/" + _curPost.InReplyToId.ToString())
+                                                    End Try
+                                                End Sub
+
             If _statuses.Tabs(_curTab.Text).TabType = TabUsageType.Lists Then
                 If _statuses.Tabs(_curTab.Text).Posts.ContainsKey(_curPost.InReplyToId) Then
                     Dim idx As Integer = _statuses.Tabs(_curTab.Text).IndexOf(_curPost.InReplyToId)
@@ -5435,7 +5458,7 @@
                         _curList.EnsureVisible(idx)
                     End If
                 Else
-                    OpenUriAsync("http://twitter.com/" + _curPost.InReplyToUser + "/statuses/" + _curPost.InReplyToId.ToString())
+                    searchInReplyToPostFromAllTab()
                 End If
             Else
                 If _statuses.ContainsKey(_curPost.InReplyToId) Then
@@ -5465,7 +5488,7 @@
                         _curList.EnsureVisible(idx)
                     End If
                 Else
-                    OpenUriAsync("http://twitter.com/" + _curPost.InReplyToUser + "/statuses/" + _curPost.InReplyToId.ToString())
+                    searchInReplyToPostFromAllTab()
                 End If
             End If
         End If



Tween-svn メーリングリストの案内
Back to archive index