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

Method load

Tools/ImageEditor/EditorState.cpp:397–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395 }
396
397 void EditorState::load()
398 {
399 DataManager::getInstance().clear();
400 ActionManager::getInstance().reset();
401 DataSelectorManager::getInstance().changeParent(DataManager::getInstance().getRoot());
402
403 pugi::xml_document doc;
404 pugi::xml_parse_result result = doc.load_file(mFileName.asWStr_c_str());
405 if (result)
406 {
407 bool success = ExportManager::getInstance().deserialization(doc);
408 if (success)
409 {
410 if (mFileName != mDefaultFileName)
411 RecentFilesManager::getInstance().addRecentFile(mFileName);
412
413 DataSelectorManager::getInstance().changeParent(DataManager::getInstance().getRoot());
414 }
415 else
416 {
417 /*MyGUI::Message* message =*/MessageBoxManager::getInstance().create(
418 replaceTags("Error"),
419 replaceTags("MessageIncorrectFileFormat"),
420 MyGUI::MessageBoxStyle::IconError | MyGUI::MessageBoxStyle::Yes);
421
422 mFileName = mDefaultFileName;
423 addUserTag("CurrentFileName", mFileName);
424
425 updateCaption();
426 }
427 }
428 else
429 {
430 /*MyGUI::Message* message =*/MessageBoxManager::getInstance().create(
431 replaceTags("Error"),
432 result.description(),
433 MyGUI::MessageBoxStyle::IconError | MyGUI::MessageBoxStyle::Yes);
434 }
435 }
436
437 bool EditorState::save()
438 {

Callers 2

createSceneMethod · 0.45
LoadGuiSettingsMethod · 0.45

Calls 12

replaceTagsFunction · 0.85
addUserTagFunction · 0.85
changeParentMethod · 0.80
asWStr_c_strMethod · 0.80
clearMethod · 0.45
resetMethod · 0.45
getRootMethod · 0.45
load_fileMethod · 0.45
deserializationMethod · 0.45
addRecentFileMethod · 0.45
createMethod · 0.45
descriptionMethod · 0.45

Tested by

no test coverage detected