m_options.InitOption(OPT_CLR_SELECTED_MOVEDBLOCK_DELETED, (int)RGB(252, 181, 163));
m_options.InitOption(OPT_CLR_SELECTED_MOVEDBLOCK_TEXT, (int)RGB(0,0,0));
+ m_options.InitOption(OPT_PROJECTS_PATH,_T(""));
+
// Overwrite WinMerge 2.0 default colors with new colors
if (m_options.GetInt(OPT_CLR_DIFF) == RGB(255,255,92))
m_options.SaveOption(OPT_CLR_DIFF, (int)RGB(239,203,5));
CString strFileExt;
strFileExt.LoadString(IDS_PROJECTFILES_EXT);
CFileDialog dlg(true,strFileExt,0,0,strFileFilter);
+
+ // get the default projects path
+ CString strProjectPath = m_options.GetString(OPT_PROJECTS_PATH);
+ // set the initial directory to the projects path if present
+ if (!strProjectPath.IsEmpty())
+ dlg.m_ofn.lpstrInitialDir = strProjectPath;
if (dlg.DoModal() != IDOK)
return;
+ // get the path part from the filename
+ CString strFileName = dlg.GetPathName();
+ strProjectPath = paths_GetParentPath(strFileName);
+ // store this as the new project path
+ m_options.SaveOption(OPT_PROJECTS_PATH,strProjectPath);
+
CStringArray files;
- files.Add(dlg.GetPathName());
+ files.Add(strFileName);
files.Add("");
BOOL bRecursive = true;
strFileExt.LoadString(IDS_PROJECTFILES_EXT);
// show a fileopen dialog with the WinMerge extension
CFileDialog dlg(false,strFileExt,0,0,strFileFilter);
+
+ // get the default projects path
+ CMainFrame* pFrame = (CMainFrame*) theApp.m_pMainWnd;
+ CString strProjectPath = pFrame->m_options.GetString(OPT_PROJECTS_PATH);
+ // set the initial directory to the projects path if present
+ if (!strProjectPath.IsEmpty())
+ dlg.m_ofn.lpstrInitialDir = strProjectPath;
+
if (dlg.DoModal() != IDOK)
return;
+
+ // get the path part from the filename
+ CString strFileName = dlg.GetPathName();
+ strProjectPath = paths_GetParentPath(strFileName);
+ // store this as the new project path
+ pFrame->m_options.SaveOption(OPT_PROJECTS_PATH,strProjectPath);
+
//get the chosen filename
- CString strProjectFileName = dlg.GetPathName();
+ CString strProjectFileName = strFileName;
// If prefix found from start..
if (strExt.Find(filterPrefix, 0) == 0)
const TCHAR OPT_CP_DEFAULT_CUSTOM[] = _T("Settings/CodepageDefaultCustomValue");
const TCHAR OPT_CP_DETECT[] = _T("Settings/CodepageDetection");
+const TCHAR OPT_PROJECTS_PATH[] = _T("Settings/ProjectsPath");
+
// Color options
// The difference color
const TCHAR OPT_CLR_DIFF[] = _T("Settings/DifferenceColor");
2005-02-28 Kimmo
PATCH: [ 1153091 ] Fix selecting default font from View menu
Src: MainFrm.cpp MainFrm.h OptionsDef.h
+ PATCH: [ 1144545 ] Project Handling Patch3 (remember last valid project path)
+ Submitted by Andreas Morsing
+ Src: MainFrm.cpp OpenDlg.cpp OptionsDef.h
2005-02-28 Perry
BUG: [ 1039158 ] Confusing EOL differences messagebox