sync with sylpheed 0.6.0cvs4
authorPaul Mangan <paul@claws-mail.org>
Sun, 2 Sep 2001 15:07:05 +0000 (15:07 +0000)
committerPaul Mangan <paul@claws-mail.org>
Sun, 2 Sep 2001 15:07:05 +0000 (15:07 +0000)
20 files changed:
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/Makefile.am
src/about.c
src/account.c
src/alertpanel.c
src/compose.c
src/defs.h
src/inc.c
src/inc.h
src/intl.h
src/main.c
src/mainwindow.c
src/prefs_account.c
src/prefs_common.c
src/send.c
src/summaryview.c
src/version.h.in [new file with mode: 0644]

index f2854c3..7c74374 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2001-09-02
+
+       * src/inc.[ch]: changed inc_autocheck_(un)lock() to inc_(un)lock().
+         inc_mail(), inc_all_account_mail(): return immediately if locked.
+       * src/account.c
+         src/prefs_common.c
+         src/prefs_account.c: use inc_lock() and inc_unlock() instead of
+         inc_autocheck_timer_{remove,set}().
+
+2001-09-01
+
+       * src/inc.[ch]: inc_autocheck_lock(), inc_autocheck_unlock(): new.
+         They increase/decrease the lock count.
+         inc_autocheck_func(): if locked, delay the autochecking 1 second.
+         inc_autocheck_timer_set_interval(): set interval by its argument.
+       * src/summaryview.c: summary_show(): lock the autochecking while
+         processing.
+       * src/main.c: app_will_exit(): remove autocheck timer.
+       * acconfig.h
+         src/defs.h: removed the definitions of PACKAGE and VERSION to
+         prevent unnecessary compilation.
+       * configure.in: changed AC_DEFINE_UNQUOTED of PACKAGE and VERSION
+         to AC_SUBST, and added src/version.h to AC_OUTPUT.
+       * src/version.h.in: new.
+       * src/intl.h: changed dgettext() to gettext().
+
 2001-08-31
 
        * po/ja.po: fixed a typo that crashed Sylpheed with older version
@@ -5,6 +31,12 @@
        * configure.in: fixed a bug that didn't show results correctly.
          Fixed a bug that --enable-compface and --enable-jconv disabled
          the options.
+       * src/procmsg.c: procmsg_send_queue(): don't abort when sending
+         message failed.
+       * src/compose.c: compose_write_headers(): add Bcc: header to the
+         output file.
+       * src/send.c: send_message_data(): new. Separated from
+         send_message_smtp(). Remove Bcc: header before sending.
 
 2001-08-30
 
index 3306644..4cd562a 100644 (file)
@@ -1,3 +1,10 @@
+2001-09-02 [paul]
+
+       * configure.in
+               change to 0.6.0claws2
+
+       * sync with sylpheed 0.6.0cvs4
+
 2001-09-01 [match]
        * pixmaps/
                interface.xpm
index 8ce0bb4..e693f5d 100644 (file)
@@ -1,3 +1,31 @@
+2001-09-02
+
+       * src/inc.[ch]: inc_autocheck_(un)lock() ¤ò inc_(un)lock() ¤ËÊѹ¹¡£
+         inc_mail(), inc_all_account_mail(): ¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ì¤Ð¤¹¤°¤ËÌá¤ë
+         ¤è¤¦¤Ë¤·¤¿¡£
+       * src/account.c
+         src/prefs_common.c
+         src/prefs_account.c: inc_autocheck_timer_{remove,set}() ¤ÎÂå¤ï¤ê¤Ë
+         inc_lock() ¤È inc_unlock() ¤òÍѤ¤¤ë¤è¤¦¤Ë¤·¤¿¡£
+
+2001-09-01
+
+       * src/inc.[ch]: inc_autocheck_lock(), inc_autocheck_unlock(): ¿·µ¬¡£
+         ¥í¥Ã¥¯¥«¥¦¥ó¥È¤òÁý²Ã/¸º¾¯¤µ¤»¤ë¡£
+       * inc_autocheck_func(): ¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ì¤Ð¡¢¼«Æ°¥Á¥§¥Ã¥¯¤ò1ÉÃÃÙ¤é
+         ¤»¤ë¤è¤¦¤Ë¤·¤¿¡£
+         inc_autocheck_timer_set_interval(): °ú¿ô¤Ç´Ö³Ö¤ò»ØÄê¡£
+       * src/summaryview.c: summary_show(): ½èÍýÃæ¤Ï¼«Æ°¥Á¥§¥Ã¥¯¤ò¥í¥Ã¥¯
+         ¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+       * src/main.c: app_will_exit(): ¼«Æ°¥Á¥§¥Ã¥¯¥¿¥¤¥Þ¤òºï½ü¡£
+       * acconfig.h
+         src/defs.h: ÉÔÍפʥ³¥ó¥Ñ¥¤¥ë¤òÈò¤±¤ë¤¿¤á¤Ë PACKAGE ¤È VERSION 
+         ¤ÎÄêµÁ¤òºï½ü¡£
+       * configure.in: PACKAGE ¤È VERSION ¤Î AC_DEFINE_UNQUOTED() ¤ò
+         AC_SUBST ¤ËÊѹ¹¤·¡¢ src/version.h ¤ò AC_OUTPUT ¤ËÄɲá£
+       * src/version.h.in: ¿·µ¬¡£
+       * src/intl.h: dgettext() ¤ò gettext() ¤ËÊѹ¹¡£
+
 2001-08-31
 
        * po/ja.po: ¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤Î GTK+ ¤Ç Sylpheed ¤ò¥¯¥é¥Ã¥·¥å¤µ¤»¤ë
@@ -5,6 +33,12 @@
        * configure.in: ·ë²Ì¤òÀµ¤·¤¯É½¼¨¤·¤Æ¤¤¤Ê¤«¤Ã¤¿¥Ð¥°¤ò½¤Àµ¡£
          --enable-compface ¤È --enable-jconv ¤¬¥ª¥×¥·¥ç¥ó¤ò̵¸ú¤Ë¤·¤Æ¤¤¤¿
          ¥Ð¥°¤ò½¤Àµ¡£
+       * src/procmsg.c: procmsg_send_queue(): ¥á¥Ã¥»¡¼¥¸¤ÎÁ÷¿®¤Ë¼ºÇÔ¤·¤Æ¤â
+         ÃæÃǤ·¤Ê¤¤¤è¤¦¤Ë¤·¤¿¡£
+       * src/compose.c: compose_write_headers(): ½ÐÎÏ¥Õ¥¡¥¤¥ë¤Ë Bcc:
+         ¥Ø¥Ã¥À¤òÉղ乤ë¤è¤¦¤Ë¤·¤¿¡£
+       * src/send.c: send_message_data(): ¿·µ¬¡£send_message_smtp() ¤«¤é
+         Ê¬Î¥¡£Á÷¿®Á°¤Ë Bcc: ¥Ø¥Ã¥À¤òºï½ü¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
 
 2001-08-30
 
index f93a203..b9c8ee1 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=6
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws1
+EXTRA_VERSION=claws2
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
@@ -324,6 +324,7 @@ intl/Makefile
 ac/Makefile
 po/Makefile.in
 libkcc/Makefile
+src/version.h
 src/Makefile
 manual/Makefile
 manual/en/Makefile
index 823f87f..c844be8 100644 (file)
@@ -3,6 +3,7 @@ bin_PROGRAMS = sylpheed
 sylpheed_SOURCES = \
        intl.h \
        defs.h \
+       version.h \
        main.c main.h \
        mainwindow.c mainwindow.h \
        folderview.c folderview.h \
@@ -117,6 +118,7 @@ sylpheed_SOURCES = \
 
 EXTRA_DIST = \
        quote_fmt_parse.h \
+       version.h.in \
        pixmaps/clip.xpm \
        pixmaps/deleted.xpm \
        pixmaps/dir-close.xpm \
index 5fdf4ea..03921db 100644 (file)
@@ -45,6 +45,7 @@
 #include "gtkutils.h"
 #include "prefs_common.h"
 #include "utils.h"
+#include "version.h"
 
 #include "pixmaps/sylpheed-logo.xpm"
 
index db774b6..acb875c 100644 (file)
@@ -237,12 +237,12 @@ GList *account_get_list(void)
 
 void account_edit_open(void)
 {
-       inc_autocheck_timer_remove();
+       inc_lock();
 
        if (compose_get_compose_list()) {
                alertpanel_notice(_("Some composing windows are open.\n"
                                    "Please close all the composing windows before editing the accounts."));
-               inc_autocheck_timer_set();
+               inc_unlock();
                return;
        }
 
@@ -265,7 +265,6 @@ void account_add(void)
        PrefsAccount *ac_prefs;
 
        ac_prefs = prefs_account_open(NULL);
-       inc_autocheck_timer_remove();
 
        if (!ac_prefs) return;
 
@@ -559,7 +558,6 @@ static void account_edit_prefs(void)
        Xstrdup_a(ac_name, ac_prefs->account_name, return);
 
        prefs_account_open(ac_prefs);
-       inc_autocheck_timer_remove();
 
        if (!prev_default && ac_prefs->is_default)
                account_set_as_default(ac_prefs);
@@ -676,7 +674,7 @@ static void account_edit_close(void)
 
        gtk_widget_hide(edit_account.window);
 
-       inc_autocheck_timer_set();
+       inc_unlock();
 }
 
 static gint account_delete_event(GtkWidget *widget, GdkEventAny *event,
index d9039cf..2b93d8a 100644 (file)
@@ -29,6 +29,7 @@
 #include "manage_window.h"
 #include "utils.h"
 #include "gtkutils.h"
+#include "inc.h"
 
 #define TITLE_FONT     "-*-helvetica-medium-r-normal--17-*-*-*-*-*-*-*," \
                        "-*-*-medium-r-normal--16-*-*-*-*-*-*-*,*"
@@ -151,10 +152,9 @@ static void alertpanel_show(void)
        manage_window_set_transient(GTK_WINDOW(dialog));
        value = G_ALERTWAIT;
 
-       /* ungrab the mouse events ? */
        if (gdk_pointer_is_grabbed())
                gdk_pointer_ungrab(GDK_CURRENT_TIME);
-
+       inc_lock();
        while ((value & G_ALERT_VALUE_MASK) == G_ALERTWAIT)
                gtk_main_iteration();
 
@@ -162,6 +162,7 @@ static void alertpanel_show(void)
        GTK_EVENTS_FLUSH();
 
        alertpanel_is_open = FALSE;
+       inc_unlock();
 }
 
 static void alertpanel_create(const gchar *title,
index 2e09465..a56c70e 100644 (file)
@@ -2662,12 +2662,9 @@ static gint compose_write_headers(Compose *compose, FILE *fp,
                        if (*str != '\0') {
                                compose->to_list = address_list_append
                                        (compose->to_list, str);
-                               if (is_draft) {
-                                       compose_convert_header
-                                               (buf, sizeof(buf), str,
-                                                strlen("Bcc: "));
-                                       fprintf(fp, "Bcc: %s\n", buf);
-                               }
+                               compose_convert_header(buf, sizeof(buf), str,
+                                                      strlen("Bcc: "));
+                               fprintf(fp, "Bcc: %s\n", buf);
                        }
                }
        }
index 294af68..51d17f1 100644 (file)
@@ -32,7 +32,7 @@
 #  include <sys/param.h>
 #endif
 
-#define PROG_VERSION           "Sylpheed version "VERSION
+/* #define PROG_VERSION                "Sylpheed version "VERSION */
 #define INBOX_DIR              "inbox"
 #define OUTBOX_DIR             "outbox"
 #define QUEUE_DIR              "queue"
index 99cf347..b86a174 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
 #include "pixmaps/complete.xpm"
 #include "pixmaps/error.xpm"
 
-GdkPixmap *currentxpm;
-GdkBitmap *currentxpmmask;
-GdkPixmap *errorxpm;
-GdkBitmap *errorxpmmask;
-GdkPixmap *okxpm;
-GdkBitmap *okxpmmask;
+static guint inc_lock_count = 0;
+
+static GdkPixmap *currentxpm;
+static GdkBitmap *currentxpmmask;
+static GdkPixmap *errorxpm;
+static GdkBitmap *errorxpmmask;
+static GdkPixmap *okxpm;
+static GdkBitmap *okxpmmask;
 
 #define MSGBUFSIZE     8192
 
@@ -116,8 +118,8 @@ static gint get_spool                       (FolderItem     *dest,
                                         const gchar    *mbox);
 
 static void inc_all_spool(void);
-
-static gint inc_autocheck_func         (gpointer        data);
+static void inc_autocheck_timer_set_interval   (guint           interval);
+static gint inc_autocheck_func                 (gpointer        data);
 
 /**
  * inc_finished:
@@ -170,6 +172,8 @@ void inc_mail(MainWindow *mainwin)
 {
        gint new_msgs = 0;
 
+       if (inc_lock_count) return;
+
        inc_autocheck_timer_remove();
        summary_write_cache(mainwin->summaryview);
        main_window_lock(mainwin);
@@ -240,6 +244,8 @@ void inc_all_account_mail(MainWindow *mainwin)
        IncProgressDialog *inc_dialog;
        gint new_msgs = 0;
 
+       if (inc_lock_count) return;
+
        inc_autocheck_timer_remove();
        summary_write_cache(mainwin->summaryview);
        main_window_lock(mainwin);
@@ -1094,6 +1100,17 @@ static gint get_spool(FolderItem *dest, const gchar *mbox)
        return msgs;
 }
 
+void inc_lock(void)
+{
+       inc_lock_count++;
+}
+
+void inc_unlock(void)
+{
+       if (inc_lock_count > 0)
+               inc_lock_count--;
+}
+
 static guint autocheck_timer = 0;
 static gpointer autocheck_data = NULL;
 
@@ -1103,21 +1120,26 @@ void inc_autocheck_timer_init(MainWindow *mainwin)
        inc_autocheck_timer_set();
 }
 
-void inc_autocheck_timer_set(void)
+static void inc_autocheck_timer_set_interval(guint interval)
 {
        inc_autocheck_timer_remove();
 
        if (prefs_common.autochk_newmail && autocheck_data) {
                autocheck_timer = gtk_timeout_add
-                       (prefs_common.autochk_itv * 60000,
-                        inc_autocheck_func,
-                        autocheck_data);
+                       (interval, inc_autocheck_func, autocheck_data);
+               debug_print("added timer = %d\n", autocheck_timer);
        }
 }
 
+void inc_autocheck_timer_set(void)
+{
+       inc_autocheck_timer_set_interval(prefs_common.autochk_itv * 60000);
+}
+
 void inc_autocheck_timer_remove(void)
 {
        if (autocheck_timer) {
+               debug_print("removed timer = %d\n", autocheck_timer);
                gtk_timeout_remove(autocheck_timer);
                autocheck_timer = 0;
        }
@@ -1127,6 +1149,12 @@ static gint inc_autocheck_func(gpointer data)
 {
        MainWindow *mainwin = (MainWindow *)data;
 
+       if (inc_lock_count) {
+               debug_print("autocheck is locked.\n");
+               inc_autocheck_timer_set_interval(1000);
+               return FALSE;
+       }
+
        inc_all_account_mail(mainwin);
 
        return FALSE;
index 0bee861..7c7210a 100644 (file)
--- a/src/inc.h
+++ b/src/inc.h
@@ -106,6 +106,10 @@ void inc_progress_update   (Pop3State      *state,
                                 Pop3Phase       phase);
 gint inc_drop_message          (const gchar    *file,
                                 Pop3State      *state);
+
+void inc_lock                  (void);
+void inc_unlock                        (void);
+
 void inc_autocheck_timer_init  (MainWindow     *mainwin);
 void inc_autocheck_timer_set   (void);
 void inc_autocheck_timer_remove        (void);
index 0f172d7..3cb08bf 100644 (file)
@@ -3,7 +3,7 @@
 
 #ifdef ENABLE_NLS
 #  include <libintl.h>
-#  define _(String) dgettext(PACKAGE,String)
+#  define _(String) gettext(String)
 #  ifdef gettext_noop
 #    define N_(String) gettext_noop(String)
 #  else
index 90bc4e1..f0c030e 100644 (file)
@@ -79,6 +79,8 @@
 #  include "ssl.h"
 #endif
 
+#include "version.h"
+
 gchar *prog_version;
 gchar *startup_dir;
 gboolean debug_mode = FALSE;
@@ -371,6 +373,8 @@ void app_will_exit(GtkWidget *widget, gpointer data)
                manage_window_focus_in(mainwin->window, NULL, NULL);
        }
 
+       inc_autocheck_timer_remove();
+
        if (prefs_common.clean_on_exit)
                main_window_empty_trash(mainwin, prefs_common.ask_on_clean);
 
index 9af3ed6..658d283 100644 (file)
@@ -76,6 +76,7 @@
 #include "about.h"
 #include "manual.h"
 #include "prefs_templates.h"
+#include "version.h"
 
 #define AC_LABEL_WIDTH 240
 
@@ -2271,7 +2272,7 @@ static void send_queue_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
        GList *list;
 
        if (procmsg_send_queue() < 0)
-               alertpanel_error(_("Sending queued message failed."));
+               alertpanel_error(_("Some errors occurred while sending queued messages."));
 
        statusbar_pop_all();
 
index 6ae61d4..c673fbb 100644 (file)
@@ -489,7 +489,7 @@ PrefsAccount *prefs_account_open(PrefsAccount *ac_prefs)
 
        debug_print(_("Opening account preferences window...\n"));
 
-       inc_autocheck_timer_remove();
+       inc_lock();
 
        cancelled = FALSE;
 
@@ -545,7 +545,7 @@ PrefsAccount *prefs_account_open(PrefsAccount *ac_prefs)
        gtk_main();
        gtk_widget_hide(dialog.window);
 
-       inc_autocheck_timer_set();
+       inc_unlock();
 
        if (cancelled && new_account) {
                g_free(ac_prefs);
index b9ff701..1b3f48b 100644 (file)
@@ -740,7 +740,7 @@ void prefs_common_open(void)
        if (prefs_rc_is_readonly(COMMON_RC))
                return;
 
-       inc_autocheck_timer_remove();
+       inc_lock();
 
        if (!dialog.window) {
                prefs_common_create();
@@ -3225,7 +3225,7 @@ static void prefs_common_ok(void)
        if (quote_desc_win && GTK_WIDGET_VISIBLE(quote_desc_win))
                gtk_widget_hide(quote_desc_win);
 
-       inc_autocheck_timer_set();
+       inc_unlock();
 }
 
 static void prefs_common_apply(void)
@@ -3233,12 +3233,15 @@ static void prefs_common_apply(void)
        prefs_set_data_from_dialog(param);
        main_window_reflect_prefs_all();
        prefs_common_save_config();
+
+       inc_autocheck_timer_remove();
+       inc_autocheck_timer_set();
 }
 
 static void prefs_common_cancel(void)
 {
        gtk_widget_hide(dialog.window);
-       inc_autocheck_timer_set();
+       inc_unlock();
 }
 
 
index 5966442..ba0a799 100644 (file)
@@ -85,6 +85,9 @@ static SockInfo *send_smtp_open       (const gchar *server, gushort port,
                                 const gchar *domain, gboolean use_smtp_auth);
 #endif
 
+static gint send_message_data  (SendProgressDialog *dialog, SockInfo *sock,
+                                FILE *fp, gint size);
+
 static SendProgressDialog *send_progress_dialog_create(void);
 static void send_progress_dialog_destroy(SendProgressDialog *dialog);
 static void send_cancel(GtkWidget *widget, gpointer data);
@@ -328,11 +331,8 @@ static gint send_message_smtp(GSList *to_list, const gchar *from,
        GtkCList *clist;
        const gchar *text[3];
        gchar buf[BUFFSIZE];
-       gchar str[BUFFSIZE];
        GSList *cur;
        gint size;
-       gint bytes = 0;
-       struct timeval tv_prev, tv_cur;
 
        g_return_val_if_fail(to_list != NULL, -1);
        g_return_val_if_fail(from != NULL, -1);
@@ -387,46 +387,119 @@ static gint send_message_smtp(GSList *to_list, const gchar *from,
 
        SEND_EXIT_IF_NOTOK(smtp_data(smtp_sock), "sending DATA");
 
+       /* send main part */
+       SEND_EXIT_IF_ERROR(send_message_data(dialog, smtp_sock, fp, size) == 0,
+                          "sending data");
+
+       progress_dialog_set_label(dialog->dialog, _("Quitting..."));
+       GTK_EVENTS_FLUSH();
+
+       SEND_EXIT_IF_NOTOK(smtp_eom(smtp_sock), "terminating data");
+       SEND_EXIT_IF_NOTOK(smtp_quit(smtp_sock), "sending QUIT");
+
+       sock_close(smtp_sock);
+       send_progress_dialog_destroy(dialog);
+
+       return 0;
+}
+
+#undef EXIT_IF_CANCELLED
+#undef SEND_EXIT_IF_ERROR
+#undef SEND_EXIT_IF_NOTOK
+
+#define EXIT_IF_CANCELLED() \
+{ \
+       if (dialog->cancelled) return -1; \
+}
+
+#define SEND_EXIT_IF_ERROR(f) \
+{ \
+       EXIT_IF_CANCELLED(); \
+       if ((f) <= 0) return -1; \
+}
+
+#define SEND_DIALOG_UPDATE() \
+{ \
+       gettimeofday(&tv_cur, NULL); \
+       if (tv_cur.tv_sec - tv_prev.tv_sec > 0 || \
+           tv_cur.tv_usec - tv_prev.tv_usec > UI_REFRESH_INTERVAL) { \
+               g_snprintf(str, sizeof(str), \
+                          _("Sending message (%d / %d bytes)"), \
+                          bytes, size); \
+               progress_dialog_set_label(dialog->dialog, str); \
+               progress_dialog_set_percentage \
+                       (dialog->dialog, (gfloat)bytes / (gfloat)size); \
+               GTK_EVENTS_FLUSH(); \
+               gettimeofday(&tv_prev, NULL); \
+       } \
+}
+
+static gint send_message_data(SendProgressDialog *dialog, SockInfo *sock,
+                             FILE *fp, gint size)
+{
+       gchar buf[BUFFSIZE];
+       gchar str[BUFFSIZE];
+       gint bytes = 0;
+       struct timeval tv_prev, tv_cur;
+
        gettimeofday(&tv_prev, NULL);
 
-       /* send main part */
+       /* output header part */
        while (fgets(buf, sizeof(buf), fp) != NULL) {
                bytes += strlen(buf);
                strretchomp(buf);
 
-               gettimeofday(&tv_cur, NULL);
-               if (tv_cur.tv_sec - tv_prev.tv_sec > 0 ||
-                   tv_cur.tv_usec - tv_prev.tv_usec > UI_REFRESH_INTERVAL) {
-                       g_snprintf(str, sizeof(str),
-                                  _("Sending message (%d / %d bytes)"),
-                                  bytes, size);
-                       progress_dialog_set_label(dialog->dialog, str);
-                       progress_dialog_set_percentage
-                               (dialog->dialog, (gfloat)bytes / (gfloat)size);
-                       GTK_EVENTS_FLUSH();
-                       gettimeofday(&tv_prev, NULL);
+               SEND_DIALOG_UPDATE();
+
+               if (!g_strncasecmp(buf, "Bcc:", 4)) {
+                       gint next;
+
+                       for (;;) {
+                               next = fgetc(fp);
+                               if (next != ' ' && next != '\t') {
+                                       ungetc(next, fp);
+                                       break;
+                               }
+                               if (fgets(buf, sizeof(buf), fp) == NULL)
+                                       break;
+                               else
+                                       bytes += strlen(buf);
+                       }
+               } else {
+                       SEND_EXIT_IF_ERROR(sock_puts(sock, buf));
                }
+       }
+
+       SEND_EXIT_IF_ERROR(sock_write(sock, "\r\n", 2));
+
+       /* output body part */
+       while (fgets(buf, sizeof(buf), fp) != NULL) {
+               bytes += strlen(buf);
+               strretchomp(buf);
+
+               SEND_DIALOG_UPDATE();
 
                /* escape when a dot appears on the top */
                if (buf[0] == '.')
-                       SEND_EXIT_IF_ERROR(sock_write(smtp_sock, ".", 1),
-                                          "sending data");
+                       SEND_EXIT_IF_ERROR(sock_write(sock, ".", 1));
 
-               SEND_EXIT_IF_ERROR(sock_puts(smtp_sock, buf), "sending data");
+               SEND_EXIT_IF_ERROR(sock_puts(sock, buf));
        }
 
-       progress_dialog_set_label(dialog->dialog, _("Quitting..."));
+       g_snprintf(str, sizeof(str), _("Sending message (%d / %d bytes)"),
+                  bytes, size);
+       progress_dialog_set_label(dialog->dialog, str);
+       progress_dialog_set_percentage
+               (dialog->dialog, (gfloat)bytes / (gfloat)size);
        GTK_EVENTS_FLUSH();
 
-       SEND_EXIT_IF_NOTOK(smtp_eom(smtp_sock), "terminating data");
-       SEND_EXIT_IF_NOTOK(smtp_quit(smtp_sock), "sending QUIT");
-
-       sock_close(smtp_sock);
-       send_progress_dialog_destroy(dialog);
-
        return 0;
 }
 
+#undef EXIT_IF_CANCELLED
+#undef SEND_EXIT_IF_ERROR
+#undef SEND_DIALOG_UPDATE
+
 #if USE_SSL
 static SockInfo *send_smtp_open(const gchar *server, gushort port,
                                const gchar *domain, gboolean use_smtp_auth,
index d6c7684..10e09a4 100644 (file)
@@ -72,6 +72,7 @@
 #include "filter.h"
 #include "folder.h"
 #include "colorlabel.h"
+#include "inc.h"
 #include "addressbook.h"
 #include "addr_compl.h"
 #include "scoring.h"
@@ -758,6 +759,8 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
 
        if (locked)
                return FALSE;
+
+       inc_lock();
        locked = TRUE;
 
        STATUSBAR_POP(summaryview->mainwin);
@@ -786,6 +789,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
                        summary_write_cache(summaryview);
                else {
                        locked = FALSE;
+                       inc_unlock();
                         return FALSE;
                }
                folder_update_op_count();
@@ -818,6 +822,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
                summaryview->folder_item = item;
                gtk_clist_thaw(GTK_CLIST(ctree));
                locked = FALSE;
+               inc_unlock();
                return TRUE;
        }
        g_free(buf);
@@ -939,6 +944,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
 
        main_window_cursor_normal(summaryview->mainwin);
        locked = FALSE;
+       inc_unlock();
 
        return TRUE;
 }
diff --git a/src/version.h.in b/src/version.h.in
new file mode 100644 (file)
index 0000000..3e92ad2
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2001 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __VERSION_H__
+#define __VERSION_H__
+
+#define PACKAGE                        "@PACKAGE@"
+#define VERSION                        "@VERSION@"
+#define PROG_VERSION           "Sylpheed version "VERSION
+
+#endif /* __VERSION_H__ */