diff options
author | Srinivasa Ragavan <sragavan@gnome.org> | 2010-07-12 21:10:33 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-07-26 09:29:59 +0800 |
commit | 9849889089a50d0e7a6efc37037956af83abc358 (patch) | |
tree | 85f7c4c517b42de41ed80c432af9b42d2fe7f494 /mail | |
parent | 34900a590970d9eb3d398ba2ec18764b8b0f678c (diff) | |
download | gsoc2013-evolution-9849889089a50d0e7a6efc37037956af83abc358.tar.gz gsoc2013-evolution-9849889089a50d0e7a6efc37037956af83abc358.tar.zst gsoc2013-evolution-9849889089a50d0e7a6efc37037956af83abc358.zip |
Unique folder tabs
Diffstat (limited to 'mail')
-rw-r--r-- | mail/e-mail-notebook-view.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/mail/e-mail-notebook-view.c b/mail/e-mail-notebook-view.c index c15ca90fb8..16353cdb1d 100644 --- a/mail/e-mail-notebook-view.c +++ b/mail/e-mail-notebook-view.c @@ -203,6 +203,24 @@ mail_notebook_view_get_window (EMailReader *reader) return GTK_WINDOW (shell_window); } +static int +emnv_get_page_num (EMailNotebookView *view, + GtkWidget *widget) +{ + EMailNotebookViewPrivate *priv = view->priv; + int i, n; + + n = gtk_notebook_get_n_pages (priv->book); + + for (i=0; i<n; i++) { + GtkWidget *curr = gtk_notebook_get_nth_page (priv->book, i); + if (curr == widget) + return i; + } + + g_warn_if_reached (); +} + static void mail_notebook_view_set_folder (EMailReader *reader, CamelFolder *folder, @@ -216,15 +234,21 @@ mail_notebook_view_set_folder (EMailReader *reader, new_view = g_hash_table_lookup (priv->views, folder_uri); if (new_view) { + int curr = emnv_get_page_num (E_MAIL_NOTEBOOK_VIEW (reader), new_view); priv->current_view = (EMailView *)new_view; + gtk_notebook_set_current_page (priv->book, curr); return; } if (folder || folder_uri) { + int page; + new_view = e_mail_paned_view_new (E_MAIL_VIEW(reader)->content); gtk_widget_show (new_view); - gtk_notebook_append_page (priv->book, new_view, gtk_label_new (camel_folder_get_full_name(folder))); + page = gtk_notebook_append_page (priv->book, new_view, gtk_label_new (camel_folder_get_full_name(folder))); e_mail_reader_set_folder (E_MAIL_READER(new_view), folder, folder_uri); + gtk_notebook_set_current_page (priv->book, page); + g_hash_table_insert (priv->views, g_strdup(folder_uri), new_view); } } |