introduced attrib in the widget struct - the prefs will be attrib=pref and will be collected and stored in prefs.js in the workspace/isetup directory

This commit is contained in:
varada%netscape.com 2000-01-13 22:12:41 +00:00
Родитель 67a5a41778
Коммит 393fb3a3fa
6 изменённых файлов: 43 добавлений и 5 удалений

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

@ -29,7 +29,7 @@ Caption=1st level node
[Navigation Controls]
onNext=
onNext=Msg(I am gonna create a JSFilenow);wizard.CreateJSFile();Msg(I have created it);
Help=Branding4_help.ini
[Image 1]

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

@ -69,6 +69,7 @@ Height=17
[Widget 3]
Type=EditBox
Attrib=Pref
Name=HomePageURL
Value=
Start_x=11

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

@ -145,6 +145,7 @@ Height=10
[Widget 5]
Type=EditBox
Attrib=Pref
Name=OrganizationName
Value=
Start_x=210

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

@ -1273,6 +1273,9 @@ void CWizardMachineApp::BuildWidget(WIDGET* aWidget, CString iniSection, CString
GetPrivateProfileString(iniSection, "Type", "", buffer, MAX_SIZE, iniFile);
aWidget->type = buffer;
GetPrivateProfileString(iniSection, "Attrib", "", buffer, MAX_SIZE, iniFile);
aWidget->attrib = buffer;
GetPrivateProfileString(iniSection, "Options", "", buffer, MAX_SIZE, iniFile);
aWidget->items = buffer;

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

@ -47,6 +47,7 @@ typedef struct WIDGET
{
CString type;
CString name;
CString attrib;
CString value;
CString title;
CString group;

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

@ -4,8 +4,17 @@
#include "globals.h"
#include "NewConfigDialog.h"
#include "NewDialog.h"
//#include <stdio.h>
//#include <string.h>
//#include <stdlib.h>
#include <iostream.h>
#include <fstream.h>
//#include <windows.h>
//#include <ctype.h>
CString DlgTitle = "";
CString rootpath = GetGlobal("Root");
CString Clist = GetGlobal("CustomizationList");
extern "C" __declspec(dllexport)
void NewNCIDialog(CString parms, WIDGET* curWidget)
@ -34,11 +43,7 @@ BOOL Config(CString globalsName, CString DialogTitle, WIDGET* curWidget)
DlgTitle = "";
newDlg.DoModal();
CString configField = newDlg.GetConfigName();
CString rootpath = GetGlobal("Root");
CString newDir = rootpath + "Configs\\" ;
CString Clist = GetGlobal("CustomizationList");
newDir += configField;
CString Template = rootpath + "WSTemplate" ;
CString FooCopy = rootpath + "Configs\\";
@ -90,3 +95,30 @@ BOOL CopyConfig(CString configname, WIDGET* curWidget)
else
return TRUE;
}
extern "C" __declspec(dllexport)
BOOL CreateJSFile(void)
{
CString JSFile = rootpath + "Configs\\" + Clist +"\\Workspace\\Isetup\\prefs.js";
ofstream myout(JSFile);
if(!myout)
{
cout << "cannot open the file \n";
}
char* attribArray[MAX_SIZE];
int k =GetAttrib("Pref", attribArray);
// CString prefValue;
int g= 0;
while(g<k)
{
// AfxMessageBox(bg,MB_OK);
myout<< "defaultPref(\"" << attribArray[g] << "\", " <<GetGlobal(attribArray[g])<<");\n";
g++;
}
// myout<< "defaultPref(\"" << prefname << "\", " <<GetGlobal(prefname) <<");\n";
// cout << prefname << " is not found \n";
myout.close();
return TRUE;
}