Skip to content

Commit

Permalink
Backing out bug 147978 - the copy of an existing config should use it…
Browse files Browse the repository at this point in the history
…s own Workspace

since it causes regression
bug 157807 - Creating a new configuration in CCK duplicates fields ...
approval for backout from ariana and shrutiv
  • Loading branch information
shannond%netscape.com committed Jul 18, 2002
1 parent 87a0f0e commit 25754ec
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 73 deletions.
9 changes: 2 additions & 7 deletions cck/driver/WizardMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1233,19 +1233,14 @@ BOOL CWizardMachineApp::FillGlobalWidgetArray()

void CWizardMachineApp::CreateNewCache()
{
CreateNewCache(CachePath);
}

void CWizardMachineApp::CreateNewCache(CString CPath)
{
globs = fopen(CPath, "w");
globs = fopen(CachePath, "w");
if (!globs)
{
fprintf(out, "--------------** TERMINATED - Can't open cache file **----------------\n");
exit( 3 );
}
CString RootCache = Root + CacheFile;
int CompareValue = RootCache.CompareNoCase(CPath);
int CompareValue = RootCache.CompareNoCase(CachePath);

for(int i=0; i< GlobalArrayIndex; i++)
{
Expand Down
1 change: 0 additions & 1 deletion cck/driver/WizardMachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ class CWizardMachineApp : public CWinApp
BOOL FillGlobalWidgetArray(CString file);
BOOL FillGlobalWidgetArray();
void CreateNewCache();
void CreateNewCache(CString CPath);
BOOL IsLastNode(NODE* treeNode);
BOOL IsFirstNode(NODE* treeNode);
CString GetGlobalOptions(CString theName);
Expand Down
16 changes: 1 addition & 15 deletions cck/driver/interpret.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ BOOL CInterpret::interpret(CString cmds, WIDGET *curWidget)
"Information", MB_OK);
exit(-30);
}

// Write out the current cache
if (!IsSameCache)
theApp.CreateNewCache();
Expand All @@ -974,20 +974,6 @@ BOOL CInterpret::interpret(CString cmds, WIDGET *curWidget)
theApp.FillGlobalWidgetArray(CachePath); // Ignore failure, we'll write one out later
IsSameCache = FALSE;
}
else if (strcmp(pcmd, "FillArray") == 0)
{
//Just FillGlobalWidgetArray from specified cache
CString arrayDir = replaceVars(parms, NULL);
CString ArrayPath = arrayDir + "\\" + CacheFile;
theApp.FillGlobalWidgetArray(ArrayPath);
IsSameCache = FALSE;
}
else if (strcmp(pcmd, "CreateCache") == 0)
{
CString cdir = replaceVars(parms, NULL);
CString cpath = cdir + "\\" + CacheFile;
theApp.CreateNewCache(cpath);
}
else if (strcmp(pcmd, "WriteCache") ==0)
{
WIDGET *w = findWidget(parms);
Expand Down
57 changes: 7 additions & 50 deletions cck/wizard/wizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,55 +73,12 @@ BOOL Config(CString globalsName, CString DialogTitle, WIDGET* curWidget)
SetGlobal(globalsName, configField);
SetGlobal(targetWid, configField);

if(DialogTitle == "Create a Copy")
{
CString CurAnimPath = GetGlobal("LargeAnimPath");
CString CurStillPath = GetGlobal("LargeStillPath");
CString CurReadMePath = GetGlobal("ReadMeFile");
CString CurBitmapPath = GetGlobal("ShellBgBitmap");
CString CurInstallFilePath = GetGlobal("ShellInstallTextFile");

CString OrigConfigName = GetGlobal("_FromConfigName");
CString OrigConfigDir = rootpath + "Configs\\" + OrigConfigName;

if(CurAnimPath.Find(OrigConfigDir) != -1)
{
//the file is located in the orig config dir that will be copied
CurAnimPath.Replace(OrigConfigDir, newDir);
//replace the old config's path with the new one
SetGlobal("LargeAnimPath", CurAnimPath);
}
if(CurStillPath.Find(OrigConfigDir) != -1)
{
CurStillPath.Replace(OrigConfigDir, newDir);
SetGlobal("LargeStillPath", CurStillPath);
}
if(CurReadMePath.Find(OrigConfigDir) != -1)
{
CurReadMePath.Replace(OrigConfigDir, newDir);
SetGlobal("ReadMeFile", CurReadMePath);
}
if(CurBitmapPath.Find(OrigConfigDir) != -1)
{
CurBitmapPath.Replace(OrigConfigDir, newDir);
SetGlobal("ShellBgBitmap", CurBitmapPath);
}
if(CurInstallFilePath.Find(OrigConfigDir) != -1)
{
CurInstallFilePath.Replace(OrigConfigDir, newDir);
SetGlobal("ShellInstallTextFile", CurInstallFilePath);
}

}
else
{
// Making custom config point to files in its own workspace
SetGlobal("LargeAnimPath", newDir + "\\Workspace\\AnimLogo\\animlogo32.gif");
SetGlobal("LargeStillPath", newDir + "\\Workspace\\AnimLogo\\staticlogo32.gif");
SetGlobal("ReadMeFile", newDir + "\\Workspace\\readme.txt");
SetGlobal("ShellBgBitmap", newDir + "\\Workspace\\Autorun\\Shell\\bmps\\install.bmp");
SetGlobal("ShellInstallTextFile", newDir + "\\Workspace\\Autorun\\install.txt");
}
// Making custom config point to files in its own workspace
SetGlobal("LargeAnimPath", newDir + "\\Workspace\\AnimLogo\\animlogo32.gif");
SetGlobal("LargeStillPath", newDir + "\\Workspace\\AnimLogo\\staticlogo32.gif");
SetGlobal("ReadMeFile", newDir + "\\Workspace\\readme.txt");
SetGlobal("ShellBgBitmap", newDir + "\\Workspace\\Autorun\\Shell\\bmps\\install.bmp");
SetGlobal("ShellInstallTextFile", newDir + "\\Workspace\\Autorun\\install.txt");

IsSameCache = FALSE;

Expand Down Expand Up @@ -170,4 +127,4 @@ BOOL CreateJSFile(void)
myout<<"}";
myout.close();
return TRUE;
}
}

0 comments on commit 25754ec

Please sign in to comment.