prefs_destroy_cache();
+ compose_reopen_exit_drafts();
+
sc_starting = FALSE;
END_TIMING();
-
+
gtk_main();
exit_claws(mainwin);
folder_func_to_all_folders(save_all_caches, NULL);
folder_write_list();
- if (!emergency_exit) {
- main_window_get_size(mainwin);
- main_window_get_position(mainwin);
- }
+ main_window_get_size(mainwin);
+ main_window_get_position(mainwin);
+
prefs_common_write_config();
account_write_config_all();
addressbook_export_to_file();
}
}
-static gint get_queued_message_num(void)
-{
- FolderItem *queue;
-
- queue = folder_get_default_queue();
- if (!queue) {
- return -1;
- }
-
- folder_item_scan(queue);
- return queue->total_msgs;
-}
-
static void initial_processing(FolderItem *item, gpointer data)
{
MainWindow *mainwin = (MainWindow *)data;
{
GList *compose_list = NULL;
+ compose_clear_exit_drafts();
while ((compose_list = compose_get_compose_list()) != NULL) {
Compose *c = (Compose*)compose_list->data;
- compose_draft(c);
+ compose_draft(c, COMPOSE_DRAFT_FOR_EXIT);
}
}
gboolean clean_quit(gpointer data)
sc_exiting = TRUE;
debug_print("exiting\n");
if (compose_get_compose_list()) {
- gint val = alertpanel(_("Really quit?"),
- _("Composing message exists."),
- _("_Save to Draft"), _("_Discard them"), _("Do_n't quit"));
- switch (val) {
- case G_ALERTOTHER:
- main_window_popup(mainwin);
- sc_exiting = FALSE;
- return;
- case G_ALERTALTERNATE:
- break;
- default:
- draft_all_messages();
- }
-
- manage_window_focus_in(mainwin->window, NULL, NULL);
+ draft_all_messages();
}
- if (prefs_common.warn_queued_on_exit && get_queued_message_num() > 0) {
+ if (prefs_common.warn_queued_on_exit && procmsg_have_queued_mails_fast()) {
if (alertpanel(_("Queued messages"),
_("Some unsent messages are queued. Exit now?"),
GTK_STOCK_CANCEL, GTK_STOCK_OK, NULL)
}
sock_cleanup();
+ summary_clear_list(mainwin->summaryview);
if (folderview_get_selected_item(mainwin->folderview))
folder_item_close(folderview_get_selected_item(mainwin->folderview));
gtk_main_quit();