Add system notification support for crashes and updates
This commit is contained in:
@@ -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), ¬ification);
|
||||
}
|
||||
|
||||
/// A CVE notification to send to the user.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct CveNotification {
|
||||
|
||||
Reference in New Issue
Block a user