diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2003-11-15 03:33:55 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2003-11-15 03:33:55 +0800 |
commit | 13f904ee3cd9f9139a4c774d923d36f59c8cf5b4 (patch) | |
tree | 7f1c0e2d78ab9c3b71e1b92807834f0fd400bcba | |
parent | 5fcb5903d844a94168593965438310285b420828 (diff) | |
download | gsoc2013-evolution-13f904ee3cd9f9139a4c774d923d36f59c8cf5b4.tar.gz gsoc2013-evolution-13f904ee3cd9f9139a4c774d923d36f59c8cf5b4.tar.zst gsoc2013-evolution-13f904ee3cd9f9139a4c774d923d36f59c8cf5b4.zip |
Don't create a new view anymore, simply set the new folder uri on the
2003-11-14 Jeffrey Stedfast <fejj@ximian.com>
* mail-component.c (folder_selected_cb): Don't create a new view
anymore, simply set the new folder uri on the folder browser. This
makes the mailer use a lot less memory than in 1.x
svn path=/trunk/; revision=23358
-rw-r--r-- | mail/ChangeLog | 6 | ||||
-rw-r--r-- | mail/mail-component.c | 64 |
2 files changed, 12 insertions, 58 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index d69009a108..17a38d9be6 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,11 @@ 2003-11-14 Jeffrey Stedfast <fejj@ximian.com> + * mail-component.c (folder_selected_cb): Don't create a new view + anymore, simply set the new folder uri on the folder browser. This + makes the mailer use a lot less memory than in 1.x + +2003-11-14 Jeffrey Stedfast <fejj@ximian.com> + * em-folder-selection.c (folder_selected_cb): Only set OK to sensitive if the selected node is not a store node. diff --git a/mail/mail-component.c b/mail/mail-component.c index 5f4a1d5995..54f4dcede9 100644 --- a/mail/mail-component.c +++ b/mail/mail-component.c @@ -223,65 +223,13 @@ setup_local_store(MailComponent *component) g_free(store_uri); } - -static BonoboControl * -create_noselect_control (void) -{ - GtkWidget *label; - - label = gtk_label_new (_("This folder cannot contain messages.")); - gtk_widget_show (label); - - return bonobo_control_new (label); -} - -static GtkWidget * -create_view_widget (EMFolderTree *emft, const char *path, const char *uri) -{ - BonoboControl *control; - const char *noselect; - CamelURL *url; - - if (!strcmp (path, "/")) { - /* user selected a CamelStore node... */ - /* NOTE: we *could* display some sort of statistics control for the store here, maybe? something like Outlook does? */ - control = create_noselect_control (); - } else { - url = camel_url_new (uri, NULL); - noselect = url ? camel_url_get_param (url, "noselect") : NULL; - if (noselect && !strcasecmp (noselect, "yes")) - control = create_noselect_control (); - else - control = folder_browser_factory_new_control (uri); - camel_url_free (url); - } - - if (!control) - return NULL; - - /* EPFIXME: This leaks the control. */ - return bonobo_widget_new_control_from_objref (BONOBO_OBJREF (control), CORBA_OBJECT_NIL); -} - static void -folder_selected_cb (EMFolderTree *emft, const char *path, const char *uri, GtkBox *vbox) -{ - GtkWidget *view; - GList *l, *n; - - /* there should only ever be 1 child */ - l = gtk_container_get_children (GTK_CONTAINER (vbox)); - while (l != NULL) { - n = l->next; - gtk_widget_destroy (l->data); - g_list_free_1 (l); - l = n; - } - - view = create_view_widget (emft, path, uri); - gtk_widget_show (view); +folder_selected_cb (EMFolderTree *emft, const char *path, const char *uri, EMFolderView *view) +{ + if (!path || !strcmp (path, "/")) + return; - gtk_box_pack_start_defaults (vbox, view); + em_folder_view_set_folder_uri (view, uri); } @@ -355,7 +303,7 @@ impl_createControls (PortableServer_Servant servant, GtkWidget *view_widget; tree_widget = (GtkWidget *) priv->emft; - view_widget = gtk_vbox_new (0, TRUE); + view_widget = em_folder_browser_new (); gtk_widget_show (tree_widget); gtk_widget_show (view_widget); |