diff options
Diffstat (limited to 'embed/downloader-view.c')
-rw-r--r-- | embed/downloader-view.c | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/embed/downloader-view.c b/embed/downloader-view.c index 698a0fe6e..fd1cfcc3a 100644 --- a/embed/downloader-view.c +++ b/embed/downloader-view.c @@ -34,10 +34,6 @@ #include <gtk/gtk.h> #include <gdk/gdkx.h> -#ifdef HAVE_LIBNOTIFY -#include <libnotify/notify.h> -#endif - enum { COL_STATUS, @@ -279,65 +275,6 @@ downloader_view_new (void) NULL)); } -#ifdef HAVE_LIBNOTIFY -static void -notification_closed_cb (NotifyNotification *notification, - DownloaderView *dv) -{ - g_object_unref (dv); -} - -static gboolean -show_notification_cb (NotifyNotification *notification) -{ - DownloaderView *dv; - GError *error = NULL; - - dv = g_object_get_data (G_OBJECT (notification), "dv"); - notify_notification_show (notification, &error); - - if (error) - { - /* notification_closed_cb () will never be called. */ - g_warning ("Error showing download notification: %s", - error->message); - g_object_unref (dv); - g_error_free (error); - } - - return FALSE; -} - -static void -show_notification (DownloaderView *dv, const char *title, const char *msg) -{ - NotifyNotification *notification; - GtkStatusIcon *status_icon; - - status_icon = dv->priv->status_icon; - - /* We keep the DownloaderView alive until the notification is gone. */ - g_object_ref (dv); - - notification = notify_notification_new (title, msg, - GTK_STOCK_INFO, NULL); - - g_signal_connect_after (notification, "closed", - G_CALLBACK (notification_closed_cb), dv); - g_object_set_data (G_OBJECT (notification), "dv", dv); - - notify_notification_set_timeout (notification, NOTIFY_EXPIRES_DEFAULT); - notify_notification_set_urgency (notification, NOTIFY_URGENCY_LOW); - - notify_notification_attach_to_status_icon (notification, status_icon); - - /* There are some visual glitches when the notification is shown and - * the GtkStatusIcon is still not visible. To avoid that, we delay the - * popup a bit. */ - g_timeout_add (500, (GSourceFunc) show_notification_cb, notification); -} -#endif - static char * format_interval (gdouble interval) { @@ -510,9 +447,6 @@ update_download_row (DownloaderView *dv, WebKitDownload *download) struct tm; int percent = 0; DownloadAction action; -#ifdef HAVE_LIBNOTIFY - char *downloaded; -#endif row_ref = get_row_from_download (dv, download); /* In downloader_view_add_download() we call this function manually to @@ -556,11 +490,6 @@ update_download_row (DownloaderView *dv, WebKitDownload *download) break; } -#ifdef HAVE_LIBNOTIFY - downloaded = g_strdup_printf (_("The file ā%sā has been downloaded."), name); - show_notification (dv, _("Download finished"), downloaded); - g_free (downloaded); -#endif downloader_view_remove_download (dv, download); return; @@ -738,19 +667,6 @@ downloader_view_add_download (DownloaderView *dv, if (g_settings_get_boolean (EPHY_SETTINGS_UI, EPHY_PREFS_UI_DOWNLOADS_HIDDEN) && !visible) { -#ifdef HAVE_LIBNOTIFY - char *name; - char *downloading; - - name = ephy_download_get_name (download); - downloading = g_strdup_printf(_("The file ā%sā has been added to the downloads queue."), name); - - show_notification (dv, _("Download started"), downloading); - - g_free (name); - g_free (downloading); -#endif - ephy_dialog_hide (EPHY_DIALOG (dv)); } else |