[Xfce4-commits] <midori:master> Don't always show the "Pending downloads" dialog.

Christian Dywan noreply at xfce.org
Tue Jun 29 07:22:02 CEST 2010


Updating branch refs/heads/master
         to 7821d61b5c8a0bde2834457ef38161b1e0cb89ec (commit)
       from 7e015f88a9ce997b0038e9fa1beda7fac2554cd5 (commit)

commit 7821d61b5c8a0bde2834457ef38161b1e0cb89ec
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date:   Mon Jun 28 19:41:13 2010 +0200

    Don't always show the "Pending downloads" dialog.
    
    If all donwloads are finished, cancelled or errored, the dialog should
    not be shown.

 toolbars/midori-transferbar.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/toolbars/midori-transferbar.c b/toolbars/midori-transferbar.c
index 3309e89..f0fb030 100644
--- a/toolbars/midori-transferbar.c
+++ b/toolbars/midori-transferbar.c
@@ -267,9 +267,29 @@ gboolean
 midori_transferbar_confirm_delete (MidoriTransferbar* transferbar)
 {
     GtkWidget* dialog = NULL;
+    GList* list;
     gboolean cancel = FALSE;
+    gboolean all_done = TRUE;
+
+    #if WEBKIT_CHECK_VERSION (1, 1, 3)
+    for (list = transferbar->infos; list != NULL; list = g_list_next (list))
+    {
+        TransferInfo* info = list->data;
+        WebKitDownloadStatus status = webkit_download_get_status (info->download);
+
+        if (status != WEBKIT_DOWNLOAD_STATUS_FINISHED
+         && status != WEBKIT_DOWNLOAD_STATUS_CANCELLED
+         && status != WEBKIT_DOWNLOAD_STATUS_ERROR)
+        {
+            all_done = FALSE;
+            break;
+        }
+    }
 
+    if (!all_done)
+    #else
     if (transferbar->infos || g_list_nth_data (transferbar->infos, 0))
+    #endif
     {
         GtkWidget* widget = gtk_widget_get_toplevel (GTK_WIDGET (transferbar));
         dialog = gtk_message_dialog_new (GTK_WINDOW (widget),



More information about the Xfce4-commits mailing list