MCPcopy Create free account
hub / github.com/MyGUI/mygui / command_OpenRecentProject

Method command_OpenRecentProject

Tools/LayoutEditor/ProjectControl.cpp:263–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261 }
262
263 void ProjectControl::command_OpenRecentProject(const MyGUI::UString& _commandName, bool& _result)
264 {
265 if (!checkCommand())
266 return;
267
268 MyGUI::UString data = CommandManager::getInstance().getCommandData();
269 if (data.empty())
270 return;
271
272 clear();
273
274 MyGUI::UString filePath;
275 MyGUI::UString fileName = data;
276
277 size_t index = data.find_last_of("\\/");
278 if (index != MyGUI::UString::npos)
279 {
280 filePath = data.substr(0, index);
281 fileName = data.substr(index + 1);
282 }
283
284 RecentFilesManager::getInstance().setRecentFolder(filePath);
285 setFileName(filePath, fileName);
286
287 if (!load())
288 {
289 /*MyGUI::Message* message = */ MessageBoxManager::getInstance().create(
290 replaceTags("Error"),
291 replaceTags("MessageFailedLoadProject"),
292 MyGUI::MessageBoxStyle::IconError | MyGUI::MessageBoxStyle::Ok);
293
294 clear();
295 }
296
297 updateCaption();
298
299 _result = true;
300 }
301
302 bool ProjectControl::checkCommand()
303 {

Callers

nothing calls this directly

Calls 7

clearFunction · 0.85
replaceTagsFunction · 0.85
find_last_ofMethod · 0.80
substrMethod · 0.80
emptyMethod · 0.45
setRecentFolderMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected