From: Christian Dywan Date: Sat, 21 Mar 2009 19:08:37 +0000 (+0100) Subject: Provide a Clear button for cancelled downloads X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5d1f36561e6e03232c8db0b239b3a8c00e749dc;p=midori Provide a Clear button for cancelled downloads --- diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 8b4089e6..c8c3e15a 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -909,21 +909,20 @@ midori_browser_download_notify_status_cb (WebKitDownload* download, GParamSpec* pspec, GtkWidget* button) { + GtkWidget* icon; + switch (webkit_download_get_status (download)) { case WEBKIT_DOWNLOAD_STATUS_FINISHED: - { - GtkWidget* icon; - icon = gtk_image_new_from_stock (GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU); gtk_button_set_image (GTK_BUTTON (button), icon); if (g_object_get_data (G_OBJECT (download), "open-download")) gtk_button_clicked (GTK_BUTTON (button)); break; - } case WEBKIT_DOWNLOAD_STATUS_CANCELLED: case WEBKIT_DOWNLOAD_STATUS_ERROR: - gtk_widget_set_sensitive (button, FALSE); + icon = gtk_image_new_from_stock (GTK_STOCK_CLEAR, GTK_ICON_SIZE_MENU); + gtk_button_set_image (GTK_BUTTON (button), icon); break; default: break; @@ -954,6 +953,8 @@ midori_browser_download_button_clicked_cb (GtkWidget* button, gtk_widget_destroy (gtk_widget_get_parent (button)); break; } + case WEBKIT_DOWNLOAD_STATUS_CANCELLED: + gtk_widget_destroy (gtk_widget_get_parent (button)); default: break; }