MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / HandleNotificationMessage

Method HandleNotificationMessage

radiant/ui/UserInterfaceModule.cpp:376–398  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

374}
375
376void UserInterfaceModule::HandleNotificationMessage(radiant::NotificationMessage& msg)
377{
378 auto parentWindow = module::GlobalModuleRegistry().moduleExists(MODULE_MAINFRAME) ?
379 GlobalMainFrame().getWxTopLevelWindow() : nullptr;
380
381 switch (msg.getType())
382 {
383 case radiant::NotificationMessage::Information:
384 wxutil::Messagebox::Show(msg.hasTitle() ? msg.getTitle() : _("Notification"),
385 msg.getMessage(), IDialog::MessageType::MESSAGE_CONFIRM, parentWindow);
386 break;
387
388 case radiant::NotificationMessage::Warning:
389 wxutil::Messagebox::Show(msg.hasTitle() ? msg.getTitle() : _("Warning"),
390 msg.getMessage(), IDialog::MessageType::MESSAGE_WARNING, parentWindow);
391 break;
392
393 case radiant::NotificationMessage::Error:
394 wxutil::Messagebox::Show(msg.hasTitle() ? msg.getTitle() : _("Error"),
395 msg.getMessage(), IDialog::MessageType::MESSAGE_ERROR, parentWindow);
396 break;
397 };
398}
399
400void UserInterfaceModule::onDispatchEvent(DispatchEvent& evt)
401{

Callers

nothing calls this directly

Calls 6

moduleExistsMethod · 0.80
getWxTopLevelWindowMethod · 0.80
getMessageMethod · 0.80
_Function · 0.50
getTypeMethod · 0.45
hasTitleMethod · 0.45

Tested by

no test coverage detected