| 495 | } |
| 496 | |
| 497 | void 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 | } |