svnno****@sourc*****
svnno****@sourc*****
2011年 8月 30日 (火) 17:02:19 JST
Revision: 1568 http://sourceforge.jp/projects/tween/svn/view?view=rev&revision=1568 Author: kiri_feather Date: 2011-08-30 17:02:19 +0900 (Tue, 30 Aug 2011) Log Message: ----------- カスタム定数関連修正 Modified Paths: -------------- trunk/Tween/AppendSettingDialog.vb trunk/Tween/Google.vb trunk/Tween/Tween.vb trunk/Tween/Twitter.vb -------------- next part -------------- Modified: trunk/Tween/AppendSettingDialog.vb =================================================================== --- trunk/Tween/AppendSettingDialog.vb 2011-08-30 04:36:44 UTC (rev 1567) +++ trunk/Tween/AppendSettingDialog.vb 2011-08-30 08:02:19 UTC (rev 1568) @@ -198,7 +198,7 @@ Else _ValidationError = False End If - +#If UA = "True" Then 'フォロー If Me.FollowCheckBox.Checked Then '現在の設定内容で通信 @@ -218,7 +218,7 @@ Dim ret As String = tw.PostFollowCommand("TweenApp") End If - +#End If Dim arg As New IntervalChangedEventArgs Dim isIntervalChanged As Boolean = False Modified: trunk/Tween/Google.vb =================================================================== --- trunk/Tween/Google.vb 2011-08-30 04:36:44 UTC (rev 1567) +++ trunk/Tween/Google.vb 2011-08-30 08:02:19 UTC (rev 1568) @@ -349,6 +349,9 @@ End Sub Private Sub SendRequest(ByVal info As Dictionary(Of String, String), ByVal userId As Long) +#If UA <> "True" Then + exit sub +#End If If userId = 0 Then Exit Sub If Me._SessionFirst = 0 Then Me.Init() Modified: trunk/Tween/Tween.vb =================================================================== --- trunk/Tween/Tween.vb 2011-08-30 04:36:44 UTC (rev 1567) +++ trunk/Tween/Tween.vb 2011-08-30 08:02:19 UTC (rev 1568) @@ -1133,13 +1133,11 @@ #Else SplitContainer4.Panel2Collapsed = True #End If -#If UA = "True" Then Google.GASender.GetInstance.SessionFirst = _cfgCommon.GAFirst Google.GASender.GetInstance.SessionLast = _cfgCommon.GALast If tw.UserId = 0 Then tw.VerifyCredentials() Google.GASender.GetInstance().TrackPage("/home_timeline", tw.UserId) Google.GASender.GetInstance().TrackEventWithCategory("post", "start", tw.UserId) -#End If End Sub Private Sub CreatePictureServices() @@ -1924,9 +1922,7 @@ Me.Visible = False Else Me.SaveConfigsCommon() -#If UA = "True" Then - Google.GASender.GetInstance().TrackEventWithCategory("post", "end", tw.UserId) -#End If + Google.GASender.GetInstance().TrackEventWithCategory("post", "end", tw.UserId) _hookGlobalHotkey.UnregisterAllOriginalHotkey() _ignoreConfigSave = True _endingFlag = True @@ -3133,9 +3129,7 @@ End Sub Private Sub SettingStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SettingStripMenuItem.Click, SettingFileMenuItem.Click -#If UA = "True" Then Google.GASender.GetInstance().TrackPage("/settings", tw.UserId) -#End If Dim result As DialogResult Dim uid As String = tw.Username.ToLower @@ -3165,9 +3159,11 @@ SettingDialog.ProxyUser, _ SettingDialog.ProxyPassword) Me.CreatePictureServices() +#If UA = "True" Then Me.SplitContainer4.Panel2.Controls.RemoveAt(0) Me.ab = New AdsBrowser Me.SplitContainer4.Panel2.Controls.Add(ab) +#End If Try If SettingDialog.TabIconDisp Then RemoveHandler ListTab.DrawItem, AddressOf ListTab_DrawItem @@ -3361,9 +3357,7 @@ Me.TopMost = SettingDialog.AlwaysTop SaveConfigsAll(False) -#If UA = "True" Then - Google.GASender.GetInstance().Trackpage("/home_timeline", tw.UserId) -#End If + Google.GASender.GetInstance().TrackPage("/home_timeline", tw.UserId) End Sub Private Sub PostBrowser_Navigated(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatedEventArgs) Handles PostBrowser.Navigated @@ -3501,9 +3495,7 @@ End If End If -#If UA = "True" Then - if not startup then Google.GASender.GetInstance().TrackEventWithCategory("post", "add_tab", tw.UserId) -#End If + If Not startup Then Google.GASender.GetInstance().TrackEventWithCategory("post", "add_tab", tw.UserId) Dim _tabPage As TabPage = New TabPage Dim _listCustom As DetailsListView = New DetailsListView Dim _colHd1 As ColumnHeader = New ColumnHeader() 'アイコン @@ -3781,9 +3773,7 @@ If _statuses.IsDefaultTab(TabName) Then Return False -#If UA = "True" Then Google.GASender.GetInstance().TrackEventWithCategory("post", "remove_tab", tw.UserId) -#End If If confirm Then Dim tmp As String = String.Format(My.Resources.RemoveSpecifiedTabText1, Environment.NewLine) If MessageBox.Show(tmp, TabName + " " + My.Resources.RemoveSpecifiedTabText2, _ @@ -3936,7 +3926,6 @@ If ListTab.Focused OrElse DirectCast(ListTab.SelectedTab.Tag, Control).Focused Then Me.Tag = ListTab.Tag TabMenuControl(ListTab.SelectedTab.Text) Me.PushSelectPostChain() -#If UA = "True" Then Select Case _statuses.Tabs(ListTab.SelectedTab.Text).TabType Case TabUsageType.Home Google.GASender.GetInstance().TrackPage("/home_timeline", tw.UserId) @@ -3961,7 +3950,6 @@ Case TabUsageType.UserTimeline Google.GASender.GetInstance().TrackPage("/user_timeline", tw.UserId) End Select -#End If End Sub Private Sub SetListProperty() @@ -7815,9 +7803,7 @@ End Sub Private Sub doRepliedStatusOpen() -#If UA = "True" Then - Google.GASender.GetInstance().Trackpage("/open_reply_to_status", tw.UserId) -#End If + Google.GASender.GetInstance().TrackPage("/open_reply_to_status", tw.UserId) If Me.ExistCurrentPost AndAlso _curPost.InReplyToUser IsNot Nothing AndAlso _curPost.InReplyToStatusId > 0 Then If My.Computer.Keyboard.ShiftKeyDown Then OpenUriAsync("http://twitter.com/" + _curPost.InReplyToUser + "/status/" + _curPost.InReplyToStatusId.ToString()) @@ -8486,9 +8472,7 @@ End Function Public Sub OpenUriAsync(ByVal UriString As String) -#If UA = "True" Then - Google.GASender.GetInstance().Trackpage("/open_url", tw.UserId) -#End If + Google.GASender.GetInstance().TrackPage("/open_url", tw.UserId) Dim args As New GetWorkerArg args.type = WORKERTYPE.OpenUri args.url = UriString @@ -9432,15 +9416,11 @@ End If End If + Google.GASender.GetInstance().TrackPage("/listuser_manage", tw.UserId) Using listSelectForm As New MyLists(user, Me.tw) -#If UA = "True" Then - Google.GASender.GetInstance().Trackpage("/listuser_manage", tw.UserId) -#End If listSelectForm.ShowDialog(Me) End Using -#If UA = "True" Then - Google.GASender.GetInstance().Trackpage("/home_timeline", tw.UserId) -#End If + Google.GASender.GetInstance().TrackPage("/home_timeline", tw.UserId) End Sub Private Sub SearchControls_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) @@ -9481,9 +9461,7 @@ End Sub Private Sub HashManageMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HashManageMenuItem.Click, HashManageToolStripMenuItem.Click -#If UA = "True" Then - Google.GASender.GetInstance().Trackpage("/hashtag_manage", tw.UserId) -#End If + Google.GASender.GetInstance().TrackPage("/hashtag_manage", tw.UserId) Dim rslt As DialogResult Try rslt = HashMgr.ShowDialog() @@ -9516,9 +9494,7 @@ 'End If _modifySettingCommon = True Me.StatusText_TextChanged(Nothing, Nothing) -#If UA = "True" Then - Google.GASender.GetInstance().Trackpage("/home_timeline", tw.UserId) -#End If + Google.GASender.GetInstance().TrackPage("/home_timeline", tw.UserId) End Sub Private Sub HashToggleMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles HashToggleMenuItem.Click, HashToggleToolStripMenuItem.Click @@ -9750,14 +9726,10 @@ Using userinfo As New ShowUserInfo() userinfo.Owner = Me userinfo.User = user -#If UA = "True" Then - Google.GASender.GetInstance().Trackpage("/user_profile", tw.UserId) -#End If + Google.GASender.GetInstance().TrackPage("/user_profile", tw.UserId) userinfo.ShowDialog(Me) Me.Activate() -#If UA = "True" Then - Google.GASender.GetInstance().Trackpage("/home_timeline", tw.UserId) -#End If + Google.GASender.GetInstance().TrackPage("/home_timeline", tw.UserId) End Using End Sub @@ -10123,15 +10095,11 @@ #End Region Private Sub ListManageToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListManageToolStripMenuItem.Click -#If UA = "True" Then - Google.GASender.GetInstance().Trackpage("/list_manage", tw.UserId) -#End If + Google.GASender.GetInstance().TrackPage("/list_manage", tw.UserId) Using form As New ListManage(tw) form.ShowDialog(Me) End Using -#If UA = "True" Then - Google.GASender.GetInstance().Trackpage("/home_timeline", tw.UserId) -#End If + Google.GASender.GetInstance().TrackPage("/home_timeline", tw.UserId) End Sub Public WriteOnly Property ModifySettingCommon() As Boolean @@ -10519,9 +10487,7 @@ StatusLabel.Text = msg End If End If -#If UA = "True" Then Google.GASender.GetInstance().TrackEventWithCategory("post", "translation", tw.UserId) -#End If End Sub Private Sub TranslationToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TranslationToolStripMenuItem.Click Modified: trunk/Tween/Twitter.vb =================================================================== --- trunk/Tween/Twitter.vb 2011-08-30 04:36:44 UTC (rev 1567) +++ trunk/Tween/Twitter.vb 2011-08-30 08:02:19 UTC (rev 1568) @@ -185,9 +185,7 @@ Twitter.AccountState = ACCOUNT_STATE.Valid _uname = Username.ToLower If AppendSettingDialog.Instance.UserstreamStartup Then Me.ReconnectUserStream() -#If UA = "True" Then - Google.GASender.GetInstance().TrackEventWithCategory("post", "authenticate",me.userid) -#End If + Google.GASender.GetInstance().TrackEventWithCategory("post", "authenticate", Me.UserId) Return "" Case HttpStatusCode.Unauthorized Twitter.AccountState = ACCOUNT_STATE.Invalid @@ -414,9 +412,7 @@ Return SendDirectMessage(postStr) End If -#If UA = "True" Then Google.GASender.GetInstance().TrackEventWithCategory("post", "status", Me.UserId) -#End If Dim res As HttpStatusCode Dim content As String = "" @@ -498,9 +494,7 @@ postStr = postStr.Trim() -#If UA = "True" Then Google.GASender.GetInstance().TrackEventWithCategory("post", "status_with_media", Me.UserId) -#End If Dim res As HttpStatusCode Dim content As String = "" @@ -581,9 +575,7 @@ If Twitter.AccountState <> ACCOUNT_STATE.Valid Then Return "" If Not TwitterApiInfo.IsDirectMessagePermission Then Return "Auth Err:try to re-authorization." -#If UA = "True" Then Google.GASender.GetInstance().TrackEventWithCategory("post", "direct_message", Me.UserId) -#End If postStr = postStr.Trim() @@ -662,9 +654,7 @@ If Twitter.AccountState <> ACCOUNT_STATE.Valid Then Return "" -#If UA = "True" Then Google.GASender.GetInstance().TrackEventWithCategory("post", "destroy", Me.UserId) -#End If Dim res As HttpStatusCode Try @@ -698,9 +688,7 @@ target = TabInformations.GetInstance.Item(id).RetweetedId '再RTの場合は元発言をRT End If -#If UA = "True" Then Google.GASender.GetInstance().TrackEventWithCategory("post", "retweet", Me.UserId) -#End If Dim res As HttpStatusCode Dim content As String = "" Try @@ -760,9 +748,7 @@ If Twitter.AccountState <> ACCOUNT_STATE.Valid Then Return "" If Not TwitterApiInfo.IsDirectMessagePermission Then Return "Auth Err:try to re-authorization." -#If UA = "True" Then Google.GASender.GetInstance().TrackEventWithCategory("post", "destroy_direct_message", Me.UserId) -#End If Dim res As HttpStatusCode 'If post.IsMe Then @@ -794,9 +780,7 @@ If Twitter.AccountState <> ACCOUNT_STATE.Valid Then Return "" -#If UA = "True" Then Google.GASender.GetInstance().TrackEventWithCategory("post", "follow", Me.UserId) -#End If Dim res As HttpStatusCode Dim content As String = "" @@ -831,9 +815,7 @@ If Twitter.AccountState <> ACCOUNT_STATE.Valid Then Return "" -#If UA = "True" Then Google.GASender.GetInstance().TrackEventWithCategory("post", "destroy_friendships", Me.UserId) -#End If Dim res As HttpStatusCode Dim content As String = "" @@ -868,9 +850,7 @@ If Twitter.AccountState <> ACCOUNT_STATE.Valid Then Return "" -#If UA = "True" Then Google.GASender.GetInstance().TrackEventWithCategory("post", "block", Me.UserId) -#End If Dim res As HttpStatusCode Dim content As String = "" @@ -905,9 +885,7 @@ If Twitter.AccountState <> ACCOUNT_STATE.Valid Then Return "" -#If UA = "True" Then Google.GASender.GetInstance().TrackEventWithCategory("post", "destroy_block", Me.UserId) -#End If Dim res As HttpStatusCode Dim content As String = "" @@ -942,9 +920,7 @@ If Twitter.AccountState <> ACCOUNT_STATE.Valid Then Return "" -#If UA = "True" Then Google.GASender.GetInstance().TrackEventWithCategory("post", "spam", Me.UserId) -#End If Dim res As HttpStatusCode Dim content As String = "" @@ -979,9 +955,7 @@ If Twitter.AccountState <> ACCOUNT_STATE.Valid Then Return "" -#If UA = "True" Then Google.GASender.GetInstance().TrackPage("/friendships", Me.UserId) -#End If Dim res As HttpStatusCode Dim content As String = "" Try @@ -1020,9 +994,7 @@ If Twitter.AccountState <> ACCOUNT_STATE.Valid Then Return "" -#If UA = "True" Then Google.GASender.GetInstance().TrackPage("/showuser", Me.UserId) -#End If Dim res As HttpStatusCode Dim content As String = "" user = Nothing @@ -1066,9 +1038,7 @@ If Twitter.AccountState <> ACCOUNT_STATE.Valid Then Return "" -#If UA = "True" Then Google.GASender.GetInstance().TrackPage("/retweet_count", Me.UserId) -#End If Dim res As HttpStatusCode Dim content As String = "" Dim xmlBuf As String = "" @@ -1119,9 +1089,7 @@ If Twitter.AccountState <> ACCOUNT_STATE.Valid Then Return "" -#If UA = "True" Then Google.GASender.GetInstance().TrackEventWithCategory("post", "favorites", Me.UserId) -#End If Dim res As HttpStatusCode Dim content As String = "" Try @@ -1192,9 +1160,7 @@ If Twitter.AccountState <> ACCOUNT_STATE.Valid Then Return "" -#If UA = "True" Then Google.GASender.GetInstance().TrackEventWithCategory("post", "destroy_favorites", Me.UserId) -#End If Dim res As HttpStatusCode Dim content As String = "" Try @@ -1227,9 +1193,7 @@ If Twitter.AccountState <> ACCOUNT_STATE.Valid Then Return "" -#If UA = "True" Then Google.GASender.GetInstance().TrackEventWithCategory("post", "update_profile", Me.UserId) -#End If Dim res As HttpStatusCode Dim content As String = "" Try @@ -1262,9 +1226,7 @@ If Twitter.AccountState <> ACCOUNT_STATE.Valid Then Return "" -#If UA = "True" Then Google.GASender.GetInstance().TrackEventWithCategory("post", "update_profile_image", Me.UserId) -#End If Dim res As HttpStatusCode Dim content As String = "" Try @@ -1354,9 +1316,7 @@ End Function Public Function GetTweenBinary(ByVal strVer As String) As String -#If UA = "True" Then Google.GASender.GetInstance().TrackPage("/newversion", Me.UserId) -#End If Try '本体 If Not (New HttpVarious).GetDataToFile("http://tween.sourceforge.jp/Tween" + strVer + ".gz?" + Now.ToString("yyMMddHHmmss") + Environment.TickCount.ToString(), _ @@ -1620,9 +1580,7 @@ If _endingFlag Then Return "" -#If UA = "True" Then Google.GASender.GetInstance().TrackPage("/showstatus", Me.UserId) -#End If Dim res As HttpStatusCode Dim content As String = "" @@ -1913,9 +1871,7 @@ End Function Public Function GetRelatedResult(ByVal read As Boolean, ByVal tab As TabClass) As String -#If UA = "True" Then Google.GASender.GetInstance().TrackPage("/related_statuses", Me.UserId) -#End If Dim rslt As String = "" Dim relPosts As New List(Of PostClass) If tab.RelationTargetPost.TextFromApi.Contains("@") AndAlso tab.RelationTargetPost.InReplyToStatusId = 0 Then @@ -2782,9 +2738,7 @@ Dim res As HttpStatusCode Dim content As String = "" -#If UA = "True" Then Google.GASender.GetInstance().TrackEventWithCategory("post", "destroy_list", Me.UserId) -#End If Try res = twCon.DeleteListID(Me.Username, list_id, content) Catch ex As Exception @@ -2807,9 +2761,7 @@ End Function Public Function EditList(ByVal list_id As String, ByVal new_name As String, ByVal isPrivate As Boolean, ByVal description As String, ByRef list As ListElement) As String -#If UA = "True" Then Google.GASender.GetInstance().TrackEventWithCategory("get", "update_list", Me.UserId) -#End If Dim res As HttpStatusCode Dim content As String = "" @@ -2903,9 +2855,7 @@ Public Function CreateListApi(ByVal listName As String, ByVal isPrivate As Boolean, ByVal description As String) As String If Twitter.AccountState <> ACCOUNT_STATE.Valid Then Return "" -#If UA = "True" Then Google.GASender.GetInstance().TrackEventWithCategory("post", "create_list", Me.UserId) -#End If Dim res As HttpStatusCode Dim content As String = "" @@ -2983,9 +2933,7 @@ Dim content As String = "" Dim res As HttpStatusCode -#If UA = "True" Then Google.GASender.GetInstance().TrackEventWithCategory("post", "add_user_to_list", Me.UserId) -#End If Try res = twCon.CreateListMembers(listId, user, content) Catch ex As Exception @@ -3008,9 +2956,7 @@ End Function Public Function RemoveUserToList(ByVal listId As String, ByVal user As String) As String -#If UA = "True" Then Google.GASender.GetInstance().TrackEventWithCategory("post", "remove_user_from_list", Me.UserId) -#End If Dim content As String = "" Dim res As HttpStatusCode @@ -3583,9 +3529,7 @@ End Sub Private Sub userStream_Started() Handles userStream.Started -#If UA = "True" Then Google.GASender.GetInstance().TrackPage("/userstream", Me.UserId) -#End If RaiseEvent UserStreamStarted() End Sub