From 25754ec010a1eb220d25a121210739113f5865c3 Mon Sep 17 00:00:00 2001 From: "shannond%netscape.com" Date: Thu, 18 Jul 2002 20:10:59 +0000 Subject: [PATCH] Backing out bug 147978 - the copy of an existing config should use its own Workspace since it causes regression bug 157807 - Creating a new configuration in CCK duplicates fields ... approval for backout from ariana and shrutiv --- cck/driver/WizardMachine.cpp | 9 ++---- cck/driver/WizardMachine.h | 1 - cck/driver/interpret.cpp | 16 +--------- cck/wizard/wizard.cpp | 57 +++++------------------------------- 4 files changed, 10 insertions(+), 73 deletions(-) diff --git a/cck/driver/WizardMachine.cpp b/cck/driver/WizardMachine.cpp index 96baf95a6dd40..eb084ceb76010 100644 --- a/cck/driver/WizardMachine.cpp +++ b/cck/driver/WizardMachine.cpp @@ -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++) { diff --git a/cck/driver/WizardMachine.h b/cck/driver/WizardMachine.h index 30563eb55460f..f9a2e508ed620 100644 --- a/cck/driver/WizardMachine.h +++ b/cck/driver/WizardMachine.h @@ -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); diff --git a/cck/driver/interpret.cpp b/cck/driver/interpret.cpp index fce2d3cdb9cfd..457c478bc1dc3 100644 --- a/cck/driver/interpret.cpp +++ b/cck/driver/interpret.cpp @@ -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(); @@ -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); diff --git a/cck/wizard/wizard.cpp b/cck/wizard/wizard.cpp index a67e156d88dae..3b4948007129a 100644 --- a/cck/wizard/wizard.cpp +++ b/cck/wizard/wizard.cpp @@ -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; @@ -170,4 +127,4 @@ BOOL CreateJSFile(void) myout<<"}"; myout.close(); return TRUE; -} +} \ No newline at end of file