From f8cf3d1a418e169f034e15e44219548d24fa87c5 Mon Sep 17 00:00:00 2001 From: "shrutiv%netscape.com" Date: Tue, 30 Apr 2002 22:32:22 +0000 Subject: [PATCH] Fix for bug 106748: When adding custom component, the description and size may be left blank (r=smeredith) git-svn-id: svn://10.0.0.236/trunk@120344 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/cck/cckwiz/iniFiles/Default.che | 4 +- mozilla/cck/cckwiz/iniFiles/MyIsp.che | 4 +- mozilla/cck/cckwiz/iniFiles/build_page1.ini | 106 ++++++++++++-------- mozilla/cck/driver/cck.che | 4 +- mozilla/cck/driver/interpret.cpp | 38 +++++++ 5 files changed, 106 insertions(+), 50 deletions(-) diff --git a/mozilla/cck/cckwiz/iniFiles/Default.che b/mozilla/cck/cckwiz/iniFiles/Default.che index 95b3ae0742f..c19ba805e43 100644 --- a/mozilla/cck/cckwiz/iniFiles/Default.che +++ b/mozilla/cck/cckwiz/iniFiles/Default.che @@ -24,6 +24,6 @@ ShellTitleText= ShellBelowTitleText= ShellInstallTextFile=%Root%Configs\Default\Workspace\Autorun\install.txt Company_Name= -CustomComponentPath1=Please select an executable to install. -CustomComponentPath2=Please select an executable to install. +CustomComponentPath1= +CustomComponentPath2= NCIFileEditor=notepad diff --git a/mozilla/cck/cckwiz/iniFiles/MyIsp.che b/mozilla/cck/cckwiz/iniFiles/MyIsp.che index fb0a4832703..a06b12f02e2 100644 --- a/mozilla/cck/cckwiz/iniFiles/MyIsp.che +++ b/mozilla/cck/cckwiz/iniFiles/MyIsp.che @@ -24,8 +24,8 @@ ShellTitleText=MyIsp ShellBelowTitleText=MyIsp ShellInstallTextFile=%Root%Configs\MyIsp\Workspace\Autorun\install.txt Company_Name= -CustomComponentPath1=Please select an executable to install. -CustomComponentPath2=Please select an executable to install. +CustomComponentPath1= +CustomComponentPath2= CustomComponentSize1= CustomComponentSize2= CustomComponentDesc1= diff --git a/mozilla/cck/cckwiz/iniFiles/build_page1.ini b/mozilla/cck/cckwiz/iniFiles/build_page1.ini index f4cdbb787e4..38dc0861552 100644 --- a/mozilla/cck/cckwiz/iniFiles/build_page1.ini +++ b/mozilla/cck/cckwiz/iniFiles/build_page1.ini @@ -50,7 +50,7 @@ Help=Online;%Root%CCKHelp\buildpage1.html [Navigation Controls] -onNext=Message(Are you ready to build your customized installer?);RunIB();Msg(Installer creation is complete. The build is in %Root%Configs\%CustomizationList%\Output) +onNext=IsFieldEmpty(%CustomComponentPath1%,%CustomComponentDesc1%,%CustomComponentSize1%,Enter the description and size for the additional component);IsFieldEmpty(%CustomComponentPath2%,%CustomComponentDesc2%,%CustomComponentSize2%,Enter the description and size for the additional component);Message(Are you ready to build your customized installer?);RunIB();Msg(Installer creation is complete. The build is in %Root%Configs\%CustomizationList%\Output) onEnter=VerifyVal(%lPlatform%,Mac OS) Help=InstallerHelp.ini @@ -133,12 +133,30 @@ Start_y=52 Width=250 Height=29 +[Widget 19] +Type=BoldText +Name=Text19 +Value=Additional Component 1: +Start_x=150 +Start_y=80 +Width=250 +Height=29 + +[Widget 10] +Type=Text +Name=Text15 +Value=File Path: +Start_x=150 +Start_y=91 +Width=220 +Height=15 + [Widget 5] Type=EditBox Name=CustomComponentPath1 Value= Start_x=150 -Start_y=97 +Start_y=100 Width=190 Height=13 @@ -147,57 +165,66 @@ Type=Button Name=Button3 Value=Choose File... Start_x=350 -Start_y=97 +Start_y=100 Width=50 -Height=14 +Height=13 onCommand=BrowseFile() target=CustomComponentPath1 +[Widget 653] +Type=Text +Name=Text1487 +Value=Title: +Start_x=151 +Start_y=117 +Width=100 +Height=10 + [Widget 8] Type=EditBox Name=CustomComponentDesc1 Value= Start_x=150 Start_y=125 -Width=162 -Height=15 +Width=190 +Height=13 [Widget 9] Type=Text Name=Text14 Value=Size (in KB): -Start_x=330 -Start_y=114 +Start_x=350 +Start_y=117 Width=50 Height=9 -[Widget 653] -Type=Text -Name=Text1487 -Value=Component Description: -Start_x=151 -Start_y=113 -Width=100 -Height=10 - [Widget 868] Type=EditBox Name=CustomComponentSize1 Value= -Start_x=330 +Start_x=350 Start_y=125 Width=45 -Height=14 +Height=13 onCommand=IsNumeric(You must enter only numeric values) -[Widget 10] -Type=Text -Name=Text15 -Value=Component Path: +[Widget 20] +Type=BoldText +Name=Text20 +Value=Additional Component 2: Start_x=150 -Start_y=88 +Start_y=147 +Width=250 +Height=29 + +[Widget 869] +Type=Text +Name=Text1538 +Value=File Path: +Start_x=151 +Start_y=157 Width=220 -Height=15 +Height=11 [Widget 7] Type=EditBox @@ -215,7 +242,7 @@ Value=Choose File... Start_x=350 Start_y=168 Width=50 -Height=14 +Height=13 onCommand=BrowseFile() target=CustomComponentPath2 @@ -225,15 +252,15 @@ Name=CustomComponentDesc2 Value= Start_x=150 Start_y=198 -Width=162 -Height=15 +Width=190 +Height=13 [Widget767] Type=Text Name=Text1411 -Value=Component Description: +Value=Title: Start_x=150 -Start_y=186 +Start_y=187 Width=117 Height=15 @@ -241,8 +268,8 @@ Height=15 Type=Text Name=Text1489 Value=Size (in KB): -Start_x=330 -Start_y=186 +Start_x=350 +Start_y=187 Width=51 Height=10 @@ -250,21 +277,12 @@ Height=10 Type=EditBox Name=CustomComponentSize2 Value= -Start_x=330 +Start_x=350 Start_y=198 Width=45 -Height=14 +Height=13 onCommand=IsNumeric(You must enter only numeric values) -[Widget 869] -Type=Text -Name=Text1538 -Value=Component Path: -Start_x=151 -Start_y=157 -Width=220 -Height=11 - [Widget 16] Type=BoldGroup Name=GroupBox3 @@ -295,7 +313,7 @@ Height=20 [Widget 18] Type=BoldGroup Name=GroupBox4 -Value=Provide Additional Components +Value=Include Additional Components Start_x=145 Start_y=40 Width=262 diff --git a/mozilla/cck/driver/cck.che b/mozilla/cck/driver/cck.che index f6f1b1540d5..010fc3aa815 100644 --- a/mozilla/cck/driver/cck.che +++ b/mozilla/cck/driver/cck.che @@ -26,8 +26,8 @@ ShellBelowTitleText= ShellInstallTextFile=%Root%Configs\Default\Workspace\Autorun\install.txt Company_Name= TechSupportNumber= -CustomComponentPath1=Please select an executable to install. -CustomComponentPath2=Please select an executable to install. +CustomComponentPath1= +CustomComponentPath2= NCIFileEditor=notepad PortNumber=110 nPortNumber=119 diff --git a/mozilla/cck/driver/interpret.cpp b/mozilla/cck/driver/interpret.cpp index e14fd5c2628..03e5e9b7238 100644 --- a/mozilla/cck/driver/interpret.cpp +++ b/mozilla/cck/driver/interpret.cpp @@ -788,6 +788,44 @@ BOOL CInterpret::interpret(CString cmds, WIDGET *curWidget) } } } + else if (strcmp(pcmd, "IsFieldEmpty") == 0) + { + /* + Check if input field/fields is empty and display error message + + If the first parameter is empty, then other listed parameters + need not contain values. If the first parameter has a value + then all other parameters listed should also contain values, + otherwise an error alert is displayed. + Format of command is: + (,,,...) + where last parameter is the error message + */ + int paramcnt=0; + char *paramList[5]; + CString valueList[5]; + paramList[paramcnt] = strtok(parms, ","); + valueList[paramcnt] = replaceVars(paramList[paramcnt],NULL); + while ((paramList[paramcnt] != NULL) && (paramcnt<4)) + { + paramcnt++; + paramList[paramcnt] = strtok(NULL, ","); + if (paramList[paramcnt]) + valueList[paramcnt] = replaceVars(paramList[paramcnt],NULL); + } + paramcnt--; + if (!valueList[0].IsEmpty()) + { + for (int count=1; count<=paramcnt; count++) + { + if (valueList[count] == "") + { + AfxMessageBox(valueList[paramcnt], MB_OK); + return FALSE; + } + } + } + } else if (strcmp(pcmd, "VerifySet") == 0) { // VerifySet checks to see if the first parameter has any value