sync with sylpheed 0.7.2cvs14
authorPaul Mangan <paul@claws-mail.org>
Sat, 23 Feb 2002 10:52:54 +0000 (10:52 +0000)
committerPaul Mangan <paul@claws-mail.org>
Sat, 23 Feb 2002 10:52:54 +0000 (10:52 +0000)
36 files changed:
ChangeLog
ChangeLog.claws
ChangeLog.jp
configure.in
src/account.c
src/addressbook.c
src/compose.c
src/export.c
src/filesel.c
src/foldersel.c
src/grouplistdialog.c
src/import.c
src/inc.c
src/inputdialog.c
src/mainwindow.c
src/manage_window.c
src/manage_window.h
src/message_search.c
src/news.c
src/passphrase.c
src/pop.c
src/prefs_account.c
src/prefs_actions.c
src/prefs_common.c
src/prefs_customheader.c
src/prefs_display_header.c
src/prefs_filter.c
src/prefs_filtering.c
src/prefs_folder_item.c
src/prefs_matcher.c
src/prefs_scoring.c
src/prefs_template.c
src/recv.c
src/recv.h
src/summary_search.c
src/summaryview.c

index 2d08d34b1725a638148f70dc67ba712148cc1d64..80017ea18d907e5957410b533bd0a5898727eea9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,31 @@
+2002-02-22
+
+       * src/manage_window.[ch]: fixed a bug that caused crash when
+         the main window was hidden.
+         MANAGE_WINDOW_SIGNALS_CONNECT(): new macro.
+         Monitor "unmap_event", "destroy" events.
+       * src/account.c;
+         src/addressbook.c
+         src/compose.c
+         src/export.c
+         src/filesel.c
+         src/foldersel.c
+         src/grouplistdialog.c
+         src/import.c
+         src/inputdialog.c
+         src/mainwindow.c
+         src/message_search.c
+         src/passphrase.c
+         src/prefs_account.c
+         src/prefs_common.c
+         src/prefs_customheader.c
+         src/prefs_display_header.c
+         src/prefs_filter.c
+         src/prefs_template.c
+         src/summary_search.c
+         src/summaryview.c: use MANAGE_WINDO_SIGNALS_CONNECT() macro to
+         connect signals for window management.
+
 2002-02-21
 
        * src/prefs_account.[ch]: added receive size limit option.
index 4568f06a6382c1547b61267dc2471584bcd4df51..4e3e4bf86cbb8810c5ba53c443653fddae63a184 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-23 [paul]      0.7.2claws8
+
+       * sync with sylpheed 0.7.2cvs14
+               see ChangeLog entries 2002-02-22 and 2002-02-23
+
 2002-02-22 [christoph] 0.7.2claws7
 
        * src/quote_fmt.c
index e3b000287558129aa8734fc55a64186b98b5cf45..b09add3840ce5add41c00cee98cedb870bbf4b3b 100644 (file)
@@ -1,3 +1,31 @@
+2002-02-22
+
+       * src/manage_window.[ch]: ¥á¥¤¥ó¥¦¥£¥ó¥É¥¦¤ò±£¤·¤Æ¤¤¤ë¤È¤­¤Ë
+         ¥¯¥é¥Ã¥·¥å¤¹¤ë¥Ð¥°¤ò½¤Àµ¡£
+         MANAGE_WINDOW_SIGNALS_CONNECT(): ¿·µ¬¥Þ¥¯¥í¡£
+         "unmap_event", "destroy" ¥¤¥Ù¥ó¥È¤ò´Æ»ë¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+       * src/account.c;
+         src/addressbook.c
+         src/compose.c
+         src/export.c
+         src/filesel.c
+         src/foldersel.c
+         src/grouplistdialog.c
+         src/import.c
+         src/inputdialog.c
+         src/mainwindow.c
+         src/message_search.c
+         src/passphrase.c
+         src/prefs_account.c
+         src/prefs_common.c
+         src/prefs_customheader.c
+         src/prefs_display_header.c
+         src/prefs_filter.c
+         src/prefs_template.c
+         src/summary_search.c
+         src/summaryview.c: ¥¦¥£¥ó¥É¥¦´ÉÍý¤Î¤¿¤á¤Ë¥·¥°¥Ê¥ë¤òÀܳ¤¹¤ë¤Î¤Ë
+         MANAGE_WINDO_SIGNALS_CONNECT() ¥Þ¥¯¥í¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+
 2002-02-21
 
        * src/prefs_account.[ch]: ¼õ¿®¥µ¥¤¥ºÀ©¸Â¤Î¥ª¥×¥·¥ç¥ó¤òÄɲá£
index 7b5d7746677573b2c31a413db1df54f06de94094..68fb0d9b17ca0de9f741f588cd3aee777dbed481 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws7
+EXTRA_VERSION=claws8
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index e9643d9d334ca10b4b3318edccbd4ac9fb7099e9..a1f0dad55f7f4ef5120491e0d044c83dba84e5d2 100644 (file)
@@ -415,10 +415,7 @@ static void account_edit_create(void)
                            GTK_SIGNAL_FUNC (account_delete_event), NULL);
        gtk_signal_connect (GTK_OBJECT (window), "key_press_event",
                            GTK_SIGNAL_FUNC (account_key_pressed), NULL);
-       gtk_signal_connect (GTK_OBJECT (window), "focus_in_event",
-                           GTK_SIGNAL_FUNC (manage_window_focus_in), NULL);
-       gtk_signal_connect (GTK_OBJECT (window), "focus_out_event",
-                           GTK_SIGNAL_FUNC (manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT (window);
        gtk_widget_realize(window);
 
        vbox = gtk_vbox_new (FALSE, 10);
index 35f2e124346976bfa1fbfa966aa3f089a3896783..2451e8d72236da00cb9ef663acfcb0c3fa3b5020 100644 (file)
@@ -546,10 +546,7 @@ static void addressbook_create(void)
                           GTK_SIGNAL_FUNC(addressbook_close), NULL);
        gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
                           GTK_SIGNAL_FUNC(key_pressed), NULL);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_in_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_out_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT(window);
 
        vbox = gtk_vbox_new(FALSE, 0);
        gtk_container_add(GTK_CONTAINER(window), vbox);
index 4089c578489f96552982634eb74c76c4ac2a7378..1cf3c818d398f4f55f3a2958eff7c1e1d55fb01d 100644 (file)
@@ -4239,10 +4239,7 @@ static Compose *compose_create(PrefsAccount *account, ComposeMode mode)
                           GTK_SIGNAL_FUNC(compose_delete_cb), compose);
        gtk_signal_connect(GTK_OBJECT(window), "destroy",
                           GTK_SIGNAL_FUNC(compose_destroy_cb), compose);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_in_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_out_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT(window);
        gtk_widget_realize(window);
 
        gtkut_widget_set_composer_icon(window);
index 6a5f5c19c5e9ac2a3622e7ccf95cf1974c7f41b0..40fdf2ec126abcb586e335e32da4efac7266f6df 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-2002 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
@@ -128,10 +128,7 @@ static void export_create(void)
                           GTK_SIGNAL_FUNC(delete_event), NULL);
        gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
                           GTK_SIGNAL_FUNC(key_pressed), NULL);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_in_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_out_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT(window);
 
        vbox = gtk_vbox_new(FALSE, 4);
        gtk_container_add(GTK_CONTAINER(window), vbox);
index 6e11be363d1d87e3146e694d084c5d42b06fa3f0..f09ec9d9046d8f10f7b2b0d7253a087013bcdf35 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-2002 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
@@ -175,10 +175,7 @@ static void filesel_create(const gchar *title, gboolean multiple_files)
                           GTK_SIGNAL_FUNC(delete_event), NULL);
        gtk_signal_connect(GTK_OBJECT(filesel), "key_press_event",
                           GTK_SIGNAL_FUNC(key_pressed), NULL);
-       gtk_signal_connect(GTK_OBJECT(filesel), "focus_in_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect(GTK_OBJECT(filesel), "focus_out_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT(filesel);
 
        gtk_window_set_modal(GTK_WINDOW(filesel), TRUE);
 
index e9b10dd698995b84f86b77bbd18bae1e84f2853f..8aa51726b8086e3d31823643a63821d5056844e2 100644 (file)
@@ -149,10 +149,7 @@ static void foldersel_create(void)
                           GTK_SIGNAL_FUNC(delete_event), NULL);
        gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
                           GTK_SIGNAL_FUNC(key_pressed), NULL);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_in_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_out_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT(window);
 
        vbox = gtk_vbox_new(FALSE, 4);
        gtk_container_add(GTK_CONTAINER(window), vbox);
index 1c7bd7ab9146e2f0dfd7b6ef72c8cdda3d7b1186..3897dbcefc5b0c18897aab7b796699054a411ab3 100644 (file)
@@ -74,7 +74,7 @@ static void grouplist_dialog_set_list (const gchar    *pattern,
                                         gboolean        refresh);
 static void grouplist_search           (void);
 static void grouplist_clear            (void);
-static void grouplist_recv_func                (SockInfo       *sock,
+static gboolean grouplist_recv_func    (SockInfo       *sock,
                                         gint            count,
                                         gint            read_bytes,
                                         gpointer        data);
@@ -127,7 +127,7 @@ GSList *grouplist_dialog(Folder *folder)
 
        grouplist_dialog_set_list(NULL, TRUE);
 
-       gtk_main();
+       if (ack) gtk_main();
 
        manage_window_focus_out(dialog, NULL, NULL);
        gtk_widget_hide(dialog);
@@ -175,10 +175,7 @@ static void grouplist_dialog_create(void)
                           GTK_SIGNAL_FUNC(cancel_clicked), NULL);
        gtk_signal_connect(GTK_OBJECT(dialog), "key_press_event",
                           GTK_SIGNAL_FUNC(key_pressed), NULL);
-       gtk_signal_connect(GTK_OBJECT(dialog), "focus_in_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect(GTK_OBJECT(dialog), "focus_out_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT(dialog);
 
        gtk_widget_realize(dialog);
 
@@ -391,12 +388,13 @@ static void grouplist_dialog_set_list(const gchar *pattern, gboolean refresh)
                pattern = "*";
 
        if (refresh) {
+               ack = TRUE;
                grouplist_clear();
                recv_set_ui_func(grouplist_recv_func, NULL);
                group_list = news_get_group_list(news_folder);
                group_list = g_slist_reverse(group_list);
                recv_set_ui_func(NULL, NULL);
-               if (group_list == NULL) {
+               if (group_list == NULL && ack == TRUE) {
                        alertpanel_error(_("Can't retrieve newsgroup list."));
                        locked = FALSE;
                        return;
@@ -470,8 +468,8 @@ static void grouplist_clear(void)
                                           NULL);
 }
 
-static void grouplist_recv_func(SockInfo *sock, gint count, gint read_bytes,
-                               gpointer data)
+static gboolean grouplist_recv_func(SockInfo *sock, gint count, gint read_bytes,
+                                   gpointer data)
 {
        gchar buf[BUFFSIZE];
 
@@ -480,6 +478,10 @@ static void grouplist_recv_func(SockInfo *sock, gint count, gint read_bytes,
                   count, to_human_readable(read_bytes));
        gtk_label_set_text(GTK_LABEL(status_label), buf);
        GTK_EVENTS_FLUSH();
+       if (ack == FALSE)
+               return FALSE;
+       else
+               return TRUE;
 }
 
 static void ok_clicked(GtkWidget *widget, gpointer data)
index f551b367fa12b9c7457d8703d2ce40b4b6a2bcd1..6cc35ad6fd66372c285d8e57cdbc878eaaef281c 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-2002 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
@@ -137,10 +137,7 @@ static void import_create(void)
                           GTK_SIGNAL_FUNC(delete_event), NULL);
        gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
                           GTK_SIGNAL_FUNC(key_pressed), NULL);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_in_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_out_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT(window);
 
        vbox = gtk_vbox_new(FALSE, 4);
        gtk_container_add(GTK_CONTAINER(window), vbox);
index d79f2f53b6710e95690638622264208538d8c04e..db6754baeadb15ea0b7df60ef28d807f0a3ea2d0 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -97,7 +97,7 @@ static gint pop3_automaton_terminate  (SockInfo               *source,
 static GHashTable *inc_get_uidl_table  (PrefsAccount           *ac_prefs);
 static void inc_write_uidl_list                (Pop3State              *state);
 
-static void inc_pop3_recv_func         (SockInfo       *sock,
+static gboolean inc_pop3_recv_func     (SockInfo       *sock,
                                         gint            count,
                                         gint            read_bytes,
                                         gpointer        data);
@@ -753,8 +753,8 @@ static void inc_write_uidl_list(Pop3State *state)
        g_free(path);
 }
 
-static void inc_pop3_recv_func(SockInfo *sock, gint count, gint read_bytes,
-                              gpointer data)
+static gboolean inc_pop3_recv_func(SockInfo *sock, gint count, gint read_bytes,
+                                  gpointer data)
 {
        gchar buf[MSGBUFSIZE];
        IncSession *session = (IncSession *)data;
@@ -768,7 +768,8 @@ static void inc_pop3_recv_func(SockInfo *sock, gint count, gint read_bytes,
        if (cur_total > state->total_bytes)
                cur_total = state->total_bytes;
 
-       Xstrdup_a(total_size, to_human_readable(state->total_bytes), return);
+       Xstrdup_a(total_size, to_human_readable(state->total_bytes),
+                 return FALSE);
        g_snprintf(buf, sizeof(buf),
                   _("Retrieving message (%d / %d) (%s / %s)"),
                   state->cur_msg, state->count,
@@ -781,6 +782,11 @@ static void inc_pop3_recv_func(SockInfo *sock, gint count, gint read_bytes,
                (GTK_PROGRESS_BAR(inc_dialog->mainwin->progressbar),
                 (gfloat)cur_total / (gfloat)state->total_bytes);
        GTK_EVENTS_FLUSH();
+
+       if (state->inc_state == INC_CANCEL)
+               return FALSE;
+       else
+               return TRUE;
 }
 
 void inc_progress_update(Pop3State *state, Pop3Phase phase)
index 7c117c037a210a7be069ab68ee66e81162df765d..2f7656d55cbd5a51ef819c143fff6883051a801f 100644 (file)
@@ -170,10 +170,7 @@ static void input_dialog_create(void)
                           GTK_SIGNAL_FUNC(delete_event), NULL);
        gtk_signal_connect(GTK_OBJECT(dialog), "key_press_event",
                           GTK_SIGNAL_FUNC(key_pressed), NULL);
-       gtk_signal_connect(GTK_OBJECT(dialog), "focus_in_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect(GTK_OBJECT(dialog), "focus_out_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT(dialog);
 
        gtk_widget_realize(dialog);
 
index 716fcc1706138b3b54b75547275fbbfcf7918e72..5a03f78dbdc290ba1ceb5188d3c6889ecbef872d 100644 (file)
@@ -766,10 +766,7 @@ MainWindow *main_window_create(SeparateType type)
        gtk_window_set_policy(GTK_WINDOW(window), TRUE, TRUE, FALSE);
        gtk_signal_connect(GTK_OBJECT(window), "delete_event",
                           GTK_SIGNAL_FUNC(main_window_close_cb), mainwin);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_in_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_out_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT(window);
        gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
                                GTK_SIGNAL_FUNC(key_pressed), mainwin);
 
index 876a0dc3609acfdf554c54e23ecb7ee21d5a885e..29ec7f3f515511651c05c4d23101bf4d422fcbd2 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-2002 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
@@ -29,29 +29,58 @@ GtkWidget *focus_window;
 gint manage_window_focus_in(GtkWidget *widget, GdkEventFocus *event,
                            gpointer data)
 {
-       /* debug_print("Focus in event: window: %08x\n", (guint)widget); */
+       /* debug_print("Focus in event: window: %p\n", widget); */
 
        focus_window = widget;
 
-       return TRUE;
+       return FALSE;
 }
 
 gint manage_window_focus_out(GtkWidget *widget, GdkEventFocus *event,
                             gpointer data)
 {
-       /* debug_print("Focused window: %08x\n", (guint)focus_window); */
-       /* debug_print("Focus out event: window: %08x\n", (guint)widget); */
+       /* debug_print("Focused window: %p\n", focus_window); */
+       /* debug_print("Focus out event: window: %p\n", widget); */
 
        if (focus_window == widget)
                focus_window = NULL;
 
-       return TRUE;
+       return FALSE;
+}
+
+gint manage_window_unmap(GtkWidget *widget, GdkEventAny *event, gpointer data)
+{
+       /* debug_print("unmap event: %p\n", widget); */
+
+       if (focus_window == widget)
+               focus_window = NULL;
+
+       return FALSE;
+}
+
+gint manage_window_delete(GtkWidget *widget, GdkEventAny *event,
+                         gpointer data)
+{
+       /* debug_print("delete event: %p\n", widget); */
+
+       if (focus_window == widget)
+               focus_window = NULL;
+
+       return FALSE;
+}
+
+void manage_window_destroy(GtkWidget *widget, gpointer data)
+{
+       /* debug_print("destroy event: %p\n", widget); */
+
+       if (focus_window == widget)
+               focus_window = NULL;
 }
 
 void manage_window_set_transient(GtkWindow *window)
 {
-       /* debug_print("window = %08x, focus_window = %08x\n",
-                   (guint)window, (guint)focus_window); */
+       /* debug_print("manage_window_set_transient(): window = %p, focus_window = %p\n",
+                   window, focus_window); */
 
        if (window && focus_window)
                gtk_window_set_transient_for(window, GTK_WINDOW(focus_window));
index 04775605ddf1aa8f8497553027554c2874c9762e..26e1e1508bcfeaedf133ec3fca79144d60bea980 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-2002 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
 #include <gtk/gtkwidget.h>
 #include <gtk/gtkwindow.h>
 
+#define MANAGE_WINDOW_SIGNALS_CONNECT(window) \
+{ \
+       gtk_signal_connect(GTK_OBJECT(window), "focus_in_event", \
+                          GTK_SIGNAL_FUNC(manage_window_focus_in), NULL); \
+       gtk_signal_connect(GTK_OBJECT(window), "focus_out_event", \
+                          GTK_SIGNAL_FUNC(manage_window_focus_out), NULL); \
+       gtk_signal_connect(GTK_OBJECT(window), "unmap_event", \
+                          GTK_SIGNAL_FUNC(manage_window_unmap), NULL); \
+       gtk_signal_connect(GTK_OBJECT(window), "destroy", \
+                          GTK_SIGNAL_FUNC(manage_window_destroy), NULL); \
+}
+
 gint manage_window_focus_in            (GtkWidget      *widget,
                                         GdkEventFocus  *event,
                                         gpointer        data);
 gint manage_window_focus_out           (GtkWidget      *widget,
                                         GdkEventFocus  *event,
                                         gpointer        data);
+gint manage_window_unmap               (GtkWidget      *widget,
+                                        GdkEventAny    *event,
+                                        gpointer        data);
+gint manage_window_delete              (GtkWidget      *widget,
+                                        GdkEventAny    *event,
+                                        gpointer        data);
+void manage_window_destroy             (GtkWidget      *widget,
+                                        gpointer        data);
 
 void manage_window_set_transient       (GtkWindow      *window);
 
@@ -37,5 +57,4 @@ extern GtkWidget *focus_window;
 
 GtkWidget *manage_window_get_focus_window      (void);
 
-
 #endif /* __MANAGE_WINDOW_H__ */
index d3b80cdd9ae3b1aeb89fe32eb874fce7d1f41dd3..9503d13da7c0ca8f5e16259291a09d3779288bba 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-2002 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
@@ -93,10 +93,7 @@ static void message_search_create(MessageView *messageview)
                           GTK_SIGNAL_FUNC(gtk_widget_hide_on_delete), NULL);
        gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
                           GTK_SIGNAL_FUNC(key_pressed), NULL);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_in_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_out_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT(window);
 
        vbox1 = gtk_vbox_new (FALSE, 0);
        gtk_widget_show (vbox1);
index 16e71f7d1d047525f699a6d505e4f350ad897d38..fa7fedba8088aada1abdbc0980e546c8bfdb3d1f 100644 (file)
@@ -427,6 +427,8 @@ GSList *news_get_group_list(Folder *folder)
                statusbar_pop_all();
                if (recv_write_to_file(SESSION(session)->sock, filename) < 0) {
                        log_warning(_("can't retrieve newsgroup list\n"));
+                       session_destroy(SESSION(session));
+                       REMOTE_FOLDER(folder)->session = NULL;
                        g_free(filename);
                        return NULL;
                }
index f5c316bf0ed459dd22026b0efce17a7c755c9bc4..c36b9ea4a2f0589d11a61d52c48366c1ef6adec9 100644 (file)
@@ -85,10 +85,7 @@ gpgmegtk_passphrase_mbox (const gchar *desc)
                        GTK_SIGNAL_FUNC(passphrase_deleted), NULL);
     gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
                        GTK_SIGNAL_FUNC(passphrase_key_pressed), NULL);
-    gtk_signal_connect(GTK_OBJECT(window), "focus_in_event",
-                       GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-    gtk_signal_connect(GTK_OBJECT(window), "focus_out_event",
-                       GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+    MANAGE_WINDOW_SIGNALS_CONNECT(window);
     manage_window_set_transient(GTK_WINDOW(window));
 
     vbox = gtk_vbox_new(FALSE, 8);
index b672504627a0291a9445282d4b65129e4a93b807..fd6e882e585b26a0698ca87d019cf2a560133139 100644 (file)
--- a/src/pop.c
+++ b/src/pop.c
@@ -436,7 +436,8 @@ gint pop3_retr_recv(SockInfo *sock, gpointer data)
 
        if ((ok = pop3_ok(sock, NULL)) == PS_SUCCESS) {
                if (recv_write_to_file(sock, (file = get_tmp_file())) < 0) {
-                       state->inc_state = INC_NOSPACE;
+                       if (state->inc_state == INC_SUCCESS)
+                               state->inc_state = INC_NOSPACE;
                        return -1;
                }
 
index 74fb9c056320dfd6d804290b9cad614a396f70f3..41361889b0077a8285f9f80180c945d446fd74f2 100644 (file)
@@ -618,10 +618,8 @@ static void prefs_account_create(void)
                           GTK_SIGNAL_FUNC(prefs_account_deleted), NULL);
        gtk_signal_connect(GTK_OBJECT(dialog.window), "key_press_event",
                           GTK_SIGNAL_FUNC(prefs_account_key_pressed), NULL);
-       gtk_signal_connect(GTK_OBJECT(dialog.window), "focus_in_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect(GTK_OBJECT(dialog.window), "focus_out_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT(dialog.window);
+
        gtk_signal_connect(GTK_OBJECT(dialog.ok_btn), "clicked",
                           GTK_SIGNAL_FUNC(prefs_account_ok), NULL);
        gtk_signal_connect(GTK_OBJECT(dialog.apply_btn), "clicked",
index 3bdc65bc264540e5a7fe7400302619f588f72dbb..6c9ad6585a20e761068ca2404b468b9a07dbbc2c 100644 (file)
@@ -269,10 +269,7 @@ static void prefs_actions_create(MainWindow *mainwin)
                            GTK_SIGNAL_FUNC(prefs_actions_deleted), NULL);
        gtk_signal_connect (GTK_OBJECT(window), "key_press_event",
                            GTK_SIGNAL_FUNC(prefs_actions_key_pressed), NULL);
-       gtk_signal_connect (GTK_OBJECT(window), "focus_in_event",
-                           GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect (GTK_OBJECT(window), "focus_out_event",
-                           GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT (window);
        gtk_signal_connect (GTK_OBJECT(ok_btn), "clicked",
                            GTK_SIGNAL_FUNC(prefs_actions_ok), mainwin);
        gtk_signal_connect (GTK_OBJECT(cancel_btn), "clicked",
index de249b1c3e1d9b923da78f355d3f2fc6c39f84cf..5a783549047b39a32dc41e3a79c5afdfd3504fb7 100644 (file)
@@ -901,10 +901,8 @@ static void prefs_common_create(void)
                            GTK_SIGNAL_FUNC(prefs_common_deleted), NULL);
        gtk_signal_connect (GTK_OBJECT(dialog.window), "key_press_event",
                            GTK_SIGNAL_FUNC(prefs_common_key_pressed), NULL);
-       gtk_signal_connect (GTK_OBJECT(dialog.window), "focus_in_event",
-                           GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect (GTK_OBJECT(dialog.window), "focus_out_event",
-                           GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT(dialog.window);
+
        gtk_signal_connect (GTK_OBJECT(dialog.ok_btn), "clicked",
                            GTK_SIGNAL_FUNC(prefs_common_ok), NULL);
        gtk_signal_connect (GTK_OBJECT(dialog.apply_btn), "clicked",
@@ -3091,10 +3089,7 @@ static void prefs_quote_colors_dialog_create(void)
        gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
 
        gtk_widget_grab_default(ok_btn);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_in_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_out_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT(window);
        gtk_signal_connect(GTK_OBJECT(window), "delete_event",
                           GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
        gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
@@ -3414,10 +3409,7 @@ static void prefs_keybind_select(void)
        gtk_box_pack_end (GTK_BOX (hbox1), confirm_area, FALSE, FALSE, 0);
        gtk_widget_grab_default (ok_btn);
 
-       gtk_signal_connect (GTK_OBJECT (window), "focus_in_event",
-                           GTK_SIGNAL_FUNC (manage_window_focus_in), NULL);
-       gtk_signal_connect (GTK_OBJECT (window), "focus_out_event",
-                           GTK_SIGNAL_FUNC (manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT(window);
        gtk_signal_connect (GTK_OBJECT (window), "delete_event",
                            GTK_SIGNAL_FUNC (prefs_keybind_deleted), NULL);
        gtk_signal_connect (GTK_OBJECT (window), "key_press_event",
index cd562c29f5bf0e2c87dd77053c3aa4fc281f6ed7..b5f5dcaae3cdcf5480f9549855eb984bd93b3954 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-2002 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
@@ -161,10 +161,7 @@ static void prefs_custom_header_create(void)
        gtk_widget_grab_default (ok_btn);
 
        gtk_window_set_title (GTK_WINDOW(window), _("Custom header setting"));
-       gtk_signal_connect (GTK_OBJECT(window), "focus_in_event",
-                           GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect (GTK_OBJECT(window), "focus_out_event",
-                           GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT (window);
        gtk_signal_connect (GTK_OBJECT(window), "delete_event",
                            GTK_SIGNAL_FUNC(prefs_custom_header_deleted),
                            NULL);
index 1acbc4bd4dfeb24e0bb88d248de70b9fa41c5f5a..be5fe0301210ad2bcd6efb22ebe599fc80226b13 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-2002 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
@@ -199,10 +199,7 @@ static void prefs_display_header_create(void)
 
        gtk_window_set_title (GTK_WINDOW(window),
                              _("Display header setting"));
-       gtk_signal_connect (GTK_OBJECT(window), "focus_in_event",
-                           GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect (GTK_OBJECT(window), "focus_out_event",
-                           GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT(window);
        gtk_signal_connect (GTK_OBJECT(window), "delete_event",
                            GTK_SIGNAL_FUNC(prefs_display_header_deleted),
                            NULL);
index a4597560b63285d6a23fdb335c5ff34ceb2b7ee6..b57e7e8da2e2a90a1e1ce3724e4ed215cce251b2 100644 (file)
@@ -220,10 +220,7 @@ static void prefs_filter_create(void)
                            GTK_SIGNAL_FUNC(prefs_filter_deleted), NULL);
        gtk_signal_connect (GTK_OBJECT(window), "key_press_event",
                            GTK_SIGNAL_FUNC(prefs_filter_key_pressed), NULL);
-       gtk_signal_connect (GTK_OBJECT(window), "focus_in_event",
-                           GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect (GTK_OBJECT(window), "focus_out_event",
-                           GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT (window);
        gtk_signal_connect (GTK_OBJECT(ok_btn), "clicked",
                            GTK_SIGNAL_FUNC(prefs_filter_ok), NULL);
        gtk_signal_connect (GTK_OBJECT(cancel_btn), "clicked",
@@ -573,12 +570,15 @@ void prefs_filter_rename_path(const gchar *old_path, const gchar *new_path)
        gchar *dest_path;
        gint oldpathlen;
 
+       g_return_if_fail(old_path != NULL);
+       g_return_if_fail(new_path != NULL);
+
        for (cur = prefs_common.fltlist; cur != NULL; cur = cur->next) {
                Filter *flt = (Filter *)cur->data;
 
                oldpathlen = strlen(old_path);
-               if (!strncmp(old_path, (gchar *)flt->dest, oldpathlen)) {
-                       base = (gchar *)flt->dest + oldpathlen;
+               if (flt->dest && !strncmp(old_path, flt->dest, oldpathlen)) {
+                       base = flt->dest + oldpathlen;
                        while (*base == G_DIR_SEPARATOR) base++;
                        if (*base == '\0')
                                dest_path = g_strdup(new_path);
@@ -598,14 +598,14 @@ void prefs_filter_delete_path(const gchar *path)
 {
        GSList *cur;
        GSList *next;
-       gint len;
+
+       g_return_if_fail(path != NULL);
 
        for (cur = prefs_common.fltlist; cur != NULL; cur = next) {
                Filter *flt = (Filter *)cur->data;
                next = cur->next;
 
-               len = strlen(path);
-               if (!strncmp(path, flt->dest, len)) {
+               if (flt->dest && !strncmp(path, flt->dest, strlen(path))) {
                        filter_free(flt);
                        prefs_common.fltlist =
                                g_slist_remove(prefs_common.fltlist, flt);
index 40387e7fa12dae389a2c9367fe50e21b3286820d..f8743eddcdf5966e625e02fd54bc2283e35b63fe 100644 (file)
@@ -342,10 +342,7 @@ static void prefs_filtering_create(void)
                            GTK_SIGNAL_FUNC(prefs_filtering_deleted), NULL);
        gtk_signal_connect (GTK_OBJECT(window), "key_press_event",
                            GTK_SIGNAL_FUNC(prefs_filtering_key_pressed), NULL);
-       gtk_signal_connect (GTK_OBJECT(window), "focus_in_event",
-                           GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect (GTK_OBJECT(window), "focus_out_event",
-                           GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT (window);
        gtk_signal_connect (GTK_OBJECT(ok_btn), "clicked",
                            GTK_SIGNAL_FUNC(prefs_filtering_ok), NULL);
        gtk_signal_connect (GTK_OBJECT(cancel_btn), "clicked",
index 5a587e960f99c80ee0014cf8a25c38dbb3564089..3ecc8d039ef2b77425c130dc4a27599b053567b5 100644 (file)
@@ -297,10 +297,7 @@ void prefs_folder_item_create(void *folderview, FolderItem *item)
        gtk_window_set_policy (GTK_WINDOW (window), FALSE, TRUE, FALSE);
        gtk_signal_connect (GTK_OBJECT(window), "delete_event",
                            GTK_SIGNAL_FUNC(prefs_folder_item_delete_cb), dialog);
-       gtk_signal_connect (GTK_OBJECT(window), "focus_in_event",
-                           GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect (GTK_OBJECT(window), "focus_out_event",
-                           GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT (window);
 
        /* Table */
        table = gtk_table_new(4, 2, FALSE);
index 3265da81296cd5a577215d2af3e5b354bc2f4ae3..7b41b00593b994348213f59c8c7a214ce16dceac 100644 (file)
@@ -309,10 +309,7 @@ static void prefs_matcher_create(void)
                            GTK_SIGNAL_FUNC(prefs_matcher_deleted), NULL);
        gtk_signal_connect (GTK_OBJECT(window), "key_press_event",
                            GTK_SIGNAL_FUNC(prefs_matcher_key_pressed), NULL);
-       gtk_signal_connect (GTK_OBJECT(window), "focus_in_event",
-                           GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect (GTK_OBJECT(window), "focus_out_event",
-                           GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT (window);
        gtk_signal_connect (GTK_OBJECT(ok_btn), "clicked",
                            GTK_SIGNAL_FUNC(prefs_matcher_ok), NULL);
        gtk_signal_connect (GTK_OBJECT(cancel_btn), "clicked",
index a8327d4b0d440d71b62e50df3122eed4ce20d611..3c25470a2d1331a3f3314cbcacc99656f49acc89 100644 (file)
@@ -205,10 +205,7 @@ static void prefs_scoring_create(void)
                            GTK_SIGNAL_FUNC(prefs_scoring_deleted), NULL);
        gtk_signal_connect (GTK_OBJECT(window), "key_press_event",
                            GTK_SIGNAL_FUNC(prefs_scoring_key_pressed), NULL);
-       gtk_signal_connect (GTK_OBJECT(window), "focus_in_event",
-                           GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect (GTK_OBJECT(window), "focus_out_event",
-                           GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT (window);
        gtk_signal_connect (GTK_OBJECT(ok_btn), "clicked",
                            GTK_SIGNAL_FUNC(prefs_scoring_ok), NULL);
        gtk_signal_connect (GTK_OBJECT(cancel_btn), "clicked",
index b8e8f8c058aca11d93a9ca3d64b109b12aaf1324..ca3d2a547073a6fc20ceecbd1610ef3fb48a275b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Sylpheed templates subsystem 
  * Copyright (C) 2001 Alexander Barinov
- * Copyright (C) 2001 Hiroyuki Yamamoto
+ * Copyright (C) 2001-2002 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
@@ -266,10 +266,7 @@ static void prefs_template_window_create(void)
                           GTK_SIGNAL_FUNC(prefs_template_deleted_cb), NULL);
        gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
                           GTK_SIGNAL_FUNC(prefs_template_key_pressed_cb), NULL);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_in_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_out_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT(window);
        gtk_signal_connect(GTK_OBJECT(ok_btn), "clicked",
                           GTK_SIGNAL_FUNC(prefs_template_ok_cb), NULL);
        gtk_signal_connect(GTK_OBJECT(cancel_btn), "clicked",
index e4627582c04a9aaa6722c0dfd0c638afff0a730e..58fd147b8e0fdadb30c26140e44b85e3a0721cd1 100644 (file)
@@ -129,8 +129,10 @@ gint recv_write(SockInfo *sock, FILE *fp)
                           than 50msec, update UI */
                        if (tv_cur.tv_sec - tv_prev.tv_sec > 0 ||
                            tv_cur.tv_usec - tv_prev.tv_usec > UI_REFRESH_INTERVAL) {
-                               recv_ui_func(sock, count, bytes,
-                                            recv_ui_func_data);
+                               gboolean ret;
+                               ret = recv_ui_func(sock, count, bytes,
+                                                  recv_ui_func_data);
+                               if (ret == FALSE) return -1;
                                gettimeofday(&tv_prev, NULL);
                        }
                }
index bc1dd89dd4a41a944f72e7ad21bd7129d22963a7..e73a78f28fa36ab9267f82f7c6204ea0522d6ee6 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-2002 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
@@ -24,7 +24,7 @@
 
 #include "socket.h"
 
-typedef void (*RecvUIFunc)     (SockInfo       *sock,
+typedef gboolean (*RecvUIFunc) (SockInfo       *sock,
                                 gint            count,
                                 gint            read_bytes,
                                 gpointer        data);
index 4db58d6fdf3972f52d627249020d11af171b1a1b..568b8895eb8b185e87db406fa43015d5be84d3d3 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-2002 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
@@ -103,10 +103,7 @@ static void summary_search_create(SummaryView *summaryview)
                           GTK_SIGNAL_FUNC(gtk_widget_hide_on_delete), NULL);
        gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
                           GTK_SIGNAL_FUNC(key_pressed), NULL);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_in_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
-       gtk_signal_connect(GTK_OBJECT(window), "focus_out_event",
-                          GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
+       MANAGE_WINDOW_SIGNALS_CONNECT(window);
 
        vbox1 = gtk_vbox_new (FALSE, 0);
        gtk_widget_show (vbox1);
index 5c4582cf89f7eb8032dbf92a792ce11da356a4aa..84ed56c7db059ba063a4916ac448385272af03f6 100644 (file)
@@ -68,7 +68,6 @@
 #include "gtkutils.h"
 #include "stock_pixmap.h"
 #include "filesel.h"
-#include "manage_window.h"
 #include "alertpanel.h"
 #include "inputdialog.h"
 #include "statusbar.h"