* src/modest-ui-actions.c
[modest] / src / widgets / modest-window-mgr.c
index 5cbae89..4d32a10 100644 (file)
@@ -673,9 +673,8 @@ on_window_destroy (ModestWindow *window,
 
                        /* If the user wants to close all the windows */
                        if ((dialog_response == GTK_RESPONSE_OK) 
-                                       || (dialog_response == GTK_RESPONSE_ACCEPT) 
-                                       || (dialog_response == GTK_RESPONSE_YES))
-                               {
+                           || (dialog_response == GTK_RESPONSE_ACCEPT) 
+                           || (dialog_response == GTK_RESPONSE_YES)) {
                                        GList *iter = priv->window_list;
                                        do {
                                                if (iter->data != window) {
@@ -688,11 +687,9 @@ on_window_destroy (ModestWindow *window,
                                                        iter = g_list_next (iter);
                                                }
                                        } while (iter);
-                               }
-                       else
-                               {
-                                       return TRUE;
-                               }
+                       } else {
+                               return TRUE;
+                       }
                }
        }
        else {
@@ -711,8 +708,9 @@ on_window_destroy (ModestWindow *window,
                                        modest_platform_run_confirmation_dialog (GTK_WINDOW (window),
                                                                                 _("mcen_nc_no_email_message_modified_save_changes"));
                                /* Save to drafts */
-                               if (response != GTK_RESPONSE_CANCEL)
-                                       modest_ui_actions_on_save_to_drafts (NULL, MODEST_MSG_EDIT_WINDOW (window));                            
+                               if (response == GTK_RESPONSE_OK)
+                                       if (!modest_ui_actions_on_save_to_drafts (NULL, MODEST_MSG_EDIT_WINDOW (window)))
+                                               return TRUE;
                        }
                }
        }