Discard/Draft/Cancel when quitting with messages open
authorColin Leroy <colin@colino.net>
Tue, 5 Nov 2002 19:01:38 +0000 (19:01 +0000)
committerColin Leroy <colin@colino.net>
Tue, 5 Nov 2002 19:01:38 +0000 (19:01 +0000)
ChangeLog.claws
configure.in
src/main.c

index 5652a2e0cbf7d0b97a210542e4017a5e50e0d6e8..d994c4ef0f72d82d14d2bd6883ab233a5b0304e2 100644 (file)
@@ -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
index 5d1e8ff14adb31562e8ff50a972a447a6b896767..42eefb6be964c62553ad66daf4f609be6a482c2f 100644 (file)
@@ -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
index 610f84692efe91a39559cc40d44b4409aa260cc7..23a39c71eb9741448da611e01ee9bbab842d782c 100644 (file)
@@ -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);
        }