| 311 | } |
| 312 | |
| 313 | void recompui::open_notification( |
| 314 | const std::string& header_text, |
| 315 | const std::string& content_text, |
| 316 | const std::string& return_element_id |
| 317 | ) { |
| 318 | std::lock_guard lock{ prompt_state.mutex }; |
| 319 | |
| 320 | std::function<void()> prev_cancel_action = std::move(prompt_state.cancel_action); |
| 321 | |
| 322 | ContextId prev_context = try_close_current_context(); |
| 323 | |
| 324 | prompt_state.ui_context.open(); |
| 325 | |
| 326 | prompt_state.prompt_header->set_text(header_text); |
| 327 | prompt_state.prompt_label->set_text(content_text); |
| 328 | prompt_state.prompt_controls->set_display(Display::None); |
| 329 | prompt_state.confirm_button->set_display(Display::None); |
| 330 | prompt_state.cancel_button->set_display(Display::None); |
| 331 | prompt_state.confirm_action = {}; |
| 332 | prompt_state.cancel_action = {}; |
| 333 | prompt_state.return_element_id = return_element_id; |
| 334 | |
| 335 | prompt_state.ui_context.close(); |
| 336 | |
| 337 | if (prev_context != ContextId::null()) { |
| 338 | prev_context.open(); |
| 339 | } |
| 340 | |
| 341 | show_prompt(prev_cancel_action, false); |
| 342 | } |
| 343 | |
| 344 | void recompui::close_prompt() { |
| 345 | std::lock_guard lock{ prompt_state.mutex }; |
nothing calls this directly
no test coverage detected