adding files for customizing helpmenu

This commit is contained in:
varada%netscape.com 2000-05-16 20:26:50 +00:00
Родитель ac63b8b616
Коммит d350d53e80
8 изменённых файлов: 151 добавлений и 2 удалений

63
cck/ib/Helpmenu.cpp Normal file
Просмотреть файл

@ -0,0 +1,63 @@
#include "stdafx.h"
#include "globals.h"
#include "fstream.h"
#include "direct.h"
#include <Winbase.h>
#include <direct.h>
#include "comp.h"
#include "ib.h"
extern CString rootPath;// = GetGlobal("Root");
extern CString configName;// = GetGlobal("CustomizationList");
extern CString configPath;// = rootPath + "Configs\\" + configName;
extern CString cdPath ;// = configPath + "\\CD";
extern CString workspacePath;// = configPath + "\\Workspace";
extern CString cdshellPath;
//CString CDout="CD_output";
void CreateHelpMenu (void)
{
CString root = GetGlobal("Root");
CString config = GetGlobal("CustomizationList");
CString file1 = root + "\\help1.txt";
CString file2 = root + "\\help2.txt";
CString HelpPath = root + "\\Configs\\" + config + "\\Temp\\";
ifstream help1(file1);
ifstream help2(file2);
_mkdir (HelpPath);
CString HelpMenuFile = HelpPath +"helpmenu.xul";
ofstream Hlp(HelpMenuFile);
CString HelpMenuName = GetGlobal("HelpMenuCommandName");
CString HelpMenuUrl = GetGlobal("HelpMenuCommandUrl");
if (HelpMenuName.IsEmpty())
HelpMenuName = config + "-Help";
char jsprefname[200];
if(!help1) {
cout << "cannot open the file \n";
}
while (!help1.eof()) {
help1.getline(jsprefname,200);
Hlp <<jsprefname<<"\n";
}
Hlp <<"<menuitem position=\"7\" value=\""<<HelpMenuName<<"\"\n\t";
Hlp <<"oncommand=\"openTopWin('"<<HelpMenuUrl<<"')\" /> \n\t";
Hlp <<"<menuseparator position=\"9\" /> \n";
if(!help2) {
cout << "cannot open the file \n";
}
while (!help2.eof()) {
help2.getline(jsprefname,200);
Hlp <<jsprefname<<"\n";
}
Hlp.close();
}

46
cck/ib/buddylist.cpp Normal file
Просмотреть файл

@ -0,0 +1,46 @@
#include "stdafx.h"
#include "globals.h"
#include "fstream.h"
#include "direct.h"
#include <Winbase.h>
#include <direct.h>
#include "comp.h"
#include "ib.h"
extern CString rootPath;// = GetGlobal("Root");
extern CString configName;// = GetGlobal("CustomizationList");
extern CString configPath;// = rootPath + "Configs\\" + configName;
extern CString cdPath ;// = configPath + "\\CD";
extern CString workspacePath;// = configPath + "\\Workspace";
extern CString cdshellPath;
//CString CDout="CD_output";
void CreateBuddyList(void)
{
CString root = GetGlobal("Root");
CString config = GetGlobal("CustomizationList");
CString BLTPath = root + "\\Configs\\" + config + "\\Temp";
_mkdir (BLTPath);
CString BLTFile = BLTPath +"buddy_list.blt";
ofstream Blt(BLTFile);
CString BuddyGroup=GetGlobal("BuddyGroup");
CString Buddy1=GetGlobal("Buddy1");
CString Buddy2=GetGlobal("Buddy2");
CString Buddy3=GetGlobal("Buddy3");
CString Buddy4=GetGlobal("Buddy4");
CString Buddy5=GetGlobal("Buddy5");
Blt <<"Config { \n version 1 \n} \nUser { \n screenName newuser \n} \nBuddy { \n list {\n";
Blt <<" "<<BuddyGroup<<" {\n";
Blt <<" \""<<Buddy1<<"\"\n";
Blt <<" \""<<Buddy2<<"\"\n";
Blt <<" \""<<Buddy3<<"\"\n";
Blt <<" \""<<Buddy4<<"\"\n";
Blt <<" \""<<Buddy5<<"\"\n";
Blt <<" }\n }\n}";
Blt.close();
}

16
cck/ib/help1.txt Normal file
Просмотреть файл

@ -0,0 +1,16 @@
<?xml version="1.0"?>
<!DOCTYPE window SYSTEM "chrome://global/locale/helpMenu.dtd" >
<overlay id="helpMenuID"
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<menupopup id="helpPopup">
<menuitem id="nscpHelpCmd.label" position="1" value="&nscpHelpCmd.label;" oncommand="openTopWin('urn:clienturl:help:nscphelp')" />
<menuitem id="whatNew" position="2" value="&whatNewCmd.label;" disabled="true" oncommand="" />
<menuitem id="netHelp" position="3" value="&netHelpCmd.label;" oncommand="openTopWin('urn:clienturl:help:nethelp')" />
<menuseparator position="4" />
<menuitem id="feedBack" position="5" value="&feedBackCmd.label;" oncommand="openTopWin('urn:clienturl:help:feedback')" />
<menuitem id="intUsers" position="6" value="&intUsersCmd.label;"

4
cck/ib/help2.txt Normal file
Просмотреть файл

@ -0,0 +1,4 @@
</menupopup>
</overlay>

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

@ -667,6 +667,8 @@ int StartIB(CString parms, WIDGET *curWidget)
//end of filesize check;
// Check to see if the animatedlogourl has the http before it or not- else the browser
// looks only in the chrome directory.
CString animLogoUrl = GetGlobal("AnimatedLogoURL");
CString leftvalue = animLogoUrl.Left(7);
CString httpvalue = "http://";
@ -676,7 +678,20 @@ int StartIB(CString parms, WIDGET *curWidget)
SetGlobal("AnimatedLogoURL",httpvalue);
}
CString HelpUrl = GetGlobal("HelpMenuCommandUrl");
leftvalue = HelpUrl.Left(7);
httpvalue = "http://";
if (leftvalue.CompareNoCase("http://") != 0)
{
httpvalue = httpvalue + HelpUrl;
SetGlobal("HelpMenuCommandUrl",httpvalue);
}
// Create the HelpMenu.xul in the beginning so that it can be called from the script.ib
CString setHlpXul = tempPath +"\\HelpMenu.xul";
SetGlobal("HlpXul",setHlpXul);
CreateHelpMenu();
if (cdDir.Compare("1") ==0)
{
_mkdir((char *)(LPCTSTR) cdPath);

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

@ -2,4 +2,6 @@ typedef struct s_xpi {
CString xpiname;
CString filename;
} XPI;
void CreateRshell(void);
void CreateRshell(void);
void CreateHelpMenu(void);
void CreateBuddyList(void);

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

@ -36,6 +36,8 @@ OBJS= \
.\$(OBJDIR)\wizshell.obj \
.\$(OBJDIR)\ib.obj \
.\$(OBJDIR)\comp.obj \
.\$(OBJDIR)\Helpmenu.obj \
.\$(OBJDIR)\buddylist.obj \
$(NULL)
# -I$(DEPTH)\xpinstall\wizard\windows\setup \

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

@ -3,6 +3,7 @@ configure(GENERAL,Setup Title1,%InstallerScreenText1%)
configure(GENERAL,Setup Title2,%InstallerScreenText2%)
configure(GENERAL,Program Folder Name,%ProgramFolderName%)
configure(Dialog Setup Type,Readme Filename,%ReadMeFile%)
replaceXPI(browser.xpi,bin/chrome/global/content/helpMenu.xul,%HlpXul%)
replaceXPI(browser.xpi,bin/chrome/global/skin/animthrob.gif,%LargeAnimPath%)
replaceXPI(browser.xpi,bin/chrome/global/skin/animthrob_single.gif,%LargeStillPath%)
replaceXPI(browser.xpi,bin/defaults/profile/bookmarks.html,%CustomBookmarkFile%)