[anjal] Preserve atleast one folder view type tab.



commit bdeb799b74a4745b643b8f7b5ee4d2b43a86e624
Author: Srinivasa Ragavan <sragavan novell com>
Date:   Wed Jun 17 08:13:21 2009 +0530

    Preserve atleast one folder view type tab.

 src/mail-view.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/mail-view.c b/src/mail-view.c
index c0e98a2..74545a2 100644
--- a/src/mail-view.c
+++ b/src/mail-view.c
@@ -235,6 +235,23 @@ mv_close_mcv (MailViewChild *mfv, MailView *mv)
 
 	if (g_list_length(mv->priv->children) == 1)
 		return;
+
+	/* Make sure atleast one folder view is open. */
+	if (mfv->type == MAIL_VIEW_FOLDER) {
+		GList *tmp = mv->priv->children;
+		gboolean found = FALSE;
+
+		while (!found && tmp) {
+			MailViewChild *tchild = (MailViewChild *)tmp->data;
+
+			if (tchild && tchild != mfv && tchild->type == MAIL_VIEW_FOLDER)
+				found = true;
+			tmp = tmp->next;
+		}
+
+		if (!found)
+			return;
+	}
 	g_signal_handlers_block_by_func(mv, mv_switch, mv);
 	gtk_notebook_remove_page ((GtkNotebook *)mv, n);
 	g_signal_handlers_unblock_by_func(mv, mv_switch, mv);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]