fix for bug #7850 - have to call function depend on the Next button on the ini file

git-svn-id: svn://10.0.0.236/trunk@51668 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
varada%netscape.com
1999-10-24 02:04:37 +00:00
parent 2aa8ec93a3
commit 66774f2d49
2 changed files with 47 additions and 1 deletions

View File

@@ -22,7 +22,7 @@ Title=Netscape Client Customization Kit - Page 2 of 10 %CustomizationList%
Caption=2nd level node
[Navigation Controls]
onNext=
onNext=Depend(%Network%,1,%FTPLocation%,NULL,If you have selected to use the Network - You MUST enter a ftp location)
Help=InfoHelp.ini
[Image 1]

View File

@@ -549,6 +549,52 @@ BOOL CInterpret::interpret(CString cmds, WIDGET *curWidget)
if (strcmp(Getval,p2) ==0)
return FALSE;
}
else if (strcmp(pcmd, "Depend") == 0)
{
int numParam = 0;
char *dParamList[5];
char *dParam = strtok(parms, ",");
while (dParam)
{
dParamList[numParam] = strdup(dParam);
dParam = strtok(NULL, ",");
numParam++;
}
CString var1 = replaceVars(dParamList[0],NULL);
CString value1 = replaceVars(dParamList[1],NULL);
CString var2 = replaceVars(dParamList[2],NULL);
CString value2;
if (strcmp(dParamList[3],"NULL") !=0)
value2 = replaceVars(dParamList[3],NULL);
else
value2.Empty();
CString message = replaceVars(dParamList[4],NULL);
if (!message)
{
AfxMessageBox("Error - provide a message to show when depend is false", MB_OK);
return FALSE;
}
if (var1.Compare(value1) == 0)
{
if (value2.IsEmpty())
{
if (var2.IsEmpty())
{
AfxMessageBox(message, MB_OK);
return FALSE;
}
}
else
{
if (var2.Compare(value2) != 0)
{
AfxMessageBox(message, MB_OK);
}
}
}
}
else if (strcmp(pcmd, "VerifyDir") == 0)
{
CFileFind tmpDir;