* @brief Allow user to select a file to open/save. */
| 1149 | * @brief Allow user to select a file to open/save. |
| 1150 | */ |
| 1151 | String COpenView::AskProjectFileName(bool bOpen) |
| 1152 | { |
| 1153 | // get the default projects path |
| 1154 | String strProjectFileName; |
| 1155 | String strProjectPath = GetOptionsMgr()->GetString(OPT_PROJECTS_PATH); |
| 1156 | |
| 1157 | if (!::SelectFile(GetSafeHwnd(), strProjectFileName, bOpen, strProjectPath.c_str(), |
| 1158 | _T(""), _("WinMerge Project Files (*.WinMerge)|*.WinMerge||"), _T(".WinMerge"))) |
| 1159 | return _T(""); |
| 1160 | |
| 1161 | if (strProjectFileName.empty()) |
| 1162 | return _T(""); |
| 1163 | |
| 1164 | // get the path part from the filename |
| 1165 | strProjectPath = paths::GetParentPath(strProjectFileName); |
| 1166 | // store this as the new project path |
| 1167 | GetOptionsMgr()->SaveOption(OPT_PROJECTS_PATH, strProjectPath); |
| 1168 | return strProjectFileName; |
| 1169 | } |
| 1170 | |
| 1171 | /** |
| 1172 | * @brief Load File- and filter-combobox states. |
nothing calls this directly
no test coverage detected