From 9c2f8007e10d401d50ce21d4ee8e49b116c5006b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Dapena=20Paz?= Date: Mon, 15 Feb 2010 18:06:30 +0100 Subject: [PATCH] On opening a new window, if current window is an editor: * If modified, don't close * If not modified, then close. --- src/hildon2/modest-hildon2-window-mgr.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/hildon2/modest-hildon2-window-mgr.c b/src/hildon2/modest-hildon2-window-mgr.c index 003c56c..06ed065 100644 --- a/src/hildon2/modest-hildon2-window-mgr.c +++ b/src/hildon2/modest-hildon2-window-mgr.c @@ -516,13 +516,21 @@ modest_hildon2_window_mgr_register_window (ModestWindowMgr *self, } /* Rules - * * toplevel = msg edit -> no action + * * toplevel = msg edit -> if not modified, close, if modified, stay * * same account -> no action * * window = accounts -> no action * * window = folders, mailboxes, headers: close all up to accounts window */ - if (MODEST_IS_MSG_EDIT_WINDOW (current_top) || + if (MODEST_IS_MSG_EDIT_WINDOW (current_top) && + !modest_msg_edit_window_is_modified (MODEST_MSG_EDIT_WINDOW (current_top))) { + gboolean retval; + + g_signal_emit_by_name (G_OBJECT (current_top), "delete-event", NULL, &retval); + current_top = (ModestWindow *) hildon_window_stack_peek (stack); + } + + if (MODEST_IS_MSG_EDIT_WINDOW (current_top) || (current_top && MODEST_IS_ACCOUNTS_WINDOW (window))) { gtk_window_present (GTK_WINDOW (current_top)); return FALSE; -- 1.7.9.5