|
|
@ -208,13 +208,13 @@ int CDirDialog::DoBrowse()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BROWSEINFO bInfo;
|
|
|
|
BROWSEINFO bInfo;
|
|
|
|
|
|
|
|
LPITEMIDLIST pidl;
|
|
|
|
ZeroMemory((PVOID)&bInfo, sizeof(BROWSEINFO));
|
|
|
|
ZeroMemory((PVOID)&bInfo, sizeof(BROWSEINFO));
|
|
|
|
|
|
|
|
|
|
|
|
if (!m_strInitDir.IsEmpty())
|
|
|
|
if (!m_strInitDir.IsEmpty())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
OLECHAR olePath[MAX_PATH];
|
|
|
|
OLECHAR olePath[MAX_PATH];
|
|
|
|
ULONG chEaten;
|
|
|
|
ULONG dwAttributes = 0;
|
|
|
|
ULONG dwAttributes;
|
|
|
|
|
|
|
|
HRESULT hr;
|
|
|
|
HRESULT hr;
|
|
|
|
LPSHELLFOLDER pDesktopFolder;
|
|
|
|
LPSHELLFOLDER pDesktopFolder;
|
|
|
|
// // Get a pointer to the Desktop's IShellFolder interface. //
|
|
|
|
// // Get a pointer to the Desktop's IShellFolder interface. //
|
|
|
@ -236,7 +236,7 @@ int CDirDialog::DoBrowse()
|
|
|
|
hr = pDesktopFolder->ParseDisplayName(NULL,
|
|
|
|
hr = pDesktopFolder->ParseDisplayName(NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
olePath,
|
|
|
|
olePath,
|
|
|
|
&chEaten,
|
|
|
|
NULL,
|
|
|
|
&pidl,
|
|
|
|
&pidl,
|
|
|
|
&dwAttributes);
|
|
|
|
&dwAttributes);
|
|
|
|
|
|
|
|
|
|
|
@ -248,7 +248,6 @@ int CDirDialog::DoBrowse()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bInfo.pidlRoot = pidl;
|
|
|
|
bInfo.pidlRoot = pidl;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -257,8 +256,10 @@ int CDirDialog::DoBrowse()
|
|
|
|
bInfo.lpszTitle = (m_strTitle.IsEmpty()) ? "Open" : m_strTitle;
|
|
|
|
bInfo.lpszTitle = (m_strTitle.IsEmpty()) ? "Open" : m_strTitle;
|
|
|
|
bInfo.ulFlags = BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
|
|
|
|
bInfo.ulFlags = BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;
|
|
|
|
|
|
|
|
|
|
|
|
PIDLIST_ABSOLUTE pidl = ::SHBrowseForFolder(&bInfo);
|
|
|
|
if ((pidl = ::SHBrowseForFolder(&bInfo)) == NULL)
|
|
|
|
if (!pidl) return 0;
|
|
|
|
{
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
m_strPath.ReleaseBuffer();
|
|
|
|
m_strPath.ReleaseBuffer();
|
|
|
|
m_iImageIndex = bInfo.iImage;
|
|
|
|
m_iImageIndex = bInfo.iImage;
|
|
|
@ -288,19 +289,26 @@ BOOL SendTextToClipboard(CString source)
|
|
|
|
if (OpenClipboard(NULL))
|
|
|
|
if (OpenClipboard(NULL))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
HGLOBAL clipbuffer;
|
|
|
|
HGLOBAL clipbuffer;
|
|
|
|
char* buffer;
|
|
|
|
TCHAR* buffer;
|
|
|
|
|
|
|
|
|
|
|
|
EmptyClipboard(); // Empty whatever's already there
|
|
|
|
EmptyClipboard(); // Empty whatever's already there
|
|
|
|
|
|
|
|
|
|
|
|
clipbuffer = GlobalAlloc(GMEM_DDESHARE, source.GetLength() + 1);
|
|
|
|
clipbuffer = GlobalAlloc(GMEM_DDESHARE, ((SIZE_T)source.GetLength() + 1) * sizeof(TCHAR));
|
|
|
|
buffer = (char*)GlobalLock(clipbuffer);
|
|
|
|
if (clipbuffer)
|
|
|
|
strcpy(buffer, LPCSTR(source));
|
|
|
|
{
|
|
|
|
GlobalUnlock(clipbuffer);
|
|
|
|
buffer = (TCHAR*)GlobalLock(clipbuffer);
|
|
|
|
|
|
|
|
if (buffer)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_tcscpy(buffer, LPCTSTR(source));
|
|
|
|
|
|
|
|
GlobalUnlock(clipbuffer);
|
|
|
|
|
|
|
|
|
|
|
|
SetClipboardData(CF_TEXT, clipbuffer); // Send the data
|
|
|
|
SetClipboardData(CF_TEXT, clipbuffer); // Send the data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CloseClipboard(); // VERY IMPORTANT
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
CloseClipboard(); // VERY IMPORTANT
|
|
|
|
CloseClipboard(); // VERY IMPORTANT
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -326,11 +334,11 @@ void CBranch_patcherDlg::OnButtonPatch()
|
|
|
|
CString text;
|
|
|
|
CString text;
|
|
|
|
text.Format(_T("Get diff from directory %s?\n\nCommand (choose No to copy it into the clipboard):\n%s"), m_SrcDir, diffCmdLine);
|
|
|
|
text.Format(_T("Get diff from directory %s?\n\nCommand (choose No to copy it into the clipboard):\n%s"), m_SrcDir, diffCmdLine);
|
|
|
|
int result;
|
|
|
|
int result;
|
|
|
|
if ((result = ::MessageBox(m_hWnd, text, "Confirmation", MB_YESNOCANCEL | MB_ICONQUESTION)) == IDYES)
|
|
|
|
if ((result = ::MessageBox(m_hWnd, text, _T("Confirmation"), MB_YESNOCANCEL | MB_ICONQUESTION)) == IDYES)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (_chdir(m_SrcDir) == 0)
|
|
|
|
if (_tchdir(m_SrcDir) == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
system(diffCmdLine);
|
|
|
|
_tsystem(diffCmdLine);
|
|
|
|
displayFile(TEMP_DIFF_FILE);
|
|
|
|
displayFile(TEMP_DIFF_FILE);
|
|
|
|
SaveDiff = true;
|
|
|
|
SaveDiff = true;
|
|
|
|
colorizeDiff();
|
|
|
|
colorizeDiff();
|
|
|
@ -461,11 +469,11 @@ void CBranch_patcherDlg::OnDoPatch()
|
|
|
|
int result;
|
|
|
|
int result;
|
|
|
|
if ((result = ::MessageBox(m_hWnd, text, _T("Confirmation"), MB_YESNOCANCEL | MB_ICONQUESTION)) == IDYES)
|
|
|
|
if ((result = ::MessageBox(m_hWnd, text, _T("Confirmation"), MB_YESNOCANCEL | MB_ICONQUESTION)) == IDYES)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (_chdir(m_DestDir) == 0)
|
|
|
|
if (_tchdir(m_DestDir) == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
system(patchCmdLine);
|
|
|
|
_tsystem(patchCmdLine);
|
|
|
|
system(concatOutput);
|
|
|
|
_tsystem(concatOutput);
|
|
|
|
system(delPatchErrors);
|
|
|
|
_tsystem(delPatchErrors);
|
|
|
|
displayFile(PATCH_RESULT);
|
|
|
|
displayFile(PATCH_RESULT);
|
|
|
|
SaveDiff = false;
|
|
|
|
SaveDiff = false;
|
|
|
|
m_Display->LineScroll(0);
|
|
|
|
m_Display->LineScroll(0);
|
|
|
|