2006-09-02 [colin] 2.4.0cvs128
authorColin Leroy <colin@colino.net>
Sat, 2 Sep 2006 13:13:03 +0000 (13:13 +0000)
committerColin Leroy <colin@colino.net>
Sat, 2 Sep 2006 13:13:03 +0000 (13:13 +0000)
* src/imap.c
* src/import.c
* src/mainwindow.c
* src/mainwindow.h
Fix warning icon
* src/inc.c
* src/mbox.c
* src/mbox.h
Let proc_mbox know its account, for
account-specific rules

ChangeLog
PATCHSETS
configure.ac
src/imap.c
src/import.c
src/inc.c
src/mainwindow.c
src/mainwindow.h
src/mbox.c
src/mbox.h

index bf4259f..23176c8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2006-09-02 [colin]     2.4.0cvs128
+
+       * src/imap.c
+       * src/import.c
+       * src/mainwindow.c
+       * src/mainwindow.h
+               Fix warning icon
+       * src/inc.c
+       * src/mbox.c
+       * src/mbox.h
+               Let proc_mbox know its account, for
+               account-specific rules
+
 2006-09-01 [colin]     2.4.0cvs127
 
        * src/codeconv.c
index 6f87f7c..66d4057 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.5 -r 1.1.2.6 manual/fr/plugins.xml;  ) > 2.4.0cvs125.patchset
 ( cvs diff -u -r 1.1.2.5 -r 1.1.2.6 manual/fr/account.xml;  ) > 2.4.0cvs126.patchset
 ( cvs diff -u -r 1.17.2.26 -r 1.17.2.27 src/alertpanel.c;  cvs diff -u -r 1.65.2.48 -r 1.65.2.49 src/codeconv.c;  cvs diff -u -r 1.149.2.56 -r 1.149.2.57 src/inc.c;  cvs diff -u -r 1.274.2.142 -r 1.274.2.143 src/mainwindow.c;  cvs diff -u -r 1.39.2.21 -r 1.39.2.22 src/mainwindow.h;  cvs diff -u -r 1.1.4.48 -r 1.1.4.49 src/etpan/imap-thread.c;  cvs diff -u -r 1.1.4.17 -r 1.1.4.18 src/gtk/logwindow.c;  cvs diff -u -r 1.1.4.4 -r 1.1.4.5 src/gtk/logwindow.h;  ) > 2.4.0cvs127.patchset
+( cvs diff -u -r 1.179.2.130 -r 1.179.2.131 src/imap.c;  cvs diff -u -r 1.13.2.17 -r 1.13.2.18 src/import.c;  cvs diff -u -r 1.149.2.57 -r 1.149.2.58 src/inc.c;  cvs diff -u -r 1.274.2.143 -r 1.274.2.144 src/mainwindow.c;  cvs diff -u -r 1.39.2.22 -r 1.39.2.23 src/mainwindow.h;  cvs diff -u -r 1.28.2.25 -r 1.28.2.26 src/mbox.c;  cvs diff -u -r 1.3.2.6 -r 1.3.2.7 src/mbox.h;  ) > 2.4.0cvs128.patchset
index b514b38..0052f9e 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=4
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=127
+EXTRA_VERSION=128
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index a535bca..962cf06 100644 (file)
@@ -896,7 +896,11 @@ try_again:
                        failed = TRUE;
                        goto try_again;
                } else {
-                       alertpanel_error_log(_("Couldn't login to IMAP server %s."), account->recv_server);
+                       if (prefs_common.no_recv_err_panel) {
+                               log_error(_("Couldn't login to IMAP server %s."), account->recv_server);
+                               mainwindow_show_error();
+                       } else
+                               alertpanel_error_log(_("Couldn't login to IMAP server %s."), account->recv_server);
                }               
 
                return;
index 8181f23..f894aea 100644 (file)
@@ -238,7 +238,7 @@ static void import_ok_cb(GtkWidget *widget, gpointer data)
                gtk_widget_grab_focus(dest_entry);
                return;
        } else {
-               import_ok = proc_mbox(dest, mbox, FALSE);
+               import_ok = proc_mbox(dest, mbox, FALSE, NULL);
        }
 
        g_free(mbox);
index c474da4..a1556c4 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -123,7 +123,8 @@ static gint inc_dialog_delete_cb    (GtkWidget      *widget,
                                         gpointer        data);
 
 static gint get_spool                  (FolderItem     *dest,
-                                        const gchar    *mbox);
+                                        const gchar    *mbox,
+                                        PrefsAccount   *account);
 
 static gint inc_spool_account(PrefsAccount *account);
 static gint inc_all_spool(void);
@@ -1096,7 +1097,6 @@ static void inc_put_error(IncState istate, Pop3Session *session)
                err_msg = g_strdup_printf(_("Connection to %s:%d failed."),
                                          SESSION(session)->server, 
                                          SESSION(session)->port);
-               fatal_error = TRUE;
                break;
        case INC_ERROR:
                log_msg = _("Error occurred while processing mail.");
@@ -1122,7 +1122,6 @@ static void inc_put_error(IncState istate, Pop3Session *session)
                break;
        case INC_SOCKET_ERROR:
                log_msg = _("Socket error.");
-               fatal_error = TRUE;
                if (prefs_common.no_recv_err_panel)
                        break;
                err_msg = g_strdup_printf(_("Socket error on connection to %s:%d."),
@@ -1149,6 +1148,7 @@ static void inc_put_error(IncState istate, Pop3Session *session)
                break;
        case INC_AUTH_FAILED:
                log_msg = _("Authentication failed.");
+               fatal_error = TRUE;
                if (prefs_common.no_recv_err_panel)
                        break;
                if (session->error_msg)
@@ -1159,7 +1159,6 @@ static void inc_put_error(IncState istate, Pop3Session *session)
                break;
        case INC_TIMEOUT:
                log_msg = _("Session timed out.");
-               fatal_error = TRUE;
                if (prefs_common.no_recv_err_panel)
                        break;
                err_msg = g_strdup_printf(_("Connection to %s:%d timed out."), 
@@ -1176,6 +1175,9 @@ static void inc_put_error(IncState istate, Pop3Session *session)
                else
                        log_warning("%s\n", log_msg);
        }
+       if (prefs_common.no_recv_err_panel && fatal_error)
+               mainwindow_show_error();
+
        if (err_msg) {
                alertpanel_error_log(err_msg);
                g_free(err_msg);
@@ -1253,7 +1255,7 @@ static gint inc_spool_account(PrefsAccount *account)
                return -1;
        }
        
-       result = get_spool(inbox, mbox);
+       result = get_spool(inbox, mbox, account);
        g_free(mbox);
        
        statusbar_pop_all();
@@ -1284,7 +1286,7 @@ static gint inc_all_spool(void)
        return new_msgs;
 }
 
-static gint get_spool(FolderItem *dest, const gchar *mbox)
+static gint get_spool(FolderItem *dest, const gchar *mbox, PrefsAccount *account)
 {
        gint msgs, size;
        gint lockfd;
@@ -1313,7 +1315,7 @@ static gint get_spool(FolderItem *dest, const gchar *mbox)
        debug_print("Getting new messages from %s into %s...\n",
                    mbox, dest->path);
 
-       msgs = proc_mbox(dest, tmp_mbox, TRUE);
+       msgs = proc_mbox(dest, tmp_mbox, TRUE, account);
 
        g_unlink(tmp_mbox);
        if (msgs >= 0) empty_mbox(mbox);
index b7d8e30..4cf4335 100644 (file)
@@ -1056,16 +1056,10 @@ static gboolean warning_enter_notify(GtkWidget *widget,
        return FALSE;
 }
 
-static gboolean mainwindow_log_error(gpointer source, gpointer data)
+void mainwindow_show_error(void)
 {
-       LogText *logtext = (LogText *) source;
-       MainWindow *mainwin = (MainWindow *) data;
-       if (logtext->type != LOG_ERROR)
-               return FALSE;
-       
+       MainWindow *mainwin = mainwindow_get_mainwindow();
        gtk_widget_show(mainwin->warning_btn);
-       
-       return FALSE;
 }
 
 void mainwindow_clear_error(MainWindow *mainwin)
@@ -1216,10 +1210,6 @@ MainWindow *main_window_create(SeparateType type)
                             _("Some error(s) happened. Click here to view log."), NULL);
        gtk_box_pack_start(GTK_BOX(hbox_stat), warning_btn, FALSE, FALSE, 0);
 
-       /* Disabled for now 
-        * hooks_register_hook(LOG_APPEND_TEXT_HOOKLIST, mainwindow_log_error, mainwin);
-        */
-
        statusbar = statusbar_create();
        gtk_box_pack_start(GTK_BOX(hbox_stat), statusbar, TRUE, TRUE, 0);
 
index 91d41d5..13d80be 100644 (file)
@@ -216,5 +216,6 @@ MainWindow *mainwindow_get_mainwindow             (void);
 void mainwindow_learn                        (MainWindow *mainwin,
                                               gboolean is_spam);
 void mainwindow_jump_to                              (const gchar       *target);
+void mainwindow_show_error                   (void);
 void mainwindow_clear_error                  (MainWindow *mainwin);
 #endif /* __MAINWINDOW_H__ */
index a704db1..03883f0 100644 (file)
@@ -60,7 +60,8 @@
        } \
 }
 
-gint proc_mbox(FolderItem *dest, const gchar *mbox, gboolean apply_filter)
+gint proc_mbox(FolderItem *dest, const gchar *mbox, gboolean apply_filter,
+              PrefsAccount *account)
 /* return values: -1 error, >=0 number of msgs added */
 {
        FILE *mbox_fp;
@@ -248,7 +249,8 @@ gint proc_mbox(FolderItem *dest, const gchar *mbox, gboolean apply_filter)
                statusbar_pop_all();
 
        if (apply_filter) {
-               procmsg_msglist_filter(to_filter, NULL, &filtered, &unfiltered, TRUE);
+               procmsg_msglist_filter(to_filter, account, 
+                               &filtered, &unfiltered, TRUE);
                unfiltered = g_slist_reverse(unfiltered);
                folder_item_move_msgs(dest, unfiltered);
                for (cur = unfiltered; cur; cur = g_slist_next(cur)) {
index ef0b400..ca07f05 100644 (file)
@@ -32,7 +32,8 @@ typedef enum {
 
 gint proc_mbox         (FolderItem     *dest,
                         const gchar    *mbox,
-                        gboolean        apply_filter);
+                        gboolean        apply_filter,
+                        PrefsAccount   *account);
 gint lock_mbox         (const gchar    *base,
                         LockType        type);
 gint unlock_mbox       (const gchar    *base,