modest_platform_run_confirmation_dialog (GTK_WINDOW (window),
_("mcen_nc_no_email_message_modified_save_changes"));
/* Save to drafts */
- if (response != GTK_RESPONSE_CANCEL)
+ if (response == GTK_RESPONSE_OK)
if (!modest_ui_actions_on_save_to_drafts (NULL, MODEST_MSG_EDIT_WINDOW (window)))
return TRUE;
}
GList *win;
ModestWindowMgrPrivate *priv;
gulong *tmp, handler_id;
+ GSList* pending_ops = NULL;
g_return_if_fail (MODEST_IS_WINDOW_MGR (self));
g_return_if_fail (MODEST_IS_WINDOW (window));
g_hash_table_remove (priv->destroy_handlers, window);
/* cancel open and receive operations */
- if (MODEST_IS_MSG_VIEW_WINDOW (window)) {
+ pending_ops = modest_mail_operation_queue_get_by_source (modest_runtime_get_mail_operation_queue (),
+ G_OBJECT (window));
+ while (pending_ops != NULL) {
ModestMailOperationTypeOperation type;
- GSList* pending_ops = NULL;
GSList* tmp_list = NULL;
- pending_ops = modest_mail_operation_queue_get_by_source (
- modest_runtime_get_mail_operation_queue (),
- G_OBJECT (window));
- while (pending_ops != NULL) {
- type = modest_mail_operation_get_type_operation (MODEST_MAIL_OPERATION (pending_ops->data));
- if (type == MODEST_MAIL_OPERATION_TYPE_RECEIVE || type == MODEST_MAIL_OPERATION_TYPE_OPEN) {
- modest_mail_operation_cancel (pending_ops->data);
- }
- g_object_unref (G_OBJECT (pending_ops->data));
- tmp_list = pending_ops;
- pending_ops = g_slist_next (pending_ops);
- g_slist_free_1 (tmp_list);
+
+ type = modest_mail_operation_get_type_operation (MODEST_MAIL_OPERATION (pending_ops->data));
+ if (type == MODEST_MAIL_OPERATION_TYPE_RECEIVE || type == MODEST_MAIL_OPERATION_TYPE_OPEN) {
+ modest_mail_operation_cancel (pending_ops->data);
}
+ g_object_unref (G_OBJECT (pending_ops->data));
+ tmp_list = pending_ops;
+ pending_ops = g_slist_next (pending_ops);
+ g_slist_free_1 (tmp_list);
}
/* Disconnect the "delete-event" handler, we won't need it anymore */
g_mutex_unlock (priv->queue_lock);
if (!old_modal) {
+ /* make us transient wrt the main window then */
+ ModestWindow *main_win = modest_window_mgr_get_main_window (self, FALSE);
+ if (GTK_WINDOW(main_win) != window) /* they should not be the same */
+ gtk_window_set_transient_for (window, GTK_WINDOW(main_win));
+
gtk_window_set_modal (window, TRUE);
} else {
/* un-modalize the old one; the one on top should be the