MCPcopy Create free account
hub / github.com/WinMerge/winmerge / AskProjectFileName

Method AskProjectFileName

Src/OpenView.cpp:1151–1169  ·  view source on GitHub ↗

* @brief Allow user to select a file to open/save. */

Source from the content-addressed store, hash-verified

1149 * @brief Allow user to select a file to open/save.
1150 */
1151String 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.

Callers

nothing calls this directly

Calls 6

SelectFileFunction · 0.85
GetParentPathFunction · 0.85
GetOptionsMgrFunction · 0.70
GetStringMethod · 0.45
emptyMethod · 0.45
SaveOptionMethod · 0.45

Tested by

no test coverage detected