aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-browser.c
diff options
context:
space:
mode:
authorRodney Dawes <dobey@novell.com>2005-05-14 05:29:28 +0800
committerRodney Dawes <dobey@src.gnome.org>2005-05-14 05:29:28 +0800
commitd88e794ded5fc1ea72af2a3d0ec4c46442a992cf (patch)
tree33b921e3906bc3990d30eeb0195c0fe13181cee6 /mail/em-folder-browser.c
parentc006784d0d4612e4c682732c7db0fea35e9407e0 (diff)
downloadgsoc2013-evolution-d88e794ded5fc1ea72af2a3d0ec4c46442a992cf.tar.gz
gsoc2013-evolution-d88e794ded5fc1ea72af2a3d0ec4c46442a992cf.tar.zst
gsoc2013-evolution-d88e794ded5fc1ea72af2a3d0ec4c46442a992cf.zip
Add profiler so that it gets disted properly
2005-05-13 Rodney Dawes <dobey@novell.com> * plugins/Makefile.am (DIST_SUBDIRS): Add profiler so that it gets disted properly 2005-05-13 Rodney Dawes <dobey@novell.com> * Makefile.am: Add new em-folder-utils.[ch] abstraction * em-folder-browser.c: Update for new menu layout Add new methods to handle the actions that were previously only available from the context menu when right-clicking on a folder * em-folder-selector.c (emfs_response): Just call emfu_folder_create if the user wants to create a new folder in the selector dialog (em_folder_selector_get_selected_path): Clean up the code to fix a couple potential crashes * em-folder-tree.[ch]: Add methods to get pointers to a CamelFolder or CamelFolderInfo object for the selected item in the tree Add a method to get a pointer to an EMFolderTreeModelStoreInfo object for the selected store in the tree Move folder operations out into em-folder-utils.[ch] so that they are abstracted from the tree and can be used by methods other than the internal context menu * em-folder-utils.[ch]: Move the folder operations code to here * em-folder-view.c: Update for the new menu layout Fix Mark as Read/Unread in the context menu to only show up in the list * mail-component.c (create_item): Just call emfu_folder_create here when the user requests to create a new folder from the New toolbar item 2005-05-13 Rodney Dawes <dobey@novell.com> * org-gnome-mailing-list-actions.xml: Update for the new menu layout 2005-05-13 Rodney Dawes <dobey@novell.com> * org-gnome-plugin-manager.xml: Update for new menu layout 2005-05-13 Rodney Dawes <dobey@novell.com> * org-gnome-save-attachments.xml: Update for new menu layout 2005-05-13 Rodney Dawes <dobey@novell.com> * e-shell-window.c (setup_widgets): Update for the new menu layout by putting the "component" switching items under the "Tools" menu 2005-05-13 Rodney Dawes <dobey@novell.com> * *.xml: Update to the new menu layout 2005-05-13 Rodney Dawes <dobey@novell.com> * e-filter-bar.[ch]: Update for the new menu layout svn path=/trunk/; revision=29354
Diffstat (limited to 'mail/em-folder-browser.c')
-rw-r--r--mail/em-folder-browser.c125
1 files changed, 98 insertions, 27 deletions
diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c
index 582546facb..257ac8ad38 100644
--- a/mail/em-folder-browser.c
+++ b/mail/em-folder-browser.c
@@ -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 *uid, void *data, const char *path)
}
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;
@@ -628,25 +714,6 @@ emfb_view_show_all(BonoboUIComponent *uid, void *data, const char *path)
/* ********************************************************************** */
static void
-emfb_empty_trash(BonoboUIComponent *uid, void *data, const char *path)
-{
- EMFolderView *emfv = data;
-
- em_utils_empty_trash (gtk_widget_get_toplevel ((GtkWidget *) emfv));
-}
-
-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 +779,12 @@ static BonoboUIVerb emfb_verbs[] = {
BONOBO_UI_UNSAFE_VERB ("ViewShowAll", emfb_view_show_all),
/* ViewThreaded is a toggle */
- BONOBO_UI_UNSAFE_VERB ("EmptyTrash", emfb_empty_trash),
- BONOBO_UI_UNSAFE_VERB ("MailCompose", emfb_mail_compose),
+ 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 ("MailPost", emfb_mail_post),
BONOBO_UI_UNSAFE_VERB ("MailStop", emfb_mail_stop),
BONOBO_UI_UNSAFE_VERB ("ToolsFilters", emfb_tools_filters),
@@ -726,11 +797,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 +808,13 @@ static const EMFolderViewEnable emfb_enable_map[] = {
{ "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 },
};