BUG#724: Preserving current working directory during file selection.
This commit is contained in:
parent
99feab3528
commit
d1185c5910
@ -450,6 +450,9 @@ void CPropertyList::OnButton()
|
|||||||
{
|
{
|
||||||
CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(m_curSel);
|
CPropertyItem* pItem = (CPropertyItem*) GetItemDataPtr(m_curSel);
|
||||||
|
|
||||||
|
// The dialogs might change the working directory. Save it.
|
||||||
|
std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
|
||||||
|
|
||||||
//display the appropriate common dialog depending on what type
|
//display the appropriate common dialog depending on what type
|
||||||
//of chooser is associated with the property
|
//of chooser is associated with the property
|
||||||
|
|
||||||
@ -459,7 +462,7 @@ void CPropertyList::OnButton()
|
|||||||
CString Filter("All Files (*.*)||");
|
CString Filter("All Files (*.*)||");
|
||||||
|
|
||||||
CFileDialog FileDlg(TRUE, NULL, NULL, NULL,
|
CFileDialog FileDlg(TRUE, NULL, NULL, NULL,
|
||||||
Filter);
|
Filter);
|
||||||
CString initialDir;
|
CString initialDir;
|
||||||
CString currPath = pItem->m_curValue;
|
CString currPath = pItem->m_curValue;
|
||||||
if (currPath.Right(9) == "-NOTFOUND" || currPath == "NOTFOUND")
|
if (currPath.Right(9) == "-NOTFOUND" || currPath == "NOTFOUND")
|
||||||
@ -511,6 +514,8 @@ void CPropertyList::OnButton()
|
|||||||
InvalidateList();
|
InvalidateList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cmSystemTools::ChangeDirectory(cwd.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPropertyList::OnLButtonUp(UINT nFlags, CPoint point)
|
void CPropertyList::OnLButtonUp(UINT nFlags, CPoint point)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user