Skip to content

Commit

Permalink
gui: fix missing notification enable() call
Browse files Browse the repository at this point in the history
  • Loading branch information
quesnel committed Jun 6, 2024
1 parent f47988a commit 33b29f0
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions app/gui/generic/modeling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,9 +667,13 @@ static void add_popup_menuitem(component_editor& ed,
{
if (not s_parent.children.can_alloc(1)) {
auto& app = container_of(&ed, &application::component_ed);
auto& n = app.notifications.alloc();
n.level = log_level::error;
n.title = "can not allocate a new model";
app.notifications.try_insert(
log_level::error, [](auto& title, auto& msg) noexcept {
title = "Generic component";
msg = "Can not allocate new model. Delete models or increase "
"generic component default size.";
});

return;
}

Expand All @@ -687,9 +691,12 @@ static void add_popup_menuitem(component_editor& ed,
data.update_position();

auto& app = container_of(&ed, &application::component_ed);
auto& n = app.notifications.alloc();
n.level = log_level::debug;
format(n.title, "new model {} added", ordinal(id));
app.notifications.try_insert(
log_level::info, [type](auto& title, auto& msg) noexcept {
title = "Generic component";
format(
msg, "New model {} added", dynamics_type_names[ordinal(type)]);
});
}
}

Expand Down

0 comments on commit 33b29f0

Please sign in to comment.