diff --git a/mozilla/cck/cckwiz/iniFiles/Customize_page3.ini b/mozilla/cck/cckwiz/iniFiles/Customize_page3.ini index 87719bc896a..2e456bfd71c 100644 --- a/mozilla/cck/cckwiz/iniFiles/Customize_page3.ini +++ b/mozilla/cck/cckwiz/iniFiles/Customize_page3.ini @@ -173,7 +173,7 @@ Value=Customize Sidebar Tabs Start_x=0 Start_y=163 Width=407 -Height=64 +Height=74 [Widget 300] Type=Text @@ -187,49 +187,45 @@ Height=25 [Widget 7] Type=Text Name=Text25 -Value=Path to Your Customized Sidebar Tabs File (panels.rdf): +Value=Sidebar Tab Title Start_x=11 Start_y=191 -Width=275 +Width=65 Height=25 [Widget 8] -Type=DynamicText -Name=SidebarPath +Type=EditBox +Name=SidebartabTitle Value= +Start_x=75 +Start_y=189 +Width=225 +Height=14 + +[Widget 12] +Type=Text +Name=Text26 +Value=Sidebar Tab URL Start_x=11 -Start_y=205 -Width=200 -Height=14 +Start_y=210 +Width=65 +Height=25 -[Widget 4931] -Type=Button -Name=Button1069 -Value=View File -Start_x=240 -Start_y=202 -Width=40 +[Widget 14] +Type=EditBox +Name=SidebartabURL +Value= +Start_x=75 +Start_y=208 +Width=225 Height=14 -onCommand=command(%NCIFileEditor% "%SidebarPath%"); - - -[Widget 507] -Type=Button -Name=Button3163 -Value=Choose File... -Start_x=284 -Start_y=202 -Width=50 -Height=14 -onCommand=BrowseFile() -Target=SidebarPath [Widget 200] Type=Button Name=Button116 Value=Show Example Start_x=339 -Start_y=202 +Start_y=208 Width=60 Height=14 onCommand=DisplayImage(sidebar.ini) diff --git a/mozilla/cck/cckwiz/iniFiles/Default.che b/mozilla/cck/cckwiz/iniFiles/Default.che index c19ba805e43..113876827e1 100644 --- a/mozilla/cck/cckwiz/iniFiles/Default.che +++ b/mozilla/cck/cckwiz/iniFiles/Default.che @@ -6,7 +6,6 @@ OrganizationName= AnimatedLogoURL=http://home.netscape.com LargeAnimPath=%Root%Configs\Default\Workspace\AnimLogo\animlogo32.gif LargeStillPath=%Root%Configs\Default\Workspace\AnimLogo\staticlogo32.gif -SidebarPath=%Root%Configs\Default\Workspace\Sidebar\panels.rdf CompanyName= HomePageURL=http://home.netscape.com HelpMenuCommandName= diff --git a/mozilla/cck/cckwiz/iniFiles/MyIsp.che b/mozilla/cck/cckwiz/iniFiles/MyIsp.che index a06b12f02e2..85177e0dfa2 100644 --- a/mozilla/cck/cckwiz/iniFiles/MyIsp.che +++ b/mozilla/cck/cckwiz/iniFiles/MyIsp.che @@ -6,7 +6,6 @@ OrganizationName= AnimatedLogoURL=http://home.netscape.com LargeAnimPath=%Root%Configs\MyIsp\Workspace\AnimLogo\animlogo32.gif LargeStillPath=%Root%Configs\MyIsp\Workspace\AnimLogo\staticlogo32.gif -SidebarPath=%Root%Configs\MyIsp\Workspace\Sidebar\panels.rdf CompanyName=MyIsp HomePageURL=http://home.netscape.com HelpMenuCommandName= diff --git a/mozilla/cck/driver/cck.che b/mozilla/cck/driver/cck.che index 54d2062a66f..2d0dd172eb2 100644 --- a/mozilla/cck/driver/cck.che +++ b/mozilla/cck/driver/cck.che @@ -7,7 +7,6 @@ OrganizationName= AnimatedLogoURL=http://home.netscape.com LargeAnimPath=%Root%Configs\Default\Workspace\AnimLogo\animlogo32.gif LargeStillPath=%Root%Configs\Default\Workspace\AnimLogo\staticlogo32.gif -SidebarPath=%Root%Configs\Default\Workspace\Sidebar\panels.rdf CompanyName= HomePageURL=http://home.netscape.com HelpMenuCommandName= diff --git a/mozilla/cck/ib/ib.cpp b/mozilla/cck/ib/ib.cpp index 1db396638ce..f917b72b65d 100644 --- a/mozilla/cck/ib/ib.cpp +++ b/mozilla/cck/ib/ib.cpp @@ -1144,6 +1144,47 @@ BOOL MarkCFGVersion(CString HashedPrefsFile, CString versionTxt) return TRUE; } +void ModifySidebar(CString inputFile, CString outputFile) +{ + // Add a sidebar tab at the topmost location in 'My sidebar' + + char tempbuf[MAX_SIZE]; + CString searchstr = ""; + CString sidebartabTitle = GetGlobal("SidebartabTitle"); + CString sidebartabURL = GetGlobal("SidebartabURL"); + + ifstream srcf(inputFile); + if (!srcf) + { + AfxMessageBox("Cannot open input file: " + CString(inputFile),MB_OK); + return; + } + ofstream dstf(outputFile); + if (!dstf) + { + AfxMessageBox("Cannot open output file: " + CString(outputFile), MB_OK); + return; + } + + while (!srcf.eof()) + { + srcf.getline(tempbuf,MAX_SIZE); + dstf << tempbuf << "\n"; + if ((CString(tempbuf).Find(searchstr)) != -1) + { + dstf << " " << "\n"; + dstf << " \n"; + dstf << " " << sidebartabTitle << "" << "\n"; + dstf << " " << sidebartabURL << "" << "\n"; + dstf << " " << "\n"; + dstf << " " << "\n"; + } + } + + srcf.close(); + dstf.close(); +} + int interpret(char *cmd) { char *cmdname = strtok(cmd, "("); @@ -1279,7 +1320,36 @@ int interpret(char *cmd) } } + else if (strcmp(cmdname, "modifySidebar") == 0) + { + // extract the file to be modified from the jar/xpi + // and process the file + + char *xpiname = strtok(NULL, ",)"); // xpi file name + char *jarname = strtok(NULL, ",)"); // jar name within xpi file + char *filename = strtok(NULL, ",)"); // file name within jar file + CString inputFile = filename; + inputFile.Replace("/","\\"); + inputFile = tempPath + "\\" + inputFile; + CString outputFile = inputFile + ".new"; + + if (!xpiname || !filename) + return TRUE; + + //check to see if it is a jar and then do accordingly + if (stricmp(jarname,"no.jar")==0) + ExtractXPIFile(xpiname, filename); + else + ExtractJARFile(xpiname, (CString)jarname, filename); + + if (strcmp(cmdname, "modifySidebar") == 0) + ModifySidebar(inputFile, outputFile); + + remove(inputFile); + rename(outputFile, inputFile); + } + else if ((strcmp(cmdname, "modifyDTD") == 0) || (strcmp(cmdname, "modifyJS") == 0) || (strcmp(cmdname, "modifyJS1") == 0) || diff --git a/mozilla/cck/ib/script_Mac OS.ib b/mozilla/cck/ib/script_Mac OS.ib index 894af346584..575290e36b5 100644 --- a/mozilla/cck/ib/script_Mac OS.ib +++ b/mozilla/cck/ib/script_Mac OS.ib @@ -8,8 +8,8 @@ replaceXPI(ChromeDefaults.zip,chrome/modern.jar,skin/modern/communicator/brand/t replaceXPI(ChromeDefaults.zip,chrome/modern.jar,skin/modern/communicator/brand/throbber16-single.gif,%LargeStillPath%) replaceXPI(ChromeDefaults.zip,no.jar,defaults/profile/bookmarks.html,%CustomBookmarkFile%) replaceXPI(ChromeDefaults.zip,no.jar,defaults/profile/%REGION%/bookmarks.html,%CustomBookmarkFile%) -replaceXPI(ChromeDefaults.zip,no.jar,defaults/profile/panels.rdf,%SidebarPath%) -replaceXPI(ChromeDefaults.zip,no.jar,defaults/profile/%REGION%/panels.rdf,%SidebarPath%) +modifySidebar(ChromeDefaults.zip,no.jar,bin/defaults/profile/panels.rdf) +modifySidebar(ChromeDefaults.zip,no.jar,bin/defaults/profile/%REGION%/panels.rdf) replaceXPI(ChromeDefaults.zip,chrome/comm.jar,content/communicator/communicatorOverlay.xul,%HlpRDF%) modifyDTD(ChromeDefaults.zip,chrome/%lang%-%REGION%.jar,locale/%lang%-%REGION%/navigator/navigator-title.dtd,mainWindow.titlemodifier,%CompanyName%) modifyProperties(ChromeDefaults.zip,chrome/%REGION%.jar,locale/%REGION%/navigator-region/region.properties,browser.startup.homepage,%HomePageURL%) diff --git a/mozilla/cck/ib/script_Windows.ib b/mozilla/cck/ib/script_Windows.ib index d10d92ac946..63afb128252 100644 --- a/mozilla/cck/ib/script_Windows.ib +++ b/mozilla/cck/ib/script_Windows.ib @@ -16,8 +16,8 @@ replaceXPI(browser.xpi,bin/chrome/modern.jar,skin/modern/communicator/brand/thro replaceXPI(browser.xpi,bin/chrome/modern.jar,skin/modern/communicator/brand/throbber16-single.gif,%LargeStillPath%) replaceXPI(defl%lang%%region%.xpi,no.jar,bin/defaults/profile/bookmarks.html,%CustomBookmarkFile%) replaceXPI(reg%region%.xpi,no.jar,bin/defaults/profile/%REGION%/bookmarks.html,%CustomBookmarkFile%) -replaceXPI(defl%lang%%region%.xpi,no.jar,bin/defaults/profile/panels.rdf,%SidebarPath%) -replaceXPI(reg%region%.xpi,no.jar,bin/defaults/profile/%REGION%/panels.rdf,%SidebarPath%) +modifySidebar(defl%lang%%region%.xpi,no.jar,bin/defaults/profile/panels.rdf) +modifySidebar(reg%region%.xpi,no.jar,bin/defaults/profile/%REGION%/panels.rdf) replaceXPI(browser.xpi,bin/chrome/comm.jar,content/communicator/communicatorOverlay.xul,%HlpRDF%) modifyDTD(lang%lang%%region%.xpi,bin/chrome/%lang%-%REGION%.jar,locale/%lang%-%REGION%/navigator/navigator-title.dtd,mainWindow.titlemodifier,%CompanyName%) modifyProperties(reg%region%.xpi,bin/chrome/%REGION%.jar,locale/%REGION%/navigator-region/region.properties,browser.startup.homepage,%HomePageURL%) diff --git a/mozilla/cck/ib/script_linux.ib b/mozilla/cck/ib/script_linux.ib index 8fcddc0bd6e..5fdf34f52ba 100644 --- a/mozilla/cck/ib/script_linux.ib +++ b/mozilla/cck/ib/script_linux.ib @@ -8,8 +8,8 @@ replaceXPI(browser.xpi,bin/chrome/modern.jar,skin/modern/communicator/brand/thro replaceXPI(browser.xpi,bin/chrome/modern.jar,skin/modern/communicator/brand/throbber16-single.gif,%LargeStillPath%) replaceXPI(defl%lang%%region%.xpi,no.jar,bin/defaults/profile/bookmarks.html,%CustomBookmarkFile%) replaceXPI(reg%region%.xpi,no.jar,bin/defaults/profile/%REGION%/bookmarks.html,%CustomBookmarkFile%) -replaceXPI(defl%lang%%region%.xpi,no.jar,bin/defaults/profile/panels.rdf,%SidebarPath%) -replaceXPI(reg%region%.xpi,no.jar,bin/defaults/profile/%REGION%/panels.rdf,%SidebarPath%) +modifySidebar(defl%lang%%region%.xpi,no.jar,bin/defaults/profile/panels.rdf) +modifySidebar(reg%region%.xpi,no.jar,bin/defaults/profile/%REGION%/panels.rdf) replaceXPI(browser.xpi,bin/chrome/comm.jar,content/communicator/communicatorOverlay.xul,%HlpRDF%) modifyDTD(lang%lang%%region%.xpi,bin/chrome/%lang%-%REGION%.jar,locale/%lang%-%REGION%/navigator/navigator-title.dtd,mainWindow.titlemodifier,%CompanyName%) modifyProperties(reg%region%.xpi,bin/chrome/%REGION%.jar,locale/%REGION%/navigator-region/region.properties,browser.startup.homepage,%HomePageURL%) diff --git a/mozilla/cck/wizard/wizard.cpp b/mozilla/cck/wizard/wizard.cpp index f63f4362d20..5c569c5bdb1 100644 --- a/mozilla/cck/wizard/wizard.cpp +++ b/mozilla/cck/wizard/wizard.cpp @@ -77,7 +77,6 @@ BOOL Config(CString globalsName, CString DialogTitle, WIDGET* curWidget) SetGlobal("LargeAnimPath", newDir + "\\Workspace\\AnimLogo\\animlogo32.gif"); SetGlobal("LargeStillPath", newDir + "\\Workspace\\AnimLogo\\staticlogo32.gif"); SetGlobal("ReadMeFile", newDir + "\\Workspace\\readme.txt"); - SetGlobal("SidebarPath", newDir + "\\Workspace\\Sidebar\\panels.rdf"); SetGlobal("CustomBookmarkFile", newDir + "\\Workspace\\Bkmarks\\bookmarks.html"); SetGlobal("ShellBgBitmap", newDir + "\\Workspace\\Autorun\\Shell\\bmps\\install.bmp"); SetGlobal("ShellInstallTextFile", newDir + "\\Workspace\\Autorun\\install.txt");