1999-11-04 20:19:27 +00:00
|
|
|
#include "stdafx.h"
|
|
|
|
#include "globals.h"
|
|
|
|
#include "ib.h"
|
1999-11-05 00:36:17 +00:00
|
|
|
#include "comp.h"
|
1999-11-04 20:19:27 +00:00
|
|
|
|
|
|
|
#define MAX_SIZE 1024
|
|
|
|
|
1999-11-05 00:36:17 +00:00
|
|
|
extern CString rootPath;
|
|
|
|
extern CString configName;
|
|
|
|
extern CString configPath;
|
|
|
|
extern CString workspacePath;
|
|
|
|
extern CString cdPath;
|
|
|
|
extern CString tempPath;
|
|
|
|
extern CString iniPath;
|
|
|
|
extern CString scriptPath;
|
|
|
|
extern CString nscpxpiPath;
|
|
|
|
|
1999-11-05 19:18:33 +00:00
|
|
|
extern COMPONENT Components[100];
|
1999-11-05 00:36:17 +00:00
|
|
|
extern int numComponents;
|
|
|
|
|
1999-11-04 20:19:27 +00:00
|
|
|
extern "C" __declspec(dllexport)
|
1999-11-05 00:36:17 +00:00
|
|
|
int BuildComponentList(COMPONENT *comps, int *compNum)
|
1999-11-04 20:19:27 +00:00
|
|
|
{
|
1999-11-05 00:36:17 +00:00
|
|
|
*compNum = 0;
|
1999-11-04 20:19:27 +00:00
|
|
|
|
|
|
|
// Get all the component info from each component section
|
|
|
|
CString component;
|
|
|
|
char archive[MAX_SIZE];
|
|
|
|
char name[MAX_SIZE];
|
|
|
|
char desc[MAX_SIZE];
|
|
|
|
char attr[MAX_SIZE];
|
1999-11-05 00:36:17 +00:00
|
|
|
component.Format("Component%d", *compNum);
|
1999-11-04 20:19:27 +00:00
|
|
|
GetPrivateProfileString(component, "Archive", "", archive, MAX_SIZE, iniPath);
|
|
|
|
while (*archive)
|
|
|
|
{
|
1999-11-05 00:36:17 +00:00
|
|
|
GetPrivateProfileString(component, "Description Short", "",
|
|
|
|
name, MAX_SIZE, iniPath);
|
|
|
|
GetPrivateProfileString(component, "Description Long", "",
|
|
|
|
desc, MAX_SIZE, iniPath);
|
|
|
|
GetPrivateProfileString(component, "Attributes", "",
|
|
|
|
attr, MAX_SIZE, iniPath);
|
|
|
|
|
1999-11-05 19:18:33 +00:00
|
|
|
comps[*compNum].archive = CString(archive);
|
1999-11-05 00:36:17 +00:00
|
|
|
comps[*compNum].compname = component;
|
|
|
|
comps[*compNum].name = CString(name);
|
|
|
|
comps[*compNum].desc = CString(desc);
|
|
|
|
comps[*compNum].selected = (strstr(attr, "SELECTED") != NULL);
|
|
|
|
comps[*compNum].invisible = (strstr(attr, "INVISIBLE") != NULL);
|
|
|
|
comps[*compNum].launchapp = (strstr(attr, "LAUNCHAPP") != NULL);
|
|
|
|
|
|
|
|
(*compNum)++;
|
|
|
|
component.Format("Component%d", *compNum);
|
|
|
|
GetPrivateProfileString(component, "Archive", "", archive, MAX_SIZE, iniPath);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
1999-11-04 20:19:27 +00:00
|
|
|
|
1999-11-05 00:36:17 +00:00
|
|
|
extern "C" __declspec(dllexport)
|
|
|
|
int GenerateComponentList(CString parms, WIDGET *curWidget)
|
|
|
|
{
|
|
|
|
rootPath = GetGlobal("Root");
|
|
|
|
configName = GetGlobal("CustomizationList");
|
|
|
|
configPath = rootPath + "Configs\\" + configName;
|
|
|
|
workspacePath = configPath + "\\Workspace";
|
|
|
|
nscpxpiPath;
|
|
|
|
if (SearchPath(workspacePath, "NSCPXPI", NULL, 0, NULL, NULL))
|
|
|
|
nscpxpiPath = workspacePath + "\\NSCPXPI";
|
|
|
|
else
|
|
|
|
nscpxpiPath = rootPath + "NSCPXPI";
|
|
|
|
iniPath = nscpxpiPath + "\\config.ini";
|
|
|
|
|
1999-11-05 19:18:33 +00:00
|
|
|
BuildComponentList(Components, &numComponents);
|
1999-11-04 20:19:27 +00:00
|
|
|
|
1999-11-05 00:36:17 +00:00
|
|
|
int i;
|
|
|
|
CString WidgetValue("");
|
|
|
|
for (i=0; i<numComponents; i++)
|
|
|
|
{
|
1999-11-05 19:18:33 +00:00
|
|
|
curWidget->options.name[i] = new char[strlen(Components[i].compname)+1];
|
|
|
|
strcpy(curWidget->options.name[i], Components[i].compname);
|
1999-11-04 20:19:27 +00:00
|
|
|
|
1999-11-05 19:18:33 +00:00
|
|
|
curWidget->options.value[i] = new char[strlen(Components[i].name)+1];
|
|
|
|
strcpy(curWidget->options.value[i], Components[i].name);
|
1999-11-04 20:19:27 +00:00
|
|
|
|
1999-11-05 19:18:33 +00:00
|
|
|
curWidget->optDesc.name[i] = new char[strlen(Components[i].compname)+1];
|
|
|
|
strcpy(curWidget->optDesc.name[i], Components[i].compname);
|
1999-11-05 00:36:17 +00:00
|
|
|
|
1999-11-05 19:18:33 +00:00
|
|
|
curWidget->optDesc.value[i] = new char[strlen(Components[i].desc)+1];
|
|
|
|
strcpy(curWidget->optDesc.value[i], Components[i].desc);
|
1999-11-04 20:19:27 +00:00
|
|
|
|
|
|
|
// INVISIBLE just means not selected, let user decide whether to
|
|
|
|
// include them again. SELECTED components get checkmarks.
|
1999-11-05 19:18:33 +00:00
|
|
|
if (Components[i].selected)
|
1999-11-04 20:19:27 +00:00
|
|
|
{
|
|
|
|
WidgetValue += ",";
|
1999-11-05 19:18:33 +00:00
|
|
|
WidgetValue += Components[i].name;
|
1999-11-04 20:19:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-11-05 00:36:17 +00:00
|
|
|
curWidget->numOfOptions = numComponents;
|
|
|
|
curWidget->numOfOptDesc = numComponents;
|
1999-11-04 20:19:27 +00:00
|
|
|
|
|
|
|
if (curWidget->value.IsEmpty())
|
|
|
|
curWidget->value = WidgetValue;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|