Mercurial > pidgin.yaz
changeset 9017:8db7732df1fd
[gaim-migrate @ 9793]
(15:53:18) SimGuy: it makes the elapsed time stop counting after the transfer ends, makes the transfer update when it is canceled so the detail view reflects that, and prevents gaim from showing odd negative times remaining if the transfer hasn't started yet
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Sat, 22 May 2004 19:55:39 +0000 |
parents | 53c1e635f11d |
children | bb168141eb5f |
files | src/gtkft.c |
diffstat | 1 files changed, 18 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gtkft.c Sat May 22 18:07:23 2004 +0000 +++ b/src/gtkft.c Sat May 22 19:55:39 2004 +0000 @@ -82,6 +82,7 @@ GtkWidget *filesel; GtkTreeIter iter; time_t start_time; + time_t end_time; gboolean in_list; char *name; @@ -121,7 +122,14 @@ data = GAIM_GTKXFER(xfer); - now = time(NULL); + if (data->end_time == -1 && + (gaim_xfer_is_canceled(xfer) || gaim_xfer_is_completed(xfer))) + data->end_time = time(NULL); + + if (data->end_time != -1) + now = data->end_time; + else + now = time(NULL); kb_sent = gaim_xfer_get_bytes_sent(xfer) / 1024.0; kb_rem = gaim_xfer_get_bytes_remaining(xfer) / 1024.0; @@ -155,6 +163,12 @@ else if (gaim_xfer_is_completed(xfer)) { *time_remaining = g_strdup(_("Finished")); } + else if (gaim_xfer_is_canceled(xfer)) { + *time_remaining = g_strdup(_("Canceled")); + } + else if (kb_sent <= 0) { + *time_remaining = g_strdup(_("Waiting for transfer to begin")); + } else { int h, m, s; int secs_remaining; @@ -805,6 +819,7 @@ gaim_gtkxfer_dialog_show(dialog); data->start_time = time(NULL); + data->end_time = -1; type = gaim_xfer_get_type(xfer); @@ -900,6 +915,8 @@ data = GAIM_GTKXFER(xfer); + update_detailed_info(dialog, xfer); + pixbuf = gtk_widget_render_icon(dialog->window, GAIM_STOCK_FILE_CANCELED, GTK_ICON_SIZE_MENU, NULL);