home *** CD-ROM | disk | FTP | other *** search
- Option Explicit
- Dim garrAppTabs, gTabCount
-
- ' Initialize the Tab Array
- Function InitTabs()
- '{
- Dim szHelpUrl, szAppUrl, szOEMIniFile, nShow
-
- garrAppTabs = Array()
- gTabCount = 0
-
- szHelpUrl = gDBobjOS.GetObjectModuleDir( CLSID_MCAgent )
- If (0 < Len(szHelpUrl)) Then
- szHelpUrl = szHelpUrl & "\" & AGENT_HELP
- End If
-
- '////////////////////////////////////////////////
- ' MYS - My Security the default Dashboard Tab
-
- Call AddTabInfo(-1, "MYS", "images\mysecurity_b_40x40.gif", "images\mysecurity_40x40.gif", SERVICE_NAME_STR, "mys.htm", szHelpUrl, "recentvirus.htm", "SecurityCenter")
-
-
- '////////////////////////////////////////////////
- ' VSO Tab
-
- szOEMIniFile = GetOEMIniFile(gDBobjReg, gDBobjFS, gDBobjOS)
-
- 'By Default show this tab
- nShow = ShowTab("VSO", szOEMIniFile, 1)
-
- If (1 = nShow) Then
- szAppUrl = "vso.htm"
- If (0 = IsVSO4Installed( gDBobjReg, gDBobjOS, gDBobjFS )) Then
- 'If an old VSO version is installed then show update page if available or knock off the tab
- If ( 0 < Len(gDBobjReg.RegQueryValue(DB_REGKEY_LINK_STR, LINK_UPDATE_VSO_URL)) ) Then
- szAppUrl = "vsoupd.htm"
- Else
- szAppUrl = ""
- End If
- End If
-
- If ("" <> szAppUrl) Then
- Call AddTabInfo(-1, "VSO", "images\VSO_b_40x40.gif", "images\VSO_40x40.gif", DEF_VSO_PRODUCT_LOWER_CASE_TAG_NAME, szAppUrl, szHelpUrl, "", DEF_VSO_PRODUCT_NAME)
- End If
- End If
-
-
- '////////////////////////////////////////////////
- ' MPF Tab
-
- Dim dwMPFVer
-
- 'By Default show this tab
- nShow = ShowTab("MPF", szOEMIniFile, 1)
-
- If (1 = nShow) Then
- dwMPFVer = GetInstalledMPFVersion( gDBobjReg, gDBobjOS, gDBobjFS )
-
- szAppUrl = ""
- If 4 = dwMPFVer Or -1 = dwMPFVer Then
- szAppUrl = "mpf.htm"
- ElseIf ( 0 < Len(gDBobjReg.RegQueryValue(DB_REGKEY_LINK_STR, LINK_UPDATE_MPF_URL)) ) Then
- szAppUrl = "mpfupd.htm"
- End If
-
- If ("" <> szAppUrl) Then
- If (IsPlus("MPF", szOEMIniFile, False)) Then
- Call AddTabInfo(-1, "MPF", "images\FirewallPlus_b_40x40.gif", "images\FirewallPlus_40x40.gif", "personal firewall plus", szAppUrl, szHelpUrl, "", "Personal Firewall Plus")
- Else
- Call AddTabInfo(-1, "MPF", "images\firewall_b_40x40.gif", "images\firewall_40x40.gif", "personal firewall", szAppUrl, szHelpUrl, "", "Personal Firewall")
- End If
- End If
- End If
-
- '////////////////////////////////////////////////
- ' MPS Tab
-
- 'By Default show this tab
- nShow = ShowTab("MPS", szOEMIniFile, 1)
-
- If (1 = nShow) Then
- szAppUrl = "mps.htm"
- If (0 = IsMPSInstalled( gDBobjReg, gDBobjOS, gDBobjFS )) Then
- 'If an old MPS version is installed then show update page if available or knock off the tab
- If ( 0 < Len(gDBobjReg.RegQueryValue(DB_REGKEY_LINK_STR, LINK_UPDATE_MSK_URL)) ) Then
- szAppUrl = "mpsupd.htm"
- Else
- szAppUrl = ""
- End If
- End If
-
- If ("" <> szAppUrl) Then
- Call AddTabInfo(-1, "MPS", "images\privacy_b_40x40.gif", "images\privacy_40x40.gif", "privacy service", szAppUrl, szHelpUrl, "", "Privacy Service")
- End If
- End If
-
- '////////////////////////////////////////////////
- ' MSK Tab
-
- 'By Default show this tab
- nShow = ShowTab("MSK", szOEMIniFile, 1)
-
- If (1 = nShow) Then
- szAppUrl = "msk.htm"
- 'Enable the lines below to detect old version and show update tab if an older version is installed
- If (0 = IsMSKInstalled( gDBobjReg, gDBobjOS, gDBobjFS )) Then
- 'If an old MSK version is installed then show update page if available or knock off the tab
- If ( 0 < Len(gDBobjReg.RegQueryValue(DB_REGKEY_LINK_STR, LINK_UPDATE_MSK_URL)) ) Then
- szAppUrl = "mskupd.htm"
- Else
- szAppUrl = ""
- End If
- End If
-
- If ("" <> szAppUrl) Then
- Call AddTabInfo(-1, "MSK", "images\msk_b_40x40.gif", "images\msk_40x40.gif", "spamkiller", szAppUrl, szHelpUrl, "", "SpamKiller")
- End If
- End If
- '}
- End Function
-
- ' Find a tab in the Array and return its Index
- Function FindTab(szAppId)
- '{
- Dim nIndex
-
- FindTab = -1
- For nIndex = 0 To gTabCount - 1
- '{
- If (0 = strcomp(szAppId, garrAppTabs(nIndex).szAppId, vbTextCompare)) Then
- FindTab = nIndex
- End If
- '}
- Next
- '}
- End Function
-
- ' Add a Tab to the array at the specified Index or Add a new element at the end
- Function AddTabInfo(nIndex, szAppId, szTabImage, szSelTabImage, szTabText, szHomePageUrl, szHelpUrl, szSecurityNewsUrl, szAppName)
- '{
- If Not (-1 < nIndex And gTabCount > nIndex) Then
- Redim Preserve garrAppTabs(gTabCount)
- nIndex = gTabCount
- Set garrAppTabs(nIndex) = New CAppTab
- gTabCount = gTabCount + 1
- End If
-
- If (0 < Len(szAppId)) Then
- garrAppTabs(nIndex).szAppId = szAppId
- End If
-
- If (0 < Len(szTabImage)) Then
- garrAppTabs(nIndex).szTabImage = szTabImage
- End If
-
- If (0 < Len(szSelTabImage)) Then
- garrAppTabs(nIndex).szSelTabImage = szSelTabImage
- End If
-
- If (0 < Len(szTabText)) Then
- garrAppTabs(nIndex).szTabText = LCase(szTabText) ' For 5.0 re-branding, all the tab text are lowercase.
- End If
-
- If (0 < Len(szHomePageUrl)) Then
- garrAppTabs(nIndex).szHomePageUrl = szHomePageUrl
- End If
-
- If (0 < Len(szHelpUrl)) Then
- garrAppTabs(nIndex).szHelpUrl = szHelpUrl
- End If
-
- If (0 < Len(szSecurityNewsUrl)) Then
- garrAppTabs(nIndex).szSecurityNewsUrl = szSecurityNewsUrl
- End If
-
- If (0 < Len(szAppName)) Then
- If (1 = InStr(szAppName, "McAfee.com ")) Then
- garrAppTabs(nIndex).szAppName = Mid(szAppName, 12)
- ElseIf (1 = InStr(szAppName, "McAfee ")) Then
- garrAppTabs(nIndex).szAppName = Mid(szAppName, 8)
- Else
- garrAppTabs(nIndex).szAppName = szAppName
- End If
- End If
-
- '}
- End Function
-
-
- ' The Tab object
- Class CAppTab
- '{
-
- Public szAppId, szTabImage, szSelTabImage, szTabText, szHomePageUrl, szHelpUrl, szSecurityNewsUrl, szAppName
-
- Private Sub Class_Initialize()
- '{
- szAppId = ""
- szTabImage = ""
- szSelTabImage = ""
- szTabText = ""
- szHomePageUrl = ""
- szHelpUrl = ""
- szSecurityNewsUrl = ""
- szAppName = ""
- '}
- End Sub
-
- '}
- End Class
-