Fix for bugscape bug 13928: Extract file associated with help menu from

the XPI directory (r=mitchf)
This commit is contained in:
shrutiv%netscape.com 2002-06-27 19:11:37 +00:00
Родитель 26d4383ff3
Коммит ad2669193d
5 изменённых файлов: 47 добавлений и 11 удалений

Просмотреть файл

@ -1308,6 +1308,45 @@ void ModifyBookmarks(CString inputFile, CString outputFile)
dstf.close(); dstf.close();
} }
void ModifyHelpMenu(CString inputFile, CString outputFile)
{
// Add an item to the Help menu
char tempbuf[MAX_SIZE];
CString searchstr = "oncommand=\"openTopWin(\'urn:clienturl:help:security\');\" />";
CString helpMenuName = GetGlobal("HelpMenuCommandName");
CString helpMenuUrl = GetGlobal("HelpMenuCommandURL");
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);
srcf.close();
return;
}
while (!srcf.eof())
{
srcf.getline(tempbuf,MAX_SIZE);
dstf << tempbuf << "\n";
if ((CString(tempbuf).Find(searchstr)) != -1)
{
dstf << " <menuitem label=\"" << helpMenuName << "\"\n";
dstf << " position=\"7\"\n";
dstf << " oncommand=\"openTopWin('" << helpMenuUrl << "');\" />\n";
}
}
srcf.close();
dstf.close();
}
int interpret(char *cmd) int interpret(char *cmd)
{ {
char *cmdname = strtok(cmd, "("); char *cmdname = strtok(cmd, "(");
@ -1476,7 +1515,8 @@ int interpret(char *cmd)
} }
else if ((strcmp(cmdname, "modifySidebar") == 0) || else if ((strcmp(cmdname, "modifySidebar") == 0) ||
(strcmp(cmdname, "modifyBookmarks") == 0)) (strcmp(cmdname, "modifyBookmarks") == 0) ||
(strcmp(cmdname, "modifyHelpMenu") == 0))
{ {
// extract the file to be modified from the jar/xpi // extract the file to be modified from the jar/xpi
// and process the file // and process the file
@ -1503,6 +1543,8 @@ int interpret(char *cmd)
ModifySidebar(inputFile, outputFile); ModifySidebar(inputFile, outputFile);
else if (strcmp(cmdname, "modifyBookmarks") == 0) else if (strcmp(cmdname, "modifyBookmarks") == 0)
ModifyBookmarks(inputFile, outputFile); ModifyBookmarks(inputFile, outputFile);
else if (strcmp(cmdname, "modifyHelpMenu") == 0)
ModifyHelpMenu(inputFile, outputFile);
remove(inputFile); remove(inputFile);
rename(outputFile, inputFile); rename(outputFile, inputFile);
@ -2504,10 +2546,6 @@ int StartIB(/*CString parms, WIDGET *curWidget*/)
httpvalue = httpvalue + HelpUrl; httpvalue = httpvalue + HelpUrl;
SetGlobal("HelpMenuCommandURL",httpvalue); SetGlobal("HelpMenuCommandURL",httpvalue);
} }
// Create the HelpMenu.xul in the beginning so that it can be called from the script.ib
CString setHlpRDF = tempPath +"\\helpMenu.rdf";
SetGlobal("HlpRDF",setHlpRDF);
CreateHelpMenu();
CString setIspRDF = tempPath +"\\mailaccount.rdf"; CString setIspRDF = tempPath +"\\mailaccount.rdf";
SetGlobal("IspRDF",setIspRDF); SetGlobal("IspRDF",setIspRDF);

Просмотреть файл

@ -35,7 +35,7 @@ OBJS= \
.\$(OBJDIR)\NewDialog.obj \ .\$(OBJDIR)\NewDialog.obj \
.\$(OBJDIR)\wizshell.obj \ .\$(OBJDIR)\wizshell.obj \
.\$(OBJDIR)\ib.obj \ .\$(OBJDIR)\ib.obj \
.\$(OBJDIR)\Helpmenu.obj \ .\$(OBJDIR)\MailNews.obj \
.\$(OBJDIR)\buddylist.obj \ .\$(OBJDIR)\buddylist.obj \
.\$(OBJDIR)\engine.obj \ .\$(OBJDIR)\engine.obj \
$(NULL) $(NULL)
@ -95,8 +95,6 @@ export::
$(MAKE_INSTALL) script_Linux.ib $(CCKDIST)\CCKTool $(MAKE_INSTALL) script_Linux.ib $(CCKDIST)\CCKTool
$(MAKE_INSTALL) script_Windows.ib $(CCKDIST)\CCKTool $(MAKE_INSTALL) script_Windows.ib $(CCKDIST)\CCKTool
$(MAKE_INSTALL) "script_Mac OS.ib" $(CCKDIST)\CCKTool $(MAKE_INSTALL) "script_Mac OS.ib" $(CCKDIST)\CCKTool
$(MAKE_INSTALL) help1.txt $(CCKDIST)\CCKTool
$(MAKE_INSTALL) help2.txt $(CCKDIST)\CCKTool
$(PROGRAM):: $(OBJDIR) $(OBJS) $(RESFILE) $(PROGRAM):: $(OBJDIR) $(OBJS) $(RESFILE)

Просмотреть файл

@ -10,7 +10,7 @@ modifySidebar(ChromeDefaults.zip,no.jar,bin/defaults/profile/panels.rdf)
modifySidebar(ChromeDefaults.zip,no.jar,bin/defaults/profile/%REGION%/panels.rdf) modifySidebar(ChromeDefaults.zip,no.jar,bin/defaults/profile/%REGION%/panels.rdf)
modifyBookmarks(ChromeDefaults.zip,no.jar,defaults/profile/bookmarks.html) modifyBookmarks(ChromeDefaults.zip,no.jar,defaults/profile/bookmarks.html)
modifyBookmarks(ChromeDefaults.zip,no.jar,defaults/profile/%REGION%/bookmarks.html) modifyBookmarks(ChromeDefaults.zip,no.jar,defaults/profile/%REGION%/bookmarks.html)
replaceXPI(ChromeDefaults.zip,chrome/comm.jar,content/communicator/communicatorOverlay.xul,%HlpRDF%) modifyHelpMenu(ChromeDefaults.zip,chrome/comm.jar,content/communicator/communicatorOverlay.xul)
modifyDTD(ChromeDefaults.zip,chrome/%lang%-%REGION%.jar,locale/%lang%-%REGION%/navigator/navigator-title.dtd,mainWindow.titlemodifier,%CompanyName%) 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%) modifyProperties(ChromeDefaults.zip,chrome/%REGION%.jar,locale/%REGION%/navigator-region/region.properties,browser.startup.homepage,%HomePageURL%)
modifyProperties(ChromeDefaults.zip,chrome/%REGION%.jar,locale/%REGION%/navigator-region/region.properties,browser.throbber.url,%AnimatedLogoURL%) modifyProperties(ChromeDefaults.zip,chrome/%REGION%.jar,locale/%REGION%/navigator-region/region.properties,browser.throbber.url,%AnimatedLogoURL%)

Просмотреть файл

@ -18,7 +18,7 @@ modifySidebar(defl%lang%%region%.xpi,no.jar,bin/defaults/profile/panels.rdf)
modifySidebar(reg%region%.xpi,no.jar,bin/defaults/profile/%REGION%/panels.rdf) modifySidebar(reg%region%.xpi,no.jar,bin/defaults/profile/%REGION%/panels.rdf)
modifyBookmarks(defl%lang%%region%.xpi,no.jar,bin/defaults/profile/bookmarks.html) modifyBookmarks(defl%lang%%region%.xpi,no.jar,bin/defaults/profile/bookmarks.html)
modifyBookmarks(reg%region%.xpi,no.jar,bin/defaults/profile/%REGION%/bookmarks.html) modifyBookmarks(reg%region%.xpi,no.jar,bin/defaults/profile/%REGION%/bookmarks.html)
replaceXPI(browser.xpi,bin/chrome/comm.jar,content/communicator/communicatorOverlay.xul,%HlpRDF%) modifyHelpMenu(browser.xpi,bin/chrome/comm.jar,content/communicator/communicatorOverlay.xul)
modifyDTD(lang%lang%%region%.xpi,bin/chrome/%lang%-%REGION%.jar,locale/%lang%-%REGION%/navigator/navigator-title.dtd,mainWindow.titlemodifier,%CompanyName%) 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%) modifyProperties(reg%region%.xpi,bin/chrome/%REGION%.jar,locale/%REGION%/navigator-region/region.properties,browser.startup.homepage,%HomePageURL%)
modifyProperties(reg%region%.xpi,bin/chrome/%REGION%.jar,locale/%REGION%/navigator-region/region.properties,browser.throbber.url,%AnimatedLogoURL%) modifyProperties(reg%region%.xpi,bin/chrome/%REGION%.jar,locale/%REGION%/navigator-region/region.properties,browser.throbber.url,%AnimatedLogoURL%)

Просмотреть файл

@ -10,7 +10,7 @@ modifySidebar(defl%lang%%region%.xpi,no.jar,bin/defaults/profile/panels.rdf)
modifySidebar(reg%region%.xpi,no.jar,bin/defaults/profile/%REGION%/panels.rdf) modifySidebar(reg%region%.xpi,no.jar,bin/defaults/profile/%REGION%/panels.rdf)
modifyBookmarks(defl%lang%%region%.xpi,no.jar,bin/defaults/profile/bookmarks.html) modifyBookmarks(defl%lang%%region%.xpi,no.jar,bin/defaults/profile/bookmarks.html)
modifyBookmarks(reg%region%.xpi,no.jar,bin/defaults/profile/%REGION%/bookmarks.html) modifyBookmarks(reg%region%.xpi,no.jar,bin/defaults/profile/%REGION%/bookmarks.html)
replaceXPI(browser.xpi,bin/chrome/comm.jar,content/communicator/communicatorOverlay.xul,%HlpRDF%) modifyHelpMenu(browser.xpi,bin/chrome/comm.jar,content/communicator/communicatorOverlay.xul)
modifyDTD(lang%lang%%region%.xpi,bin/chrome/%lang%-%REGION%.jar,locale/%lang%-%REGION%/navigator/navigator-title.dtd,mainWindow.titlemodifier,%CompanyName%) 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%) modifyProperties(reg%region%.xpi,bin/chrome/%REGION%.jar,locale/%REGION%/navigator-region/region.properties,browser.startup.homepage,%HomePageURL%)
modifyProperties(reg%region%.xpi,bin/chrome/%REGION%.jar,locale/%REGION%/navigator-region/region.properties,browser.throbber.url,%AnimatedLogoURL%) modifyProperties(reg%region%.xpi,bin/chrome/%REGION%.jar,locale/%REGION%/navigator-region/region.properties,browser.throbber.url,%AnimatedLogoURL%)