From 96dee52528d0acb9749fb53d5d1e46f9d655b6c1 Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Tue, 5 Nov 2002 19:01:38 +0000 Subject: [PATCH] Discard/Draft/Cancel when quitting with messages open --- ChangeLog.claws | 6 ++++++ configure.in | 2 +- src/main.c | 28 +++++++++++++++++++++------- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/ChangeLog.claws b/ChangeLog.claws index 5652a2e0c..d994c4ef0 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,9 @@ +2002-11-05 [colin] 0.8.5claws76 + + * src/main.c + Changes choices if compose windows are opened to + Discard, Draft, Don't quit + 2002-11-05 [thorsten] 0.8.5claws75 * src/compose.c diff --git a/configure.in b/configure.in index 5d1e8ff14..42eefb6be 100644 --- a/configure.in +++ b/configure.in @@ -11,7 +11,7 @@ MINOR_VERSION=8 MICRO_VERSION=5 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=claws75 +EXTRA_VERSION=claws76 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION dnl set $target diff --git a/src/main.c b/src/main.c index 610f84692..23a39c71e 100644 --- a/src/main.c +++ b/src/main.c @@ -507,7 +507,7 @@ static void initial_processing(FolderItem *item, gpointer data) main_window_cursor_normal(mainwin); } -void clean_quit(void) +static void draft_all_messages(void) { GList * compose_list = compose_get_compose_list(); GList * elem = NULL; @@ -516,7 +516,13 @@ void clean_quit(void) Compose *c = (Compose*)elem->data; compose_draft(c); } - } + } +} + +void clean_quit(void) +{ + draft_all_messages(); + if (prefs_common.warn_queued_on_exit) { /* disable the popup */ prefs_common.warn_queued_on_exit = FALSE; @@ -533,12 +539,20 @@ void app_will_exit(GtkWidget *widget, gpointer data) { MainWindow *mainwin = data; gchar *filename; - + if (compose_get_compose_list()) { - if (alertpanel(_("Notice"), - _("Composing message exists. Really quit?"), - _("OK"), _("Cancel"), NULL) != G_ALERTDEFAULT) - return; + gint val = alertpanel(_("Notice"), + _("Composing message exists."), + _("Draft them"), _("Discard them"), _("Don't quit")); + switch (val) { + case G_ALERTOTHER: + return; + case G_ALERTALTERNATE: + break; + default: + draft_all_messages(); + } + manage_window_focus_in(mainwin->window, NULL, NULL); } -- 2.25.1