Commit 0afe0250 authored by Gauthier Quesnel's avatar Gauthier Quesnel
Browse files

gui: attach read models to the top cluster

parent 02cc0cba
Pipeline #22254 passed with stage
in 2 minutes and 14 seconds
......@@ -2444,14 +2444,20 @@ editor::show_editor() noexcept
if (load_file_dialog(path)) {
show_load_file_dialog = false;
log_w.log(
5, "Load file from %s\n", (const char*)path.u8string().c_str());
5, "Load file from %s: ", (const char*)path.u8string().c_str());
if (auto is = std::ifstream(path); is.is_open()) {
reader r(is);
auto ret = r(sim);
auto ret = r(sim, [this](model_id id) {
parent(id, undefined<cluster_id>());
imnodes::SetNodeEditorSpacePos(
top.emplace_back(id), imnodes::EditorContextGetPanning());
});
if (is_success(ret))
log_w.log(5, "success\n");
else
log_w.log(4, "error writing\n");
log_w.log(4, "fail\n");
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment