aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlo Gravo <flo.gravo@gmail.com>2010-10-23 06:54:27 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-10-23 06:54:27 +0800
commit8854c727c1c05bc22a7757ffa93bc9533286525f (patch)
treeee93b2f5830a4fcec4ed4947fda36865f6fddd5b
parent2636da7dac1683c7bac98b7a6d1ee084ea2efbca (diff)
downloadgsoc2013-evolution-8854c727c1c05bc22a7757ffa93bc9533286525f.tar.gz
gsoc2013-evolution-8854c727c1c05bc22a7757ffa93bc9533286525f.tar.zst
gsoc2013-evolution-8854c727c1c05bc22a7757ffa93bc9533286525f.zip
Bug 632903 - Support libnotify-0.7
-rw-r--r--calendar/gui/alarm-notify/alarm-queue.c4
-rw-r--r--configure.ac6
-rw-r--r--plugins/mail-notification/mail-notification.c8
-rw-r--r--plugins/publish-calendar/publish-calendar.c8
4 files changed, 21 insertions, 5 deletions
diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c
index 7145a2209a..752ce3749e 100644
--- a/calendar/gui/alarm-notify/alarm-queue.c
+++ b/calendar/gui/alarm-notify/alarm-queue.c
@@ -1606,7 +1606,11 @@ popup_notification (time_t trigger, CompQueuedAlarms *cqa,
body = g_strdup_printf ("%s %s", start_str, time_str);
}
+#ifdef HAVE_LIBNOTIFY_07
+ n = notify_notification_new (summary, body, "stock_appointment-reminder");
+#else
n = notify_notification_new (summary, body, "stock_appointment-reminder", NULL);
+#endif /* HAVE_LIBNOTIFY_07 */
if (!notify_notification_show (n, NULL))
g_warning ("Could not send notification to daemon\n");
diff --git a/configure.ac b/configure.ac
index d7c2abee8f..133161eae4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1340,7 +1340,7 @@ LIBNOTIFY_CFLAGS=
LIBNOTIFY_LIBS=
PKG_CHECK_MODULES([LIBNOTIFY], [libnotify >= $libnotify_minimum_version], [HAVE_LIBNOTIFY="yes"], [HAVE_LIBNOTIFY="no"])
if test "x$HAVE_LIBNOTIFY" = "xyes"; then
- AC_DEFINE(HAVE_LIBNOTIFY, 1, [libnotify available])
+ AC_DEFINE(HAVE_LIBNOTIFY, 1, [Define if you have libnotify])
libnotify="libnotify"
else
libnotify=""
@@ -1348,6 +1348,10 @@ fi
AC_SUBST(LIBNOTIFY_CFLAGS)
AC_SUBST(LIBNOTIFY_LIBS)
+if $PKG_CONFIG --atleast-version=0.7 libnotify; then
+ AC_DEFINE(HAVE_LIBNOTIFY_07, 1, [Define if you have libnotify >= 0.7])
+fi
+
dnl **************
dnl Calendar Flags
dnl **************
diff --git a/plugins/mail-notification/mail-notification.c b/plugins/mail-notification/mail-notification.c
index f8fd766cb1..961868ad56 100644
--- a/plugins/mail-notification/mail-notification.c
+++ b/plugins/mail-notification/mail-notification.c
@@ -562,11 +562,15 @@ new_notify_status (EMEventTargetFolder *t)
if (!notify_init ("evolution-mail-notification"))
fprintf (stderr,"notify init error");
+#ifdef HAVE_LIBNOTIFY_07
notify = notify_notification_new (
- _("New email"), safetext,
- "mail-unread", NULL);
+ _("New email"), safetext, "mail-unread");
+#else
+ notify = notify_notification_new (
+ _("New email"), safetext, "mail-unread", NULL);
notify_notification_attach_to_status_icon (
notify, status_icon);
+#endif /* HAVE_LIBNOTIFY_07 */
/* Check if actions are supported */
if (can_support_actions ()) {
diff --git a/plugins/publish-calendar/publish-calendar.c b/plugins/publish-calendar/publish-calendar.c
index d30a9b15f2..da9306331d 100644
--- a/plugins/publish-calendar/publish-calendar.c
+++ b/plugins/publish-calendar/publish-calendar.c
@@ -140,7 +140,7 @@ update_publish_notification (GtkMessageType msg_type, const gchar *msg_text)
gtk_status_icon_set_from_stock (status_icon, stock_name);
gtk_status_icon_set_tooltip_text (status_icon, actual_msg->str);
- #ifdef HAVE_LIBNOTIFY
+#ifdef HAVE_LIBNOTIFY
if (can_notify) {
if (notify) {
notify_notification_update (notify, _("Calendar Publishing"), actual_msg->str, stock_name);
@@ -150,8 +150,12 @@ update_publish_notification (GtkMessageType msg_type, const gchar *msg_text)
return;
}
+#ifdef HAVE_LIBNOTIFY_07
+ notify = notify_notification_new (_("Calendar Publishing"), actual_msg->str, stock_name);
+#else
notify = notify_notification_new (_("Calendar Publishing"), actual_msg->str, stock_name, NULL);
notify_notification_attach_to_status_icon (notify, status_icon);
+#endif /* HAVE_LIBNOTIFY_07 */
notify_notification_set_urgency (notify, NOTIFY_URGENCY_NORMAL);
notify_notification_set_timeout (notify, NOTIFY_EXPIRES_DEFAULT);
g_timeout_add (500, show_notify_cb, NULL);
@@ -159,7 +163,7 @@ update_publish_notification (GtkMessageType msg_type, const gchar *msg_text)
g_signal_connect (notify, "closed", G_CALLBACK (remove_notification), NULL);
}
}
- #endif
+#endif
status_icon_timeout_id = g_timeout_add_seconds (15, remove_notification, NULL);