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

Method load

Tools/FontEditor/EditorState.cpp:424–462  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

422 }
423
424 void EditorState::load()
425 {
426 DataManager::getInstance().clear();
427 ActionManager::getInstance().reset();
428 DataSelectorManager::getInstance().changeParent(DataManager::getInstance().getRoot());
429
430 pugi::xml_document doc;
431 pugi::xml_parse_result result = doc.load_file(mFileName.asWStr_c_str());
432 if (result)
433 {
434 bool success = ExportManager::getInstance().deserialization(doc);
435 if (success)
436 {
437 if (mFileName != mDefaultFileName)
438 RecentFilesManager::getInstance().addRecentFile(mFileName);
439
440 DataSelectorManager::getInstance().changeParent(DataManager::getInstance().getRoot());
441 }
442 else
443 {
444 /*MyGUI::Message* message =*/MessageBoxManager::getInstance().create(
445 replaceTags("Error"),
446 replaceTags("MessageIncorrectFileFormat"),
447 MyGUI::MessageBoxStyle::IconError | MyGUI::MessageBoxStyle::Yes);
448
449 mFileName = mDefaultFileName;
450 addUserTag("CurrentFileName", mFileName);
451
452 updateCaption();
453 }
454 }
455 else
456 {
457 /*MyGUI::Message* message =*/MessageBoxManager::getInstance().create(
458 replaceTags("Error"),
459 result.description(),
460 MyGUI::MessageBoxStyle::IconError | MyGUI::MessageBoxStyle::Yes);
461 }
462 }
463
464 bool EditorState::save()
465 {

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