+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
* 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
+2001-09-02 [paul]
+
+ * configure.in
+ change to 0.6.0claws2
+
+ * sync with sylpheed 0.6.0cvs4
+
2001-09-01 [match]
* pixmaps/
interface.xpm
+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 ¤ò¥¯¥é¥Ã¥·¥å¤µ¤»¤ë
* 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
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
ac/Makefile
po/Makefile.in
libkcc/Makefile
+src/version.h
src/Makefile
manual/Makefile
manual/en/Makefile
sylpheed_SOURCES = \
intl.h \
defs.h \
+ version.h \
main.c main.h \
mainwindow.c mainwindow.h \
folderview.c folderview.h \
EXTRA_DIST = \
quote_fmt_parse.h \
+ version.h.in \
pixmaps/clip.xpm \
pixmaps/deleted.xpm \
pixmaps/dir-close.xpm \
#include "gtkutils.h"
#include "prefs_common.h"
#include "utils.h"
+#include "version.h"
#include "pixmaps/sylpheed-logo.xpm"
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;
}
PrefsAccount *ac_prefs;
ac_prefs = prefs_account_open(NULL);
- inc_autocheck_timer_remove();
if (!ac_prefs) return;
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);
gtk_widget_hide(edit_account.window);
- inc_autocheck_timer_set();
+ inc_unlock();
}
static gint account_delete_event(GtkWidget *widget, GdkEventAny *event,
#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-*-*-*-*-*-*-*,*"
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();
GTK_EVENTS_FLUSH();
alertpanel_is_open = FALSE;
+ inc_unlock();
}
static void alertpanel_create(const gchar *title,
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);
}
}
}
# 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"
#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
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:
{
gint new_msgs = 0;
+ if (inc_lock_count) return;
+
inc_autocheck_timer_remove();
summary_write_cache(mainwin->summaryview);
main_window_lock(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);
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;
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;
}
{
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;
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);
#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
# include "ssl.h"
#endif
+#include "version.h"
+
gchar *prog_version;
gchar *startup_dir;
gboolean debug_mode = FALSE;
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);
#include "about.h"
#include "manual.h"
#include "prefs_templates.h"
+#include "version.h"
#define AC_LABEL_WIDTH 240
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();
debug_print(_("Opening account preferences window...\n"));
- inc_autocheck_timer_remove();
+ inc_lock();
cancelled = FALSE;
gtk_main();
gtk_widget_hide(dialog.window);
- inc_autocheck_timer_set();
+ inc_unlock();
if (cancelled && new_account) {
g_free(ac_prefs);
if (prefs_rc_is_readonly(COMMON_RC))
return;
- inc_autocheck_timer_remove();
+ inc_lock();
if (!dialog.window) {
prefs_common_create();
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)
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();
}
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);
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);
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,
#include "filter.h"
#include "folder.h"
#include "colorlabel.h"
+#include "inc.h"
#include "addressbook.h"
#include "addr_compl.h"
#include "scoring.h"
if (locked)
return FALSE;
+
+ inc_lock();
locked = TRUE;
STATUSBAR_POP(summaryview->mainwin);
summary_write_cache(summaryview);
else {
locked = FALSE;
+ inc_unlock();
return FALSE;
}
folder_update_op_count();
summaryview->folder_item = item;
gtk_clist_thaw(GTK_CLIST(ctree));
locked = FALSE;
+ inc_unlock();
return TRUE;
}
g_free(buf);
main_window_cursor_normal(summaryview->mainwin);
locked = FALSE;
+ inc_unlock();
return TRUE;
}
--- /dev/null
+/*
+ * 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__ */