2006-08-10 [colin] 2.4.0cvs39
[claws.git] / src / main.c
index 5694a58e2d49b72b5a33575168984c61c11c5c96..fef7bb54307b4848b24c36b6606ef7090e92812c 100644 (file)
@@ -487,6 +487,7 @@ int main(int argc, char *argv[])
        if (folder_read_list() < 0) {
                if (!run_wizard(mainwin, TRUE))
                        exit(1);
+               main_window_reflect_prefs_all_now();
                folder_write_list();
        }
 
@@ -638,10 +639,14 @@ static void save_all_caches(FolderItem *item, gpointer data)
                folder_item_write_cache(item);
 }
 
+static gboolean sc_exiting = FALSE;
+
 static void exit_sylpheed(MainWindow *mainwin)
 {
        gchar *filename;
 
+       sc_exiting = TRUE;
+
        debug_print("shutting down\n");
        inc_autocheck_timer_remove();
 
@@ -949,6 +954,12 @@ void app_will_exit(GtkWidget *widget, gpointer data)
 {
        MainWindow *mainwin = data;
        
+       if (sc_exiting == TRUE) {
+               debug_print("exit pending\n");
+               return;
+       }
+       sc_exiting = TRUE;
+       debug_print("exiting\n");
        if (compose_get_compose_list()) {
                gint val = alertpanel(_("Really quit?"),
                               _("Composing message exists."),
@@ -981,6 +992,11 @@ void app_will_exit(GtkWidget *widget, gpointer data)
        gtk_main_quit();
 }
 
+gboolean sylpheed_is_exiting(void)
+{
+       return sc_exiting;
+}
+
 /*
  * CLAWS: want this public so crash dialog can delete the
  * lock file too
@@ -1276,6 +1292,7 @@ static void quit_signal_handler(int sig)
 #ifdef SIGPIPE
        if (sig == SIGPIPE) {
                debug_print("caugth SIGPIPE, maybe X closing!\n");
+               signal(SIGPIPE, SIG_IGN); /* ignore following sigpipes */
                folder_write_list();
                folder_func_to_all_folders(save_all_caches, GINT_TO_POINTER(0));
                return;