void CDirView::OnInitialUpdate()
{
CListViewEx::OnInitialUpdate();
+ m_sortColumn = -1; // start up in no sorted order.
m_pList = &GetListCtrl();
GetDocument()->m_pView = this;
#include "coretools.h"
#include "Splash.h"
#include "VssPrompt.h"
+#include "CCPrompt.h"
#include "PropVss.h"
#include "PropGeneral.h"
#include "RegKey.h"
m_bScrollToFirst = theApp.GetProfileInt(_T("Settings"), _T("ScrollToFirst"), FALSE)!=0;
m_bIgnoreWhitespace = theApp.GetProfileInt(_T("Settings"), _T("IgnoreSpace"), TRUE)!=0;
m_bHideBak = theApp.GetProfileInt(_T("Settings"), _T("HideBak"), TRUE)!=0;
- m_bUseVss = theApp.GetProfileInt(_T("Settings"), _T("UseVss"), FALSE)!=0;
+ m_nVerSys = theApp.GetProfileInt(_T("Settings"), _T("VersionSystem"), 0);
m_strVssProject = theApp.GetProfileString(_T("Settings"), _T("VssProject"), _T(""));
m_strVssPath = theApp.GetProfileString(_T("Settings"), _T("VssPath"), _T(""));
m_nTabSize = theApp.GetProfileInt(_T("Settings"), _T("TabSize"), 4);
{
if (status.m_attribute & CFile::Attribute::readOnly)
{
- if (!m_bUseVss)
+ int userChoice = IDCANCEL;
+
+ switch(m_nVerSys)
{
- CString title;
- VERIFY(title.LoadString(IDS_SAVE_AS_TITLE));
+ case 0: //no versioning system
+ // prompt for user choice
AfxFormatString1(s, IDS_SAVEREADONLY_FMT, strSavePath);
- if (AfxMessageBox(s, MB_YESNO|MB_ICONQUESTION) == IDYES
- && SelectFile(s, strSavePath, title, NULL, FALSE))
+ if (AfxMessageBox(s, MB_YESNO|MB_ICONQUESTION) == IDYES)
{
- strSavePath = s;
- needCheck=TRUE;
+ userChoice = IDSAVEAS;
}
- else
- return FALSE;
- }
- else
+ break;
+ case 1: // Visual Source Safe
{
+ // prompt for user choice
CVssPrompt dlg;
- AfxFormatString1(dlg.m_strMessage, IDS_SAVEVSS_FMT, strSavePath);
+ dlg.m_strMessage.FormatMessage(IDS_SAVE_FMT, strSavePath);
dlg.m_strProject = m_strVssProject;
- switch(dlg.DoModal())
- {
- case IDOK:
+ userChoice = dlg.DoModal();
+ // process versioning system specific action
+ if(userChoice==IDOK)
{
- BeginWaitCursor();
+ CWaitCursor wait;
m_strVssProject = dlg.m_strProject;
theApp.WriteProfileString(_T("Settings"), _T("VssProject"), mf->m_strVssProject);
TCHAR args[1024];
DWORD code;
_stprintf(args,_T("checkout %s/%s"), m_strVssProject,name);
HANDLE hVss = RunIt(m_strVssPath, args, TRUE, FALSE);
- if (hVss)
+ if (hVss!=INVALID_HANDLE_VALUE)
+ {
+ WaitForSingleObject(hVss, INFINITE);
+ GetExitCodeProcess(hVss, &code);
+ CloseHandle(hVss);
+ if (code != 0)
+ {
+ AfxMessageBox(IDS_VSSERROR, MB_ICONSTOP);
+ return FALSE;
+ }
+ needCheck=FALSE;
+ }
+ else
{
- while (!HasExited(hVss, &code))
- Sleep(1000);
+ AfxMessageBox(IDS_VSS_RUN_ERROR, MB_ICONSTOP);
+ return FALSE;
+ }
+ }
+ }
+ break;
+ case 2: // ClearCase
+ {
+ // prompt for user choice
+ CCCPrompt dlg;
+ userChoice = dlg.DoModal();
+ // process versioning system specific action
+ if(userChoice == IDOK)
+ {
+ CWaitCursor wait;
+ TCHAR args[1024];
+ TCHAR path[MAX_PATH],name[MAX_PATH];
+ split_filename(strSavePath,path,name,NULL);
+ _chdrive(toupper(path[0])-'A'+1);
+ _chdir(path);
+ DWORD code;
+ _stprintf(args,_T("checkout -c \"%s\" %s"), dlg.m_comments, name);
+ HANDLE hVss = RunIt(m_strVssPath, args, TRUE, FALSE);
+ if (hVss!=INVALID_HANDLE_VALUE)
+ {
+ WaitForSingleObject(hVss, INFINITE);
+ GetExitCodeProcess(hVss, &code);
+ CloseHandle(hVss);
if (code != 0)
{
return FALSE;
}
needCheck=FALSE;
- //CloseHandle(hVss);
}
- EndWaitCursor();
+ else
+ {
+ AfxMessageBox(IDS_VSS_RUN_ERROR, MB_ICONSTOP);
+ return FALSE;
+ }
+ }
}
break;
+ } //switch(m_nVerSys)
+
+ // common processing for all version systems
+ switch(userChoice)
+ {
case IDCANCEL:
return FALSE;
case IDSAVEAS:
CString title;
VERIFY(title.LoadString(IDS_SAVE_AS_TITLE));
- if (SelectFile(s, strSavePath, title, NULL, FALSE))
+ if (SelectFile(s, NULL, title, NULL, FALSE))
{
strSavePath = s;
needCheck=TRUE;
}
}
}
- }
} while (needCheck);
return TRUE;
}
sht.AddPage(&gen);
sht.AddPage(&vss);
- vss.m_bDoVss = m_bUseVss;
+ vss.m_nVerSys = m_nVerSys;
vss.m_strPath = m_strVssPath;
gen.m_bBackup = m_bBackup;
if (sht.DoModal()==IDOK)
{
- m_bUseVss = vss.m_bDoVss;
+ m_nVerSys = vss.m_nVerSys;
m_strVssPath = vss.m_strPath;
m_bBackup = gen.m_bBackup;
ignore_some_changes = m_bIgnoreWhitespace || m_bIgnoreCase || m_bIgnoreBlankLines;
length_varies = m_bIgnoreWhitespace;
- theApp.WriteProfileInt(_T("Settings"), _T("UseVss"), m_bUseVss);
+ theApp.WriteProfileInt(_T("Settings"), _T("VersionSystem"), m_nVerSys);
theApp.WriteProfileInt(_T("Settings"), _T("IgnoreSpace"), m_bIgnoreWhitespace);
theApp.WriteProfileInt(_T("Settings"), _T("ScrollToFirst"), m_bScrollToFirst);
theApp.WriteProfileInt(_T("Settings"), _T("BackupFile"), m_bBackup);
_T("\tShowIdentical: %d\r\n")
_T("\tShowDiff: %d\r\n")
_T("\tHideBak: %d\r\n")
- _T("\tUseVss: %d\r\n")
+ _T("\tVerSys: %d\r\n")
_T("\tVssPath: %s\r\n")
_T("\tBackups: %d\r\n")
_T("\tIgnoreWS: %d\r\n")
m_bShowIdent,
m_bShowDiff,
m_bHideBak,
- m_bUseVss,
+ m_nVerSys,
m_strVssPath,
m_bBackup,
m_bIgnoreWhitespace,
BOOL CheckSavePath(CString& strSavePath);
CString m_strVssPath;
CString m_strVssProject;
- BOOL m_bUseVss;
+ int m_nVerSys;
BOOL m_bHideBak;
BOOL m_bIgnoreWhitespace;
BOOL m_bScrollToFirst;
# ADD LINK32 version.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"msvcrtd.lib" /out:"..\Build\MergeRelease/WinMerge.exe" /verbose:lib
# SUBTRACT LINK32 /pdb:none
# Begin Special Build Tool
-TargetPath=\Programs\Merge\Build\MergeRelease\WinMerge.exe
+TargetPath=\Merge\Build\MergeRelease\WinMerge.exe
SOURCE="$(InputPath)"
PostBuild_Cmds=StampVer -vstampver.inf -i4 -j4 -o2 $(TargetPath)
# End Special Build Tool
# End Source File
# Begin Source File
+SOURCE=.\CCPrompt.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\ChildFrm.cpp
!IF "$(CFG)" == "Merge - Win32 Release"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
+SOURCE=.\CCPrompt.h
+# End Source File
+# Begin Source File
+
SOURCE=.\ChildFrm.h
# End Source File
# Begin Source File
IDD_PROP_VSS DIALOG DISCARDABLE 0, 0, 259, 157
STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
-CAPTION "SourceSafe"
+CAPTION "Versioning System"
FONT 8, "MS Sans Serif"
BEGIN
GROUPBOX "Settings",IDC_STATIC,7,7,245,54
- CONTROL "Enable Visual &SourceSafe integration",IDC_DOVSS_CHECK,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,21,133,10
- LTEXT "&Path to SS.EXE:",IDC_VSS_L1,16,42,53,8
- EDITTEXT IDC_PATH_EDIT,72,40,131,12,ES_AUTOHSCROLL
+ LTEXT "&Path to cleartool.exe:",IDC_VSS_L1,16,42,68,8
+ EDITTEXT IDC_PATH_EDIT,85,40,116,12,ES_AUTOHSCROLL
PUSHBUTTON "&Browse...",IDC_BROWSE_BUTTON,206,40,42,12
+ COMBOBOX IDC_VER_SYS,85,20,157,41,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP
+ LTEXT "&Versioning System",IDC_STATIC,16,22,60,10
END
IDD_PROPPAGE_LARGE DIALOG DISCARDABLE 0, 0, 235, 156
LTEXT "Available languages:",IDC_STATIC,7,7,66,8
END
+IDD_CLEARCASE DIALOG DISCARDABLE 0, 0, 279, 111
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Rational Clearcase"
+FONT 8, "MS Sans Serif"
+BEGIN
+ DEFPUSHBUTTON "CheckOut",IDOK,35,90,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,194,90,50,14
+ PUSHBUTTON "Save As...",IDSAVEAS,114,90,50,14
+ EDITTEXT IDC_COMMENTS,18,21,243,56,ES_MULTILINE | ES_AUTOVSCROLL |
+ ES_AUTOHSCROLL | ES_WANTRETURN | WS_VSCROLL | WS_HSCROLL
+ LTEXT "Comments",IDC_STATIC,18,7,34,10
+END
+
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 252
+ VERTGUIDE, 85
TOPMARGIN, 7
BOTTOMMARGIN, 150
END
TOPMARGIN, 7
BOTTOMMARGIN, 149
END
+
+ IDD_CLEARCASE, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 272
+ VERTGUIDE, 18
+ VERTGUIDE, 35
+ VERTGUIDE, 244
+ VERTGUIDE, 261
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 104
+ END
END
#endif // APSTUDIO_INVOKED
IDB_BINARY BITMAP DISCARDABLE "res\\binary.bmp"
IDB_LFILE BITMAP DISCARDABLE "res\\lfile.bmp"
IDB_RFILE BITMAP DISCARDABLE "res\\rfile.bmp"
-IDB_BITMAP1 BITMAP DISCARDABLE "res\\bitmap1.bmp"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog Info
+//
+
+IDD_PROP_VSS DLGINIT
+BEGIN
+ IDC_VER_SYS, 0x403, 5, 0
+0x6f4e, 0x656e, "\000"
+ IDC_VER_SYS, 0x403, 18, 0
+0x6956, 0x7573, 0x6c61, 0x5320, 0x756f, 0x6372, 0x5365, 0x6661, 0x0065,
+
+ IDC_VER_SYS, 0x403, 19, 0
+0x6152, 0x6974, 0x6e6f, 0x6c61, 0x4320, 0x656c, 0x7261, 0x6143, 0x6573,
+"\000"
+ 0
+END
+
/////////////////////////////////////////////////////////////////////////////
//
IDS_SAVEREADONLY_FMT "%1 is marked read-only. Would you like to save the file under a different name?"
IDS_SAVE_FMT "Save changes to %1?"
IDS_FILEBINARY "Binary files cannot be visually compared."
- IDS_SAVEVSS_FMT "%1 is marked read-only. Would you like to check it out from SourceSafe, or save it under a different name?"
- IDS_VSSERROR "SourceSafe returned an error while attempting to check out the file. Unable to continue..."
+ IDS_SAVEVSS_FMT "%1 is marked read-only. Would you like to check it out from Versioning System, or save it under a different name?"
+ IDS_VSSERROR "Versioning System returned an error while attempting to check out the file. Unable to continue..."
IDS_NOPROJECT "You must specify a SourceSafe project path in order to continue (ie: $/MyProject)"
END
IDS_DIFF_NUMBER_STATUS_FMT "Difference %1 of %2"
IDS_NO_DIFF_SEL_FMT "%1 Differences Found"
IDS_FILEISDIR "Directory files cannot be visually compared."
+ IDS_CC_CMD "&Path to cleartool.exe :"
+ IDS_VSS_CMD "&Path to SS.EXE :"
+ IDS_VSS_RUN_ERROR "Error executing versioning system command."
END
#endif // English (U.S.) resources
{
//{{AFX_DATA_INIT(CPropVss)
m_strPath = _T("");
- m_bDoVss = FALSE;
+ m_nVerSys = -1;
//}}AFX_DATA_INIT
}
DDX_Control(pDX, IDC_PATH_EDIT, m_ctlPath);
DDX_Control(pDX, IDC_BROWSE_BUTTON, m_ctlBrowse);
DDX_Text(pDX, IDC_PATH_EDIT, m_strPath);
- DDX_Check(pDX, IDC_DOVSS_CHECK, m_bDoVss);
+ DDX_CBIndex(pDX, IDC_VER_SYS, m_nVerSys);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPropVss, CPropertyPage)
//{{AFX_MSG_MAP(CPropVss)
- ON_BN_CLICKED(IDC_DOVSS_CHECK, OnDovssCheck)
ON_BN_CLICKED(IDC_BROWSE_BUTTON, OnBrowseButton)
+ ON_CBN_SELENDOK(IDC_VER_SYS, OnSelendokVerSys)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
return FALSE;
}
-
-
-void CPropVss::OnDovssCheck()
-{
- UpdateData(TRUE);
- m_ctlPath.EnableWindow(m_bDoVss);
- m_ctlVssL1.EnableWindow(m_bDoVss);
- m_ctlBrowse.EnableWindow(m_bDoVss);
-}
-
void CPropVss::OnBrowseButton()
{
CString s;
CPropertyPage::OnInitDialog();
UpdateData(FALSE);
- OnDovssCheck();
+ OnSelendokVerSys();
return TRUE;
}
+
+void CPropVss::OnSelendokVerSys()
+{
+ UpdateData(TRUE);
+ CString tempStr((LPCSTR)(m_nVerSys==2?IDS_CC_CMD:IDS_VSS_CMD));
+ m_ctlVssL1.SetWindowText(tempStr);
+ m_ctlPath.EnableWindow(m_nVerSys>0);
+ m_ctlVssL1.EnableWindow(m_nVerSys>0);
+ m_ctlBrowse.EnableWindow(m_nVerSys>0);
+}
CEdit m_ctlPath;
CButton m_ctlBrowse;
CString m_strPath;
- BOOL m_bDoVss;
+ int m_nVerSys;
//}}AFX_DATA
protected:
// Generated message map functions
//{{AFX_MSG(CPropVss)
- afx_msg void OnDovssCheck();
afx_msg void OnBrowseButton();
virtual BOOL OnInitDialog();
+ afx_msg void OnSelendokVerSys();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
BEGIN_MESSAGE_MAP(CVssPrompt, CDialog)
//{{AFX_MSG_MAP(CVssPrompt)
+ ON_BN_CLICKED(IDSAVEAS, OnSaveas)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
CDialog::OnOK();
}
+
+void CVssPrompt::OnSaveas()
+{
+ EndDialog(IDSAVEAS);
+}
//{{AFX_MSG(CVssPrompt)
virtual BOOL OnInitDialog();
virtual void OnOK();
+ afx_msg void OnSaveas();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#define IDD_PROPPAGE_LARGE 133
#define IDS_CONFIRM_ALL_RIGHT 133
#define IDS_COPY2DIR_FMT 134
-#define IDB_BITMAP1 134
+#define IDD_CLEARCASE 134
#define IDS_CONFIRM_COPY2DIR 135
#define IDS_FONT_CHANGE 136
#define IDS_DIRECTORY_WINDOW_TITLE 137
#define IDS_NO_DIFF_SEL 165
#define IDS_NO_DIFF_SEL_FMT 165
#define IDS_FILEISDIR 166
+#define IDS_CC_CMD 167
+#define IDS_VSS_CMD 168
+#define IDS_VSS_RUN_ERROR 169
#define IDB_EQUAL 213
#define IDB_NOTEQUAL 214
#define IDB_RFOLDER 215
#define IDC_IGNCASE_CHECK 1014
#define IDC_EMAIL 1015
#define IDC_COMPANY 1016
+#define IDC_COMMENTS 1017
+#define IDC_VER_SYS 1018
#define IDD_LANGUAGE_SELECT 30000
#define IDS_AFRIKAANS 30003
#define IDS_ALBANIAN 30004
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 135
-#define _APS_NEXT_COMMAND_VALUE 32809
-#define _APS_NEXT_CONTROL_VALUE 1017
+#define _APS_NEXT_COMMAND_VALUE 32806
+#define _APS_NEXT_CONTROL_VALUE 1019
#define _APS_NEXT_SYMED_VALUE 106
#endif
#endif