Add system notification support for crashes and updates

This commit is contained in:
lashman
2026-02-27 23:47:19 +02:00
parent 9cf4f1126c
commit 0777ae1a26
2 changed files with 27 additions and 0 deletions

View File

@@ -1,6 +1,23 @@
use gtk::gio;
use gtk::prelude::*;
use super::database::Database;
use super::security;
/// Send a desktop notification via gio.
pub fn send_system_notification(
app: &gio::Application,
id: &str,
title: &str,
body: &str,
priority: gio::NotificationPriority,
) {
let notification = gio::Notification::new(title);
notification.set_body(Some(body));
notification.set_priority(priority);
app.send_notification(Some(id), &notification);
}
/// A CVE notification to send to the user.
#[derive(Debug, Clone)]
pub struct CveNotification {