From: Christian Dywan Date: Fri, 20 Mar 2009 23:11:29 +0000 (+0100) Subject: Remove items from the transferbar when they are opened X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81717cc965c979db0ca9abed93c2dfb2fb96a0cd;p=midori Remove items from the transferbar when they are opened --- diff --git a/midori/midori-browser.c b/midori/midori-browser.c index a92278dd..acdad246 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -939,13 +939,16 @@ midori_browser_download_button_clicked_cb (GtkWidget* button, case WEBKIT_DOWNLOAD_STATUS_FINISHED: { const gchar* uri = webkit_download_get_destination_uri (download); - if (!gtk_show_uri (gtk_widget_get_screen (button), - uri, gtk_get_current_event_time (), NULL)) + gboolean success = gtk_show_uri (gtk_widget_get_screen (button), + uri, gtk_get_current_event_time (), NULL); + if (!success) { gchar* command = g_strconcat ("exo-open ", uri, NULL); - g_spawn_command_line_async (command, NULL); + success = g_spawn_command_line_async (command, NULL); g_free (command); } + if (success) + gtk_widget_destroy (gtk_widget_get_parent (button)); break; } default: