[epiphany] downloader-view: hide the view when last download finishes



commit 061f31953d1d4a6b18b7ac434f0520e65249b9e1
Author: Diego Escalante Urrelo <descalante igalia com>
Date:   Wed Mar 10 16:46:53 2010 -0500

    downloader-view: hide the view when last download finishes
    
    When there are no more downloads in queue, hide the view. Also if a download is
    added but finishes before showing the window, don't show the window nor the
    notification.
    
    Bug #611779

 embed/downloader-view.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/embed/downloader-view.c b/embed/downloader-view.c
index 645f267..8469387 100644
--- a/embed/downloader-view.c
+++ b/embed/downloader-view.c
@@ -717,6 +717,16 @@ downloader_view_add_download (DownloaderView *dv,
 
 	/* Show it already */
 	g_object_get (G_OBJECT (dv->priv->window), "visible", &visible, NULL);
+
+	/* In the previous update_download_row() (or handlers) the download
+	 * might have finished, if that's the case, we have nothing else to do.
+	 * A notification of the finished download will pop to inform the user
+	 * there was success. */
+	if (g_hash_table_size (dv->priv->downloads_hash) < 1)
+	{
+		ephy_dialog_hide (EPHY_DIALOG (dv));
+		return;
+	}
 	
 	if (eel_gconf_get_boolean (CONF_DOWNLOADS_HIDDEN) && !visible)
 	{
@@ -1021,6 +1031,7 @@ downloader_view_remove_download (DownloaderView *dv, WebKitDownload *download)
 	{
 		gtk_widget_set_sensitive (dv->priv->abort_button, FALSE);
 		gtk_widget_set_sensitive (dv->priv->pause_button, FALSE);
+		ephy_dialog_hide (EPHY_DIALOG (dv));
 		g_object_unref (dv);
 	}
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]