[gnome-online-accounts] Support notification filtering



commit cbcb0da9ea39c841e4cc1f82b88379920604d0a3
Author: Nuno Araujo <nuno araujo russo79 com>
Date:   Tue Jan 29 07:29:44 2013 +0100

    Support notification filtering
    
    Set the desktop-entry hint on the notifications of goa-daemon and
    create a desktop file for it with a X-GNOME-UsesNotifications key, so
    that it appears in the new control panel notifications panel.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=692768

 data/Makefile.am              |   13 +++++++++++++
 data/goa-daemon.desktop.in.in |   12 ++++++++++++
 po/POTFILES.in                |    1 +
 src/daemon/goadaemon.c        |    3 +++
 4 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/data/Makefile.am b/data/Makefile.am
index 49004b8..48ad0d9 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -6,6 +6,11 @@ SUBDIRS = icons
 cssdir = $(pkgdatadir)
 css_DATA = goawebview.css
 
+desktopdir = $(datadir)/applications
+desktop_in_in_files = goa-daemon.desktop.in.in
+desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in)
+desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
+
 servicedir       = $(datadir)/dbus-1/services
 service_in_files = org.gnome.OnlineAccounts.service.in
 service_DATA     = $(service_in_files:.service.in=.service)
@@ -13,14 +18,22 @@ service_DATA     = $(service_in_files:.service.in=.service)
 $(service_DATA): $(service_in_files) Makefile
 	@sed -e "s|\ libexecdir\@|$(libexecdir)|" $< > $@
 
+$(desktop_in_files): $(desktop_in_in_files) Makefile
+	@sed -e "s|\ libexecdir\@|$(libexecdir)|" $< > $@
+
+ INTLTOOL_DESKTOP_RULE@
+
 EXTRA_DIST =						\
 	$(css_DATA)					\
+	$(desktop_in_in_files)				\
 	$(service_in_files)				\
 	dbus-interfaces.xml				\
 	$(NULL)
 
 DISTCLEANFILES =					\
 	org.gnome.OnlineAccounts.service		\
+	$(desktop_DATA)					\
+	$(desktop_in_files)				\
 	$(NULL)
 
 clean-local :
diff --git a/data/goa-daemon.desktop.in.in b/data/goa-daemon.desktop.in.in
new file mode 100644
index 0000000..d2ef081
--- /dev/null
+++ b/data/goa-daemon.desktop.in.in
@@ -0,0 +1,12 @@
+[Desktop Entry]
+_Name=Online Accounts
+_Comment=Provides the org.gnome.OnlinesAccounts name on the session bus
+Exec= libexecdir@/goa-daemon
+Icon=goa-panel
+Terminal=false
+Type=Application
+StartupNotify=false
+Categories=GTK;GNOME;Settings;X-GNOME-PersonalSettings;
+OnlyShowIn=GNOME;Unity;
+NoDisplay=true
+X-GNOME-UsesNotifications=true
diff --git a/po/POTFILES.in b/po/POTFILES.in
index a529fd0..20fd0a9 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,6 +1,7 @@
 [encoding: UTF-8]
 # List of source files containing translatable strings.
 # Please keep this file sorted alphabetically.
+data/goa-daemon.desktop.in.in
 src/daemon/goadaemon.c
 src/goabackend/goaewsclient.c
 src/goabackend/goaexchangeprovider.c
diff --git a/src/daemon/goadaemon.c b/src/daemon/goadaemon.c
index 1224fd9..e82612e 100644
--- a/src/daemon/goadaemon.c
+++ b/src/daemon/goadaemon.c
@@ -986,10 +986,13 @@ goa_daemon_update_notifications (GoaDaemon *daemon)
       if (daemon->notification == NULL)
         {
           GError *error;
+          GVariant *desktop_entry;
 
           daemon->notification = notify_notification_new (_("An online account needs attention"),
                                                           NULL,
                                                           NULL);
+          desktop_entry = g_variant_new_string ("goa-daemon");
+          notify_notification_set_hint (daemon->notification, "desktop-entry", desktop_entry);
           notify_notification_set_timeout (daemon->notification, NOTIFY_EXPIRES_NEVER);
           g_object_set (daemon->notification, "icon-name", "gtk-dialog-error", NULL);
           notify_notification_add_action (daemon->notification,



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