[nautilus] Add source hints to notifications



commit 8db750fd470ce3545258b043cbc0e839c45da288
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jan 12 16:05:36 2013 -0500

    Add source hints to notifications
    
    This makes it easier for gnome-shell to apply filtering.
    See https://live.gnome.org/GnomeGoals/NotificationSource
    
    https://bugzilla.gnome.org/show_bug.cgi?id=690995

 src/nautilus-application.c         |    4 ++++
 src/nautilus-progress-ui-handler.c |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 780b04d..0470901 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -146,6 +146,8 @@ nautilus_application_notify_unmount_done (NautilusApplication *application,
 		strings = g_strsplit (message, "\n", 0);
 		unplug = notify_notification_new (strings[0], strings[1],
 						  "media-removable");
+		notify_notification_set_hint (unplug,
+					      "desktop-entry", g_variant_new_string ("nautilus"));
 
 		notify_notification_show (unplug, NULL);
 		g_object_unref (unplug);
@@ -167,6 +169,8 @@ nautilus_application_notify_unmount_show (NautilusApplication *application,
 						 "media-removable");
 
 		notify_notification_set_hint (application->priv->unmount_notify,
+					      "desktop-entry", g_variant_new_string ("nautilus"));
+		notify_notification_set_hint (application->priv->unmount_notify,
 					      "transient", g_variant_new_boolean (TRUE));
 		notify_notification_set_urgency (application->priv->unmount_notify,
 						 NOTIFY_URGENCY_CRITICAL);
diff --git a/src/nautilus-progress-ui-handler.c b/src/nautilus-progress-ui-handler.c
index 5598cf5..020ec04 100644
--- a/src/nautilus-progress-ui-handler.c
+++ b/src/nautilus-progress-ui-handler.c
@@ -112,6 +112,8 @@ progress_ui_handler_ensure_notification (NautilusProgressUIHandler *self)
 	notify_notification_set_category (notify, "transfer");
 	notify_notification_set_hint (notify, "resident",
 				      g_variant_new_boolean (TRUE));
+	notify_notification_set_hint (notify,
+				      "desktop-entry", g_variant_new_string ("nautilus"));
 
 	notify_notification_add_action (notify, ACTION_DETAILS,
 					_("Show Details"),
@@ -272,6 +274,8 @@ progress_ui_handler_show_complete_notification (NautilusProgressUIHandler *self)
 	complete_notification = notify_notification_new (_("File Operations"),
 							 _("All file operations have been successfully completed"),
 							 NULL);
+	notify_notification_set_hint (complete_notification,
+				      "desktop-entry", g_variant_new_string ("nautilus"));
 	notify_notification_show (complete_notification, NULL);
 
 	g_object_unref (complete_notification);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]