sync with 0.9.0cvs8
authorPaul Mangan <paul@claws-mail.org>
Sat, 24 May 2003 17:34:56 +0000 (17:34 +0000)
committerPaul Mangan <paul@claws-mail.org>
Sat, 24 May 2003 17:34:56 +0000 (17:34 +0000)
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.ac
src/inc.c

index 75e76ab..7316ba7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2003-05-23
+
+       * src/inc.c: inc_start(): ask every password before retrieving.
+         Don't popup the redundant error dialog.
+         inc_account_mail()
+         inc_all_account_mail()
+         inc_progress_dialog_set_list(): separated account list display
+         into a new function.
+         inc_progress_dialog_set_label()
+         inc_recv_data_finished()
+         inc_recv_message(): properly update the dialog when RETR finished.
+
 2003-05-22
 
        * src/imap.c:
index e34d83f..549a62f 100644 (file)
@@ -1,3 +1,8 @@
+2003-05-24 [paul]      0.9.0claws1
+
+       * sync with 0.9.0cvs8
+               see ChangeLog 2003-05-23
+
 2003-05-24 [paul]      0.9.0claws
 
        * version 0.9.0claws released
index c5f7179..3961027 100644 (file)
@@ -1,3 +1,15 @@
+2003-05-23
+
+       * src/inc.c: inc_start(): ¼õ¿®Á°¤ËÁ´¤Æ¤Î¥Ñ¥¹¥ï¡¼¥É¤ò¿Ö¤¯¤è¤¦¤Ë¤·¤¿¡£
+         Í¾Ê¬¤Ê¥¨¥é¡¼¥À¥¤¥¢¥í¥°¤ò¥Ý¥Ã¥×¥¢¥Ã¥×¤·¤Ê¤¤¤è¤¦¤Ë¤·¤¿¡£
+         inc_account_mail()
+         inc_all_account_mail()
+         inc_progress_dialog_set_list(): ¥¢¥«¥¦¥ó¥È¥ê¥¹¥È¤Îɽ¼¨¤ò¿·¤·¤¤
+         ´Ø¿ô¤ËʬΥ¡£
+         inc_progress_dialog_set_label()
+         inc_recv_data_finished()
+         inc_recv_message(): RETR ¤¬´°Î»¤·¤¿¤È¤­¤ËÀµ¤·¤¯¥À¥¤¥¢¥í¥°¤ò¹¹¿·¡£
+
 2003-05-22
 
        * src/imap.c:
index cef02f0..e885814 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws
+EXTRA_VERSION=claws1
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 32a6263..c5799bb 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -85,6 +85,7 @@ static gint inc_account_mail          (PrefsAccount           *account,
                                         MainWindow             *mainwin);
 
 static IncProgressDialog *inc_progress_dialog_create   (void);
+static void inc_progress_dialog_set_list(IncProgressDialog     *inc_dialog);
 static void inc_progress_dialog_destroy        (IncProgressDialog      *inc_dialog);
 
 static IncSession *inc_session_new     (PrefsAccount           *account);
@@ -92,6 +93,10 @@ static void inc_session_destroy              (IncSession             *session);
 static gint inc_start                  (IncProgressDialog      *inc_dialog);
 static IncState inc_pop3_session_do    (IncSession             *session);
 
+static void inc_progress_dialog_set_label
+                                       (IncProgressDialog      *inc_dialog,
+                                        IncSession             *inc_session);
+
 static gint inc_recv_data_progressive  (Session        *session,
                                         guint           cur_len,
                                         guint           total_len,
@@ -215,7 +220,6 @@ static gint inc_account_mail(PrefsAccount *account, MainWindow *mainwin)
 {
        IncProgressDialog *inc_dialog;
        IncSession *session;
-       gchar *text[3];
        FolderItem *item = NULL;
        
        if(mainwin && mainwin->summaryview)
@@ -240,13 +244,8 @@ static gint inc_account_mail(PrefsAccount *account, MainWindow *mainwin)
                inc_dialog->queue_list = g_list_append(inc_dialog->queue_list,
                                                       session);
                inc_dialog->mainwin = mainwin;
-               session->data = inc_dialog;
-       
-               text[0] = NULL;
-               text[1] = account->account_name;
-               text[2] = _("Standby");
-               gtk_clist_append(GTK_CLIST(inc_dialog->dialog->clist), text);
-               
+               inc_progress_dialog_set_list(inc_dialog);
+
                if (mainwin) {
                        toolbar_main_set_sensitive(mainwin);
                        main_window_set_menu_sensitive(mainwin);
@@ -333,18 +332,7 @@ void inc_all_account_mail(MainWindow *mainwin, gboolean notify)
        inc_dialog = inc_progress_dialog_create();
        inc_dialog->queue_list = queue_list;
        inc_dialog->mainwin = mainwin;
-       for (list = queue_list; list != NULL; list = list->next) {
-               IncSession *session = list->data;
-               Pop3Session *pop3_session = POP3_SESSION(session->session);
-               gchar *text[3];
-
-               session->data = inc_dialog;
-
-               text[0] = NULL;
-               text[1] = pop3_session->ac_prefs->account_name;
-               text[2] = _("Standby");
-               gtk_clist_append(GTK_CLIST(inc_dialog->dialog->clist), text);
-       }
+       inc_progress_dialog_set_list(inc_dialog);
 
        toolbar_main_set_sensitive(mainwin);
        main_window_set_menu_sensitive(mainwin);
@@ -396,6 +384,24 @@ static IncProgressDialog *inc_progress_dialog_create(void)
        return dialog;
 }
 
+static void inc_progress_dialog_set_list(IncProgressDialog *inc_dialog)
+{
+       GList *list;
+
+       for (list = inc_dialog->queue_list; list != NULL; list = list->next) {
+               IncSession *session = list->data;
+               Pop3Session *pop3_session = POP3_SESSION(session->session);
+               gchar *text[3];
+
+               session->data = inc_dialog;
+
+               text[0] = NULL;
+               text[1] = pop3_session->ac_prefs->account_name;
+               text[2] = _("Standby");
+               gtk_clist_append(GTK_CLIST(inc_dialog->dialog->clist), text);
+       }
+}
+
 static void inc_progress_dialog_clear(IncProgressDialog *inc_dialog)
 {
        progress_dialog_set_value(inc_dialog->dialog, 0.0);
@@ -448,6 +454,7 @@ static gint inc_start(IncProgressDialog *inc_dialog)
 {
        IncSession *session;
        GtkCList *clist = GTK_CLIST(inc_dialog->dialog->clist);
+       GList *qlist;
        Pop3Session *pop3_session;
        IncState inc_state;
        gint num = 0;
@@ -459,14 +466,12 @@ static gint inc_start(IncProgressDialog *inc_dialog)
        MsgInfo *msginfo;
        GSList *msglist, *msglist_element;
 
-       while (inc_dialog->queue_list != NULL) {
-               session = inc_dialog->queue_list->data;
-               pop3_session = POP3_SESSION(session->session);
-
-               inc_progress_dialog_clear(inc_dialog);
-
-               gtk_clist_moveto(clist, num, -1, 1.0, 0.0);
+       qlist = inc_dialog->queue_list;
+       while (qlist != NULL) {
+               GList *next = qlist->next;
 
+               session = qlist->data;
+               pop3_session = POP3_SESSION(session->session); 
                pop3_session->user = g_strdup(pop3_session->ac_prefs->userid);
                if (pop3_session->ac_prefs->passwd)
                        pop3_session->pass =
@@ -477,26 +482,46 @@ static gint inc_start(IncProgressDialog *inc_dialog)
                else {
                        gchar *pass;
 
+                       if (inc_dialog->show_dialog)
+                               manage_window_focus_in
+                                       (inc_dialog->dialog->window,
+                                        NULL, NULL);
+
                        pass = input_dialog_query_password
                                (pop3_session->ac_prefs->recv_server,
                                 pop3_session->user);
 
-                       if (inc_dialog->mainwin && inc_dialog->show_dialog)
-                               manage_window_focus_in
-                                       (inc_dialog->mainwin->window,
+                       if (inc_dialog->show_dialog)
+                               manage_window_focus_out
+                                       (inc_dialog->dialog->window,
                                         NULL, NULL);
+
                        if (pass) {
                                pop3_session->ac_prefs->tmp_pass =
                                        g_strdup(pass);
                                pop3_session->pass = pass;
-                       } else {
-                               inc_session_destroy(session);
-                               inc_dialog->queue_list = g_list_remove
-                                       (inc_dialog->queue_list, session);
-                               continue;
                        }
                }
 
+               qlist = next;
+       }
+
+       for (; inc_dialog->queue_list != NULL; num++) {
+               session = inc_dialog->queue_list->data;
+               pop3_session = POP3_SESSION(session->session);
+
+               if (pop3_session->pass == NULL) {
+                       gtk_clist_set_pixmap(clist, num, 0, okxpm, okxpmmask);
+                       gtk_clist_set_text(clist, num, 2, _("Cancelled"));
+                       inc_session_destroy(session);
+                       inc_dialog->queue_list =
+                               g_list_remove(inc_dialog->queue_list, session);
+                       continue;
+               }
+
+               inc_progress_dialog_clear(inc_dialog);
+               gtk_clist_moveto(clist, num, -1, 1.0, 0.0);
+
                gtk_clist_set_pixmap(clist, num, 0, currentxpm, currentxpmmask);
                gtk_clist_set_text(clist, num, 2, _("Retrieving"));
 
@@ -621,8 +646,6 @@ static gint inc_start(IncProgressDialog *inc_dialog)
                inc_session_destroy(session);
                inc_dialog->queue_list =
                        g_list_remove(inc_dialog->queue_list, session);
-
-               num++;
        }
 
        if (new_msgs > 0)
@@ -633,6 +656,7 @@ static gint inc_start(IncProgressDialog *inc_dialog)
 
        progress_dialog_set_label(inc_dialog->dialog, fin_msg);
 
+#if 0
        if (error_num && !prefs_common.no_recv_err_panel) {
                if (inc_dialog->show_dialog)
                        manage_window_focus_in(inc_dialog->dialog->window,
@@ -642,6 +666,7 @@ static gint inc_start(IncProgressDialog *inc_dialog)
                        manage_window_focus_out(inc_dialog->dialog->window,
                                                NULL, NULL);
        }
+#endif
 
        while (inc_dialog->queue_list != NULL) {
                session = inc_dialog->queue_list->data;
@@ -760,6 +785,63 @@ static IncState inc_pop3_session_do(IncSession *session)
        return session->inc_state;
 }
 
+static void inc_progress_dialog_set_label(IncProgressDialog *inc_dialog,
+                                         IncSession *inc_session)
+{
+       gchar buf[MSGBUFSIZE];
+       ProgressDialog *dialog = inc_dialog->dialog;
+       Pop3Session *session;
+
+       g_return_if_fail(inc_session != NULL);
+
+       session = POP3_SESSION(inc_session->session);
+
+       switch (session->state) {
+       case POP3_GREETING:
+               break;
+       case POP3_GETAUTH_USER:
+       case POP3_GETAUTH_PASS:
+       case POP3_GETAUTH_APOP:
+               progress_dialog_set_label(dialog, _("Authenticating..."));
+               break;
+       case POP3_GETRANGE_STAT:
+               progress_dialog_set_label
+                       (dialog, _("Getting the number of new messages (STAT)..."));
+               break;
+       case POP3_GETRANGE_LAST:
+               progress_dialog_set_label
+                       (dialog, _("Getting the number of new messages (LAST)..."));
+               break;
+       case POP3_GETRANGE_UIDL:
+               progress_dialog_set_label
+                       (dialog, _("Getting the number of new messages (UIDL)..."));
+               break;
+       case POP3_GETSIZE_LIST:
+               progress_dialog_set_label
+                       (dialog, _("Getting the size of messages (LIST)..."));
+               break;
+       case POP3_RETR:
+               inc_recv_data_progressive
+                       (SESSION(session), 0,
+                        session->msg[session->cur_msg].size,
+                        inc_session);
+               break;
+       case POP3_DELETE:
+               if (session->msg[session->cur_msg].recv_time <
+                       session->current_time) {
+                       g_snprintf(buf, sizeof(buf), _("Deleting message %d"),
+                                  session->cur_msg);
+                       progress_dialog_set_label(dialog, buf);
+               }
+               break;
+       case POP3_LOGOUT:
+               progress_dialog_set_label(dialog, _("Quitting"));
+               break;
+       default:
+               break;
+       }
+}
+
 static gint inc_recv_data_progressive(Session *session, guint cur_len,
                                      guint total_len, gpointer data)
 {
@@ -801,69 +883,26 @@ static gint inc_recv_data_progressive(Session *session, guint cur_len,
 static gint inc_recv_data_finished(Session *session, guint len, gpointer data)
 {
        IncSession *inc_session = (IncSession *)data;
+       IncProgressDialog *inc_dialog;
 
        g_return_val_if_fail(inc_session != NULL, -1);
 
+       inc_dialog = (IncProgressDialog *)inc_session->data;
        inc_recv_data_progressive(session, 0, len, inc_session);
+       inc_progress_dialog_set_label(inc_dialog, inc_session);
+
        return 0;
 }
 
 static gint inc_recv_message(Session *session, const gchar *msg, gpointer data)
 {
-       gchar buf[MSGBUFSIZE];
        IncSession *inc_session = (IncSession *)data;
-       Pop3Session *pop3_session = POP3_SESSION(session);
        IncProgressDialog *inc_dialog;
-       ProgressDialog *dialog;
 
        g_return_val_if_fail(inc_session != NULL, -1);
 
        inc_dialog = (IncProgressDialog *)inc_session->data;
-       dialog = inc_dialog->dialog;
-
-       switch (pop3_session->state) {
-       case POP3_GREETING:
-               break;
-       case POP3_GETAUTH_USER:
-       case POP3_GETAUTH_PASS:
-       case POP3_GETAUTH_APOP:
-               progress_dialog_set_label(dialog, _("Authenticating..."));
-               break;
-       case POP3_GETRANGE_STAT:
-               progress_dialog_set_label
-                       (dialog, _("Getting the number of new messages (STAT)..."));
-               break;
-       case POP3_GETRANGE_LAST:
-               progress_dialog_set_label
-                       (dialog, _("Getting the number of new messages (LAST)..."));
-               break;
-       case POP3_GETRANGE_UIDL:
-               progress_dialog_set_label
-                       (dialog, _("Getting the number of new messages (UIDL)..."));
-               break;
-       case POP3_GETSIZE_LIST:
-               progress_dialog_set_label
-                       (dialog, _("Getting the size of messages (LIST)..."));
-               break;
-       case POP3_RETR:
-               inc_recv_data_progressive
-                       (session, 0,
-                        pop3_session->msg[pop3_session->cur_msg].size, data);
-               break;
-       case POP3_DELETE:
-               if (pop3_session->msg[pop3_session->cur_msg].recv_time <
-                       pop3_session->current_time) {
-                       g_snprintf(buf, sizeof(buf), _("Deleting message %d"),
-                                  pop3_session->cur_msg);
-                       progress_dialog_set_label(dialog, buf);
-               }
-               break;
-       case POP3_LOGOUT:
-               progress_dialog_set_label(dialog, _("Quitting"));
-               break;
-       default:
-               break;
-       }
+       inc_progress_dialog_set_label(inc_dialog, inc_session);
 
        return 0;
 }