diff --git a/cck/cckwiz/iniFiles/CheckList.ini b/cck/cckwiz/iniFiles/CheckList.ini index 3d1e88fe9a11..3fc1baa0f520 100644 --- a/cck/cckwiz/iniFiles/CheckList.ini +++ b/cck/cckwiz/iniFiles/CheckList.ini @@ -208,7 +208,7 @@ Start_y=218 Width=77 Height=17 onInit=Enable2(%CustomizationList%) -onCommand=VerifySet(%CustomizationList%,Choose an existing configuration or create a new one);SetGlobal(_FromConfigName,%CustomizationList%);NewConfigDialog(_NewConfigName);CopyDir(%Root%Configs\%_FromConfigName%,%Root%Configs\%_NewConfigName%);Reload(%Root%Configs\%_NewConfigName%) +onCommand=VerifySet(%CustomizationList%,Choose an existing configuration or create a new one);SetGlobal(_FromConfigName,%CustomizationList%);CopyConfig(_NewConfigName);CopyDir(%Root%Configs\%_FromConfigName%,%Root%Configs\%_NewConfigName%);Reload(%Root%Configs\%_NewConfigName%) ; GenerateFileList not required due to the way NewConfigDialog works, ; but this should be changed at some point... diff --git a/cck/driver/NewConfigDialog.cpp b/cck/driver/NewConfigDialog.cpp index 52b4e3391ba9..bb3a46b5b1cb 100644 --- a/cck/driver/NewConfigDialog.cpp +++ b/cck/driver/NewConfigDialog.cpp @@ -23,6 +23,7 @@ #include "stdafx.h" #include "WizardMachine.h" #include "NewConfigDialog.h" +#include "globals.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -76,6 +77,24 @@ END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CNewConfigDialog message handlers +BOOL CNewConfigDialog::OnInitDialog() +{ + CDialog::OnInitDialog(); + // TODO: Add extra initialization here + + CString DlgTitle = GetGlobal("DialogTitle"); + if (!DlgTitle.IsEmpty()) + { + SetWindowText(DlgTitle); + GetDlgItem(IDC_STATIC1)->SetWindowText(""); + GetDlgItem(IDC_STATIC2)->SetWindowText(""); + GetDlgItem(IDOK)->SetWindowText(DlgTitle); + } + + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE +} + void CNewConfigDialog::OnOK() { // TODO: Add extra validation here diff --git a/cck/driver/NewConfigDialog.h b/cck/driver/NewConfigDialog.h index 9f1b4f32104f..8785ad633ef4 100644 --- a/cck/driver/NewConfigDialog.h +++ b/cck/driver/NewConfigDialog.h @@ -51,6 +51,7 @@ protected: // Generated message map functions //{{AFX_MSG(CNewConfigDialog) + virtual BOOL OnInitDialog(); virtual void OnOK(); //}}AFX_MSG DECLARE_MESSAGE_MAP() diff --git a/cck/driver/WizardMachine.rc b/cck/driver/WizardMachine.rc index 36206da7b5bc..4b0c0ff2a77e 100644 --- a/cck/driver/WizardMachine.rc +++ b/cck/driver/WizardMachine.rc @@ -140,9 +140,9 @@ BEGIN PUSHBUTTON "Cancel",IDCANCEL,209,98,50,14 LTEXT "Name of new configuration:",IDC_STATIC,7,7,173,13 LTEXT "The CCK tool creates a new configuration directory in C:\\CCK\\Configs. Within your new configuration directory, the CCK tool creates a \\Workspace directory, for example, C:\\CCK\\Configs\\CustomBuild01\\Workspace.", - IDC_STATIC,7,39,253,26 + IDC_STATIC1,7,39,253,26 LTEXT "You can use the Workspace directory as a convenient place in which to store your custom files.", - IDC_STATIC,7,69,248,17 + IDC_STATIC2,7,69,248,17 END IDD_DIALOG112 DIALOG DISCARDABLE 0, 0, 187, 95 diff --git a/cck/driver/interpret.cpp b/cck/driver/interpret.cpp index 1ae65260350c..1f20e7386eb2 100644 --- a/cck/driver/interpret.cpp +++ b/cck/driver/interpret.cpp @@ -66,13 +66,15 @@ BOOL CInterpret::InitInstance() //---------------------------------------------------------- -BOOL CInterpret::NewConfig(WIDGET *curWidget, CString globalsName) +BOOL CInterpret::NewConfig(WIDGET *curWidget, CString globalsName, CString DialogTitle) { // This doesn't really belong here... WIN32_FIND_DATA data; HANDLE d; CNewConfigDialog newDlg; + if (!DialogTitle.IsEmpty()) + SetGlobal("DialogTitle", "CreateCopy"); newDlg.DoModal(); CString configField = newDlg.GetConfigName(); CString newDir = CString(customizationPath); @@ -685,7 +687,13 @@ BOOL CInterpret::interpret(CString cmds, WIDGET *curWidget) else if (strcmp(pcmd, "NewConfigDialog") == 0) { if (curWidget) - NewConfig(curWidget, CString(parms)); + NewConfig(curWidget, CString(parms),""); + } + + else if (strcmp(pcmd, "CopyConfig") == 0) + { + if (curWidget) + NewConfig(curWidget, CString(parms),"Create Copy"); } else if (strcmp(pcmd, "CopyDir") == 0) diff --git a/cck/driver/interpret.h b/cck/driver/interpret.h index 96a0d0b31ab7..0a5efbcfba78 100644 --- a/cck/driver/interpret.h +++ b/cck/driver/interpret.h @@ -33,7 +33,7 @@ class CInterpret public: CInterpret(); ~CInterpret(); - BOOL NewConfig(WIDGET *curWidget, CString globalsName); + BOOL NewConfig(WIDGET *curWidget, CString globalsName, CString DialogTitle); BOOL BrowseFile(WIDGET *curWidget); BOOL BrowseDir(WIDGET *curWidget); BOOL Progress(); // Not actually used right now diff --git a/cck/driver/resource.h b/cck/driver/resource.h index fd21f5dcd5d8..4685e606fc8a 100644 --- a/cck/driver/resource.h +++ b/cck/driver/resource.h @@ -25,6 +25,8 @@ #define IDC_HELP_BUTTON 1005 #define IDC_BUTTON1 1007 #define ID_HELP_EDIT 1007 +#define IDC_STATIC1 1008 +#define IDC_STATIC2 1009 #define IDC_PROGRESS1 1036 #define IDC_PROGESSTEXT_STATIC 1037 #define IDD_HELP_DLG 1537 @@ -37,7 +39,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 142 #define _APS_NEXT_COMMAND_VALUE 32771 -#define _APS_NEXT_CONTROL_VALUE 1008 +#define _APS_NEXT_CONTROL_VALUE 1010 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif