MCPcopy Create free account
hub / github.com/audacity/audacity / ShowNotifications

Method ShowNotifications

src/update/UpdateManager.cpp:497–529  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

495}
496
497void UpdateManager::ShowNotifications()
498{
499 auto activeNotifications = GetActiveNotifications();
500
501 for (const auto& notification : activeNotifications)
502 {
503 if (IsNotificationShown(notification.uuid))
504 continue;
505
506 if (CustomNotificationRegistry::HasCustomDialog(notification.uuid))
507 {
508 int result = CustomNotificationRegistry::ShowCustomDialog(nullptr, notification);
509 if (result != wxID_APPLY && !IsNotificationShown(notification.uuid))
510 MarkNotificationAsShown(notification.uuid);
511 continue;
512 }
513
514 UpdateNotificationDialog dlg(nullptr, notification);
515
516 dlg.Bind(EVT_NOTIFICATION_DISMISSED, [this](wxCommandEvent& evt) {
517 MarkNotificationAsShown(evt.GetString());
518 });
519
520 dlg.Bind(EVT_NOTIFICATION_REMIND_LATER, [](wxCommandEvent&) {
521 // If remind later, close the dialog, and show it again next time
522 });
523
524 int result = dlg.ShowModal();
525
526 if ((result == wxID_OK || result == wxID_CANCEL) && !IsNotificationShown(notification.uuid))
527 MarkNotificationAsShown(notification.uuid);
528 }
529}

Callers

nothing calls this directly

Calls 3

BindMethod · 0.80
GetStringMethod · 0.45
ShowModalMethod · 0.45

Tested by

no test coverage detected