From c2b8efbbfc84f022791b6044cc04f0295452f4f2 Mon Sep 17 00:00:00 2001 From: Alfons Hoogervorst Date: Sat, 28 Apr 2001 18:04:08 +0000 Subject: [PATCH] bug sync with sylpheed --- ChangeLog | 6 ++++++ ChangeLog.claws | 1 + ChangeLog.jp | 7 +++++++ src/inc.c | 25 ++++++++++++++----------- src/recv.c | 6 +++--- 5 files changed, 31 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index c19aa2644..2f506988a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-04-28 + + * src/inc.c: made it displays current read bytes to the dialog. + * src/pop.c: recv_write(): call UI function before editing + strings. + 2001-04-27 * src/progressdialog.c: progress_dialog_create(): modified the diff --git a/ChangeLog.claws b/ChangeLog.claws index 9bd8512b0..637f5cf4d 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -9,6 +9,7 @@ 2001-04-28 [alfons] + * bug sync with sylpheed * prefs_common.c: created date format ui for darko * sync with 0.4.65cvs11 * configure.in: corrected to have the new gpg checks diff --git a/ChangeLog.jp b/ChangeLog.jp index 5c4d5b785..b5b21bc28 100644 --- a/ChangeLog.jp +++ b/ChangeLog.jp @@ -1,3 +1,10 @@ +2001-04-28 + + * src/inc.c: ¥À¥¤¥¢¥í¥°¤Ë¸½ºß¤ÎÆɤ߹þ¤ó¤À¥Ð¥¤¥È¿ô¤òɽ¼¨¤¹¤ë¤è¤¦¤Ë + ¤·¤¿¡£ + * src/pop.c: recv_write(): ʸ»úÎó¤òÊÔ½¸¤¹¤ëÁ°¤Ë UI ´Ø¿ô¤ò¸Æ¤Ö¤è¤¦¤Ë + ¤·¤¿¡£ + 2001-04-27 * src/progressdialog.c: progress_dialog_create(): ¥À¥¤¥¢¥í¥°¤Î diff --git a/src/inc.c b/src/inc.c index cbcfe0552..3ce44326a 100644 --- a/src/inc.c +++ b/src/inc.c @@ -670,22 +670,26 @@ static gint connection_check_cb(Automaton *atm) static void inc_pop3_recv_func(SockInfo *sock, gint read_len, gpointer data) { + gchar buf[MSGBUFSIZE]; IncSession *session = (IncSession *)data; Pop3State *state = session->pop3_state; IncProgressDialog *inc_dialog = session->data; ProgressDialog *dialog = inc_dialog->dialog; + gint cur_total; state->cur_msg_bytes += read_len; + cur_total = state->cur_total_bytes + state->cur_msg_bytes; + if (cur_total > state->total_bytes) + cur_total = state->total_bytes; - //g_snprintf(buf, sizeof(buf), - // _("Retrieving message (%d / %d)"), - // state->cur_msg, state->count); - //progress_dialog_set_label(dialog, buf); + g_snprintf(buf, sizeof(buf), + _("Retrieving message (%d / %d) (%d / %d bytes)"), + state->cur_msg, state->count, + cur_total, state->total_bytes); + progress_dialog_set_label(dialog, buf); progress_dialog_set_percentage - (dialog, - (gfloat)(state->cur_total_bytes + state->cur_msg_bytes) / - (gfloat)(state->total_bytes)); + (dialog, (gfloat)cur_total / (gfloat)state->total_bytes); GTK_EVENTS_FLUSH(); } @@ -718,11 +722,10 @@ void inc_progress_update(Pop3State *state, Pop3Phase phase) case POP3_RETR_SEND: case POP3_RETR_RECV: g_snprintf(buf, sizeof(buf), - _("Retrieving message (%d / %d)"), - state->cur_msg, state->count); + _("Retrieving message (%d / %d) (%d / %d bytes)"), + state->cur_msg, state->count, + state->cur_total_bytes, state->total_bytes); progress_dialog_set_label(dialog, buf); - //progress_dialog_set_percentage - // (dialog, (gfloat)state->cur_msg / state->count); progress_dialog_set_percentage (dialog, (gfloat)(state->cur_total_bytes) / diff --git a/src/recv.c b/src/recv.c index 9d27fb7f3..25c814d77 100644 --- a/src/recv.c +++ b/src/recv.c @@ -115,6 +115,9 @@ gint recv_write(SockInfo *sock, FILE *fp) len = strlen(buf); if (len > 1 && buf[0] == '.' && buf[1] == '\r') break; + if (recv_ui_func) + recv_ui_func(sock, len, recv_ui_func_data); + if (len > 1 && buf[len - 1] == '\n' && buf[len - 2] == '\r') { buf[len - 2] = '\n'; buf[len - 1] = '\0'; @@ -127,9 +130,6 @@ gint recv_write(SockInfo *sock, FILE *fp) if (!strncmp(buf, ">From ", 6)) memmove(buf, buf + 1, len--); - if (recv_ui_func) - recv_ui_func(sock, len, recv_ui_func_data); - if (fp && fputs(buf, fp) == EOF) { perror("fputs"); g_warning(_("Can't write to file.\n")); -- 2.25.1