[Evolution-hackers] New Menu Layout



So,

Here is the initial working patch to change the layout for menus in the
Mailer. The plan is to do this work incrementally, and the Mailer is the
largest component in terms of menus, and number of users, so it was done
first. It is not 100% complete, but this patch does have >= 90% of the
changes necessary for it. Some of the changes are not implemented in
this patch, as they were casuing other components to crash. Most
notable, the "Custom View" and "Search" menus, were causing other
componets to crash, as they access them as well, with generic paths.

I want to get this patch in CVS as soon as possible, preferrably before
the first release of 2.3, so that we can get a lot of testing during the
2.3 cycle. So, once this patch is approved and I commit it to CVS, I
will start working to get the rest of the components up to par as well,
and will take feedback about these menus and work to improve them still.

-- dobey

? calendar/gui/apps_evolution_calendar-2.0.schemas
? calendar/gui/apps_evolution_calendar-2.4.schemas
? help/C/evolution-2.0-C.omf
? help/C/evolution-2.0.xml
? help/C/evolution-2.2-C.omf
? help/C/evolution-2.2.xml
? help/C/evolution-2.4-C.omf
? help/C/evolution-2.4.xml
? mail/evolution-mail-2.0.schemas
? mail/evolution-mail-2.4.schemas
? mail/folder-tree.patch
? mail/default/zh_CN/Makefile
? mail/default/zh_CN/Makefile.in
? plugins/addressbook-file/Makefile
? plugins/addressbook-file/Makefile.in
? plugins/addressbook-file/org-gnome-addressbook-file.eplug
? plugins/addressbook-groupwise/Makefile
? plugins/addressbook-groupwise/Makefile.in
? plugins/addressbook-groupwise/org-gnome-addressbook-groupwise.eplug
? plugins/default-source/Makefile
? plugins/default-source/Makefile.in
? plugins/default-source/org-gnome-default-source.eplug
? plugins/exchange-account-setup/Makefile
? plugins/exchange-account-setup/Makefile.in
? plugins/exchange-account-setup/org-gnome-exchange-account-setup.eplug
? plugins/groupwise-account-setup/Makefile
? plugins/groupwise-account-setup/Makefile.in
? plugins/groupwise-account-setup/org-gnome-gw-account-setup.eplug
? plugins/groupwise-send-options/Makefile
? plugins/groupwise-send-options/Makefile.in
? plugins/groupwise-send-options/org-gnome-compose-send-options.eplug
? plugins/groupwise-status-tracking/Makefile
? plugins/groupwise-status-tracking/Makefile.in
? plugins/groupwise-status-tracking/org-gnome-status-track.eplug
? plugins/new-mail-notify/Makefile
? plugins/new-mail-notify/Makefile.in
? plugins/new-mail-notify/org-gnome-new-mail-notify.eplug
? plugins/send-options/Makefile
? plugins/send-options/Makefile.in
? plugins/send-options/org-gnome-send-options.eplug
? plugins/shared-folder/Makefile
? plugins/shared-folder/Makefile.in
? plugins/shared-folder/org-gnome-shared-folder.eplug
? shell/Evolution-Addressbook-SelectNames-common.c
? shell/Evolution-Addressbook-SelectNames-skels.c
? shell/Evolution-Addressbook-SelectNames-stubs.c
? shell/Evolution-Addressbook-SelectNames.h
? widgets/e-timezone-dialog/e-timezone-dialog.gladep
? widgets/misc/gtkmenutoolbutton.c
? widgets/misc/gtkmenutoolbutton.h
? widgets/misc/test-source-option-menu
? widgets/misc/test-source-selector
? widgets/misc/test-title-bar
Index: mail/Makefile.am
===================================================================
RCS file: /cvs/gnome/evolution/mail/Makefile.am,v
retrieving revision 1.259
diff -u -p -r1.259 Makefile.am
--- mail/Makefile.am	25 Jan 2005 02:26:33 -0000	1.259
+++ mail/Makefile.am	20 Apr 2005 19:16:58 -0000
@@ -93,6 +93,8 @@ libevolution_mail_la_SOURCES =			\
 	em-folder-tree-model.h			\
 	em-folder-tree.c			\
 	em-folder-tree.h			\
+	em-folder-utils.c			\
+	em-folder-utils.h			\
 	em-folder-view.c			\
 	em-folder-view.h			\
 	em-format-hook.c			\
Index: mail/em-folder-browser.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-browser.c,v
retrieving revision 1.59
diff -u -p -r1.59 em-folder-browser.c
--- mail/em-folder-browser.c	28 Feb 2005 04:31:50 -0000	1.59
+++ mail/em-folder-browser.c	20 Apr 2005 19:16:58 -0000
@@ -73,6 +73,7 @@
 #include "em-format-html-print.h"
 #include "em-folder-browser.h"
 #include "em-folder-properties.h"
+#include "em-folder-utils.h"
 #include "em-subscribe-editor.h"
 #include "em-menu.h"
 #include "message-list.h"
@@ -569,6 +570,91 @@ emfb_folder_properties(BonoboUIComponent
 }
 
 static void
+emfb_folder_copy(BonoboUIComponent *uid, void *data, const char *path)
+{
+	EMFolderBrowser *emfb = data;
+	CamelFolderInfo *fi = NULL;
+	CamelException ex;
+
+	camel_exception_init (&ex);
+
+	if ((fi = camel_store_get_folder_info (emfb->view.folder->parent_store,
+					       emfb->view.folder->full_name,
+					       CAMEL_STORE_FOLDER_INFO_FAST,
+					       &ex)) != NULL)
+		emfu_copy_folder (fi);
+
+	camel_exception_clear (&ex);
+
+	return;
+}
+
+static void
+emfb_folder_move(BonoboUIComponent *uid, void *data, const char *path)
+{
+	EMFolderBrowser *emfb = data;
+	CamelFolderInfo *fi = NULL;
+	CamelException ex;
+
+	camel_exception_init (&ex);
+
+	if ((fi = camel_store_get_folder_info (emfb->view.folder->parent_store,
+					       emfb->view.folder->full_name,
+					       CAMEL_STORE_FOLDER_INFO_FAST,
+					       &ex)) != NULL)
+		emfu_move_folder (fi);
+
+	camel_exception_clear (&ex);
+
+	return;
+}
+
+static void
+emfb_folder_delete(BonoboUIComponent *uid, void *data, const char *path)
+{
+	EMFolderBrowser *emfb = data;
+
+	emfu_delete_folder (emfb->view.folder);
+
+	return;
+}
+
+static void
+emfb_folder_rename(BonoboUIComponent *uid, void *data, const char *path)
+{
+	EMFolderBrowser *emfb = data;
+
+	emfu_rename_folder (emfb->view.folder);
+
+	return;
+}
+
+static void
+emfb_folder_create(BonoboUIComponent *uid, void *data, const char *path)
+{
+	EMFolderBrowser *emfb = data;
+	CamelFolderInfo *fi = NULL;
+	CamelException ex;
+
+	camel_exception_init (&ex);
+
+	if (emfb->view.folder) {
+		if ((fi = camel_store_get_folder_info (emfb->view.folder->parent_store,
+						       emfb->view.folder->full_name,
+						       CAMEL_STORE_FOLDER_INFO_FAST,
+						       &ex)) != NULL)
+			emfu_folder_create (fi);
+	} else {
+		emfu_folder_create (NULL);
+	}
+			
+
+	camel_exception_clear (&ex);
+
+	return;
+}
+
+static void
 emfb_folder_expunge(BonoboUIComponent *uid, void *data, const char *path)
 {
 	EMFolderBrowser *emfb = data;
@@ -636,17 +722,6 @@ emfb_empty_trash(BonoboUIComponent *uid,
 }
 
 static void
-emfb_mail_compose(BonoboUIComponent *uid, void *data, const char *path)
-{
-	EMFolderView *emfv = data;
-
-	if (!em_utils_check_user_can_send_mail((GtkWidget *)emfv))
-		return;
-
-	em_utils_compose_new_message(emfv->folder_uri);
-}
-
-static void
 emfb_mail_stop(BonoboUIComponent *uid, void *data, const char *path)
 {
 	mail_cancel_all();
@@ -712,8 +787,13 @@ static BonoboUIVerb emfb_verbs[] = {
 	BONOBO_UI_UNSAFE_VERB ("ViewShowAll", emfb_view_show_all),
 	/* ViewThreaded is a toggle */
 
+	BONOBO_UI_UNSAFE_VERB ("FolderCopy", emfb_folder_copy),
+	BONOBO_UI_UNSAFE_VERB ("FolderMove", emfb_folder_move),
+	BONOBO_UI_UNSAFE_VERB ("FolderDelete", emfb_folder_delete),
+	BONOBO_UI_UNSAFE_VERB ("FolderRename", emfb_folder_rename),
+	BONOBO_UI_UNSAFE_VERB ("FolderCreate", emfb_folder_create),
+
 	BONOBO_UI_UNSAFE_VERB ("EmptyTrash", emfb_empty_trash),
-	BONOBO_UI_UNSAFE_VERB ("MailCompose", emfb_mail_compose),
 	BONOBO_UI_UNSAFE_VERB ("MailPost", emfb_mail_post),
 	BONOBO_UI_UNSAFE_VERB ("MailStop", emfb_mail_stop),
 	BONOBO_UI_UNSAFE_VERB ("ToolsFilters", emfb_tools_filters),
@@ -726,11 +806,8 @@ static BonoboUIVerb emfb_verbs[] = {
 
 static EPixmap emfb_pixmaps[] = {
 	E_PIXMAP ("/commands/ChangeFolderProperties", "stock_folder-properties", E_ICON_SIZE_MENU),
-	E_PIXMAP ("/commands/ViewHideRead", "stock_mail-hide-read", E_ICON_SIZE_MENU),
-	E_PIXMAP ("/commands/ViewHideSelected", "stock_mail-hide-selected", E_ICON_SIZE_MENU),
-	E_PIXMAP ("/commands/ViewShowAll", "stock_show-all", E_ICON_SIZE_MENU),
-	
-	E_PIXMAP ("/commands/MailCompose", "stock_mail-compose", E_ICON_SIZE_MENU),
+	E_PIXMAP ("/commands/FolderCopy", "stock_folder-copy", E_ICON_SIZE_MENU),
+	E_PIXMAP ("/commands/FolderMove", "stock_folder-move", E_ICON_SIZE_MENU),
 
 	E_PIXMAP_END
 };
@@ -740,10 +817,13 @@ static const EMFolderViewEnable emfb_ena
 	{ "EditSelectAll", EM_POPUP_SELECT_FOLDER },
 	{ "EditSelectThread", EM_FOLDER_VIEW_SELECT_THREADED },
 	{ "FolderExpunge", EM_POPUP_SELECT_FOLDER },
+	{ "FolderCopy", EM_POPUP_SELECT_FOLDER },
+	{ "FolderMove", EM_POPUP_SELECT_FOLDER },
+	{ "FolderDelete", EM_POPUP_SELECT_FOLDER },
+	{ "FolderRename", EM_POPUP_SELECT_FOLDER },
 	{ "MailPost", EM_POPUP_SELECT_FOLDER },
 	{ "MessageMarkAllAsRead", EM_POPUP_SELECT_FOLDER },
 	{ "ViewHideSelected", EM_POPUP_SELECT_MANY },
-	{ "ViewShowAll", EM_FOLDER_VIEW_SELECT_HIDDEN },
 	{ NULL },
 };
 
Index: mail/em-folder-selector.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-selector.c,v
retrieving revision 1.32
diff -u -p -r1.32 em-folder-selector.c
--- mail/em-folder-selector.c	6 Oct 2004 03:33:55 -0000	1.32
+++ mail/em-folder-selector.c	20 Apr 2005 19:16:58 -0000
@@ -161,28 +161,7 @@ emfs_response (GtkWidget *dialog, int re
 	if (response != EM_FOLDER_SELECTOR_RESPONSE_NEW)
 		return;
 	
-	model = em_folder_tree_get_model (emfs->emft);
-	emft = (EMFolderTree *) em_folder_tree_new_with_model (model);
-	dialog = em_folder_selector_create_new (emft, 0, _("Create New Folder"), _("Specify where to create the folder:"));
-	gtk_window_set_transient_for ((GtkWindow *) dialog, (GtkWindow *) emfs);
-	uri = em_folder_selector_get_selected_uri (emfs);
-	if (uri)
-		em_folder_tree_set_selected (emft, uri);
-	
-	if (gtk_dialog_run ((GtkDialog *) dialog) == GTK_RESPONSE_OK) {
-		uri = em_folder_selector_get_selected_uri ((EMFolderSelector *) dialog);
-		path = em_folder_selector_get_selected_path ((EMFolderSelector *) dialog);
-		
-		g_free (emfs->created_uri);
-		emfs->created_uri = g_strdup (uri);
-		
-		if (emfs->created_id == 0)
-			emfs->created_id = g_signal_connect (model, "folder-added", G_CALLBACK (folder_created_cb), emfs);
-		
-		em_folder_tree_create_folder (emfs->emft, path, uri);
-	}
-	
-	gtk_widget_destroy (dialog);
+	emfu_folder_create (NULL);
 	
 	g_signal_stop_emission_by_name (emfs, "response");
 }
@@ -421,13 +400,10 @@ em_folder_selector_get_selected_path (EM
 		char *newpath;
 		
 		name = gtk_entry_get_text (emfs->name_entry);
-		if (strcmp (path, "") != 0)
-			newpath = g_strdup_printf ("%s/%s", path?path:"", name);
-		else
-			newpath = g_strdup (name);
-		
+		newpath = g_strdup_printf ("%s/%s", path?path:"", name);
+
 		g_free(path);
-		emfs->selected_path = newpath;
+		emfs->selected_path = g_strdup (newpath);
 	} else {
 		g_free(emfs->selected_path);
 		emfs->selected_path = path?path:g_strdup("");
Index: mail/em-folder-tree.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-tree.c,v
retrieving revision 1.147
diff -u -p -r1.147 em-folder-tree.c
--- mail/em-folder-tree.c	13 Apr 2005 03:32:58 -0000	1.147
+++ mail/em-folder-tree.c	20 Apr 2005 19:16:58 -0000
@@ -67,6 +67,7 @@
 #include "em-popup.h"
 #include "em-marshal.h"
 #include "em-folder-tree.h"
+#include "em-folder-utils.h"
 #include "em-folder-selector.h"
 #include "em-folder-selection.h"
 #include "em-folder-properties.h"
@@ -2003,597 +2004,40 @@ emft_popup_open_new (GtkWidget *item, EM
 #endif
 
 
-struct _EMCopyFolders {
-	struct _mail_msg msg;
-	
-	/* input data */
-	CamelStore *fromstore;
-	CamelStore *tostore;
-	
-	char *frombase;
-	char *tobase;
-	
-	int delete;
-};
-
-static char *
-emft_copy_folders__desc (struct _mail_msg *mm, int complete)
-{
-	struct _EMCopyFolders *m = (struct _EMCopyFolders *) mm;
-	
-	return g_strdup_printf (_("Copying `%s' to `%s'"), m->frombase, m->tobase);
-}
-
-static void
-emft_copy_folders__copy (struct _mail_msg *mm)
-{
-	struct _EMCopyFolders *m = (struct _EMCopyFolders *) mm;
-	guint32 flags = CAMEL_STORE_FOLDER_INFO_FAST | CAMEL_STORE_FOLDER_INFO_RECURSIVE;
-	GList *pending = NULL, *deleting = NULL, *l;
-	GString *fromname, *toname;
-	CamelFolderInfo *fi;
-	const char *tmp;
-	int fromlen;
-	
-	if (camel_store_supports_subscriptions (m->fromstore))
-		flags |= CAMEL_STORE_FOLDER_INFO_SUBSCRIBED;
-	
-	if (!(fi = camel_store_get_folder_info (m->fromstore, m->frombase, flags, &mm->ex)))
-		return;
-	
-	pending = g_list_append (pending, fi);
-	
-	toname = g_string_new ("");
-	fromname = g_string_new ("");
-	
-	tmp = strrchr (m->frombase, '/');
-	if (tmp == NULL)
-		fromlen = 0;
-	else
-		fromlen = tmp - m->frombase + 1;
-	
-	d(printf ("top name is '%s'\n", fi->full_name));
-	
-	while (pending) {
-		CamelFolderInfo *info = pending->data;
-		
-		pending = g_list_remove_link (pending, pending);
-		while (info) {
-			CamelFolder *fromfolder, *tofolder;
-			GPtrArray *uids;
-			int deleted = 0;
-			
-			if (info->child)
-				pending = g_list_append (pending, info->child);
-			
-			if (m->tobase[0])
-				g_string_printf (toname, "%s/%s", m->tobase, info->full_name + fromlen);
-			else
-				g_string_printf (toname, "%s", info->full_name + fromlen);
-			
-			d(printf ("Copying from '%s' to '%s'\n", info->full_name, toname->str));
-			
-			/* This makes sure we create the same tree, e.g. from a nonselectable source */
-			/* Not sure if this is really the 'right thing', e.g. for spool stores, but it makes the ui work */
-			if ((info->flags & CAMEL_FOLDER_NOSELECT) == 0) {
-				d(printf ("this folder is selectable\n"));
-				if (m->tostore == m->fromstore && m->delete) {
-					camel_store_rename_folder (m->fromstore, info->full_name, toname->str, &mm->ex);
-					if (camel_exception_is_set (&mm->ex))
-						goto exception;
-					
-					/* this folder no longer exists, unsubscribe it */
-					if (camel_store_supports_subscriptions (m->fromstore))
-						camel_store_unsubscribe_folder (m->fromstore, info->full_name, NULL);
-					
-					deleted = 1;
-				} else {
-					if (!(fromfolder = camel_store_get_folder (m->fromstore, info->full_name, 0, &mm->ex)))
-						goto exception;
-					
-					if (!(tofolder = camel_store_get_folder (m->tostore, toname->str, CAMEL_STORE_FOLDER_CREATE, &mm->ex))) {
-						camel_object_unref (fromfolder);
-						goto exception;
-					}
-					
-					uids = camel_folder_get_uids (fromfolder);
-					camel_folder_transfer_messages_to (fromfolder, uids, tofolder, NULL, m->delete, &mm->ex);
-					camel_folder_free_uids (fromfolder, uids);
-					
-					if (m->delete)
-						camel_folder_sync(fromfolder, TRUE, NULL);
-					
-					camel_object_unref (fromfolder);
-					camel_object_unref (tofolder);
-				}
-			}
-			
-			if (camel_exception_is_set (&mm->ex))
-				goto exception;
-			else if (m->delete && !deleted)
-				deleting = g_list_prepend (deleting, info);
-			
-			/* subscribe to the new folder if appropriate */
-			if (camel_store_supports_subscriptions (m->tostore)
-			    && !camel_store_folder_subscribed (m->tostore, toname->str))
-				camel_store_subscribe_folder (m->tostore, toname->str, NULL);
-			
-			info = info->next;
-		}
-	}
-	
-	/* delete the folders in reverse order from how we copyied them, if we are deleting any */
-	l = deleting;
-	while (l) {
-		CamelFolderInfo *info = l->data;
-		
-		d(printf ("deleting folder '%s'\n", info->full_name));
-		
-		/* FIXME: we need to do something with the exception
-		   since otherwise the users sees a failed operation
-		   with no error message or even any warnings */
-		if (camel_store_supports_subscriptions (m->fromstore))
-			camel_store_unsubscribe_folder (m->fromstore, info->full_name, NULL);
-		
-		camel_store_delete_folder (m->fromstore, info->full_name, NULL);
-		l = l->next;
-	}
-	
- exception:
-	
-	camel_store_free_folder_info (m->fromstore, fi);
-	g_list_free (deleting);
-	
-	g_string_free (toname, TRUE);
-	g_string_free (fromname, TRUE);
-}
-
-static void
-emft_copy_folders__free (struct _mail_msg *mm)
-{
-	struct _EMCopyFolders *m = (struct _EMCopyFolders *) mm;
-	
-	camel_object_unref (m->fromstore);
-	camel_object_unref (m->tostore);
-	
-	g_free (m->frombase);
-	g_free (m->tobase);
-}
-
-static struct _mail_msg_op copy_folders_op = {
-	emft_copy_folders__desc,
-	emft_copy_folders__copy,
-	NULL,
-	emft_copy_folders__free,
-};
-
-static void
-emft_copy_folders (CamelStore *tostore, const char *tobase, CamelStore *fromstore, const char *frombase, int delete)
-{
-	struct _EMCopyFolders *m;
-	
-	m = mail_msg_new (&copy_folders_op, NULL, sizeof (struct _EMCopyFolders));
-	camel_object_ref (fromstore);
-	m->fromstore = fromstore;
-	camel_object_ref (tostore);
-	m->tostore = tostore;
-	m->frombase = g_strdup (frombase);
-	m->tobase = g_strdup (tobase);
-	m->delete = delete;
-	
-	e_thread_put (mail_thread_new, (EMsg *) m);
-}
-
-struct _copy_folder_data {
-	EMFolderTree *emft;
-	gboolean delete;
-};
-
-static void
-emft_popup_copy_folder_selected (const char *uri, void *data)
-{
-	struct _copy_folder_data *cfd = data;
-	struct _EMFolderTreePrivate *priv;
-	CamelStore *fromstore = NULL, *tostore = NULL;
-	char *tobase = NULL, *frombase = NULL, *fromuri = NULL;
-	CamelException ex;
-	CamelURL *url;
-
-	if (uri == NULL) {
-		g_free (cfd);
-		return;
-	}
-	
-	priv = cfd->emft->priv;
-	
-	camel_exception_init (&ex);
-
-	fromuri = em_folder_tree_get_selected_uri(cfd->emft);
-	g_return_if_fail(fromuri != NULL);
-	frombase = em_folder_tree_get_selected_path(cfd->emft);
-	g_return_if_fail(frombase != NULL);
-
-	if (!(fromstore = camel_session_get_store (session, fromuri, &ex))) {
-		e_error_run((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *) cfd->emft),
-			    cfd->delete?"mail:no-move-folder-notexist":"mail:no-copy-folder-notexist", frombase, uri, ex.desc, NULL);
-		goto fail;
-	}
-	
-	if (cfd->delete && fromstore == mail_component_peek_local_store (NULL) && is_special_local_folder (frombase)) {
-		e_error_run((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *) cfd->emft),
-			    "mail:no-rename-special-folder", frombase, NULL);
-		goto fail;
-	}
-	
-	if (!(tostore = camel_session_get_store (session, uri, &ex))) {
-		e_error_run((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *) cfd->emft),
-			    cfd->delete?"mail:no-move-folder-to-notexist":"mail:no-copy-folder-to-notexist", frombase, uri, ex.desc, NULL);
-		goto fail;
-	}
-
-	url = camel_url_new (uri, NULL);
-	if (((CamelService *)tostore)->provider->url_flags & CAMEL_URL_FRAGMENT_IS_PATH)
-		tobase = url->fragment;
-	else if (url->path && url->path[0])
-		tobase = url->path+1;
-	if (tobase == NULL)
-		tobase = "";
-
-	emft_copy_folders (tostore, tobase, fromstore, frombase, cfd->delete);
-	
-	camel_url_free (url);
-fail:
-	if (fromstore)
-		camel_object_unref(fromstore);
-	if (tostore)
-		camel_object_unref(tostore);
-	g_free(frombase);
-	g_free(fromuri);
-	camel_exception_clear (&ex);
-	g_free (cfd);
-}
-
-/* tree here is the 'destination' selector, not 'self' */
-static gboolean
-emft_popup_copy_folder_exclude(EMFolderTree *tree, GtkTreeModel *model, GtkTreeIter *iter, void *data)
-{
-	struct _copy_folder_data *cfd = data;
-	int fromvfolder, tovfolder;
-	char *fromuri, *touri;
-	guint flags;
-	gboolean is_store;
-
-	/* handles moving to/from vfolders */
-
-	fromuri = em_folder_tree_get_selected_uri(cfd->emft);
-	fromvfolder = strncmp(fromuri, "vfolder:", 8) == 0;
-	gtk_tree_model_get(model, iter, COL_STRING_URI, &touri, COL_UINT_FLAGS, &flags, COL_BOOL_IS_STORE, &is_store, -1);
-	tovfolder = strncmp(touri, "vfolder:", 8) == 0;
-	g_free(fromuri);
-	g_free(touri);
-
-	/* moving from vfolder to normal- not allowed */
-	if (fromvfolder && !tovfolder && cfd->delete)
-		return FALSE;
-	/* copy/move from normal folder to vfolder - not allowed */
-	if (!fromvfolder && tovfolder)
-		return FALSE;
-	/* copying to vfolder - not allowed */
-	if (tovfolder && !cfd->delete)
-		return FALSE;
-
-	return (flags & EMFT_EXCLUDE_NOINFERIORS) == 0;
-}
-
 static void
 emft_popup_copy(EPopup *ep, EPopupItem *item, void *data)
 {
 	EMFolderTree *emft = data;
-	struct _copy_folder_data *cfd;
-	
-	cfd = g_malloc (sizeof (*cfd));
-	cfd->emft = emft;
-	cfd->delete = FALSE;
-	
-	em_select_folder (NULL, _("Select folder"), _("C_opy"),
-			  NULL, emft_popup_copy_folder_exclude, emft_popup_copy_folder_selected, cfd);
-}
+	CamelFolderInfo *fi = NULL;
 
-static void
-emft_popup_move(EPopup *ep, EPopupItem *item, void *data)
-{
-	EMFolderTree *emft = data;
-	struct _copy_folder_data *cfd;
-	
-	cfd = g_malloc (sizeof (*cfd));
-	cfd->emft = emft;
-	cfd->delete = TRUE;
-	
-	em_select_folder (NULL, _("Select folder"), _("_Move"),
-			  NULL, emft_popup_copy_folder_exclude, emft_popup_copy_folder_selected, cfd);
-}
-
-
-struct _EMCreateFolder {
-	struct _mail_msg msg;
-	
-	/* input data */
-	CamelStore *store;
-	char *full_name;
-	char *parent;
-	char *name;
-	
-	/* output data */
-	CamelFolderInfo *fi;
-	
-	/* callback data */
-	void (* done) (CamelFolderInfo *fi, void *user_data);
-	void *user_data;
-};
-
-static char *
-emft_create_folder__desc (struct _mail_msg *mm, int done)
-{
-	struct _EMCreateFolder *m = (struct _EMCreateFolder *) mm;
-	
-	return g_strdup_printf (_("Creating folder `%s'"), m->full_name);
-}
-
-static void
-emft_create_folder__create (struct _mail_msg *mm)
-{
-	struct _EMCreateFolder *m = (struct _EMCreateFolder *) mm;
-	
-	d(printf ("creating folder parent='%s' name='%s' full_name='%s'\n", m->parent, m->name, m->full_name));
-	
-	if ((m->fi = camel_store_create_folder (m->store, m->parent, m->name, &mm->ex))) {
-		if (camel_store_supports_subscriptions (m->store))
-			camel_store_subscribe_folder (m->store, m->full_name, &mm->ex);
+	if ((fi = em_folder_tree_get_selected_folder_info (emft)) != NULL) {
+		emfu_copy_folder (fi);
 	}
 }
 
 static void
-emft_create_folder__created (struct _mail_msg *mm)
-{
-	struct _EMCreateFolder *m = (struct _EMCreateFolder *) mm;
-	
-	if (m->done)
-		m->done (m->fi, m->user_data);
-}
-
-static void
-emft_create_folder__free (struct _mail_msg *mm)
-{
-	struct _EMCreateFolder *m = (struct _EMCreateFolder *) mm;
-	
-	camel_store_free_folder_info (m->store, m->fi);
-	camel_object_unref (m->store);
-	g_free (m->full_name);
-	g_free (m->parent);
-	g_free (m->name);
-}
-
-static struct _mail_msg_op create_folder_op = {
-	emft_create_folder__desc,
-	emft_create_folder__create,
-	emft_create_folder__created,
-	emft_create_folder__free,
-};
-
-
-static int
-emft_create_folder (CamelStore *store, const char *full_name, void (* done) (CamelFolderInfo *fi, void *user_data), void *user_data)
-{
-	char *name, *namebuf = NULL;
-	struct _EMCreateFolder *m;
-	const char *parent;
-	int id;
-	
-	namebuf = g_strdup (full_name);
-	if (!(name = strrchr (namebuf, '/'))) {
-		name = namebuf;
-		parent = "";
-	} else {
-		*name++ = '\0';
-		parent = namebuf;
-	}
-	
-	m = mail_msg_new (&create_folder_op, NULL, sizeof (struct _EMCreateFolder));
-	camel_object_ref (store);
-	m->store = store;
-	m->full_name = g_strdup (full_name);
-	m->parent = g_strdup (parent);
-	m->name = g_strdup (name);
-	m->user_data = user_data;
-	m->done = done;
-	
-	g_free (namebuf);
-	
-	id = m->msg.seq;
-	e_thread_put (mail_thread_new, (EMsg *) m);
-	
-	return id;
-}
-
-static void
-created_cb (CamelFolderInfo *fi, void *user_data)
-{
-	gboolean *created = user_data;
-	
-	*created = fi ? TRUE : FALSE;
-}
-
-gboolean
-em_folder_tree_create_folder (EMFolderTree *emft, const char *full_name, const char *uri)
-{
-	struct _EMFolderTreePrivate *priv = emft->priv;
-	struct _EMFolderTreeModelStoreInfo *si;
-	gboolean created = FALSE;
-	CamelStore *store;
-	CamelException ex;
-	
-	d(printf ("Creating folder: %s (%s)\n", full_name, uri));
-	
-	camel_exception_init (&ex);
-	if (!(store = (CamelStore *) camel_session_get_service (session, uri, CAMEL_PROVIDER_STORE, &ex))) {
-		e_error_run((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *)emft),
-			    "mail:no-create-folder-nostore", full_name, ex.desc, NULL);
-		goto fail;
-	}
-	
-	if (!(si = g_hash_table_lookup (priv->model->store_hash, store))) {
-		abort();
-		camel_object_unref (store);
-		goto fail;
-	}
-	
-	camel_object_unref (store);
-	
-	mail_msg_wait (emft_create_folder (si->store, full_name, created_cb, &created));
-fail:
-	camel_exception_clear(&ex);
-	
-	return created;
-}
-
-static void
-new_folder_created_cb (CamelFolderInfo *fi, void *user_data)
-{
-	EMFolderSelector *emfs = user_data;
-	
-	if (fi)
-		gtk_widget_destroy ((GtkWidget *) emfs);
-	
-	g_object_unref (emfs);
-}
-
-static void
-emft_popup_new_folder_response (EMFolderSelector *emfs, int response, EMFolderTree *emft)
+emft_popup_move(EPopup *ep, EPopupItem *item, void *data)
 {
-	struct _EMFolderTreePrivate *priv = emft->priv;
-	struct _EMFolderTreeModelStoreInfo *si;
-	const char *uri, *path;
-	CamelException ex;
-	CamelStore *store;
-	
-	if (response != GTK_RESPONSE_OK) {
-		gtk_widget_destroy ((GtkWidget *) emfs);
-		return;
-	}
-	
-	uri = em_folder_selector_get_selected_uri (emfs);
-	path = em_folder_selector_get_selected_path (emfs);
-	
-	d(printf ("Creating new folder: %s (%s)\n", path, uri));
-	
-	camel_exception_init (&ex);
-	if (!(store = (CamelStore *) camel_session_get_service (session, uri, CAMEL_PROVIDER_STORE, &ex))) {
-		camel_exception_clear (&ex);
-		return;
-	}
-	
-	if (!(si = g_hash_table_lookup (priv->model->store_hash, store))) {
-		g_assert_not_reached ();
-		camel_object_unref (store);
-		return;
-	}
+	EMFolderTree *emft = data;
+	CamelFolderInfo *fi = NULL;
 
-	/* HACK: we need to create vfolders using the vfolder editor */
-	if (CAMEL_IS_VEE_STORE(store)) {
-		EMVFolderRule *rule;
-
-		rule = em_vfolder_rule_new();
-		filter_rule_set_name((FilterRule *)rule, path);
-		vfolder_gui_add_rule(rule);
-		gtk_widget_destroy((GtkWidget *)emfs);
-	} else {
-		g_object_ref (emfs);
-		emft_create_folder (si->store, path, new_folder_created_cb, emfs);
+	if ((fi = em_folder_tree_get_selected_folder_info (emft)) != NULL) {
+		emfu_copy_folder (fi);
 	}
-
-	camel_object_unref (store);
 }
 
 static void
 emft_popup_new_folder (EPopup *ep, EPopupItem *pitem, void *data)
 {
 	EMFolderTree *emft = data;
+	CamelFolderInfo *fi;
 
-	EMFolderTree *folder_tree;
-	GtkWidget *dialog;
-	char *uri;
-
-	folder_tree = (EMFolderTree *) em_folder_tree_new_with_model (emft->priv->model);
-	
-	dialog = em_folder_selector_create_new (folder_tree, 0, _("Create folder"), _("Specify where to create the folder:"));
-	uri = em_folder_tree_get_selected_uri(emft);
-	em_folder_selector_set_selected ((EMFolderSelector *) dialog, uri);
-	g_free(uri);
-	g_signal_connect (dialog, "response", G_CALLBACK (emft_popup_new_folder_response), emft);
-	gtk_widget_show (dialog);
-}
-
-static void
-emft_popup_delete_rec (CamelStore *store, CamelFolderInfo *fi, CamelException *ex)
-{
-	while (fi) {
-		CamelFolder *folder;
-		
-		if (fi->child) {
-			emft_popup_delete_rec (store, fi->child, ex);
-			if (camel_exception_is_set (ex))
-				return;
-		}
-		
-		d(printf ("deleting folder '%s'\n", fi->full_name));
-		
-		/* shouldn't camel do this itself? */
-		if (camel_store_supports_subscriptions (store))
-			camel_store_unsubscribe_folder (store, fi->full_name, NULL);
-		
-		if (!(folder = camel_store_get_folder (store, fi->full_name, 0, ex)))
-			return;
-		
-		if (!CAMEL_IS_VEE_FOLDER (folder)) {
-			GPtrArray *uids = camel_folder_get_uids (folder);
-			int i;
-			
-			camel_folder_freeze (folder);
-			for (i = 0; i < uids->len; i++)
-				camel_folder_delete_message (folder, uids->pdata[i]);
-			
-			camel_folder_free_uids (folder, uids);
-			
-			camel_folder_sync (folder, TRUE, NULL);
-			camel_folder_thaw (folder);
-		}
-		
-		camel_store_delete_folder (store, fi->full_name, ex);
-		if (camel_exception_is_set (ex))
-			return;
-		
-		fi = fi->next;
+	if ((fi = em_folder_tree_get_selected_folder_info (emft)) != NULL) {
+		emfu_folder_create (fi);
 	}
 }
 
 static void
-emft_popup_delete_folders (CamelStore *store, const char *full_name, CamelException *ex)
-{
-	guint32 flags = CAMEL_STORE_FOLDER_INFO_RECURSIVE | CAMEL_STORE_FOLDER_INFO_FAST;
-	CamelFolderInfo *fi;
-	
-	if (camel_store_supports_subscriptions (store))
-		flags |= CAMEL_STORE_FOLDER_INFO_SUBSCRIBED;
-	
-	fi = camel_store_get_folder_info (store, full_name, flags, ex);
-	if (camel_exception_is_set (ex))
-		return;
-	
-	emft_popup_delete_rec (store, fi, ex);
-	camel_store_free_folder_info (store, fi);
-}
-
-static void
 selfunc (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
 {
 	struct _emft_selection_data *dat = (struct _emft_selection_data *) data;
@@ -2620,163 +2064,25 @@ emft_selection_get_selected (GtkTreeSele
 }
 
 static void
-emft_popup_delete_response (GtkWidget *dialog, int response, EMFolderTree *emft)
-{
-	CamelStore *store;
-	CamelException ex;
-	char *full_name;
-	
-	full_name = g_object_get_data ((GObject *) dialog, "full_name");
-	store = g_object_get_data ((GObject *) dialog, "store");
-	
-	if (response == GTK_RESPONSE_OK) {
-		camel_exception_init (&ex);
-		emft_popup_delete_folders (store, full_name, &ex);
-		if (camel_exception_is_set (&ex)) {
-			e_error_run((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *)emft),
-				    "mail:no-delete-folder", full_name, ex.desc, NULL);
-			camel_exception_clear (&ex);
-		}
-	}
-	
-	gtk_widget_destroy (dialog);
-}
-
-static void
 emft_popup_delete_folder (EPopup *ep, EPopupItem *pitem, void *data)
 {
 	EMFolderTree *emft = data;
-	struct _EMFolderTreePrivate *priv = emft->priv;
-	GtkTreeSelection *selection;
-	CamelStore *local, *store;
-	GtkTreeModel *model;
-	GtkTreeIter iter;
-	GtkWidget *dialog;
-	char *full_name;
-	
-	selection = gtk_tree_view_get_selection (priv->treeview);
-	if (!emft_selection_get_selected (selection, &model, &iter))
-		return;
-	
-	gtk_tree_model_get (model, &iter, COL_POINTER_CAMEL_STORE, &store,
-			    COL_STRING_FULL_NAME, &full_name, -1);
-	
-	local = mail_component_peek_local_store (NULL);
-	
-	if (store == local && is_special_local_folder (full_name)) {
-		e_error_run(NULL, "mail:no-delete-special-folder", full_name, NULL);
-		return;
-	}
-	
-	camel_object_ref (store);
+	CamelFolder *folder;	
 
-	dialog = e_error_new((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *)emft),
-			     (store && CAMEL_IS_VEE_STORE(store))?"mail:ask-delete-vfolder":"mail:ask-delete-folder",
-			     full_name, NULL);
-	g_object_set_data_full ((GObject *) dialog, "full_name", full_name, g_free);
-	g_object_set_data_full ((GObject *) dialog, "store", store, camel_object_unref);
-	g_signal_connect (dialog, "response", G_CALLBACK (emft_popup_delete_response), emft);
-	gtk_widget_show (dialog);
+	if ((folder = em_folder_tree_get_selected_folder (emft)) != NULL) {
+		emfu_delete_folder (folder);
+	}
 }
 
 static void
 emft_popup_rename_folder (EPopup *ep, EPopupItem *pitem, void *data)
 {
 	EMFolderTree *emft = data;
-	struct _EMFolderTreePrivate *priv = emft->priv;
-	char *prompt, *full_name, *name, *new_name, *uri;
-	GtkTreeSelection *selection;
-	const char *p;
-	CamelStore *local, *store;
-	gboolean done = FALSE;
-	GtkTreeModel *model;
-	GtkTreeIter iter;
-	size_t base_len;
-	
-	local = mail_component_peek_local_store (NULL);
-	
-	selection = gtk_tree_view_get_selection (priv->treeview);
-	if (!emft_selection_get_selected (selection, &model, &iter))
-		return;
-	
-	gtk_tree_model_get (model, &iter, COL_STRING_FULL_NAME, &full_name,
-			    COL_STRING_DISPLAY_NAME, &name,
-			    COL_POINTER_CAMEL_STORE, &store,
-			    COL_STRING_URI, &uri, -1);
-	
-	/* don't allow user to rename one of the special local folders */
-	if (store == local && is_special_local_folder (full_name)) {
-		e_error_run((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *)emft),
-			    "mail:no-rename-special-folder", full_name, NULL);
-		g_free (full_name);
-		g_free (name);
-		g_free (uri);
-		return;
-	}
-	
-	if ((p = strrchr (full_name, '/')))
-		base_len = (size_t) (p - full_name);
-	else
-		base_len = 0;
-	
-	prompt = g_strdup_printf (_("Rename the \"%s\" folder to:"), name);
-	while (!done) {
-		new_name = e_request_string (NULL, _("Rename Folder"), prompt, name);
-		if (new_name == NULL || !strcmp (name, new_name)) {
-			/* old name == new name */
-			done = TRUE;
-		} else if (strchr(new_name, '/') != NULL) {
-			e_error_run((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *)emft),
-				    "mail:no-rename-folder", name, new_name, _("Folder names cannot contain '/'"), NULL);
-			done = TRUE;
-		} else {
-			CamelFolderInfo *fi;
-			CamelException ex;
-			char *path, *p;
-			
-			if (base_len > 0) {
-				path = g_malloc (base_len + strlen (new_name) + 2);
-				memcpy (path, full_name, base_len);
-				p = path + base_len;
-				*p++ = '/';
-				strcpy (p, new_name);
-			} else {
-				path = g_strdup (new_name);
-			}
-			
-			camel_exception_init (&ex);
-			if ((fi = camel_store_get_folder_info (store, path, CAMEL_STORE_FOLDER_INFO_FAST, &ex)) != NULL) {
-				camel_store_free_folder_info (store, fi);
-				e_error_run((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *)emft),
-					    "mail:no-rename-folder-exists", name, new_name, NULL);
-			} else {
-				const char *oldpath, *newpath;
-				
-				oldpath = full_name;
-				newpath = path;
-				
-				d(printf ("renaming %s to %s\n", oldpath, newpath));
-				
-				camel_exception_clear (&ex);
-				camel_store_rename_folder (store, oldpath, newpath, &ex);
-				if (camel_exception_is_set (&ex)) {
-					e_error_run((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *)emft),
-						    "mail:no-rename-folder", oldpath, newpath, ex.desc, NULL);
-					camel_exception_clear (&ex);
-				}
-				
-				done = TRUE;
-			}
-			
-			g_free (path);
-		}
-		
-		g_free (new_name);
+	CamelFolder *folder;
+
+	if ((folder = em_folder_tree_get_selected_folder (emft)) != NULL) {
+		emfu_rename_folder (folder);
 	}
-	
-	g_free (full_name);
-	g_free (name);
-	g_free (uri);
 }
 
 
@@ -3030,6 +2336,60 @@ em_folder_tree_get_selected_path (EMFold
 	return name;
 }
 
+CamelFolder *
+em_folder_tree_get_selected_folder (EMFolderTree *emft)
+{
+	GtkTreeSelection *selection;
+	GtkTreeModel *model;
+	GtkTreeIter iter;
+	char *full_name = NULL;
+	CamelException ex;
+	CamelStore *store = NULL;
+	CamelFolder *folder = NULL;
+
+	g_return_val_if_fail (EM_IS_FOLDER_TREE (emft), NULL);
+
+	camel_exception_init (&ex);
+
+	selection = gtk_tree_view_get_selection(emft->priv->treeview);
+	if (gtk_tree_selection_get_selected(selection, &model, &iter))
+		gtk_tree_model_get (model, &iter, COL_POINTER_CAMEL_STORE, &store,
+				    COL_STRING_FULL_NAME, &full_name, -1);
+
+	folder = camel_store_get_folder (store, full_name, CAMEL_STORE_FOLDER_INFO_FAST, &ex);
+
+	camel_exception_clear (&ex);
+
+	return folder;
+}
+
+CamelFolderInfo *
+em_folder_tree_get_selected_folder_info (EMFolderTree *emft)
+{
+	GtkTreeSelection *selection;
+	GtkTreeModel *model;
+	GtkTreeIter iter;
+	char *full_name = NULL;
+	CamelException ex;
+	CamelStore *store = NULL;
+	CamelFolderInfo *fi = NULL;
+
+	g_return_val_if_fail (EM_IS_FOLDER_TREE (emft), NULL);
+
+	camel_exception_init (&ex);
+
+	selection = gtk_tree_view_get_selection(emft->priv->treeview);
+	if (gtk_tree_selection_get_selected(selection, &model, &iter))
+		gtk_tree_model_get (model, &iter, COL_POINTER_CAMEL_STORE, &store,
+				    COL_STRING_FULL_NAME, &full_name, -1);
+
+	fi = camel_store_get_folder_info (store, full_name, CAMEL_STORE_FOLDER_INFO_FAST, &ex);
+
+	camel_exception_clear (&ex);
+
+	return fi;
+}
+
 EMFolderTreeModel *
 em_folder_tree_get_model (EMFolderTree *emft)
 {
@@ -3038,6 +2398,18 @@ em_folder_tree_get_model (EMFolderTree *
 	return emft->priv->model;
 }
 
+EMFolderTreeModelStoreInfo *
+em_folder_tree_get_model_storeinfo (EMFolderTree *emft, CamelStore *store)
+{
+	struct _EMFolderTreePrivate *priv = emft->priv;
+	struct _EMFolderTreeModelStoreInfo *si;
+
+	if (!(si = g_hash_table_lookup (priv->model->store_hash, store))) {
+		g_assert_not_reached ();
+		return NULL;
+	}
+	return si;
+}
 
 static gboolean
 emft_save_state (EMFolderTree *emft)
Index: mail/em-folder-tree.h
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-tree.h,v
retrieving revision 1.13
diff -u -p -r1.13 em-folder-tree.h
--- mail/em-folder-tree.h	8 Feb 2005 05:07:42 -0000	1.13
+++ mail/em-folder-tree.h	20 Apr 2005 19:16:58 -0000
@@ -85,8 +85,11 @@ GList *em_folder_tree_get_selected_paths
 void em_folder_tree_set_selected (EMFolderTree *emft, const char *uri);
 char *em_folder_tree_get_selected_uri (EMFolderTree *emft);
 char *em_folder_tree_get_selected_path (EMFolderTree *emft);
+CamelFolder *em_folder_tree_get_selected_folder (EMFolderTree *emft);
+CamelFolderInfo *em_folder_tree_get_selected_folder_info (EMFolderTree *emft);
 
 EMFolderTreeModel *em_folder_tree_get_model (EMFolderTree *emft);
+EMFolderTreeModelStoreInfo *em_folder_tree_get_model_storeinfo (EMFolderTree *emft, CamelStore *store);
 
 gboolean em_folder_tree_create_folder (EMFolderTree *emft, const char *full_name, const char *uri);
 
Index: mail/em-folder-utils.c
===================================================================
RCS file: mail/em-folder-utils.c
diff -N mail/em-folder-utils.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ mail/em-folder-utils.c	20 Apr 2005 19:16:58 -0000
@@ -0,0 +1,744 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *  Authors: Jeffrey Stedfast <fejj ximian com>
+ *
+ *  Copyright 2003 Ximian, Inc. (www.ximian.com)
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+
+#include <libxml/tree.h>
+
+#include <gtk/gtk.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <libgnome/gnome-i18n.h>
+
+#include <camel/camel-session.h>
+#include <camel/camel-store.h>
+#include <camel/camel-folder.h>
+#include <camel/camel-vee-store.h>
+#include <camel/camel-vtrash-folder.h>
+#include <camel/camel-stream-mem.h>
+#include <camel/camel-file-utils.h>
+#include <camel/camel-stream-fs.h>
+
+#include "e-util/e-mktemp.h"
+#include "e-util/e-request.h"
+#include "e-util/e-icon-factory.h"
+
+#include "widgets/misc/e-error.h"
+
+#include "em-vfolder-rule.h"
+
+#include "mail-mt.h"
+#include "mail-ops.h"
+#include "mail-tools.h"
+#include "mail-config.h"
+#include "mail-component.h"
+#include "mail-vfolder.h"
+
+#include "em-utils.h"
+#include "em-popup.h"
+#include "em-marshal.h"
+#include "em-folder-tree.h"
+#include "em-folder-tree-model.h"
+#include "em-folder-utils.h"
+#include "em-folder-selector.h"
+#include "em-folder-selection.h"
+#include "em-folder-properties.h"
+
+#define d(x)
+
+extern CamelSession *session;
+
+static gboolean
+emfu_is_special_local_folder (const char *name)
+{
+	return (!strcmp (name, "Drafts") || !strcmp (name, "Inbox") || !strcmp (name, "Outbox") || !strcmp (name, "Sent"));
+}
+
+struct _EMCopyFolders {
+	struct _mail_msg msg;
+	
+	/* input data */
+	CamelStore *fromstore;
+	CamelStore *tostore;
+	
+	char *frombase;
+	char *tobase;
+	
+	int delete;
+};
+
+static char *
+emft_copy_folders__desc (struct _mail_msg *mm, int complete)
+{
+	struct _EMCopyFolders *m = (struct _EMCopyFolders *) mm;
+	
+	return g_strdup_printf (_("Copying `%s' to `%s'"), m->frombase, m->tobase);
+}
+
+static void
+emft_copy_folders__copy (struct _mail_msg *mm)
+{
+	struct _EMCopyFolders *m = (struct _EMCopyFolders *) mm;
+	guint32 flags = CAMEL_STORE_FOLDER_INFO_FAST | CAMEL_STORE_FOLDER_INFO_RECURSIVE;
+	GList *pending = NULL, *deleting = NULL, *l;
+	GString *fromname, *toname;
+	CamelFolderInfo *fi;
+	const char *tmp;
+	int fromlen;
+	
+	if (camel_store_supports_subscriptions (m->fromstore))
+		flags |= CAMEL_STORE_FOLDER_INFO_SUBSCRIBED;
+	
+	if (!(fi = camel_store_get_folder_info (m->fromstore, m->frombase, flags, &mm->ex)))
+		return;
+	
+	pending = g_list_append (pending, fi);
+	
+	toname = g_string_new ("");
+	fromname = g_string_new ("");
+	
+	tmp = strrchr (m->frombase, '/');
+	if (tmp == NULL)
+		fromlen = 0;
+	else
+		fromlen = tmp - m->frombase + 1;
+	
+	d(printf ("top name is '%s'\n", fi->full_name));
+	
+	while (pending) {
+		CamelFolderInfo *info = pending->data;
+		
+		pending = g_list_remove_link (pending, pending);
+		while (info) {
+			CamelFolder *fromfolder, *tofolder;
+			GPtrArray *uids;
+			int deleted = 0;
+			
+			if (info->child)
+				pending = g_list_append (pending, info->child);
+			
+			if (m->tobase[0])
+				g_string_printf (toname, "%s/%s", m->tobase, info->full_name + fromlen);
+			else
+				g_string_printf (toname, "%s", info->full_name + fromlen);
+			
+			d(printf ("Copying from '%s' to '%s'\n", info->full_name, toname->str));
+			
+			/* This makes sure we create the same tree, e.g. from a nonselectable source */
+			/* Not sure if this is really the 'right thing', e.g. for spool stores, but it makes the ui work */
+			if ((info->flags & CAMEL_FOLDER_NOSELECT) == 0) {
+				d(printf ("this folder is selectable\n"));
+				if (m->tostore == m->fromstore && m->delete) {
+					camel_store_rename_folder (m->fromstore, info->full_name, toname->str, &mm->ex);
+					if (camel_exception_is_set (&mm->ex))
+						goto exception;
+					
+					/* this folder no longer exists, unsubscribe it */
+					if (camel_store_supports_subscriptions (m->fromstore))
+						camel_store_unsubscribe_folder (m->fromstore, info->full_name, NULL);
+					
+					deleted = 1;
+				} else {
+					if (!(fromfolder = camel_store_get_folder (m->fromstore, info->full_name, 0, &mm->ex)))
+						goto exception;
+					
+					if (!(tofolder = camel_store_get_folder (m->tostore, toname->str, CAMEL_STORE_FOLDER_CREATE, &mm->ex))) {
+						camel_object_unref (fromfolder);
+						goto exception;
+					}
+					
+					uids = camel_folder_get_uids (fromfolder);
+					camel_folder_transfer_messages_to (fromfolder, uids, tofolder, NULL, m->delete, &mm->ex);
+					camel_folder_free_uids (fromfolder, uids);
+					
+					if (m->delete)
+						camel_folder_sync(fromfolder, TRUE, NULL);
+					
+					camel_object_unref (fromfolder);
+					camel_object_unref (tofolder);
+				}
+			}
+			
+			if (camel_exception_is_set (&mm->ex))
+				goto exception;
+			else if (m->delete && !deleted)
+				deleting = g_list_prepend (deleting, info);
+			
+			/* subscribe to the new folder if appropriate */
+			if (camel_store_supports_subscriptions (m->tostore)
+			    && !camel_store_folder_subscribed (m->tostore, toname->str))
+				camel_store_subscribe_folder (m->tostore, toname->str, NULL);
+			
+			info = info->next;
+		}
+	}
+	
+	/* delete the folders in reverse order from how we copyied them, if we are deleting any */
+	l = deleting;
+	while (l) {
+		CamelFolderInfo *info = l->data;
+		
+		d(printf ("deleting folder '%s'\n", info->full_name));
+		
+		/* FIXME: we need to do something with the exception
+		   since otherwise the users sees a failed operation
+		   with no error message or even any warnings */
+		if (camel_store_supports_subscriptions (m->fromstore))
+			camel_store_unsubscribe_folder (m->fromstore, info->full_name, NULL);
+		
+		camel_store_delete_folder (m->fromstore, info->full_name, NULL);
+		l = l->next;
+	}
+	
+ exception:
+	
+	camel_store_free_folder_info (m->fromstore, fi);
+	g_list_free (deleting);
+	
+	g_string_free (toname, TRUE);
+	g_string_free (fromname, TRUE);
+}
+
+static void
+emft_copy_folders__free (struct _mail_msg *mm)
+{
+	struct _EMCopyFolders *m = (struct _EMCopyFolders *) mm;
+	
+	camel_object_unref (m->fromstore);
+	camel_object_unref (m->tostore);
+	
+	g_free (m->frombase);
+	g_free (m->tobase);
+}
+
+static struct _mail_msg_op copy_folders_op = {
+	emft_copy_folders__desc,
+	emft_copy_folders__copy,
+	NULL,
+	emft_copy_folders__free,
+};
+
+static void
+emfu_copy_folders (CamelStore *tostore, const char *tobase, CamelStore *fromstore, const char *frombase, int delete)
+{
+	struct _EMCopyFolders *m;
+	
+	m = mail_msg_new (&copy_folders_op, NULL, sizeof (struct _EMCopyFolders));
+	camel_object_ref (fromstore);
+	m->fromstore = fromstore;
+	camel_object_ref (tostore);
+	m->tostore = tostore;
+	m->frombase = g_strdup (frombase);
+	m->tobase = g_strdup (tobase);
+	m->delete = delete;
+	
+	e_thread_put (mail_thread_new, (EMsg *) m);
+}
+
+struct _copy_folder_data {
+	CamelFolderInfo *fi;
+	gboolean delete;
+};
+
+static void
+emfu_copy_folder_selected (const char *uri, void *data)
+{
+	struct _copy_folder_data *cfd = data;
+	CamelStore *fromstore = NULL, *tostore = NULL;
+	char *tobase = NULL;
+	CamelException ex;
+	CamelURL *url;
+
+	if (uri == NULL) {
+		g_free (cfd);
+		return;
+	}
+	
+	camel_exception_init (&ex);
+
+	if (!(fromstore = camel_session_get_store (session, cfd->fi->uri, &ex))) {
+		e_error_run(NULL,
+			    cfd->delete?"mail:no-move-folder-notexist":"mail:no-copy-folder-notexist", cfd->fi->full_name, uri, ex.desc, NULL);
+		goto fail;
+	}
+	
+	if (cfd->delete && fromstore == mail_component_peek_local_store (NULL) && emfu_is_special_local_folder (cfd->fi->full_name)) {
+		e_error_run(NULL,
+			    "mail:no-rename-special-folder", cfd->fi->full_name, NULL);
+		goto fail;
+	}
+	
+	if (!(tostore = camel_session_get_store (session, uri, &ex))) {
+		e_error_run(NULL,
+			    cfd->delete?"mail:no-move-folder-to-notexist":"mail:no-copy-folder-to-notexist", cfd->fi->full_name, uri, ex.desc, NULL);
+		goto fail;
+	}
+
+	url = camel_url_new (uri, NULL);
+	if (((CamelService *)tostore)->provider->url_flags & CAMEL_URL_FRAGMENT_IS_PATH)
+		tobase = url->fragment;
+	else if (url->path && url->path[0])
+		tobase = url->path+1;
+	if (tobase == NULL)
+		tobase = "";
+
+	emfu_copy_folders (tostore, tobase, fromstore, cfd->fi->full_name, cfd->delete);
+	
+	camel_url_free (url);
+fail:
+	if (fromstore)
+		camel_object_unref(fromstore);
+	if (tostore)
+		camel_object_unref(tostore);
+	camel_exception_clear (&ex);
+	g_free (cfd);
+}
+
+/* tree here is the 'destination' selector, not 'self' */
+static gboolean
+emfu_copy_folder_exclude(EMFolderTree *tree, GtkTreeModel *model, GtkTreeIter *iter, void *data)
+{
+	struct _copy_folder_data *cfd = data;
+	int fromvfolder, tovfolder;
+	char *touri;
+	guint flags;
+	gboolean is_store;
+
+	/* handles moving to/from vfolders */
+
+	fromvfolder = strncmp(cfd->fi->uri, "vfolder:", 8) == 0;
+	gtk_tree_model_get(model, iter, COL_STRING_URI, &touri, COL_UINT_FLAGS, &flags, COL_BOOL_IS_STORE, &is_store, -1);
+	tovfolder = strncmp(touri, "vfolder:", 8) == 0;
+	g_free(touri);
+
+	/* moving from vfolder to normal- not allowed */
+	if (fromvfolder && !tovfolder && cfd->delete)
+		return FALSE;
+	/* copy/move from normal folder to vfolder - not allowed */
+	if (!fromvfolder && tovfolder)
+		return FALSE;
+	/* copying to vfolder - not allowed */
+	if (tovfolder && !cfd->delete)
+		return FALSE;
+
+	return (flags & EMFT_EXCLUDE_NOINFERIORS) == 0;
+}
+
+void
+emfu_copy_folder (CamelFolderInfo *folderinfo)
+{
+	struct _copy_folder_data *cfd;
+	
+	cfd = g_malloc (sizeof (*cfd));
+	cfd->fi = folderinfo;
+	cfd->delete = FALSE;
+
+	em_select_folder (NULL, _("Select folder"), _("C_opy"),
+			  NULL, emfu_copy_folder_exclude,
+			  emfu_copy_folder_selected, cfd);}
+
+void
+emfu_move_folder (CamelFolderInfo *folderinfo)
+{
+	struct _copy_folder_data *cfd;
+	
+	cfd = g_malloc (sizeof (*cfd));
+	cfd->fi = folderinfo;
+	cfd->delete = TRUE;
+
+	em_select_folder (NULL, _("Select folder"), _("_Move"),
+			  NULL, emfu_copy_folder_exclude,
+			  emfu_copy_folder_selected, cfd);
+}
+
+static void
+emfu_delete_rec (CamelStore *store, CamelFolderInfo *fi, CamelException *ex)
+{
+	while (fi) {
+		CamelFolder *folder;
+		
+		if (fi->child) {
+			emfu_delete_rec (store, fi->child, ex);
+			if (camel_exception_is_set (ex))
+				return;
+		}
+		
+		d(printf ("deleting folder '%s'\n", fi->full_name));
+		
+		/* shouldn't camel do this itself? */
+		if (camel_store_supports_subscriptions (store))
+			camel_store_unsubscribe_folder (store, fi->full_name, NULL);
+		
+		if (!(folder = camel_store_get_folder (store, fi->full_name, 0, ex)))
+			return;
+		
+		if (!CAMEL_IS_VEE_FOLDER (folder)) {
+			GPtrArray *uids = camel_folder_get_uids (folder);
+			int i;
+			
+			camel_folder_freeze (folder);
+			for (i = 0; i < uids->len; i++)
+				camel_folder_delete_message (folder, uids->pdata[i]);
+			
+			camel_folder_free_uids (folder, uids);
+			
+			camel_folder_sync (folder, TRUE, NULL);
+			camel_folder_thaw (folder);
+		}
+		
+		camel_store_delete_folder (store, fi->full_name, ex);
+		if (camel_exception_is_set (ex))
+			return;
+		
+		fi = fi->next;
+	}
+}
+
+static void
+emfu_delete_folders (CamelStore *store, const char *full_name, CamelException *ex)
+{
+	guint32 flags = CAMEL_STORE_FOLDER_INFO_RECURSIVE | CAMEL_STORE_FOLDER_INFO_FAST;
+	CamelFolderInfo *fi;
+	
+	if (camel_store_supports_subscriptions (store))
+		flags |= CAMEL_STORE_FOLDER_INFO_SUBSCRIBED;
+	
+	fi = camel_store_get_folder_info (store, full_name, flags, ex);
+	if (camel_exception_is_set (ex))
+		return;
+	
+	emfu_delete_rec (store, fi, ex);
+	camel_store_free_folder_info (store, fi);
+}
+
+static void
+emfu_delete_response (GtkWidget *dialog, int response, gpointer data)
+{
+	CamelStore *store;
+	CamelException ex;
+	char *full_name;
+	
+	full_name = g_object_get_data ((GObject *) dialog, "full_name");
+	store = g_object_get_data ((GObject *) dialog, "store");
+	
+	if (response == GTK_RESPONSE_OK) {
+		camel_exception_init (&ex);
+		emfu_delete_folders (store, full_name, &ex);
+		if (camel_exception_is_set (&ex)) {
+			e_error_run(NULL,
+				    "mail:no-delete-folder", full_name, ex.desc, NULL);
+			camel_exception_clear (&ex);
+		}
+	}
+	
+	gtk_widget_destroy (dialog);
+}
+
+void
+emfu_delete_folder (CamelFolder *folder)
+{
+	CamelStore *local;
+	GtkWidget *dialog;
+
+	local = mail_component_peek_local_store (NULL);
+	
+	if (folder->parent_store == local && emfu_is_special_local_folder (folder->full_name)) {
+		e_error_run(NULL, "mail:no-delete-special-folder", folder->full_name, NULL);
+		return;
+	}
+
+	camel_object_ref (folder->parent_store);
+
+	dialog = e_error_new(NULL,
+			     (folder->parent_store && CAMEL_IS_VEE_STORE(folder->parent_store))?"mail:ask-delete-vfolder":"mail:ask-delete-folder",
+			     folder->full_name, NULL);
+	g_object_set_data_full ((GObject *) dialog, "full_name", folder->full_name, g_free);
+	g_object_set_data_full ((GObject *) dialog, "store", folder->parent_store, camel_object_unref);
+	g_signal_connect (dialog, "response", G_CALLBACK (emfu_delete_response), NULL);
+	gtk_widget_show (dialog);
+}
+
+void
+emfu_rename_folder (CamelFolder *folder)
+{
+	char *prompt, *new_name;
+	const char *p;
+	CamelStore *local;
+	gboolean done = FALSE;
+	size_t base_len;
+
+	local = mail_component_peek_local_store (NULL);
+
+	/* don't allow user to rename one of the special local folders */
+	if (folder->parent_store == local && emfu_is_special_local_folder (folder->full_name)) {
+		e_error_run(NULL,
+			    "mail:no-rename-special-folder", folder->full_name, NULL);
+		return;
+	}
+	
+	if ((p = strrchr (folder->full_name, '/')))
+		base_len = (size_t) (p - folder->full_name);
+	else
+		base_len = 0;
+	
+	prompt = g_strdup_printf (_("Rename the \"%s\" folder to:"), folder->name);
+	while (!done) {
+		new_name = e_request_string (NULL, _("Rename Folder"), prompt, folder->name);
+		if (new_name == NULL || !strcmp (folder->name, new_name)) {
+			/* old name == new name */
+			done = TRUE;
+		} else if (strchr(new_name, '/') != NULL) {
+			e_error_run(NULL,
+				    "mail:no-rename-folder", folder->name, new_name, _("Folder names cannot contain '/'"), NULL);
+			done = TRUE;
+		} else {
+			CamelFolderInfo *fi;
+			CamelException ex;
+			char *path, *p;
+			
+			if (base_len > 0) {
+				path = g_malloc (base_len + strlen (new_name) + 2);
+				memcpy (path, folder->full_name, base_len);
+				p = path + base_len;
+				*p++ = '/';
+				strcpy (p, new_name);
+			} else {
+				path = g_strdup (new_name);
+			}
+			
+			camel_exception_init (&ex);
+			if ((fi = camel_store_get_folder_info (folder->parent_store, path, CAMEL_STORE_FOLDER_INFO_FAST, &ex)) != NULL) {
+				camel_store_free_folder_info (folder->parent_store, fi);
+				e_error_run(NULL,
+					    "mail:no-rename-folder-exists", folder->name, new_name, NULL);
+			} else {
+				const char *oldpath, *newpath;
+				
+				oldpath = folder->full_name;
+				newpath = path;
+				
+				d(printf ("renaming %s to %s\n", oldpath, newpath));
+				
+				camel_exception_clear (&ex);
+				camel_store_rename_folder (folder->parent_store, oldpath, newpath, &ex);
+				if (camel_exception_is_set (&ex)) {
+					e_error_run(NULL,
+						    "mail:no-rename-folder", oldpath, newpath, ex.desc, NULL);
+					camel_exception_clear (&ex);
+				}
+				
+				done = TRUE;
+			}
+			
+			g_free (path);
+		}
+		
+		g_free (new_name);
+	}
+}
+
+struct _EMCreateFolder {
+	struct _mail_msg msg;
+	
+	/* input data */
+	CamelStore *store;
+	char *full_name;
+	char *parent;
+	char *name;
+	
+	/* output data */
+	CamelFolderInfo *fi;
+	
+	/* callback data */
+	void (* done) (CamelFolderInfo *fi, void *user_data);
+	void *user_data;
+};
+
+static char *
+emfu_create_folder__desc (struct _mail_msg *mm, int done)
+{
+	struct _EMCreateFolder *m = (struct _EMCreateFolder *) mm;
+	
+	return g_strdup_printf (_("Creating folder `%s'"), m->full_name);
+}
+
+static void
+emfu_create_folder__create (struct _mail_msg *mm)
+{
+	struct _EMCreateFolder *m = (struct _EMCreateFolder *) mm;
+	
+	d(printf ("creating folder parent='%s' name='%s' full_name='%s'\n", m->parent, m->name, m->full_name));
+	
+	if ((m->fi = camel_store_create_folder (m->store, m->parent, m->name, &mm->ex))) {
+		if (camel_store_supports_subscriptions (m->store))
+			camel_store_subscribe_folder (m->store, m->full_name, &mm->ex);
+	}
+}
+
+static void
+emfu_create_folder__created (struct _mail_msg *mm)
+{
+	struct _EMCreateFolder *m = (struct _EMCreateFolder *) mm;
+	
+	if (m->done)
+		m->done (m->fi, m->user_data);
+}
+
+static void
+emfu_create_folder__free (struct _mail_msg *mm)
+{
+	struct _EMCreateFolder *m = (struct _EMCreateFolder *) mm;
+	
+	camel_store_free_folder_info (m->store, m->fi);
+	camel_object_unref (m->store);
+	g_free (m->full_name);
+	g_free (m->parent);
+	g_free (m->name);
+}
+
+static struct _mail_msg_op create_folder_op = {
+	emfu_create_folder__desc,
+	emfu_create_folder__create,
+	emfu_create_folder__created,
+	emfu_create_folder__free,
+};
+
+
+static int
+emfu_create_folder_real (CamelStore *store, const char *full_name, void (* done) (CamelFolderInfo *fi, void *user_data), void *user_data)
+{
+	char *name, *namebuf = NULL;
+	struct _EMCreateFolder *m;
+	const char *parent;
+	int id;
+	
+	namebuf = g_strdup (full_name);
+	if (!(name = strrchr (namebuf, '/'))) {
+		name = namebuf;
+		parent = "";
+	} else {
+		*name++ = '\0';
+		parent = namebuf;
+	}
+	
+	m = mail_msg_new (&create_folder_op, NULL, sizeof (struct _EMCreateFolder));
+	camel_object_ref (store);
+	m->store = store;
+	m->full_name = g_strdup (full_name);
+	m->parent = g_strdup (parent);
+	m->name = g_strdup (name);
+	m->user_data = user_data;
+	m->done = done;
+	
+	g_free (namebuf);
+	
+	id = m->msg.seq;
+	e_thread_put (mail_thread_new, (EMsg *) m);
+	
+	return id;
+}
+
+static void
+new_folder_created_cb (CamelFolderInfo *fi, void *user_data)
+{
+	EMFolderSelector *emfs = user_data;
+	
+	if (fi)
+		gtk_widget_destroy ((GtkWidget *) emfs);
+	
+	g_object_unref (emfs);
+}
+
+static void
+emfu_popup_new_folder_response (EMFolderSelector *emfs, int response, gpointer data)
+{
+	EMFolderTreeModelStoreInfo *si;
+	const char *uri, *path;
+	CamelException ex;
+	CamelStore *store;
+	
+	if (response != GTK_RESPONSE_OK) {
+		gtk_widget_destroy ((GtkWidget *) emfs);
+		return;
+	}
+
+	uri = em_folder_selector_get_selected_uri (emfs);
+	path = em_folder_selector_get_selected_path (emfs);
+
+	d(printf ("Creating new folder: %s (%s)\n", path, uri));
+
+	g_print ("DEBUG: %s (%s)\n", path, uri);
+
+	camel_exception_init (&ex);
+	if (!(store = (CamelStore *) camel_session_get_service (session, uri, CAMEL_PROVIDER_STORE, &ex))) {
+		camel_exception_clear (&ex);
+		return;
+	}
+
+	if (!(si = em_folder_tree_get_model_storeinfo (emfs->emft, store))) {
+		g_assert_not_reached ();
+		camel_object_unref (store);
+		return;
+	}
+
+	/* HACK: we need to create vfolders using the vfolder editor */
+	if (CAMEL_IS_VEE_STORE(store)) {
+		EMVFolderRule *rule;
+
+		rule = em_vfolder_rule_new();
+		filter_rule_set_name((FilterRule *)rule, path);
+		vfolder_gui_add_rule(rule);
+		gtk_widget_destroy((GtkWidget *)emfs);
+	} else {
+		g_object_ref (emfs);
+		emfu_create_folder_real (si->store, path, new_folder_created_cb, emfs);
+	}
+
+	camel_object_unref (store);
+	camel_exception_clear (&ex);
+}
+
+void
+emfu_folder_create (CamelFolderInfo *folderinfo) {
+	EMFolderTree *folder_tree;
+	EMFolderTreeModel *model;
+	GtkWidget *dialog;
+
+	model = mail_component_peek_tree_model (mail_component_peek ());
+	folder_tree = (EMFolderTree *) em_folder_tree_new_with_model (model);
+	
+	dialog = em_folder_selector_create_new (folder_tree, 0, _("Create folder"), _("Specify where to create the folder:"));
+	if (folderinfo != NULL)
+		em_folder_selector_set_selected ((EMFolderSelector *) dialog, folderinfo->uri);
+	g_signal_connect (dialog, "response", G_CALLBACK (emfu_popup_new_folder_response), folder_tree);
+	gtk_widget_show (dialog);
+}
Index: mail/em-folder-utils.h
===================================================================
RCS file: mail/em-folder-utils.h
diff -N mail/em-folder-utils.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ mail/em-folder-utils.h	20 Apr 2005 19:16:59 -0000
@@ -0,0 +1,32 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ *  Authors: Jeffrey Stedfast <fejj ximian com>
+ *           Rodney Dawes <dobey novell com>
+ *
+ *  Copyright 2003-2005 Novell, Inc. (www.novell.com)
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include <camel/camel-store.h>
+
+void emfu_copy_folder (CamelFolderInfo *folderinfo);
+void emfu_move_folder (CamelFolderInfo *folderinfo);
+
+void emfu_delete_folder (CamelFolder *folder);
+void emfu_rename_folder (CamelFolder *folder);
+
+void emfu_folder_create (CamelFolderInfo *folderinfo);
Index: mail/em-folder-view.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-view.c,v
retrieving revision 1.114
diff -u -p -r1.114 em-folder-view.c
--- mail/em-folder-view.c	8 Apr 2005 04:34:25 -0000	1.114
+++ mail/em-folder-view.c	20 Apr 2005 19:16:59 -0000
@@ -687,6 +687,22 @@ emfv_popup_saveas(EPopup *ep, EPopupItem
 }
 
 static void
+emfv_view_load_images(BonoboUIComponent *uic, void *data, const char *path)
+{
+	EMFolderView *emfv = data;
+
+	if (emfv->preview)
+		em_format_html_load_http((EMFormatHTML *)emfv->preview);
+}
+
+static void
+emfv_popup_load_images(EPopup *ep, EPopupItem *pitem, void *data)
+{
+	EMFolderView *emfv = data;	
+	emfv_view_load_images(NULL, data, NULL);
+}
+
+static void
 emfv_popup_print(EPopup *ep, EPopupItem *pitem, void *data)
 {
 	EMFolderView *emfv = data;
@@ -701,6 +717,44 @@ emfv_popup_copy_text(EPopup *ep, EPopupI
 }
 
 static void
+emfv_popup_source(EPopup *ep, EPopupItem *pitem, void *data)
+{
+	EMFolderView *emfv = data;
+	EMMessageBrowser *emmb;
+	GPtrArray *uids;
+	
+	uids = message_list_get_selected(emfv->list);
+
+	emmb = (EMMessageBrowser *)em_message_browser_window_new();
+	em_format_set_session((EMFormat *)((EMFolderView *)emmb)->preview, ((EMFormat *)emfv->preview)->session);
+	em_folder_view_set_folder((EMFolderView *)emmb, emfv->folder, emfv->folder_uri);
+	em_format_set_mode((EMFormat *)((EMFolderView *)emmb)->preview, EM_FORMAT_SOURCE);
+	em_folder_view_set_message((EMFolderView *)emmb, uids->pdata[0], FALSE);
+	gtk_widget_show(emmb->window);
+
+	message_list_free_uids(emfv->list, uids);
+}
+
+static void
+emfv_mail_compose(BonoboUIComponent *uid, void *data, const char *path)
+{
+	EMFolderView *emfv = data;
+
+	if (!em_utils_check_user_can_send_mail((GtkWidget *)emfv))
+		return;
+
+	em_utils_compose_new_message(emfv->folder_uri);
+}
+
+static void
+emfv_popup_selectall(EPopup *ep, EPopupItem *pitem, void *data)
+{
+	EMFolderView *emfv = data;
+	gtk_html_select_all (((EMFormatHTML *)emfv->preview)->html);
+
+}
+
+static void
 emfv_popup_reply_sender(EPopup *ep, EPopupItem *pitem, void *data)
 {
 	EMFolderView *emfv = data;
@@ -1002,8 +1056,8 @@ static EPopupItem emfv_popup_items[] = {
 	{ E_POPUP_ITEM, "40.emfv.03", N_("_Copy to Folder..."), emfv_popup_copy, NULL, "stock_mail-copy", EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_LISTONLY },
 
 	{ E_POPUP_BAR, "50.emfv", NULL, NULL, NULL, NULL },
-	{ E_POPUP_ITEM, "50.emfv.00", N_("Mar_k as Read"), emfv_popup_mark_read, NULL, "stock_mail-open", EM_POPUP_SELECT_MARK_READ },
-	{ E_POPUP_ITEM, "50.emfv.01", N_("Mark as U_nread"), emfv_popup_mark_unread, NULL, "stock_mail-unread", EM_POPUP_SELECT_MARK_UNREAD },
+	{ E_POPUP_ITEM, "50.emfv.00", N_("Mar_k as Read"), emfv_popup_mark_read, NULL, "stock_mail-open", EM_POPUP_SELECT_MARK_READ|EM_FOLDER_VIEW_SELECT_LISTONLY },
+	{ E_POPUP_ITEM, "50.emfv.01", N_("Mark as U_nread"), emfv_popup_mark_unread, NULL, "stock_mail-unread", EM_POPUP_SELECT_MARK_UNREAD|EM_FOLDER_VIEW_SELECT_LISTONLY },
 	{ E_POPUP_ITEM, "50.emfv.02", N_("Mark as _Important"), emfv_popup_mark_important, NULL, "stock_mail-priority-high", EM_POPUP_SELECT_MARK_IMPORTANT|EM_FOLDER_VIEW_SELECT_LISTONLY },
 	{ E_POPUP_ITEM, "50.emfv.03", N_("_Mark as Unimportant"), emfv_popup_mark_unimportant, NULL, NULL, EM_POPUP_SELECT_MARK_UNIMPORTANT|EM_FOLDER_VIEW_SELECT_LISTONLY },
 	{ E_POPUP_ITEM, "50.emfv.04", N_("Mark as _Junk"), emfv_popup_mark_junk, NULL, "stock_spam", EM_POPUP_SELECT_MANY|EM_FOLDER_VIEW_SELECT_LISTONLY },
@@ -1162,6 +1216,7 @@ EMFV_MAP_CALLBACK(emfv_message_open, emf
 EMFV_MAP_CALLBACK(emfv_message_edit, emfv_popup_edit)
 EMFV_MAP_CALLBACK(emfv_message_saveas, emfv_popup_saveas)
 EMFV_MAP_CALLBACK(emfv_print_message, emfv_popup_print)
+EMFV_MAP_CALLBACK(emfv_message_source, emfv_popup_source)
 
 static void
 emfv_edit_cut(BonoboUIComponent *uid, void *data, const char *path)
@@ -1565,15 +1620,6 @@ EMFV_MAP_CALLBACK(emfv_tools_vfolder_mli
 
 /* ********************************************************************** */
 
-static void
-emfv_view_load_images(BonoboUIComponent *uic, void *data, const char *path)
-{
-	EMFolderView *emfv = data;
-
-	if (emfv->preview)
-		em_format_html_load_http((EMFormatHTML *)emfv->preview);
-}
-
 static BonoboUIVerb emfv_message_verbs[] = {
 	BONOBO_UI_UNSAFE_VERB ("EditCut", emfv_edit_cut),
 	BONOBO_UI_UNSAFE_VERB ("EditCopy", emfv_edit_copy),
@@ -1623,6 +1669,10 @@ static BonoboUIVerb emfv_message_verbs[]
 	BONOBO_UI_UNSAFE_VERB ("TextZoomOut", emfv_text_zoom_out),
 	BONOBO_UI_UNSAFE_VERB ("TextZoomReset", emfv_text_zoom_reset),
 
+	BONOBO_UI_UNSAFE_VERB ("ViewSource", emfv_message_source),
+
+	BONOBO_UI_UNSAFE_VERB ("MailCompose", emfv_mail_compose),
+
 	/* TODO: This stuff should just be 1 item that runs a wizard */
 	BONOBO_UI_UNSAFE_VERB ("ToolsFilterMailingList", emfv_tools_filter_mlist),
 	BONOBO_UI_UNSAFE_VERB ("ToolsFilterRecipient", emfv_tools_filter_recipient),
@@ -1663,6 +1713,8 @@ static EPixmap emfv_message_pixmaps[] = 
 	E_PIXMAP ("/commands/MessageMarkAsJunk", "stock_spam", E_ICON_SIZE_MENU),
 	E_PIXMAP ("/commands/MessageMarkAsNotJunk", "stock_not-spam", E_ICON_SIZE_MENU),
 	E_PIXMAP ("/commands/MessageFollowUpFlag", "stock_mail-flag-for-followup", E_ICON_SIZE_MENU),
+	E_PIXMAP ("/commands/ViewLoadImages", "stock_insert_image", E_ICON_SIZE_MENU),
+	E_PIXMAP ("/commands/MailCompose", "stock_mail-compose", E_ICON_SIZE_MENU),
 
 	E_PIXMAP ("/Toolbar/MailMessageToolbar/MessageReplySender", "stock_mail-reply", E_ICON_SIZE_LARGE_TOOLBAR),
 	E_PIXMAP ("/Toolbar/MailMessageToolbar/MessageReplyAll", "stock_mail-reply-to-all", E_ICON_SIZE_LARGE_TOOLBAR),
@@ -1683,7 +1735,7 @@ static EPixmap emfv_message_pixmaps[] = 
 /* this is added to emfv->enable_map in :init() */
 static const EMFolderViewEnable emfv_enable_map[] = {
 	{ "EditCut",                  EM_POPUP_SELECT_MANY },
-	{ "EditCopy",                 EM_POPUP_SELECT_MANY },
+	{ "EditCopy",                 EM_FOLDER_VIEW_SELECT_SELECTION },
 	{ "EditPaste",                EM_POPUP_SELECT_FOLDER },
 
 	/* FIXME: should these be single-selection? */
@@ -1740,6 +1792,7 @@ static const EMFolderViewEnable emfv_ena
 	{ "ToolsVFolderSubject",      EM_POPUP_SELECT_ONE },
 
 	{ "ViewLoadImages",	      EM_POPUP_SELECT_ONE },
+	{ "ViewSource",               EM_POPUP_SELECT_ONE },
 
 	/* always enabled */
 	{ "MailStop", 0 },
@@ -1818,16 +1871,15 @@ emfv_view_mode(BonoboUIComponent *uic, c
 	EMFolderView *emfv = data;
 	int i;
 
-	if (type != Bonobo_UIComponent_STATE_CHANGED
-	    || state[0] == '0')
+	if (type != Bonobo_UIComponent_STATE_CHANGED)
 		return;
 
 	/* TODO: I don't like this stuff much, is there any way we can move listening for such events
 	   elsehwere?  Probably not I guess, unless there's a EMFolderViewContainer for bonobo usage
 	   of a folder view */
 
-	for (i=0;i<= EM_FORMAT_SOURCE;i++) {
-		if (strcmp(emfv_display_styles[i]+strlen("/commands/"), path) == 0) {
+	i = state[0] != '0';
+
 			em_format_set_mode((EMFormat *)emfv->preview, i);
 
 			if (EM_FOLDER_VIEW_GET_CLASS (emfv)->update_message_style) {
@@ -1835,9 +1887,6 @@ emfv_view_mode(BonoboUIComponent *uic, c
 				
 				gconf_client_set_int (gconf, "/apps/evolution/mail/display/message_style", i, NULL);
 			}
-			break;
-		}
-	}
 }
 
 static void
@@ -1898,11 +1947,11 @@ emfv_activate(EMFolderView *emfv, Bonobo
 		bonobo_ui_component_set_prop(uic, "/commands/CaretMode", "state", state?"1":"0", NULL);
 		bonobo_ui_component_add_listener(uic, "CaretMode", emfv_caret_mode, emfv);
 
-		style = ((EMFormat *)emfv->preview)->mode;
-		bonobo_ui_component_set_prop(uic, emfv_display_styles[style], "state", "1", NULL);
-		bonobo_ui_component_add_listener(uic, "ViewNormal", emfv_view_mode, emfv);
+		style = ((EMFormat *)emfv->preview)->mode?EM_FORMAT_ALLHEADERS:EM_FORMAT_NORMAL;
+		bonobo_ui_component_set_prop(uic, emfv_display_styles[style], "state", style?"1":"0", NULL);
+		/*		bonobo_ui_component_add_listener(uic, "ViewNormal", emfv_view_mode, emfv); */
 		bonobo_ui_component_add_listener(uic, "ViewFullHeaders", emfv_view_mode, emfv);
-		bonobo_ui_component_add_listener(uic, "ViewSource", emfv_view_mode, emfv);
+		/*		bonobo_ui_component_add_listener(uic, "ViewSource", emfv_view_mode, emfv); */
 		em_format_set_mode((EMFormat *)emfv->preview, style);
 		
 		if (emfv->folder && !em_utils_folder_is_sent(emfv->folder, emfv->folder_uri))
Index: mail/mail-component.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-component.c,v
retrieving revision 1.110
diff -u -p -r1.110 mail-component.c
--- mail/mail-component.c	17 Mar 2005 01:51:12 -0000	1.110
+++ mail/mail-component.c	20 Apr 2005 19:16:59 -0000
@@ -737,23 +737,6 @@ impl__get_userCreatableItems (PortableSe
 	return list;
 }
 
-static void
-emc_new_folder_response(EMFolderSelector *emfs, int response, void *dummy)
-{
-	const char *uri, *path;
-	
-	if (response != GTK_RESPONSE_OK) {
-		gtk_widget_destroy((GtkWidget *)emfs);
-		return;
-	}
-	
-	uri = em_folder_selector_get_selected_uri(emfs);
-	path = em_folder_selector_get_selected_path(emfs);
-	
-	if (em_folder_tree_create_folder(emfs->emft, path, uri))
-		gtk_widget_destroy((GtkWidget *)emfs);
-}
-
 static int
 create_item(const char *type, EMFolderTreeModel *model, const char *uri)
 {
@@ -763,15 +746,7 @@ create_item(const char *type, EMFolderTr
 	
 		em_utils_compose_new_message(uri);
 	} else if (strcmp(type, "folder") == 0) {
-		EMFolderTree *folder_tree;
-		GtkWidget *dialog;
-		
-		folder_tree = (EMFolderTree *)em_folder_tree_new_with_model(model);
-		dialog = em_folder_selector_create_new (folder_tree, 0, _("Create folder"), _("Specify where to create the folder:"));
-		if (uri)
-			em_folder_selector_set_selected ((EMFolderSelector *) dialog, uri);
-		g_signal_connect (dialog, "response", G_CALLBACK(emc_new_folder_response), NULL);
-		gtk_widget_show(dialog);
+		emfu_folder_create (NULL);
 	} else
 		return -1;
 
Index: mail/mail-vfolder.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-vfolder.c,v
retrieving revision 1.131
diff -u -p -r1.131 mail-vfolder.c
--- mail/mail-vfolder.c	18 Feb 2005 16:43:55 -0000	1.131
+++ mail/mail-vfolder.c	20 Apr 2005 19:16:59 -0000
@@ -1110,13 +1110,11 @@ vfolder_gui_add_rule(EMVFolderRule *rule
 }
 
 void
-vfolder_gui_add_from_message(CamelMimeMessage *msg, int flags, const char *source)
+vfolder_gui_add_from_message(CamelMimeMessage *addr, int flags, const char *source)
 {
 	EMVFolderRule *rule;
 
-	g_return_if_fail (msg != NULL);
-
-	rule = (EMVFolderRule*)em_vfolder_rule_from_message(context, msg, flags, source);
+	rule = (EMVFolderRule*)em_vfolder_rule_from_message(context, addr, flags, source);
 	vfolder_gui_add_rule(rule);
 }
 
Index: plugins/mailing-list-actions/org-gnome-mailing-list-actions.xml
===================================================================
RCS file: /cvs/gnome/evolution/plugins/mailing-list-actions/org-gnome-mailing-list-actions.xml,v
retrieving revision 1.3
diff -u -p -r1.3 org-gnome-mailing-list-actions.xml
--- plugins/mailing-list-actions/org-gnome-mailing-list-actions.xml	17 Nov 2004 04:03:45 -0000	1.3
+++ plugins/mailing-list-actions/org-gnome-mailing-list-actions.xml	20 Apr 2005 19:16:59 -0000
@@ -9,7 +9,8 @@
   </commands>
 
   <menu>
-    <submenu name="Actions">
+    <placeholder name="MessagePlaceholder">
+      <submenu name="Message">
       <submenu name="List" _label="Mailing _List">    
         <menuitem verb="ListHelp" _label="Get list _usage information"/>
         <menuitem verb="ListSubscribe" _label="_Subscribe to list"/>
@@ -19,5 +20,6 @@
         <menuitem verb="ListArchive" _label="Get list _archive"/>
       </submenu>
     </submenu>
+    </placeholder>
   </menu>
 </Root>
Index: plugins/plugin-manager/org-gnome-plugin-manager.xml
===================================================================
RCS file: /cvs/gnome/evolution/plugins/plugin-manager/org-gnome-plugin-manager.xml,v
retrieving revision 1.1
diff -u -p -r1.1 org-gnome-plugin-manager.xml
--- plugins/plugin-manager/org-gnome-plugin-manager.xml	3 Nov 2004 07:28:33 -0000	1.1
+++ plugins/plugin-manager/org-gnome-plugin-manager.xml	20 Apr 2005 19:16:59 -0000
@@ -1,13 +1,19 @@
 <Root>
   <commands>
-    <cmd name="EPluginManagerManage" _label="Manage Plugins..."
+    <cmd name="EPluginManagerManage" _label="Plugins"
       _tip="Enable and disable plugins"/>
   </commands>
 
   <menu>
+    <submenu name="Edit">
+      <placeholder name="PluginManagerPlaceholder">
+        <menuitem name="EPluginManagerManage" verb=""/>
+      </placeholder>
+    </submenu>
+
     <submenu name="Tools">
       <placeholder name="ComponentPlaceholder"/>
-      <menuitem name="EPluginManagerManage" verb=""/>
     </submenu>
+
   </menu>
 </Root>
Index: plugins/save-attachments/org-gnome-save-attachments.xml
===================================================================
RCS file: /cvs/gnome/evolution/plugins/save-attachments/org-gnome-save-attachments.xml,v
retrieving revision 1.1
diff -u -p -r1.1 org-gnome-save-attachments.xml
--- plugins/save-attachments/org-gnome-save-attachments.xml	20 Oct 2004 07:40:04 -0000	1.1
+++ plugins/save-attachments/org-gnome-save-attachments.xml	20 Apr 2005 19:16:59 -0000
@@ -6,14 +6,15 @@
   </commands>
 
   <menu>
-    <submenu name="Actions">
-      <placeholder name="ComponentActionsPlaceholder">
+<!--
+    <placeholder name="MessagePlaceholder">
+      <submenu name="Message">
         <placeholder name="MailMessageActions">
 	  <separator f="" name="emaillist5"/>
 	  <menuitem name="EPSASaveAttachments" verb=""/>
         </placeholder>
-      </placeholder>
    </submenu>
-
+    </placeholder>
+-->
   </menu>
 </Root>
Index: plugins/shared-folder/org-gnome-shared-folder-errors.xml.h
===================================================================
RCS file: /cvs/gnome/evolution/plugins/shared-folder/org-gnome-shared-folder-errors.xml.h,v
retrieving revision 1.1
diff -u -p -r1.1 org-gnome-shared-folder-errors.xml.h
--- plugins/shared-folder/org-gnome-shared-folder-errors.xml.h	24 Jan 2005 14:50:51 -0000	1.1
+++ plugins/shared-folder/org-gnome-shared-folder-errors.xml.h	20 Apr 2005 19:16:59 -0000
@@ -8,4 +8,5 @@ char *s = N_("\n"
 char *s = N_("Specify User");
 /* org.gnome.evolution.mail_shared_folder:no-user secondary */
 char *s = N_("\n"
-	"\tYou have to specify a user name whom you want to add to the list \n");
+	"\tYou have to specify a user name whom you want to add to the list \n"
+	"");
Index: shell/e-shell-window.c
===================================================================
RCS file: /cvs/gnome/evolution/shell/e-shell-window.c,v
retrieving revision 1.32
diff -u -p -r1.32 e-shell-window.c
--- shell/e-shell-window.c	24 Feb 2005 04:55:57 -0000	1.32
+++ shell/e-shell-window.c	20 Apr 2005 19:16:59 -0000
@@ -702,8 +702,7 @@ setup_widgets (EShellWindow *window)
 					      (BonoboUIVerbFn)menu_component_selected,
 					      window);
 
-		g_string_printf(xml, "<submenu name=\"View\">"
-				"<submenu name=\"Window\">"
+		g_string_printf(xml, "<submenu name=\"Tools\">"
 				"<placeholder name=\"WindowComponent\">"
 				"<menuitem name=\"SwitchComponent-%s\" "
 				"verb=\"\" label=\"%s\" accel=\"%s\" tip=\"",
@@ -713,7 +712,7 @@ setup_widgets (EShellWindow *window)
 		g_string_append_printf(xml, _("Switch to %s"), info->button_label);
 		tmp = bonobo_ui_util_pixbuf_to_xml (info->menu_icon),
 		g_string_append_printf(xml, "\" pixtype=\"pixbuf\" pixname=\"%s\"/>"
-				       "</placeholder></submenu></submenu>\n",
+				       "</placeholder></submenu>\n",
 				       tmp);
 		g_free(tmp);
 		bonobo_ui_component_set_translate (e_shell_window_peek_bonobo_ui_component (window),
Index: ui/evolution-mail-global.xml
===================================================================
RCS file: /cvs/gnome/evolution/ui/evolution-mail-global.xml,v
retrieving revision 1.30
diff -u -p -r1.30 evolution-mail-global.xml
--- ui/evolution-mail-global.xml	1 Feb 2005 20:25:12 -0000	1.30
+++ ui/evolution-mail-global.xml	20 Apr 2005 19:16:59 -0000
@@ -5,11 +5,6 @@
     <cmd name="EmptyTrash"
      _tip="Permanently remove all deleted messages from all folders"/>
 
-    <cmd name="MailCompose"
-     _tip="Open a window for composing a mail message"
-     pixtype="pixbuf"
-     accel="*Control**Shift*m"/>
-
     <cmd name="MailPost"
      _tip="Post a message to a Public folder"
      accel="*Control**Alt*m"/>
@@ -18,6 +13,19 @@
      _tip="Cancel the current mail operation"
      pixtype="stock" pixname="gtk-stop"/>
 
+    <cmd name="FolderCreate"
+     _tip="Create a new folder for storing mail"
+     accel="*Control**Shift*f"
+     pixtype="pixbuf"/>
+
+    <cmd name="FolderCopy"
+     _tip="Copy the selected folder into another folder"
+     pixtype="pixbuf"/>
+
+    <cmd name="FolderMove"
+     _tip="Move the selected folder into another folder"
+     pixtype="pixbuf"/>
+
     <cmd name="ToolsFilters"
      _tip="Create or edit rules for filtering new mail"/>
 
@@ -29,7 +37,7 @@
 
     <cmd name="ViewPreview"
      _tip="Show message preview window"
-     accel="*Control*grave"
+     accel="*Control*m"
      type="toggle"/>
 
   </commands>
@@ -37,9 +45,23 @@
   <menu>
 
     <submenu name="View" _label="_View">
-      <menuitem name="ViewPreview" verb="" _label="_Preview Pane"/>
+      <placeholder name="ViewPreview">
+        <menuitem name="ViewPreview" verb="" _label="Message _Preview"/>
+      </placeholder>
+
       <separator f="" name="emailglobal"/>
+      <placeholder name="MailMessageFilter"/>
       <placeholder name="MailMessageView"/>
+
+<!-- This is the menu we want to replace "Current View" with
+      <submenu name="ViewAs" _label="Message _List As">
+        <placeholder name="CurrentView"/>
+      </submenu>
+-->
+      
+      <placeholder name="MailViewType"/>
+
+      <placeholder name="MailMessageZoom"/>
       <placeholder name="MailListView"/>
     </submenu>
 
@@ -49,47 +71,45 @@
         <placeholder name="MailMessageEdit"/>
         <placeholder name="MailListEditFlags"/>
       </placeholder>
-    </submenu>
-
-    <submenu name="Actions" _label="_Actions">
-      <placeholder name="ComponentActionsPlaceholder">
-        <menuitem name="ActionCompose" verb="MailCompose" _label="Compose _New Message"/>
-        <menuitem name="ActionPost" verb="MailPost" _label="Post Ne_w Message"/>
-	<menuitem name="ActionStop" verb="MailStop" _label="Cancel"/>
 
-	<separator f="" name="emailglobal"/>
-
-        <placeholder name="MailMessageActions"/>
-
-        <placeholder name="MailListActions"/>
+      <placeholder name="MailFilterTools">
+        <menuitem name="ToolsFilters" verb="" _label="Message F_ilters"/>
+      </placeholder>
 
-        <menuitem name="EmptyTrash" verb="" _label="Empty _Trash"/>
+      <placeholder name="MailVFolderTools">
+        <menuitem name="ToolsVFolders" verb="" _label="Search F_olders"/>
       </placeholder>
     </submenu>
 
-    <submenu name="Tools">
+    <placeholder name="FolderPlaceholder">
+      <submenu name="Folder" _label="F_older">
 
-      <placeholder name="ComponentPlaceholder">
+        <menuitem name="FolderCreate" verb="" _label="_New..." pixtype="pixbuf"/>
+<!--
+        <menuitem name="CreateVFolder" verb="CreateVFolder" _label="_New Search _Folder (FIXME)"/>
+-->
+        <menuitem name="ToolsSubscriptions" verb="" _label="_Subscriptions"/>
 
-        <placeholder name="MailFilterTools">
-          <menuitem name="ToolsFilters" verb="" _label="_Filters..."/>
-        </placeholder>
+ 	<separator f="" name="Folder1"/>
 
-	<separator f="" name="emailglobal2"/>
+        <menuitem name="FolderCopy" verb="" _label="_Copy Folder To..."/>
+        <menuitem name="FolderMove" verb="" _label="_Move Folder To..."/>
 
-        <placeholder name="MailVFolderTools">
-          <menuitem name="ToolsVFolders" verb="" _label="vFolder _Editor..."/>
-        </placeholder>
+ 	<separator f="" name="Folder2"/>
 
-	<separator f="" name="emailglobal3"/>
+        <placeholder name="MessagesInFolder"/>
 
-        <menuitem name="ToolsSubscriptions" verb="" _label="S_ubscribe to Folders..."/>
+ 	<separator f="" name="Folder3"/>
 
-	<separator f="" name="emailglobal4"/>
+ 	<placeholder name="FolderOps"/>        
 
-      </placeholder>
+      </submenu>
+    </placeholder>
 
+    <submenu name="Tools">
+      <placeholder name="ComponentPlaceholder"/>
     </submenu>
+
   </menu>
 
   <dockitem name="Toolbar">
Index: ui/evolution-mail-list.xml
===================================================================
RCS file: /cvs/gnome/evolution/ui/evolution-mail-list.xml,v
retrieving revision 1.22
diff -u -p -r1.22 evolution-mail-list.xml
--- ui/evolution-mail-list.xml	14 Feb 2005 15:55:00 -0000	1.22
+++ ui/evolution-mail-list.xml	20 Apr 2005 19:16:59 -0000
@@ -28,30 +28,37 @@
 
     <cmd name="ChangeFolderProperties"
      _tip="Change the properties of this folder"
-     pixtype="stock" pixname="gtk-properties"/>
+     pixtype="pixbuf"/>
 
     <cmd name="FolderExpunge"
      _tip="Permanently remove all deleted messages from this folder"
      accel="*Control*e"/>
 
+    <cmd name="FolderDelete"
+     _tip="Permanently remove this folder"/>
+
+    <cmd name="FolderRename"
+     _tip="Change the name of this folder"/>
+
     <cmd name="HideDeleted"
      _tip="Hide deleted messages rather than displaying them with a line through them"
      type="toggle" />
 
+    <cmd name="MessageFilterJunk"
+     _tip="Filter the selected messages for junk status"
+     pixtype="pixbuf"/>
+
     <cmd name="MessageMarkAllAsRead"
      _tip="Mark all visible messages as read"/>
 
-    <cmd name="ViewHideRead"
-     _tip="Temporarily hide all messages that have already been read"
-     pixtype="pixbuf"/>
+    <cmd name="ViewHideRead"  _tip="Temporarily hide all messages that have already been read"
+     type="radio" group="Message_Filter"/>
 
-    <cmd name="ViewHideSelected"
-     _tip="Temporarily hide the selected messages"
-     pixtype="pixbuf"/>
+    <cmd name="ViewHideSelected" _tip="Temporarily hide the selected messages"
+     type="radio" group="Message_Filter"/>
 
-    <cmd name="ViewShowAll"
-     _tip="Show messages that have been temporarily hidden"
-     pixtype="pixbuf"/>
+    <cmd name="ViewShowAll" _tip="Show messages that have been temporarily hidden"
+     type="radio" group="Message_Filter"/>
 
     <cmd name="ViewThreaded"
      _tip="Threaded Message list"
@@ -66,54 +73,78 @@
 
   <menu>
 
-    <submenu name="File">
-      <placeholder name="ComponentPlaceholder">
-        <separator name="mail-list-folder"/>
-        <submenu name="Folder" _label="_Folder">
-           <menuitem name="ChangeFolderProperties" verb="" _label="_Properties"/>
-        </submenu>
-      </placeholder>
-    </submenu>
-
-    <submenu name="Edit" _label="_Edit">
-      <placeholder name="EditPlaceholder">
-        <placeholder name="MailListEdit">
-          <menuitem name="EditSelectAll" verb="" _label="Select _All"/>
-          <menuitem name="EditSelectThread" verb="" _label="Select _Thread"/>
-          <menuitem name="EditInvertSelection" verb="" _label="_Invert Selection"/>
+    <submenu name="View">
 
-	  <separator f="" name="emaillist2"/>
-        </placeholder>
+      <placeholder name="MailMessageFilter">
+<!--
+        <submenu name="FilterMessages" _label="Show _Messages">
+
+          <menuitem name="ViewShowAll" verb="" _label="_All"/>
+	  <menuitem name="ViewHideSelected" verb="" _label="_Selected Messages"/>
+          <menuitem name="ViewHideRead" verb="" _label="Un_read Messages"/>
 
-        <placeholder name="MailListEditFlags">
-          <menuitem name="MessageMarkAllAsRead" verb="" _label="Mark All as _Read"/>
-        </placeholder>
+	</submenu>
+-->
       </placeholder>
-    </submenu>
 
-    <submenu name="View">
       <placeholder name="MailMessageView">
-        <menuitem name="ViewThreaded" verb="" _label="_Threaded Message List"/>
+        <menuitem name="ViewThreaded" verb="" _label="Group By _Threads"/>
         <menuitem name="HideDeleted" verb="" _label="Hide _Deleted Messages"/>
-
-  	<separator f="" name="emaillist"/>
       </placeholder>
 
       <placeholder name="MailListView">
 	<separator f="" name="emaillist"/>
-        <menuitem name="ViewHideSelected" verb="" _label="Hide S_elected Messages"/>
-        <menuitem name="ViewHideRead" verb="" _label="Hide _Read Messages"/>
-        <menuitem name="ViewShowAll" verb="" _label="Sh_ow Hidden Messages"/>
      </placeholder>
     </submenu>
 
+    <placeholder name="MessagePlaceholder">
+      <submenu name="Message" _label="_Message">
+        <placeholder name="MessageTopActions"/>
+
+        <separator f="" name="emailglobal"/>
+
+        <placeholder name="MessageNavigation"/>
+	<placeholder name="MailListActions"/>
+        <placeholder name="MailMessageActions"/>
+
+        <menuitem name="MessageFilterJunk" verb="" _label="Check for _Junk"/>
+
+        <separator f="" name="emaillist5"/>
+
+        <placeholder name="MessageRuleCreate"/>
+
+      </submenu>
+    </placeholder>
+
+    <placeholder name="FolderPlaceholder">
+      <submenu name="Folder" _label="F_older">
+
+        <placeholder name="MessagesInFolder">
+          <menuitem name="EditSelectAll" verb="" _label="Select _All Messages"/>
+          <menuitem name="MarkAsRead" verb="" _label="Mark Me_ssages as Read"/>
+          <menuitem name="FolderExpunge" verb="" _label="E_xpunge"/>
+        </placeholder>
+
+ 	<placeholder name="FolderOps">
+	  <menuitem name="FolderRename" verb="" _label="_Rename..."/>
+	  <menuitem name="FolderDelete" verb="" _label="_Delete" pixtype="stock" pixname="gtk-delete"/>
+
+ 	  <separator f="" name="FolderOps1"/>
+          <menuitem name="ChangeFolderProperties" verb="" _label="_Properties"/>
+ 	</placeholder>
+
+      </submenu>
+    </placeholder>
+
+<!--
     <submenu name="Actions" _label="_Actions">
       <placeholder name="ComponentActionsPlaceholder">
         <placeholder name="MailListActions">
-          <menuitem name="FolderExpunge" verb="" _label="E_xpunge"/>
         </placeholder>
       </placeholder>
     </submenu>
+-->
+
   </menu>
 
 </Root>
Index: ui/evolution-mail-message.xml
===================================================================
RCS file: /cvs/gnome/evolution/ui/evolution-mail-message.xml,v
retrieving revision 1.70
diff -u -p -r1.70 evolution-mail-message.xml
--- ui/evolution-mail-message.xml	14 Feb 2005 15:55:00 -0000	1.70
+++ ui/evolution-mail-message.xml	20 Apr 2005 19:16:59 -0000
@@ -7,7 +7,11 @@
 
     <cmd name="CaretMode"
     _tip="Show a blinking cursor in the body of displayed messages"
-    type = "toggle" state = "0" accel="F7"/>
+    type="toggle" state="0" accel="F7"/>
+
+    <cmd name="DeselectAllText"
+     _tip="Select none of the text in a message"
+     accel="*Control**Shift**Alt*a"/>
 
     <cmd name="EditCut"
      _tip="Cut selected message(s) to the clipboard"
@@ -49,10 +53,6 @@
      accel="*Control*y"
      pixtype="pixbuf"/>
 
-    <cmd name="MessageFilterJunk"
-     _tip="Filter the selected messages for junk status"
-     pixtype="pixbuf"/>
-
     <cmd name="MessageCopy"
      _tip="Copy selected messages to another folder"
      accel="*Control**Shift*y"
@@ -109,6 +109,11 @@
      _tip="Mark the selected message(s) as not being junk"
      pixtype="pixbuf"/>
 
+    <cmd name="MailCompose"
+     _tip="Open a window for composing a mail message"
+     pixtype="pixbuf"
+     accel="*Control**Shift*m"/>
+
     <cmd name="MessageMove"
      _tip="Move selected message(s) to another folder"
      accel="*Control**Shift*v"
@@ -146,17 +151,25 @@
 
     <cmd name="MessageSaveAs"
      _tip="Save the message as a text file"
-     accel="*Control**Alt*s"
+     accel="*Control*s"
      pixtype="stock" pixname="gtk-save-as"/>
 
     <cmd name="MessageSearch"
      _tip="Search for text in the body of the displayed message"
-     accel="*Control*s"
+     accel="*Control**Alt*f"
      pixtype="stock" pixname="gtk-find"/>
 
+    <cmd name="MessageSearchNext"
+     _tip="Find the next match of your search in the displayed message"
+     accel="*Control*g"/>
+
+    <cmd name="MessageSearchPrev"
+     _tip="Find the previous match of your search in the displayed message"
+     accel="*Control**Shift*g"/>
+
     <cmd name="MessageUndelete"
      _tip="Un-delete the selected messages"
-     accel="*Control*u"
+     accel="*Control**Shift*d"
      pixtype="stock" pixname="gtk-undelete"/>
 
     <cmd name="PrintMessage"
@@ -166,12 +179,17 @@
 
     <cmd name="PrintPreviewMessage"
      _tip="Preview the message to be printed"
+     accel="*Control**Shift*p"
      pixtype="stock" pixname="gtk-print-preview"/>
 
     <cmd name="PrintSetup"
      _tip="Set up the page settings for your current printer"
      pixtype="pixbuf"/>
 
+    <cmd name="SelectAllText"
+     _tip="Select all the text in a message"
+     accel="*Control**Alt*a"/>
+
     <cmd name="ToolsFilterMailingList"
      _tip="Create a rule to filter messages to this mailing list"/>
 
@@ -198,10 +216,11 @@
 
     <cmd name="ViewFullHeaders"
      _tip="Show message with all email headers"
-     type="radio" group="message_display"/>
+     type="toggle" state="0"/>
 
     <cmd name="ViewLoadImages"
-     _tip="Force images in HTML mail to be loaded"/>
+     _tip="Force images in HTML mail to be loaded"
+     accel="*Control*i" pixtype="pixbuf"/>
 
     <cmd name="ViewNormal"
      _tip="Show message in the normal style"
@@ -209,19 +228,19 @@
 
     <cmd name="ViewSource"
      _tip="Show the raw email source of the message"
-     type="radio" group="message_display"/>
+     accel="*Control*u"/>
 
     <cmd name="TextZoomIn"
     _tip="Increase the text size"
-    accel="*Control*8"/>
+    accel="*Control*plus"/>
 
     <cmd name="TextZoomOut"
     _tip="Decrease the text size"
-    accel="*Control*0"/>
+    accel="*Control*minus"/>
 
     <cmd name="TextZoomReset"
     _tip="Reset the text to its original size"
-    accel="*Control*9"/>
+    accel="*Control*0"/>
 
   </commands>
 
@@ -240,8 +259,7 @@
 
     <submenu name="File">
       <placeholder name="FileOps">
-        <menuitem name="MessageOpen" verb="" _label="_Open Message"/>
-        <menuitem name="MessageSaveAs" verb="" _label="_Save As..."/>
+        <menuitem name="MessageSaveAs" verb="" _label="_Save Message..."/>
       </placeholder>
 
       <placeholder name="Print">
@@ -253,92 +271,83 @@
     <submenu name="Edit">
       <placeholder name="EditPlaceholder">
         <placeholder name="MailMessageEdit">
-          <menuitem name="EditCut" verb="" _label="Cu_t"/>
           <menuitem name="EditCopy" verb="" _label="_Copy"/>
-          <menuitem name="EditPaste" verb="" _label="_Paste"/>
 
 	  <separator f="" name="emaillist1"/>
 
-	  <menuitem name="MessageSearch" verb="" _label="S_earch in Message..."/>
+          <menuitem name="SelectAllText" verb="" _label="Select _All Text"/>
+          <menuitem name="DeselectAllText" verb="" _label="Dese_lect All Text"/>
 
-	  <separator f="" name="emaillist2"/>
+ 	  <separator f="" name="emaillist2"/>
 
-          <menuitem name="MessageDelete" verb="" _label="_Delete"/>
-          <menuitem name="MessageUndelete" verb="" _label="_Undelete"/>
+          <menuitem name="MessageDelete" verb="" _label="_Delete Message"/>
+          <menuitem name="MessageUndelete" verb="" _label="_Undelete Message"/>
 
 	  <separator f="" name="emaillist3"/>
 
-          <menuitem name="MessageMarkAsRead" verb="" _label="Mar_k as Read"/>
-          <menuitem name="MessageMarkAsUnRead" verb="" _label="Mark as U_nread"/>
-          <menuitem name="MessageMarkAsImportant" verb="" _label="Mark as I_mportant"/>
-          <menuitem name="MessageMarkAsUnimportant" verb="" _label="Mark as Unimp_ortant"/>
-          <menuitem name="MessageMarkAsJunk" verb="" _label="Mark as _Junk"/>
-          <menuitem name="MessageMarkAsNotJunk" verb="" _label="Mark as _Not Junk"/>
+          <menuitem name="MessageSearch" verb="" _label="_Find in Message..."/>
+          <menuitem name="MessageSearchNext" verb="" _label="Find Ne_xt"/>
+          <menuitem name="MessageSearchPrev" verb="" _label="Find Pre_vious"/>
+
         </placeholder>
       </placeholder>
     </submenu>
 
     <submenu name="View">
-      <placeholder name="MailMessageView">
-        <submenu name="GoTo" _label="_Go To">
-          <menuitem name="MailNext" verb="" _label="_Next Message"/>
-          <menuitem name="MailNextUnread" verb="" _label="Next _Unread Message"/>
-          <menuitem name="MailNextFlagged" verb="" _label="Next _Important Message"/>
-          <menuitem name="MailNextThread" verb="" _label="Next _Thread"/>
-	  <separator f="" name="emaillist"/>
-          <menuitem name="MailPrevious" verb="" _label="_Previous Message"/>
-          <menuitem name="MailPreviousUnread" verb="" _label="P_revious Unread Message"/>
-          <menuitem name="MailPreviousFlagged" verb="" _label="Pr_evious Important Message"/>
-        </submenu>
-
-	<separator f="" name="emaillist"/>
-
-	<submenu name="TextSize" _label="Text Si_ze">
-	  <menuitem name="TextZoomOut" verb="" _label="S_maller"
-           pixtype="stock" pixname="gtk-zoom-out"/>
-	  <menuitem name="TextZoomIn" verb="" _label="_Larger"
-           pixtype="stock" pixname="gtk-zoom-in"/>
-	  
+       <placeholder name="MailMessageZoom">
 	  <separator f="" name="emaillist"/>
-	  
-	  <menuitem name="TextZoomReset" verb="" _label="Original Si_ze"
-           pixtype="stock" pixname="gtk-zoom-100"/>
-	</submenu>
-        <submenu name="MessageDisplay" _label="_Message Display">
-          <menuitem name="ViewLoadImages" verb="" _label="Load _Images"/>
-          <menuitem name="CaretMode" verb="" _label="Caret _Mode"/>
+ 	  <menuitem name="TextZoomIn" verb="" _label="_Zoom In"
+		    pixtype="stock" pixname="gtk-zoom-in"/>
+ 	  <menuitem name="TextZoomOut" verb="" _label="Zoom _Out"
+		    pixtype="stock" pixname="gtk-zoom-out"/>
 
-	  <separator f="" name="emaillist"/>
+ 	  <menuitem name="TextZoomReset" verb="" _label="_Normal Size"
+		    pixtype="stock" pixname="gtk-zoom-100"/>
+
+       </placeholder>
+
+       <placeholder name="MailViewType">
+         <separator f="" name="MailViewOps"/>
+
+         <menuitem name="ViewLoadImages" verb="" _label="_Load Images"/>
+         <menuitem name="ViewFullHeaders" verb="" _label="All Message _Headers"/>
+           <menuitem name="CaretMode" verb="" _label="_Caret Mode"/>
+           <menuitem name="ViewSource" verb="" _label="Message Source"/>
+
+       </placeholder>
 
-          <menuitem name="ViewNormal" verb="" _label="_Normal Display"/>
-	  <menuitem name="ViewFullHeaders" verb="" _label="Show Full _Headers"/>
-	  <menuitem name="ViewSource" verb="" _label="Show Email _Source"/>
-        </submenu>
-      </placeholder>
     </submenu>
 
-    <submenu name="Actions" _label="_Actions">
-      <placeholder name="ComponentActionsPlaceholder">
-        <placeholder name="MailMessageActions">
-          <menuitem name="MessageFollowUpFlag" verb="" _label="Follow _Up..."/>
+    <placeholder name="MessagePlaceholder">
+      <submenu name="Message" _label="_Message">
+        <placeholder name="MessageTopActions">
+          <menuitem name="ActionCompose" verb="MailCompose" _label="Compose _New Message"/>
+          <menuitem name="MessageOpen" verb="" _label="_Open in New Window"/>
+          <menuitem name="MessageEdit" verb="" _label="_Edit as New Message..."/>
+          <menuitem name="AddSenderToAddressbook" verb="" _label="A_dd Sender to Address Book"/>
+        </placeholder>
 
-	  <separator f="" name="emaillist2"/>
+        <placeholder name="MessageNavigation">
+          <submenu name="GoTo" _label="_Go To">
+            <menuitem name="MailNext" verb="" _label="_Next Message"/>
+            <menuitem name="MailNextUnread" verb="" _label="Next _Unread Message"/>
+            <menuitem name="MailNextFlagged" verb="" _label="Next _Important Message"/>
+            <menuitem name="MailNextThread" verb="" _label="Next _Thread"/>
+	    <separator f="" name="emaillist"/>
+            <menuitem name="MailPrevious" verb="" _label="_Previous Message"/>
+            <menuitem name="MailPreviousUnread" verb="" _label="P_revious Unread Message"/>
+            <menuitem name="MailPreviousFlagged" verb="" _label="Pr_evious Important Message"/>
+          </submenu>
+	</placeholder>
+
+        <placeholder name="MailMessageActions">
 
+          <menuitem name="MessageReplyAll" verb="" _label="Reply"/>
+<!--          <menuitem name="MessagePostReply" verb="" _label="Post a Repl_y"/> -->
           <menuitem name="MessageReplySender" verb="" _label="_Reply to Sender"/>
           <menuitem name="MessageReplyList" verb="" _label="Reply to _List"/>
-          <menuitem name="MessageReplyAll" verb="" _label="Reply to _All"/>
           <menuitem name="MessageForward" verb="" _label="_Forward"/>
-          <submenu name="ForwardAs" _label="F_orward As...">
-            <menuitem verb="MessageForwardAttached" _label="_Attached"/>
-            <menuitem verb="MessageForwardInline" _label="_Inline"/>
-            <menuitem verb="MessageForwardQuoted" _label="_Quoted"/>
-            <separator f="" name="forwardlist1"/>
             <menuitem verb="MessageRedirect" _label="Re_direct"/>
-          </submenu>
-
-          <menuitem name="MessagePostReply" verb="" _label="Post a Repl_y"/>
-
-          <menuitem name="MessageEdit" verb="" _label="_Edit as New Message..."/>
 
 	  <separator f="" name="emaillist3"/>
 
@@ -347,36 +356,46 @@
 
 	  <separator f="" name="emaillist4"/>
 
-          <menuitem name="AddSenderToAddressbook" verb="" _label="A_dd Sender to Address Book"/>
+          <submenu name="MessageMarkAs" _label="Mar_k as">
+            <menuitem name="MessageMarkAsRead" verb="" _label="_Read"/>
+            <menuitem name="MessageMarkAsUnRead" verb="" _label="_Unread"/>
+
+            <separator f="" name="emailmark1"/>
+
+            <menuitem name="MessageMarkAsImportant" verb="" _label="_Important"/>
+            <menuitem name="MessageMarkAsUnimportant" verb="" _label="Uni_mportant"/>
+
+            <separator f="" name="emailmark2"/>
+
+            <menuitem name="MessageMarkAsJunk" verb="" _label="_Junk"/>
+            <menuitem name="MessageMarkAsNotJunk" verb="" _label="_Not Junk"/>
 
-	  <separator f="" name="emaillist5"/>
+      	    <separator f="" name="emaillist2"/>
 
+            <menuitem name="MessageFollowUpFlag" verb="" _label="Follow _Up..."/>
+
+          </submenu>
           <menuitem name="MessageApplyFilters" verb="" _label="A_pply Filters"/>
-          <menuitem name="MessageFilterJunk" verb="" _label="Filter _Junk"/>
         </placeholder>
-      </placeholder>
-    </submenu>
 
-    <submenu name="Tools" _label="_Tools">
-      <placeholder name="ComponentPlaceholder">
-        <placeholder name="MailFilterTools">
-          <submenu name="ToolsFilterFromMessage" _label="_Create Filter From Message">
+        <placeholder name="MessageRuleCreate">
+          <submenu name="CreateRule" _label="Create R_ule">
             <menuitem name="ToolsFilterSubject" verb="" _label="Filter on _Subject..."/>
             <menuitem name="ToolsFilterSender" verb="" _label="Filter on Se_nder..."/>
             <menuitem name="ToolsFilterRecipient" verb="" _label="Filter on _Recipients..."/>
             <menuitem name="ToolsFilterMailingList" verb="" _label="Filter on Mailing _List..."/>
+
+            <separator f="" name="RuleSeparator"/>
+
+            <menuitem name="ToolsVFolderSubject" verb="" _label="VFolder on S_ubject..."/>
+            <menuitem name="ToolsVFolderSender" verb="" _label="VFolder on Sen_der..."/>
+            <menuitem name="ToolsVFolderRecipient" verb="" _label="VFolder on Recipients..."/>
+            <menuitem name="ToolsVFolderMailingList" verb="" _label="VFolder on _Mailing _List..."/>
+
           </submenu>
         </placeholder>
-        <placeholder name="MailVFolderTools">
-          <submenu name="ToolsVFolderFromMessage" _label="Create _vFolder From Message">
-            <menuitem name="ToolsVFolderSubject" verb="" _label="vFolder on _Subject..."/>
-            <menuitem name="ToolsVFolderSender" verb="" _label="vFolder on Se_nder..."/>
-            <menuitem name="ToolsVFolderRecipient" verb="" _label="vFolder on _Recipients..."/>
-            <menuitem name="ToolsVFolderMailingList" verb="" _label="vFolder on Mailing _List..."/>
-          </submenu>
-        </placeholder>
-      </placeholder>
-    </submenu>
+      </submenu>
+    </placeholder>
   </menu>
 
   <dockitem name="Toolbar">
Index: ui/evolution-mail-messagedisplay.xml
===================================================================
RCS file: /cvs/gnome/evolution/ui/evolution-mail-messagedisplay.xml,v
retrieving revision 1.14
diff -u -p -r1.14 evolution-mail-messagedisplay.xml
--- ui/evolution-mail-messagedisplay.xml	16 Dec 2004 18:26:54 -0000	1.14
+++ ui/evolution-mail-messagedisplay.xml	20 Apr 2005 19:16:59 -0000
@@ -27,18 +27,38 @@
       <placeholder name="MailMessageView"/>
     </submenu>
 
-    <submenu name="Actions" _label="_Actions">
-      <placeholder name="ComponentActionsPlaceholder">
+    <placeholder name="MessagePlaceholder">
+      <submenu name="Message" _label="_Message">
+        <placeholder name="MessageTopActions"/>
+
+        <separator f="" name="emailglobal"/>
+
+        <placeholder name="MessageNavigation"/>
+
+        <placeholder name="MailListActions"/>
+
         <placeholder name="MailMessageActions"/>
-      </placeholder>
+
+        <menuitem name="MessageFilterJunk" verb="" _label="Check for _Junk"/>
+
+        <separator f="" name="emaillist5"/>
+
+        <placeholder name="MessageRuleCreate"/>
+
     </submenu>
+    </placeholder>
+
+
+<!--
+    <placeholder name="MessagePlaceholder">
+      <submenu name="Message" _label="_Message">
 
-    <submenu name="Tools">
-      <placeholder name="ComponentPlaceholder">
-	<placeholder name="MailFilterTools"/>
-	<placeholder name="MailVFolderTools"/>
+        <placeholder name="ComponentActionsPlaceholder">
+          <placeholder name="MailMessageActions"/>
       </placeholder>
     </submenu>
+    </placeholder>
+-->
 
   </menu>
 
Index: ui/evolution.xml
===================================================================
RCS file: /cvs/gnome/evolution/ui/evolution.xml,v
retrieving revision 1.98
diff -u -p -r1.98 evolution.xml
--- ui/evolution.xml	4 Jan 2005 19:43:20 -0000	1.98
+++ ui/evolution.xml	20 Apr 2005 19:16:59 -0000
@@ -4,10 +4,10 @@
       _tip="Create a new window displaying this folder"
       accel="*Control**Shift*w"/>
 
-    <cmd name="FileClose" _label="Close" _tip="Close this window"
+    <cmd name="FileClose" _label="_Close Window" _tip="Close this window"
       pixtype="stock" pixname="gtk-close" accel="*Control*w"/>
 
-    <cmd name="FileExit" _label="E_xit" _tip="Exit the program"
+    <cmd name="FileExit" _label="_Quit" _tip="Exit the program"
       pixtype="stock" pixname="gtk-quit" accel="*Control*q"/>
 
     <cmd name="ViewButtonsIconText" _label="Icons _and text" 
@@ -57,27 +57,37 @@
 
       <menuitem name="OpenNewWindow" verb="" pixtype="pixbuf"/>
 
+      <separator f="" name="eshell4"/>
+      
+      <menuitem name="SendReceive" verb="" _label="_Send / Receive" accel="F9"/>
+
       <placeholder name="FileOps"/>
 
-      <separator f="" name="eshell4"/>
+      <separator f="" name="eshell1"/>
       
       <menuitem name="FileImporter" verb=""
 	_label="_Import..."
-	_tip="Import data from other programs" accel="*Control*i"
+	_tip="Import data from other programs"
 	pixtype="pixbuf"/>
 
       <placeholder name="Print" delimit="top"/>
 
+<!--
       <placeholder name="ComponentPlaceholder"/>
+-->
 
       <separator f="" name="eshell5"/>
 
+      <menuitem name="EmptyTrash" verb="" _label="Empty _Trash" pixtype="stock" pixname="gtk-delete"/>
+
+      <menuitem name="ForgetPasswords" verb="" _label="Forget _Passwords"/>
+
       <menuitem name="ToggleOffline" verb=""
-	_label="Work Offline"
+	_label="_Work Offline"
 	pixtype="pixbuf"/>
       
       <menuitem name="FileClose" verb=""
-	_label="_Close"/>
+	_label="_Close Window"/>
 
       <menuitem name="FileExit" verb="FileExit"/>
     </submenu>
@@ -85,33 +95,44 @@
     <submenu name="Edit" _label="_Edit">
       <placeholder name="EditPlaceholder"/>
       <separator/>
+      <menuitem name="PilotSettings" verb="" _label="_Synchronization Options..." _tip="Set up Pilot configuration"/>
+      <placeholder name="MailFilterTools"/>
+      <placeholder name="MailVFolderTools"/>
+
+      <placeholder name="PluginManagerPlaceholder"/>
+
       <menuitem name="Settings" verb="" _label="Prefere_nces" _tip="Change Evolution's settings"/>
     </submenu>
 
     <submenu name="View" _label="_View">
       <placeholder name="ViewBegin"/>
-      <submenu name="Window" _label="_Window"/>
-      <submenu name="Buttons" _label="Window B_uttons">
+      <menuitem name="ViewToolbar" id="ViewToolbar" verb="" accel="*Control**Shift*o"/>
+      <placeholder name="ViewPreview"/>
+      <submenu name="Buttons" _label="_Switcher Appearance">
             <menuitem name="ViewButtonsIconText" id="ViewButtonsIconText" verb=""/>
             <menuitem name="ViewButtonsIcon" id="ViewButtonsIcon" verb=""/>
             <menuitem name="ViewButtonsText" id="ViewButtonsText" verb=""/>
             <menuitem name="ViewButtonsGnome" id="ViewButtonsToolbar" verb=""/>
-            <separator/>
+            <separator f="" name="Switcher1"/>
             <menuitem name="ViewButtonsHide" id="ViewButtonsHide" verb=""/>
       </submenu>
-      <menuitem name="ViewToolbar" id="ViewToolbar" verb="" accel="*Control**Shift*o"/>
       <placeholder name="ViewAfterControl"/>
     </submenu>
 
+    <placeholder name="FolderPlaceholder">
+    </placeholder>
+
+    <placeholder name="MessagePlaceholder">
+    </placeholder>
+
+<!--
     <submenu name="Actions" _label="_Actions">
-      <menuitem name="SendReceive" verb="" _label="_Send / Receive" accel="F9"/>
-      <menuitem name="ForgetPasswords" verb="" _label="Forget _Passwords"/>
       <placeholder name="ComponentActionsPlaceholder"/>
     </submenu>
+-->
 
     <submenu name="Tools" _label="_Tools">
       <placeholder name="ComponentPlaceholder"/>
-      <menuitem name="PilotSettings" verb="" _label="Pi_lot Settings..." _tip="Set up Pilot configuration"/>
     </submenu>
 
     <placeholder name="SearchPlaceholder">
Index: widgets/misc/e-filter-bar.c
===================================================================
RCS file: /cvs/gnome/evolution/widgets/misc/e-filter-bar.c,v
retrieving revision 1.50
diff -u -p -r1.50 e-filter-bar.c
--- widgets/misc/e-filter-bar.c	14 Apr 2004 21:30:54 -0000	1.50
+++ widgets/misc/e-filter-bar.c	20 Apr 2005 19:16:59 -0000
@@ -334,17 +334,6 @@ build_items (ESearchBar *esb, ESearchBar
 
 	g_ptr_array_set_size(rules, 0);
 
-	/* find a unique starting point for the id's of our items */
-	for (i = 0; items[i].id != -1; i++) {
-		ESearchBarItem dup_item;
-
-		if (items[i].id >= id)
-			id = items[i].id + 1;
-
-		dup_item_no_subitems (&dup_item, items + i);
-		g_array_append_vals (menu, &dup_item, 1);
-	}
-	
 	*start = id;
 	
 	if (type == 0) {
@@ -384,6 +373,17 @@ build_items (ESearchBar *esb, ESearchBar
 		g_ptr_array_add (rules, rule);
 	}
 
+	/* find a unique starting point for the id's of our items */
+	for (i = 0; items[i].id != -1; i++) {
+		ESearchBarItem dup_item;
+
+		if (items[i].id >= id)
+			id = items[i].id + 1;
+
+		dup_item_no_subitems (&dup_item, items + i);
+		g_array_append_vals (menu, &dup_item, 1);
+	}
+	
 	/* anything elft in gtksux has gone away, and we need to unref/disconnect from it */
 	while (gtksux) {
 		GSList *next;
Index: widgets/misc/e-filter-bar.h
===================================================================
RCS file: /cvs/gnome/evolution/widgets/misc/e-filter-bar.h,v
retrieving revision 1.21
diff -u -p -r1.21 e-filter-bar.h
--- widgets/misc/e-filter-bar.h	11 Mar 2004 20:18:43 -0000	1.21
+++ widgets/misc/e-filter-bar.h	20 Apr 2005 19:16:59 -0000
@@ -91,14 +91,14 @@ enum {
 
 #define E_FILTERBAR_SAVE      { N_("_Save Search..."), E_FILTERBAR_SAVE_ID, NULL }
 #define E_FILTERBAR_EDIT      { N_("_Edit Saved Searches..."), E_FILTERBAR_EDIT_ID, NULL }
-#define E_FILTERBAR_ADVANCED  { N_("_Advanced..."), E_FILTERBAR_ADVANCED_ID, NULL }
+#define E_FILTERBAR_ADVANCED  { N_("_Advanced Search..."), E_FILTERBAR_ADVANCED_ID, NULL }
 #define E_FILTERBAR_SEPARATOR { NULL, 0, NULL }
 
 #ifdef JUST_FOR_TRANSLATORS
 const char * strings[] = {
 	N_("_Save Search..."),
 	N_("_Edit Saved Searches..."),
-	N_("_Advanced...")
+	N_("_Advanced Search...")
 };
 #endif
 


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