diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-09-18 20:03:15 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-09-18 20:03:15 +0800 |
commit | f1ef34a569c6a97a5ba2516f4e4511d2a93f05f6 (patch) | |
tree | 0eead031ea0032dd570c5c66b70b7b54f6e823db | |
parent | 3b1f9048fa3055b317c78db5d8490702e5d253f8 (diff) | |
download | gsoc2013-epiphany-f1ef34a569c6a97a5ba2516f4e4511d2a93f05f6.tar gsoc2013-epiphany-f1ef34a569c6a97a5ba2516f4e4511d2a93f05f6.tar.gz gsoc2013-epiphany-f1ef34a569c6a97a5ba2516f4e4511d2a93f05f6.tar.bz2 gsoc2013-epiphany-f1ef34a569c6a97a5ba2516f4e4511d2a93f05f6.tar.lz gsoc2013-epiphany-f1ef34a569c6a97a5ba2516f4e4511d2a93f05f6.tar.xz gsoc2013-epiphany-f1ef34a569c6a97a5ba2516f4e4511d2a93f05f6.tar.zst gsoc2013-epiphany-f1ef34a569c6a97a5ba2516f4e4511d2a93f05f6.zip |
Fix download progress indicator in downloader view.
2004-09-18 Christian Persch <chpe@cvs.gnome.org>
* embed/downloader-view.c: (progress_cell_data_func):
* embed/mozilla/MozDownload.cpp:
* lib/ephy-gui.c: (ephy_gui_menu_position_tree_selection):
Fix download progress indicator in downloader view.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | embed/downloader-view.c | 13 | ||||
-rw-r--r-- | embed/mozilla/MozDownload.cpp | 10 |
3 files changed, 28 insertions, 3 deletions
@@ -1,3 +1,11 @@ +2004-09-18 Christian Persch <chpe@cvs.gnome.org> + + * embed/downloader-view.c: (progress_cell_data_func): + * embed/mozilla/MozDownload.cpp: + * lib/ephy-gui.c: (ephy_gui_menu_position_tree_selection): + + Fix download progress indicator in downloader view. + 2004-09-18 Marco Pesenti Gritti <marco@gnome.org> reviewed by: Christian Persch <chpe@cvs.gnome.org> diff --git a/embed/downloader-view.c b/embed/downloader-view.c index 2029a701c..32975231c 100644 --- a/embed/downloader-view.c +++ b/embed/downloader-view.c @@ -522,6 +522,7 @@ progress_cell_data_func (GtkTreeViewColumn *col, gpointer user_data) { EphyDownloadState state; + const char *text = NULL; int percent; gtk_tree_model_get (model, iter, @@ -532,18 +533,24 @@ progress_cell_data_func (GtkTreeViewColumn *col, switch (state) { case EPHY_DOWNLOAD_INITIALISING: - g_object_set (renderer, "text", Q_("download status|Unknown"), NULL); + text = Q_("download status|Unknown"); break; case EPHY_DOWNLOAD_FAILED: - g_object_set (renderer, "text", Q_("download status|Failed"), NULL); + text = Q_("download status|Failed"); break; case EPHY_DOWNLOAD_DOWNLOADING: case EPHY_DOWNLOAD_PAUSED: - g_object_set (renderer, "text", NULL, "value", percent, NULL); + if (percent == -1) + { + text = Q_("download status|Unknown"); + percent = 0; + } break; default: g_return_if_reached (); } + + g_object_set (renderer, "text", text, "value", percent, NULL); } static void diff --git a/embed/mozilla/MozDownload.cpp b/embed/mozilla/MozDownload.cpp index eec039641..fdb8e3b75 100644 --- a/embed/mozilla/MozDownload.cpp +++ b/embed/mozilla/MozDownload.cpp @@ -298,6 +298,16 @@ MozDownload::OnStateChange (nsIWebProgress *aWebProgress, nsIRequest *aRequest, if (NS_FAILED(aStatus) && NS_SUCCEEDED(mStatus)) mStatus = aStatus; + if (aStateFlags & STATE_START) + { + mDownloadState = EPHY_DOWNLOAD_DOWNLOADING; + + if (mEphyDownload) + { + g_signal_emit_by_name (mEphyDownload, "changed"); + } + } + /* We will get this even in the event of a cancel */ if (aStateFlags & STATE_STOP) { |