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 c19aa26..2f50698 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 9bd8512..637f5cf 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 5c4d5b7..b5b21bc 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 cbcfe05..3ce4432 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 9d27fb7..25c814d 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"));