------------------------------------------------------------------------ r330 | plushuang | 2010-11-11 19:39:36 +0900 (Thu, 11 Nov 2010) | 6 lines * ug_plugin_curl.c (ug_plugin_curl_progress): send progress message every 2 times. * uget-gtk-timeout.c (uget_gtk_notify): support libnotify 0.7 ------------------------------------------------------------------------ Index: configure.ac =================================================================== --- configure.ac (revision 329) +++ configure.ac (revision 330) @@ -55,7 +55,7 @@ ) if test "x$enable_notify" = "xyes"; then PKG_CHECK_MODULES(LIBNOTIFY, libnotify) - AC_DEFINE(HAVE_NOTIFY, 1, [Define to 1 if libnotify support is required.]) + AC_DEFINE(HAVE_LIBNOTIFY, 1, [Define to 1 if libnotify support is required.]) # for ArchLinux AC_SUBST(LIBNOTIFY_CFLAGS) AC_SUBST(LIBNOTIFY_LIBS) Index: uget-gtk/uget-gtk-timeout.c =================================================================== --- uget-gtk/uget-gtk-timeout.c (revision 329) +++ uget-gtk/uget-gtk-timeout.c (revision 330) @@ -36,7 +36,7 @@ #ifdef HAVE_CONFIG_H #include -# if HAVE_NOTIFY +# if HAVE_LIBNOTIFY # include # endif # if HAVE_GSTREAMER @@ -496,7 +496,7 @@ // static void uget_play_sound (const gchar* sound_file); // GStreamer -#if defined (HAVE_GSTREAMER) && HAVE_GSTREAMER == 1 +#ifdef HAVE_GSTREAMER static gboolean ugst_bus_func (GstBus* bus, GstMessage* msg, gpointer data) { GstElement* playbin = data; @@ -588,12 +588,12 @@ { gdk_beep (); } -#endif // HAVE_GSTREAMER +#endif // HAVE_GSTREAMER // ---------------------------------------------------------------------------- // notification // -#if defined (HAVE_NOTIFY) && HAVE_NOTIFY == 1 +#ifdef HAVE_LIBNOTIFY static void uget_gtk_notify (UgetGtk* ugtk, const gchar* title, const gchar* body) { static NotifyNotification* notification = NULL; @@ -604,8 +604,13 @@ // set title and body string = g_strconcat (UGET_GTK_NAME " - ", title, NULL); if (notification == NULL) { +#if LIBNOTIFY_VERSION_MINOR >= 7 + notification = notify_notification_new (string, + body, UGET_GTK_ICON_NAME); +#else notification = notify_notification_new_with_status_icon (string, body, UGET_GTK_ICON_NAME, ugtk->tray_icon.self); +#endif notify_notification_set_timeout (notification, 7000); // milliseconds } else { @@ -657,7 +662,7 @@ { // do nothing } -#endif +#endif // HAVE_LIBNOTIFY #define NOTIFICATION_STARTING_TITLE _("Download Starting") #define NOTIFICATION_STARTING_STRING _("Starting download queue.") Index: uget-gtk/main.c =================================================================== --- uget-gtk/main.c (revision 329) +++ uget-gtk/main.c (revision 330) @@ -118,7 +118,7 @@ #endif // libnotify -#ifdef HAVE_NOTIFY +#ifdef HAVE_LIBNOTIFY #include #endif @@ -235,7 +235,7 @@ goto exit; } // libnotify -#ifdef HAVE_NOTIFY +#ifdef HAVE_LIBNOTIFY notify_init ("Uget"); #endif @@ -251,7 +251,7 @@ gdk_threads_leave (); // libnotify -#ifdef HAVE_NOTIFY +#ifdef HAVE_LIBNOTIFY if (notify_is_initted ()) notify_uninit (); #endif