sync with 0.9.7cvs8
authorPaul Mangan <paul@claws-mail.org>
Sat, 6 Dec 2003 11:34:59 +0000 (11:34 +0000)
committerPaul Mangan <paul@claws-mail.org>
Sat, 6 Dec 2003 11:34:59 +0000 (11:34 +0000)
21 files changed:
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.ac
src/Makefile.am
src/html.c
src/imap.c
src/mainwindow.c
src/messageview.c
src/messageview.h
src/news.c
src/pixmaps/offline.xpm [new file with mode: 0644]
src/pixmaps/online.xpm [new file with mode: 0644]
src/pixmaps/work_offline.xpm [deleted file]
src/pixmaps/work_online.xpm [deleted file]
src/procmsg.c
src/stock_pixmap.c
src/stock_pixmap.h
src/summaryview.c
src/textview.c
src/textview.h

index fdfffeb..3e831f6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2003-12-06
+
+       * src/mainwindow.[ch]: added online switch button to the statusbar,
+         and "/File/Work offline" in the menu.
+       * src/pixmaps/offline.xpm
+         src/pixmaps/online.xpm: new (borrowed from
+         themes/classic/communicator/icons/ in Mozilla).
+       * src/stock_pixmap.[ch]: added online.xpm and offline.xpm.
+       * src/textview.[ch]: textview_show_error(): new.
+       * src/summaryview.c: summary_display_msg_full(): update marks only
+         if messages are displayed.
+       * src/prefs_common.[ch]: added PrefsCommon::online_mode.
+       * src/news.c: news_session_get()
+         src/imap.c: imap_session_get(): return NULL when in offline mode.
+       * src/messageview.[ch]: messageview_show(): return status whether
+         messages are successfully displayed. Display error messages in
+         the view when failed.
+       * src/procmsg.c:
+         procmsg_get_message_file()
+         procmsg_open_message(): don't output warnings when fetch failed.
+
+2003-12-04
+
+       * src/html.c: html_get_tag(): support attributes which don't have
+         values.
+
 2003-12-04
 
        * src/codeconv.c: conv_get_code_conv_func(): return conv_latintodisp
index a582ff6..4a6440a 100644 (file)
@@ -1,3 +1,9 @@
+2003-12-06 [paul]      0.9.7claws27
+
+       * partial sync with 0.9.7cvs8
+               leaving claws' online/offline more or less intact
+               see ChangeLog 2003-12-04 and 2003-12-06
+
 2003-12-05 [christoph] 0.9.7claws26
 
        * src/messageview.c
index 20be4dc..6e74d7c 100644 (file)
@@ -1,3 +1,30 @@
+2003-12-06
+
+       * src/mainwindow.[ch]: ¥¹¥Æ¡¼¥¿¥¹¥Ð¡¼¤Ë¥ª¥ó¥é¥¤¥ó¥¹¥¤¥Ã¥Á¥Ü¥¿¥ó¤ò
+         Äɲä·¡¢¥á¥Ë¥å¡¼¤Ë¡Ö/¥Õ¥¡¥¤¥ë/¥ª¥Õ¥é¥¤¥ó¤Ë¤¹¤ë¡×¤òÄɲá£
+       * src/pixmaps/offline.xpm
+         src/pixmaps/online.xpm: ¿·µ¬(Mozilla ¤Î
+         themes/classic/communicator/icons/ ¤«¤éÇÒ¼Ú)¡£
+       * src/stock_pixmap.[ch]: online.xpm ¤È offline.xpm ¤òÄɲá£
+       * src/textview.[ch]: textview_show_error(): ¿·µ¬¡£
+       * src/summaryview.c: summary_display_msg_full(): ¥á¥Ã¥»¡¼¥¸¤¬É½¼¨
+         ¤µ¤ì¤¿¾ì¹ç¤Î¤ß¥Þ¡¼¥¯¤ò¹¹¿·¡£
+       * src/prefs_common.[ch]: PrefsCommon::online_mode ¤òÄɲá£
+       * src/news.c: news_session_get()
+         src/imap.c: imap_session_get(): ¥ª¥Õ¥é¥¤¥ó¥â¡¼¥É¤Î¤È¤­¤Ï NULL ¤ò
+         ÊÖ¤¹¤è¤¦¤Ë¤·¤¿¡£
+       * src/messageview.[ch]: messageview_show(): ¥á¥Ã¥»¡¼¥¸¤¬É½¼¨¤Ç¤­¤¿
+         ¤«¤É¤¦¤«¤Î¥¹¥Æ¡¼¥¿¥¹¤òÊÖ¤¹¤è¤¦¤Ë¤·¤¿¡£¼ºÇÔ¤·¤¿¤È¤­¤Ï¥¨¥é¡¼
+         ¥á¥Ã¥»¡¼¥¸¤ò¥Ó¥å¡¼¤Ëɽ¼¨¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+       * src/procmsg.c:
+         procmsg_get_message_file()
+         procmsg_open_message(): ¼èÆÀ¤Ë¼ºÇÔ¤·¤¿¤È¤­¤Ë·Ù¹ð¤òɽ¼¨¤·¤Ê¤¤¤è¤¦¤Ë
+         ¤·¤¿¡£
+
+2003-12-04
+
+       * src/html.c: html_get_tag(): Ãͤò»ý¤¿¤Ê¤¤Â°À­¤ËÂбþ¡£
+
 2003-12-04
 
        * src/codeconv.c: conv_get_code_conv_func(): src_charset ¤È¸½ºß¤Î
index 0677787..0e65137 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=7
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=26
+EXTRA_VERSION=27
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index 337cba8..11fd541 100644 (file)
@@ -311,6 +311,8 @@ EXTRA_DIST = \
        pixmaps/notice_error.xpm \
        pixmaps/notice_note.xpm \
        pixmaps/notice_warn.xpm \
+       pixmaps/offline.xpm \
+       pixmaps/online.xpm \
        pixmaps/outbox_hrm.xpm \
        pixmaps/outbox.xpm \
        pixmaps/paste.xpm \
@@ -332,9 +334,7 @@ EXTRA_DIST = \
        pixmaps/trash.xpm \
        pixmaps/unread.xpm \
        pixmaps/up_arrow.xpm \
-       pixmaps/vcard.xpm \
-       pixmaps/work_offline.xpm \
-       pixmaps/work_online.xpm
+       pixmaps/vcard.xpm
 
 INCLUDES = \
        -Icommon \
index 3f708a3..f10c55b 100644 (file)
@@ -551,36 +551,38 @@ static HTMLTag *html_get_tag(const gchar *str)
 
                while (isspace(*tmpp)) tmpp++;
                attr_name = tmpp;
-               if ((p = strchr(attr_name, '=')) == NULL) {
-                       g_warning("html_get_tag(): syntax error in tag: '%s'\n", str);
-                       return tag;
+
+               while (*tmpp != '\0' && !isspace(*tmpp) && *tmpp != '=') tmpp++;
+               if (*tmpp != '\0' && *tmpp != '=') {
+                       *tmpp++ = '\0';
+                       while (isspace(*tmpp)) tmpp++;
                }
-               tmpp = p;
-               *tmpp++ = '\0';
-               while (isspace(*tmpp)) tmpp++;
 
-               if (*tmpp == '\0') {
-                       g_warning("html_get_tag(): syntax error in tag: '%s'\n", str);
-                       return tag;
-               } else if (*tmpp == '"' || *tmpp == '\'') {
-                       /* name="value" */
-                       quote = *tmpp;
-                       tmpp++;
-                       attr_value = tmpp;
-                       if ((p = strchr(attr_value, quote)) == NULL) {
-                               g_warning("html_get_tag(): syntax error in tag: '%s'\n", str);
-                               return tag;
-                       }
-                       tmpp = p;
+               if (*tmpp == '=') {
                        *tmpp++ = '\0';
                        while (isspace(*tmpp)) tmpp++;
-               } else {
-                       /* name=value */
-                       attr_value = tmpp;
-                       while (*tmpp != '\0' && !isspace(*tmpp)) tmpp++;
-                       if (*tmpp != '\0')
+
+                       if (*tmpp == '"' || *tmpp == '\'') {
+                               /* name="value" */
+                               quote = *tmpp;
+                               tmpp++;
+                               attr_value = tmpp;
+                               if ((p = strchr(attr_value, quote)) == NULL) {
+                                       g_warning("html_get_tag(): syntax error in tag: '%s'\n", str);
+                                       return tag;
+                               }
+                               tmpp = p;
                                *tmpp++ = '\0';
-               }
+                               while (isspace(*tmpp)) tmpp++;
+                       } else {
+                               /* name=value */
+                               attr_value = tmpp;
+                               while (*tmpp != '\0' && !isspace(*tmpp)) tmpp++;
+                               if (*tmpp != '\0')
+                                       *tmpp++ = '\0';
+                       }
+               } else
+                       attr_value = "";
 
                g_strchomp(attr_name);
                g_strdown(attr_name);
index 492f692..656b503 100644 (file)
 #include "md5.h"
 #include "base64.h"
 #include "utils.h"
+#include "prefs_common.h"
 #include "inputdialog.h"
 #include "log.h"
 #include "remotefolder.h"
+#include "alertpanel.h"
 
 typedef struct _IMAPFolder     IMAPFolder;
 typedef struct _IMAPSession    IMAPSession;
@@ -616,6 +618,9 @@ static IMAPSession *imap_session_get(Folder *folder)
        g_return_val_if_fail(folder != NULL, NULL);
        g_return_val_if_fail(FOLDER_CLASS(folder) == &imap_class, NULL);
        g_return_val_if_fail(folder->account != NULL, NULL);
+       
+       if (prefs_common.work_offline)
+               return NULL;
 
        /* Make sure we have a session */
        if (rfolder->session != NULL) {
index 5aeb739..91afc98 100644 (file)
@@ -39,6 +39,7 @@
 #include <gtk/gtkhandlebox.h>
 #include <gtk/gtktoolbar.h>
 #include <gtk/gtkbutton.h>
+#include <gtk/gtktooltips.h>
 #include <string.h>
 
 #include "intl.h"
@@ -432,11 +433,12 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {N_("/_File/_Import mbox file..."),     NULL, import_mbox_cb, 0, NULL},
        {N_("/_File/_Export to mbox file..."),  NULL, export_mbox_cb, 0, NULL},
        {N_("/_File/Empty _trash"),             "<shift>D", empty_trash_cb, 0, NULL},
-       {N_("/_File/_Work offline"),            "<control>W", toggle_work_offline_cb, 0, "<ToggleItem>"},                                               
        {N_("/_File/---"),                      NULL, NULL, 0, "<Separator>"},
        {N_("/_File/_Save as..."),              "<control>S", save_as_cb, 0, NULL},
        {N_("/_File/_Print..."),                NULL, print_cb, 0, NULL},
        {N_("/_File/---"),                      NULL, NULL, 0, "<Separator>"},
+       {N_("/_File/_Work offline"),            "<control>W", toggle_work_offline_cb, 0, "<ToggleItem>"},
+       {N_("/_File/---"),                      NULL, NULL, 0, "<Separator>"},
        /* {N_("/_File/_Close"),                "<alt>W", app_exit_cb, 0, NULL}, */
        {N_("/_File/E_xit"),                    "<control>Q", app_exit_cb, 0, NULL},
 
@@ -829,16 +831,17 @@ MainWindow *main_window_create(SeparateType type)
        gtk_widget_set_usize(progressbar, 120, 1);
        gtk_box_pack_start(GTK_BOX(hbox_stat), progressbar, FALSE, FALSE, 0);
 
-       online_pixmap = stock_pixmap_widget(hbox_stat, STOCK_PIXMAP_WORK_ONLINE);
-       offline_pixmap = stock_pixmap_widget(hbox_stat, STOCK_PIXMAP_WORK_OFFLINE);
+       online_pixmap = stock_pixmap_widget(hbox_stat, STOCK_PIXMAP_ONLINE);
+       offline_pixmap = stock_pixmap_widget(hbox_stat, STOCK_PIXMAP_OFFLINE);
        online_tip = gtk_tooltips_new();
        online_switch = gtk_button_new ();
-       gtk_tooltips_set_tip(GTK_TOOLTIPS(online_tip),
-                            online_switch, _("Go offline"), NULL);
+       gtk_tooltips_set_tip(GTK_TOOLTIPS(online_tip),online_switch, 
+                            _("You are online. Click the icon to go offline"), NULL);
        offline_tip = gtk_tooltips_new();
        offline_switch = gtk_button_new ();
-       gtk_tooltips_set_tip(GTK_TOOLTIPS(offline_tip),
-                            offline_switch, _("Go online"), NULL);
+       gtk_tooltips_set_tip(GTK_TOOLTIPS(offline_tip),offline_switch, 
+                            _("You are offline. Click the icon to go online"),
+                            NULL);
        gtk_container_add (GTK_CONTAINER(online_switch), online_pixmap);
        gtk_button_set_relief (GTK_BUTTON(online_switch), GTK_RELIEF_NONE);
        gtk_signal_connect (GTK_OBJECT(online_switch), "clicked", (GtkSignalFunc)online_switch_clicked, mainwin);
@@ -1131,13 +1134,13 @@ void main_window_reflect_prefs_all_real(gboolean pixmap_theme_changed)
                        folderview_reflect_prefs_pixmap_theme(mainwin->folderview);
                        summary_reflect_prefs_pixmap_theme(mainwin->summaryview);
 
-                       pixmap = stock_pixmap_widget(mainwin->hbox_stat, STOCK_PIXMAP_WORK_ONLINE);
+                       pixmap = stock_pixmap_widget(mainwin->hbox_stat, STOCK_PIXMAP_ONLINE);
                        gtk_container_remove(GTK_CONTAINER(mainwin->online_switch), 
                                             mainwin->online_pixmap);
                        gtk_container_add (GTK_CONTAINER(mainwin->online_switch), pixmap);
                        gtk_widget_show(pixmap);
                        mainwin->online_pixmap = pixmap;
-                       pixmap = stock_pixmap_widget(mainwin->hbox_stat, STOCK_PIXMAP_WORK_OFFLINE);
+                       pixmap = stock_pixmap_widget(mainwin->hbox_stat, STOCK_PIXMAP_OFFLINE);
                        gtk_container_remove(GTK_CONTAINER(mainwin->offline_switch), 
                                             mainwin->offline_pixmap);
                        gtk_container_add (GTK_CONTAINER(mainwin->offline_switch), pixmap);
index d0ad10b..0126e3f 100644 (file)
@@ -641,16 +641,19 @@ static MimeInfo *find_encrypted_part(MimeInfo *rootinfo)
        return encinfo;
 }
 
-void messageview_show(MessageView *messageview, MsgInfo *msginfo,
+gint messageview_show(MessageView *messageview, MsgInfo *msginfo,
                      gboolean all_headers)
 {
        gchar *file;
        MimeInfo *mimeinfo, *encinfo;
 
-       g_return_if_fail(msginfo != NULL);
+       g_return_val_if_fail(msginfo != NULL, -1);
 
        mimeinfo = procmime_scan_message(msginfo);
-       g_return_if_fail(mimeinfo != NULL);
+       if (!mimeinfo) {
+               textview_show_error(messageview->mimeview->textview);
+               return -1;
+       }
 
        while ((encinfo = find_encrypted_part(mimeinfo)) != NULL) {
                debug_print("decrypting message part\n");
@@ -662,7 +665,8 @@ void messageview_show(MessageView *messageview, MsgInfo *msginfo,
        if (!file) {
                g_warning("can't get message file path.\n");
                procmime_mimeinfo_free_all(mimeinfo);
-               return;
+               textview_show_error(messageview->mimeview->textview);
+               return -1;
        }
 
        if (messageview->msginfo != msginfo) {
@@ -684,6 +688,8 @@ void messageview_show(MessageView *messageview, MsgInfo *msginfo,
                noticeview_hide(messageview->noticeview);
 
        g_free(file);
+
+       return 0;
 }
 
 void messageview_reflect_prefs_pixmap_theme(void)
index f32444e..d4ba73a 100644 (file)
@@ -23,7 +23,7 @@
 #include <glib.h>
 #include <gtk/gtkwidget.h>
 
-typedef struct _MessageView            MessageView;
+typedef struct _MessageView    MessageView;
 
 #include "mainwindow.h"
 #include "headerview.h"
@@ -71,7 +71,7 @@ MessageView *messageview_create                       (MainWindow     *mainwin);
 MessageView *messageview_create_with_new_window        (MainWindow     *mainwin);
 
 void messageview_init                          (MessageView    *messageview);
-void messageview_show                          (MessageView    *messageview,
+gint messageview_show                          (MessageView    *messageview,
                                                 MsgInfo        *msginfo,
                                                 gboolean        all_headers);
 void messageview_clear                         (MessageView    *messageview);
index adecc70..9dc2012 100644 (file)
@@ -49,6 +49,7 @@
 #include "log.h"
 #include "progressindicator.h"
 #include "remotefolder.h"
+#include "alertpanel.h"
 #if USE_OPENSSL
 #  include "ssl.h"
 #endif
@@ -280,6 +281,11 @@ static NNTPSession *news_session_get(Folder *folder)
        g_return_val_if_fail(FOLDER_CLASS(folder) == &news_class, NULL);
        g_return_val_if_fail(folder->account != NULL, NULL);
 
+       if (prefs_common.work_offline) {
+               g_print("offline mode\n");
+               return NULL;
+       }
+
        if (!rfolder->session) {
                rfolder->session = news_session_new_for_folder(folder);
                return NNTP_SESSION(rfolder->session);
diff --git a/src/pixmaps/offline.xpm b/src/pixmaps/offline.xpm
new file mode 100644 (file)
index 0000000..baa36a4
--- /dev/null
@@ -0,0 +1,228 @@
+/* XPM */
+static char * offline_xpm[] = {
+"26 12 213 2",
+"      c None",
+".     c #FFFFFF",
+"+     c #FFFFCC",
+"@     c #FFFF99",
+"#     c #FFFF66",
+"$     c #FFFF33",
+"%     c #FFFF00",
+"&     c #FFCCFF",
+"*     c #FFCCCC",
+"=     c #FFCC99",
+"-     c #FFCC66",
+";     c #FFCC33",
+">     c #FFCC00",
+",     c #FF99FF",
+"'     c #FF99CC",
+")     c #FF9999",
+"!     c #FF9966",
+"~     c #FF9933",
+"{     c #FF9900",
+"]     c #FF66FF",
+"^     c #FF66CC",
+"/     c #FF6699",
+"(     c #FF6666",
+"_     c #FF6633",
+":     c #FF6600",
+"<     c #FF33FF",
+"[     c #FF33CC",
+"}     c #FF3399",
+"|     c #FF3366",
+"1     c #FF3333",
+"2     c #FF3300",
+"3     c #FF00FF",
+"4     c #FF00CC",
+"5     c #FF0099",
+"6     c #FF0066",
+"7     c #FF0033",
+"8     c #FF0000",
+"9     c #CCFFFF",
+"0     c #CCFFCC",
+"a     c #CCFF99",
+"b     c #CCFF66",
+"c     c #CCFF33",
+"d     c #CCFF00",
+"e     c #CCCCFF",
+"f     c #CCCCCC",
+"g     c #CCCC99",
+"h     c #CCCC66",
+"i     c #CCCC33",
+"j     c #CCCC00",
+"k     c #CC99FF",
+"l     c #CC99CC",
+"m     c #CC9999",
+"n     c #CC9966",
+"o     c #CC9933",
+"p     c #CC9900",
+"q     c #CC66FF",
+"r     c #CC66CC",
+"s     c #CC6699",
+"t     c #CC6666",
+"u     c #CC6633",
+"v     c #CC6600",
+"w     c #CC33FF",
+"x     c #CC33CC",
+"y     c #CC3399",
+"z     c #CC3366",
+"A     c #CC3333",
+"B     c #CC3300",
+"C     c #CC00FF",
+"D     c #CC00CC",
+"E     c #CC0099",
+"F     c #CC0066",
+"G     c #CC0033",
+"H     c #CC0000",
+"I     c #99FFFF",
+"J     c #99FFCC",
+"K     c #99FF99",
+"L     c #99FF66",
+"M     c #99FF33",
+"N     c #99FF00",
+"O     c #99CCFF",
+"P     c #99CCCC",
+"Q     c #99CC99",
+"R     c #99CC66",
+"S     c #99CC33",
+"T     c #99CC00",
+"U     c #9999FF",
+"V     c #9999CC",
+"W     c #999999",
+"X     c #999966",
+"Y     c #999933",
+"Z     c #999900",
+"`     c #9966FF",
+" .    c #9966CC",
+"..    c #996699",
+"+.    c #996666",
+"@.    c #996633",
+"#.    c #996600",
+"$.    c #9933FF",
+"%.    c #9933CC",
+"&.    c #993399",
+"*.    c #993366",
+"=.    c #993333",
+"-.    c #993300",
+";.    c #9900FF",
+">.    c #9900CC",
+",.    c #990099",
+"'.    c #990066",
+").    c #990033",
+"!.    c #990000",
+"~.    c #66FFFF",
+"{.    c #66FFCC",
+"].    c #66FF99",
+"^.    c #66FF66",
+"/.    c #66FF33",
+"(.    c #66FF00",
+"_.    c #66CCFF",
+":.    c #66CCCC",
+"<.    c #66CC99",
+"[.    c #66CC66",
+"}.    c #66CC33",
+"|.    c #66CC00",
+"1.    c #6699FF",
+"2.    c #6699CC",
+"3.    c #669999",
+"4.    c #669966",
+"5.    c #669933",
+"6.    c #669900",
+"7.    c #6666FF",
+"8.    c #6666CC",
+"9.    c #666699",
+"0.    c #666666",
+"a.    c #666633",
+"b.    c #666600",
+"c.    c #6633FF",
+"d.    c #6633CC",
+"e.    c #663399",
+"f.    c #663366",
+"g.    c #663333",
+"h.    c #663300",
+"i.    c #6600FF",
+"j.    c #6600CC",
+"k.    c #660099",
+"l.    c #660066",
+"m.    c #660033",
+"n.    c #660000",
+"o.    c #33FFFF",
+"p.    c #33FFCC",
+"q.    c #33FF99",
+"r.    c #33FF66",
+"s.    c #33FF33",
+"t.    c #33FF00",
+"u.    c #33CCFF",
+"v.    c #33CCCC",
+"w.    c #33CC99",
+"x.    c #33CC66",
+"y.    c #33CC33",
+"z.    c #33CC00",
+"A.    c #3399FF",
+"B.    c #3399CC",
+"C.    c #339999",
+"D.    c #339966",
+"E.    c #339933",
+"F.    c #339900",
+"G.    c #3366FF",
+"H.    c #3366CC",
+"I.    c #336699",
+"J.    c #336666",
+"K.    c #336633",
+"L.    c #336600",
+"M.    c #3333FF",
+"N.    c #3333CC",
+"O.    c #333399",
+"P.    c #333366",
+"Q.    c #333333",
+"R.    c #333300",
+"S.    c #3300FF",
+"T.    c #3300CC",
+"U.    c #330099",
+"V.    c #330066",
+"W.    c #330033",
+"X.    c #330000",
+"Y.    c #00FFFF",
+"Z.    c #00FFCC",
+"`.    c #00FF99",
+" +    c #00FF66",
+".+    c #00FF33",
+"++    c #00FF00",
+"@+    c #00CCFF",
+"#+    c #00CCCC",
+"$+    c #00CC99",
+"%+    c #00CC66",
+"&+    c #00CC33",
+"*+    c #00CC00",
+"=+    c #0099FF",
+"-+    c #0099CC",
+";+    c #009999",
+">+    c #009966",
+",+    c #009933",
+"'+    c #009900",
+")+    c #0066FF",
+"!+    c #0066CC",
+"~+    c #006699",
+"{+    c #006666",
+"]+    c #006633",
+"^+    c #006600",
+"/+    c #0033FF",
+"(+    c #0033CC",
+"_+    c #003399",
+":+    c #003366",
+"<+    c #003333",
+"[+    c #003300",
+"}+    c #0000FF",
+"|+    c #0000CC",
+"                                                    ",
+"              P.P.P.P.P.                            ",
+"            P.. e |+e |+        P.P.P.P.            ",
+"            P.e U P.8.|+          P.. U P.          ",
+"          P.P.U U P.e |+        P.|+e U P.P.        ",
+"P.P.P.P.P.e P.U U P.8.|+          |+U U P.e P.P.P.P.",
+"U U U U P.U P.U U P.e |+        P.|+U U P.U P.8.8.8.",
+"P.P.P.P.P.8.P.U U P.8.|+          |+U U P.8.P.P.P.P.",
+"          P.P.U U P.e |+        P.|+U U P.P.        ",
+"            P.U U P.P.|+          P.8.8.P.          ",
+"            P.8.8.P.W P.        P.P.P.P.            ",
+"              P.P.P.P.P.                            "};
diff --git a/src/pixmaps/online.xpm b/src/pixmaps/online.xpm
new file mode 100644 (file)
index 0000000..ed50865
--- /dev/null
@@ -0,0 +1,232 @@
+/* XPM */
+static char * online_xpm[] = {
+"26 12 217 2",
+"      c None",
+".     c #FFFFFF",
+"+     c #FFFFCC",
+"@     c #FFFF99",
+"#     c #FFFF66",
+"$     c #FFFF33",
+"%     c #FFFF00",
+"&     c #FFCCFF",
+"*     c #FFCCCC",
+"=     c #FFCC99",
+"-     c #FFCC66",
+";     c #FFCC33",
+">     c #FFCC00",
+",     c #FF99FF",
+"'     c #FF99CC",
+")     c #FF9999",
+"!     c #FF9966",
+"~     c #FF9933",
+"{     c #FF9900",
+"]     c #FF66FF",
+"^     c #FF66CC",
+"/     c #FF6699",
+"(     c #FF6666",
+"_     c #FF6633",
+":     c #FF6600",
+"<     c #FF33FF",
+"[     c #FF33CC",
+"}     c #FF3399",
+"|     c #FF3366",
+"1     c #FF3333",
+"2     c #FF3300",
+"3     c #FF00FF",
+"4     c #FF00CC",
+"5     c #FF0099",
+"6     c #FF0066",
+"7     c #FF0033",
+"8     c #FF0000",
+"9     c #CCFFFF",
+"0     c #CCFFCC",
+"a     c #CCFF99",
+"b     c #CCFF66",
+"c     c #CCFF33",
+"d     c #CCFF00",
+"e     c #CCCCFF",
+"f     c #CCCCCC",
+"g     c #CCCC99",
+"h     c #CCCC66",
+"i     c #CCCC33",
+"j     c #CCCC00",
+"k     c #CC99FF",
+"l     c #CC99CC",
+"m     c #CC9999",
+"n     c #CC9966",
+"o     c #CC9933",
+"p     c #CC9900",
+"q     c #CC66FF",
+"r     c #CC66CC",
+"s     c #CC6699",
+"t     c #CC6666",
+"u     c #CC6633",
+"v     c #CC6600",
+"w     c #CC33FF",
+"x     c #CC33CC",
+"y     c #CC3399",
+"z     c #CC3366",
+"A     c #CC3333",
+"B     c #CC3300",
+"C     c #CC00FF",
+"D     c #CC00CC",
+"E     c #CC0099",
+"F     c #CC0066",
+"G     c #CC0033",
+"H     c #CC0000",
+"I     c #99FFFF",
+"J     c #99FFCC",
+"K     c #99FF99",
+"L     c #99FF66",
+"M     c #99FF33",
+"N     c #99FF00",
+"O     c #99CCFF",
+"P     c #99CCCC",
+"Q     c #99CC99",
+"R     c #99CC66",
+"S     c #99CC33",
+"T     c #99CC00",
+"U     c #9999FF",
+"V     c #9999CC",
+"W     c #999999",
+"X     c #999966",
+"Y     c #999933",
+"Z     c #999900",
+"`     c #9966FF",
+" .    c #9966CC",
+"..    c #996699",
+"+.    c #996666",
+"@.    c #996633",
+"#.    c #996600",
+"$.    c #9933FF",
+"%.    c #9933CC",
+"&.    c #993399",
+"*.    c #993366",
+"=.    c #993333",
+"-.    c #993300",
+";.    c #9900FF",
+">.    c #9900CC",
+",.    c #990099",
+"'.    c #990066",
+").    c #990033",
+"!.    c #990000",
+"~.    c #66FFFF",
+"{.    c #66FFCC",
+"].    c #66FF99",
+"^.    c #66FF66",
+"/.    c #66FF33",
+"(.    c #66FF00",
+"_.    c #66CCFF",
+":.    c #66CCCC",
+"<.    c #66CC99",
+"[.    c #66CC66",
+"}.    c #66CC33",
+"|.    c #66CC00",
+"1.    c #6699FF",
+"2.    c #6699CC",
+"3.    c #669999",
+"4.    c #669966",
+"5.    c #669933",
+"6.    c #669900",
+"7.    c #6666FF",
+"8.    c #6666CC",
+"9.    c #666699",
+"0.    c #666666",
+"a.    c #666633",
+"b.    c #666600",
+"c.    c #6633FF",
+"d.    c #6633CC",
+"e.    c #663399",
+"f.    c #663366",
+"g.    c #663333",
+"h.    c #663300",
+"i.    c #6600FF",
+"j.    c #6600CC",
+"k.    c #660099",
+"l.    c #660066",
+"m.    c #660033",
+"n.    c #660000",
+"o.    c #33FFFF",
+"p.    c #33FFCC",
+"q.    c #33FF99",
+"r.    c #33FF66",
+"s.    c #33FF33",
+"t.    c #33FF00",
+"u.    c #33CCFF",
+"v.    c #33CCCC",
+"w.    c #33CC99",
+"x.    c #33CC66",
+"y.    c #33CC33",
+"z.    c #33CC00",
+"A.    c #3399FF",
+"B.    c #3399CC",
+"C.    c #339999",
+"D.    c #339966",
+"E.    c #339933",
+"F.    c #339900",
+"G.    c #3366FF",
+"H.    c #3366CC",
+"I.    c #336699",
+"J.    c #336666",
+"K.    c #336633",
+"L.    c #336600",
+"M.    c #3333FF",
+"N.    c #3333CC",
+"O.    c #333399",
+"P.    c #333366",
+"Q.    c #333333",
+"R.    c #333300",
+"S.    c #3300FF",
+"T.    c #3300CC",
+"U.    c #330099",
+"V.    c #330066",
+"W.    c #330033",
+"X.    c #330000",
+"Y.    c #00FFFF",
+"Z.    c #00FFCC",
+"`.    c #00FF99",
+" +    c #00FF66",
+".+    c #00FF33",
+"++    c #00FF00",
+"@+    c #00CCFF",
+"#+    c #00CCCC",
+"$+    c #00CC99",
+"%+    c #00CC66",
+"&+    c #00CC33",
+"*+    c #00CC00",
+"=+    c #0099FF",
+"-+    c #0099CC",
+";+    c #009999",
+">+    c #009966",
+",+    c #009933",
+"'+    c #009900",
+")+    c #0066FF",
+"!+    c #0066CC",
+"~+    c #006699",
+"{+    c #006666",
+"]+    c #006633",
+"^+    c #006600",
+"/+    c #0033FF",
+"(+    c #0033CC",
+"_+    c #003399",
+":+    c #003366",
+"<+    c #003333",
+"[+    c #003300",
+"}+    c #0000FF",
+"|+    c #0000CC",
+"1+    c #000099",
+"2+    c #000066",
+"3+    c #000033",
+"4+    c #000000",
+"                                                    ",
+"                      8.P.P.                        ",
+"                    8.. e P.8.8.P.                  ",
+"                    8.U e }+e . e P.                ",
+"                  P.P.U e }+U U U P.P.              ",
+"8.8.8.8.8.8.8.8.8.e P.U e }+U U U P.e 4+P.P.P.P.P.P.",
+"e e U e U U U U P.U P.U e }+U U U P.U P.U U U U U U ",
+"P.P.P.P.P.P.P.P.P.8.P.U e }+U U U P.8.P.P.P.P.P.P.P.",
+"                  P.P.U e }+8.8.8.P.P.              ",
+"                    P.U 8.}+8.8.8.P.                ",
+"                    4+8.8.P.P.P.P.                  ",
+"                      P.P.P.                        "};
diff --git a/src/pixmaps/work_offline.xpm b/src/pixmaps/work_offline.xpm
deleted file mode 100644 (file)
index 8b70d22..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/* XPM */
-static char * work_offline_xpm[] = {
-"24 6 4 1",
-"      c None",
-".     c #000000",
-"+     c #D8BE6A",
-"@     c #8E7D45",
-"............  ..........",
-"+++++++++++.  .@++++++++",
-"++++++++++.  .@+++++++++",
-"++++++++++.  .@+++++++++",
-"@@@@@@@@@.  .@@@@@@@@@@@",
-"..........  ............"};
diff --git a/src/pixmaps/work_online.xpm b/src/pixmaps/work_online.xpm
deleted file mode 100644 (file)
index 5bb7116..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/* XPM */
-static char * work_online_xpm[] = {
-"24 6 4 1",
-"      c None",
-".     c #000000",
-"+     c #D8BE6A",
-"@     c #8E7D45",
-"........................",
-"++++++++++++++.@++++++++",
-"+++++++++++++.@+++++++++",
-"+++++++++++++.@+++++++++",
-"@@@@@@@@@@@@.@@@@@@@@@@@",
-"........................"};
index f673cb8..e6fa6bd 100644 (file)
@@ -401,7 +401,7 @@ gchar *procmsg_get_message_file(MsgInfo *msginfo)
 
        filename = folder_item_fetch_msg(msginfo->folder, msginfo->msgnum);
        if (!filename)
-               g_warning("can't fetch message %d\n", msginfo->msgnum);
+               debug_print("can't fetch message %d\n", msginfo->msgnum);
 
        return filename;
 }
@@ -463,7 +463,8 @@ FILE *procmsg_open_message(MsgInfo *msginfo)
        if (!is_file_exist(file)) {
                g_free(file);
                file = procmsg_get_message_file(msginfo);
-               g_return_val_if_fail(file != NULL, NULL);
+               if (!file)
+                       return NULL;
        }
 
        if ((fp = fopen(file, "rb")) == NULL) {
index f6e0b4f..cd5cd16 100644 (file)
@@ -84,8 +84,8 @@
 #include "pixmaps/unread.xpm"
 #include "pixmaps/vcard.xpm"
 #include "pixmaps/ignorethread.xpm"
-#include "pixmaps/work_online.xpm"
-#include "pixmaps/work_offline.xpm"
+#include "pixmaps/online.xpm"
+#include "pixmaps/offline.xpm"
 #include "pixmaps/notice_warn.xpm"
 #include "pixmaps/notice_error.xpm"
 #include "pixmaps/notice_note.xpm"
@@ -195,8 +195,8 @@ static StockPixmapData pixmaps[] =
        {trash_hrm_xpm                          , NULL, NULL, "trash_close_hrm", "  "},
        {unread_xpm                             , NULL, NULL, "unread", "  "},
        {vcard_xpm                              , NULL, NULL, "vcard", "  "},
-       {work_online_xpm                        , NULL, NULL, "work_online", "  "},
-       {work_offline_xpm                       , NULL, NULL, "work_offline", "  "},
+       {online_xpm                             , NULL, NULL, "online", "  "},
+       {offline_xpm                            , NULL, NULL, "offline", "  "},
        {notice_warn_xpm                        , NULL, NULL, "notice_warn",  "  "},
        {notice_error_xpm                       , NULL, NULL, "notice_error",  "  "},
        {notice_note_xpm                        , NULL, NULL, "notice_note",  "  "},
index 29cdb5d..15dd17f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2001 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2003 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -95,8 +95,8 @@ typedef enum
        STOCK_PIXMAP_TRASH_CLOSE_HRM,
        STOCK_PIXMAP_UNREAD,
        STOCK_PIXMAP_VCARD,
-       STOCK_PIXMAP_WORK_ONLINE,
-       STOCK_PIXMAP_WORK_OFFLINE,
+       STOCK_PIXMAP_ONLINE,
+       STOCK_PIXMAP_OFFLINE,
        STOCK_PIXMAP_NOTICE_WARN,               /* small warning */
        STOCK_PIXMAP_NOTICE_ERROR,              /* small error   */
        STOCK_PIXMAP_NOTICE_NOTE,               /* small message */
index a1ddddf..1c806d3 100644 (file)
@@ -2438,6 +2438,7 @@ static void summary_display_msg_full(SummaryView *summaryview,
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
        MsgInfo *msginfo;
        MsgFlags flags;
+       gint val;
 
        if (!new_window) {
                if (summaryview->displayed == row)
@@ -2456,26 +2457,11 @@ static void summary_display_msg_full(SummaryView *summaryview,
 
        msginfo = gtk_ctree_node_get_row_data(ctree, row);
 
-       if (new_window || !prefs_common.mark_as_read_on_new_window) {
-               if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags) 
-               && procmsg_msg_has_marked_parent(msginfo))
-                       summaryview->unreadmarked--;
-               if (MSG_IS_NEW(msginfo->flags) || MSG_IS_UNREAD(msginfo->flags)) {
-                       procmsg_msginfo_unset_flags
-                               (msginfo, MSG_NEW | MSG_UNREAD, 0);
-                       summary_set_row_marks(summaryview, row);
-                       gtk_clist_thaw(GTK_CLIST(ctree));
-                       summary_status_show(summaryview);
-                       
-                       flags = msginfo->flags;
-               }
-       }
-
        if (new_window) {
                MessageView *msgview;
 
                msgview = messageview_create_with_new_window(summaryview->mainwin);
-               messageview_show(msgview, msginfo, all_headers);
+               val = messageview_show(msgview, msginfo, all_headers);
        } else {
                MessageView *msgview;
 
@@ -2484,13 +2470,29 @@ static void summary_display_msg_full(SummaryView *summaryview,
                summaryview->displayed = row;
                if (!messageview_is_visible(msgview))
                        main_window_toggle_message_view(summaryview->mainwin);
-               messageview_show(msgview, msginfo, all_headers);
+               val = messageview_show(msgview, msginfo, all_headers);
                if (GTK_CLIST(msgview->mimeview->ctree)->row_list == NULL)
                        gtk_widget_grab_focus(summaryview->ctree);
                GTK_EVENTS_FLUSH();
                gtkut_ctree_node_move_if_on_the_edge(ctree, row);
        }
 
+       if (val == 0 &&
+           (new_window || !prefs_common.mark_as_read_on_new_window)) {
+               if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags) 
+               && procmsg_msg_has_marked_parent(msginfo))
+                       summaryview->unreadmarked--;
+               if (MSG_IS_NEW(msginfo->flags) || MSG_IS_UNREAD(msginfo->flags)) {
+                       procmsg_msginfo_unset_flags
+                               (msginfo, MSG_NEW | MSG_UNREAD, 0);
+                       summary_set_row_marks(summaryview, row);
+                       gtk_clist_thaw(GTK_CLIST(ctree));
+                       summary_status_show(summaryview);
+                       
+                       flags = msginfo->flags;
+               }
+       }
+
        summary_set_menu_sensitive(summaryview);
        toolbar_main_set_sensitive(summaryview->mainwin);
 
index ed45306..50dd82d 100644 (file)
@@ -553,6 +553,21 @@ static void textview_add_parts(TextView *textview, MimeInfo *mimeinfo)
 #define TEXT_INSERT(str) \
        gtk_stext_insert(text, textview->msgfont, NULL, NULL, str, -1)
 
+void textview_show_error(TextView *textview)
+{
+       GtkSText *text;
+
+       textview_set_font(textview, NULL);
+       text = GTK_STEXT(textview->text);
+       textview_clear(textview);
+
+       gtk_stext_freeze(text);
+
+       TEXT_INSERT(_("This message can't be displayed.\n"));
+
+       gtk_stext_thaw(text);
+}
+
 void textview_show_mime_part(TextView *textview, MimeInfo *partinfo)
 {
        GtkSText *text;
index 48dd20d..9425980 100644 (file)
@@ -72,6 +72,7 @@ void textview_show_message    (TextView       *textview,
 void textview_show_part                (TextView       *textview,
                                 MimeInfo       *mimeinfo,
                                 FILE           *fp);
+void textview_show_error       (TextView       *textview);
 void textview_show_mime_part   (TextView       *textview,
                                 MimeInfo       *partinfo);
 void textview_clear            (TextView       *textview);