bug sync with sylpheed
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Sat, 28 Apr 2001 18:04:08 +0000 (18:04 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Sat, 28 Apr 2001 18:04:08 +0000 (18:04 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
src/inc.c
src/recv.c

index c19aa2644c3cd180889b7ffd3a2b71f9d99171f5..2f506988a926aa1d7c5858f114e59b2b8a1a4209 100644 (file)
--- 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
index 9bd8512b0aa378ef5ae1c9611b7210dafdde1b20..637f5cf4d12d17dfa27f2667265c81c51b9c4872 100644 (file)
@@ -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
index 5c4d5b78585eb215529c6cf783da91f90d52c745..b5b21bc283aea17c53a8ed68d5d040bea6df0da7 100644 (file)
@@ -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(): ¥À¥¤¥¢¥í¥°¤Î
index cbcfe0552ce92add90a01aa70bd243854695757a..3ce44326a729f1f0a6d30721ae833c612a24e386 100644 (file)
--- 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) /
index 9d27fb7f3647dc3e0cc422c7e149b38f491a9833..25c814d773cb88d0294e75d136de43ef0da59459 100644 (file)
@@ -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"));