diff options
author | Underground78 <underground78@users.sourceforge.net> | 2013-05-17 00:06:54 +0400 |
---|---|---|
committer | Underground78 <underground78@users.sourceforge.net> | 2013-05-18 11:03:44 +0400 |
commit | a4ef88b02460cfc9637834501d292c36acafd752 (patch) | |
tree | 4a08f915c34fc9a499b6d76bb96ee77bee96ce47 /src | |
parent | 335b167bd7ad439a534e3a4b6b0df6a82dec1f62 (diff) |
Open dialog: Fix the error message shown when clicking "Browse" while having an URL entered in the corresponding field.
Diffstat (limited to 'src')
-rw-r--r-- | src/mpc-hc/OpenFileDlg.cpp | 5 | ||||
-rw-r--r-- | src/mpc-hc/OpenFileDlg.h | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/mpc-hc/OpenFileDlg.cpp b/src/mpc-hc/OpenFileDlg.cpp index 37447e4e5..66e69459f 100644 --- a/src/mpc-hc/OpenFileDlg.cpp +++ b/src/mpc-hc/OpenFileDlg.cpp @@ -38,8 +38,11 @@ COpenFileDlg::COpenFileDlg(CAtlArray<CString>& mask, bool fAllowDirSelection, LP : CFileDialog(TRUE, lpszDefExt, lpszFileName, dwFlags | OFN_NOVALIDATE, lpszFilter, pParentWnd, 0)
, m_mask(mask)
{
+ m_defaultDir = lpszFileName;
+ m_defaultDir.RemoveFileSpec();
+
m_fAllowDirSelection = fAllowDirSelection;
- m_pOFN->lpstrInitialDir = lpszFileName;
+ m_pOFN->lpstrInitialDir = m_defaultDir.FileExists() ? m_defaultDir : nullptr;
m_buff = DEBUG_NEW TCHAR[10000];
m_buff[0] = 0;
diff --git a/src/mpc-hc/OpenFileDlg.h b/src/mpc-hc/OpenFileDlg.h index b948be62f..24765964f 100644 --- a/src/mpc-hc/OpenFileDlg.h +++ b/src/mpc-hc/OpenFileDlg.h @@ -1,6 +1,6 @@ /*
* (C) 2003-2006 Gabest
- * (C) 2006-2012 see Authors.txt
+ * (C) 2006-2013 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -33,6 +33,7 @@ class COpenFileDlg : public CFileDialog private:
TCHAR* m_buff;
CAtlArray<CString>& m_mask;
+ CPath m_defaultDir;
public:
COpenFileDlg(CAtlArray<CString>& mask, bool fAllowDirSelection,
|