OSDN Git Service

検索の通知関連不具合修正
authorkiri_feather <kiri_feather@users.sourceforge.jp>
Sun, 17 Jan 2010 15:59:47 +0000 (15:59 +0000)
committerKimura Youichi <kim.upsilon@bucyou.net>
Sat, 18 Feb 2012 14:10:40 +0000 (23:10 +0900)
git-svn-id: http://svn.sourceforge.jp/svnroot/tween/trunk@55 e39ad16e-3079-482e-bb30-4b4d378143b6

Tween/StatusDictionary.vb
Tween/Tween.vb

index 4d5ed79..26241a5 100644 (file)
@@ -710,6 +710,9 @@ Public NotInheritable Class TabInformations
             If _notifyPosts Is Nothing Then _notifyPosts = New List(Of PostClass)
             Me.Distribute()    'タブに仮振分
             _addCount = _addedIds.Count
+            For Each tb As TabClass In _tabs.Values
+                If tb.TabType = TabUsageType.PublicSearch Then _addCount += tb.GetTemporaryPosts.Length
+            Next
             _addedIds.Clear()
             _addedIds = Nothing     '後始末
             Return _addCount     '件数
@@ -807,9 +810,18 @@ Public NotInheritable Class TabInformations
         For Each tn As String In _tabs.Keys
             If _tabs(tn).TabType = TabUsageType.PublicSearch Then
                 If _tabs(tn).GetTemporaryPosts.Length > 0 Then
-                    For Each post As PostClass In _tabs(tn).GetTemporaryPosts
-                        _notifyPosts.Add(post)
-                    Next
+                    If _tabs(tn).Notify Then
+                        For Each post As PostClass In _tabs(tn).GetTemporaryPosts
+                            Dim exist As Boolean = False
+                            For Each npost As PostClass In _notifyPosts
+                                If npost.Id = post.Id Then
+                                    exist = True
+                                    Exit For
+                                End If
+                            Next
+                            If Not exist Then _notifyPosts.Add(post)
+                        Next
+                    End If
                     If _soundFile = "" AndAlso _tabs(tn).SoundFile <> "" Then _soundFile = _tabs(tn).SoundFile
                 End If
             End If
index f6299dc..0c635bc 100644 (file)
@@ -925,7 +925,6 @@ Public Class TweenMain
         'ReadedStripMenuItem.ShortcutKeyDisplayString = "B"
         'UnreadStripMenuItem.ShortcutKeyDisplayString = "Shift+B"
 
-        AddHandler My.Computer.Network.NetworkAvailabilityChanged, AddressOf Network_NetworkAvailabilityChanged
         If SettingDialog.MinimizeToTray = False OrElse Me.WindowState <> FormWindowState.Minimized Then
             Me.Visible = True
         End If
@@ -1384,12 +1383,24 @@ Public Class TweenMain
 
     Private Sub NotifyNewPosts(ByVal notifyPosts() As PostClass, ByVal soundFile As String, ByVal addCount As Integer)
         '新着通知
-        If (NewPostPopMenuItem.Checked AndAlso _
-               notifyPosts IsNot Nothing AndAlso notifyPosts.Length > 0 AndAlso _
-               Not _initial AndAlso _
-               ((SettingDialog.LimitBalloon AndAlso _
-                 (Me.WindowState = FormWindowState.Minimized OrElse Not Me.Visible OrElse Form.ActiveForm Is Nothing)) _
-                OrElse Not SettingDialog.LimitBalloon)) AndAlso Not IsScreenSaverRunning() Then
+        If ( _
+                NewPostPopMenuItem.Checked AndAlso _
+                notifyPosts IsNot Nothing AndAlso _
+                notifyPosts.Length > 0 AndAlso _
+                Not _initial AndAlso _
+                ( _
+                    ( _
+                        SettingDialog.LimitBalloon AndAlso _
+                        ( _
+                            Me.WindowState = FormWindowState.Minimized OrElse _
+                            Not Me.Visible OrElse _
+                            Form.ActiveForm Is Nothing _
+                        ) _
+                    ) OrElse _
+                    Not SettingDialog.LimitBalloon _
+                ) _
+            ) AndAlso _
+            Not IsScreenSaverRunning() Then
             Dim sb As New StringBuilder
             Dim reply As Boolean = False
             Dim dm As Boolean = False
@@ -6747,6 +6758,7 @@ RETRY:
     End Sub
 
     Private Sub TweenMain_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
+        AddHandler My.Computer.Network.NetworkAvailabilityChanged, AddressOf Network_NetworkAvailabilityChanged
         Try
             PostBrowser.Url = New Uri("about:blank")
             PostBrowser.DocumentText = ""       '発言詳細部初期化