diff options
author | Jeffrey Stedfast <fejj@helixcode.com> | 2000-08-07 14:55:53 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2000-08-07 14:55:53 +0800 |
commit | 9739fb5219a67aab4e7e7f2b84ec3795ef042f09 (patch) | |
tree | 060d7bfd52379c64f9418a65e1d2c2538bdfdbbb | |
parent | c6c1164cca58c30c9bec04ca1c01856ed04a1366 (diff) | |
download | gsoc2013-evolution-9739fb5219a67aab4e7e7f2b84ec3795ef042f09.tar gsoc2013-evolution-9739fb5219a67aab4e7e7f2b84ec3795ef042f09.tar.gz gsoc2013-evolution-9739fb5219a67aab4e7e7f2b84ec3795ef042f09.tar.bz2 gsoc2013-evolution-9739fb5219a67aab4e7e7f2b84ec3795ef042f09.tar.lz gsoc2013-evolution-9739fb5219a67aab4e7e7f2b84ec3795ef042f09.tar.xz gsoc2013-evolution-9739fb5219a67aab4e7e7f2b84ec3795ef042f09.tar.zst gsoc2013-evolution-9739fb5219a67aab4e7e7f2b84ec3795ef042f09.zip |
New menu item under Actions to allow editing of messages.
2000-08-07 Jeffrey Stedfast <fejj@helixcode.com>
* folder-browser-factory.c (control_activate): New menu item under
Actions to allow editing of messages.
* mail-ops.c (edit_message): New function for editing messages.
svn path=/trunk/; revision=4563
-rw-r--r-- | mail/ChangeLog | 5 | ||||
-rw-r--r-- | mail/folder-browser-factory.c | 11 | ||||
-rw-r--r-- | mail/mail-ops.c | 35 | ||||
-rw-r--r-- | mail/mail.h | 1 |
4 files changed, 48 insertions, 4 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 5dbd2c8dee..95e484aa8d 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,10 @@ 2000-08-07 Jeffrey Stedfast <fejj@helixcode.com> + * folder-browser-factory.c (control_activate): New menu item under + Actions to allow editing of messages. + + * mail-ops.c (edit_message): New function for editing messages. + * component-factory.c (owner_set_cb): Create a global reference to the Drafts mbox folder for the Composer to use diff --git a/mail/folder-browser-factory.c b/mail/folder-browser-factory.c index bf13ce6319..2b034522b0 100644 --- a/mail/folder-browser-factory.c +++ b/mail/folder-browser-factory.c @@ -65,14 +65,20 @@ control_activate (BonoboControl *control, BonoboUIHandler *uih, message_list_toggle_threads, FOLDER_BROWSER (folder_browser)->message_list, NULL); - + bonobo_ui_handler_menu_new_item (uih, "/Actions/Mark all seen", _("_Mark all messages seen"), NULL, -1, BONOBO_UI_HANDLER_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_CLEAR, 0, 0, mark_all_seen, folder_browser); - + + bonobo_ui_handler_menu_new_item (uih, "/Actions/Edit Message", _("E_dit Message"), + NULL, -1, + BONOBO_UI_HANDLER_PIXMAP_STOCK, + GNOME_STOCK_PIXMAP_MAIL_NEW, + 0, 0, edit_message, folder_browser); + bonobo_ui_handler_menu_new_item (uih, "/Actions/Expunge", _("_Expunge"), NULL, -1, BONOBO_UI_HANDLER_PIXMAP_STOCK, @@ -136,6 +142,7 @@ control_deactivate (BonoboControl *control, BonoboUIHandler *uih, bonobo_ui_handler_menu_remove (uih, "/View/Threaded"); bonobo_ui_handler_menu_remove (uih, "/Actions/Mark all seen"); + bonobo_ui_handler_menu_remove (uih, "/Actions/Edit Message"); bonobo_ui_handler_menu_remove (uih, "/Actions/Expunge"); bonobo_ui_handler_menu_remove (uih, "/Tools/Mail Filters ..."); bonobo_ui_handler_menu_remove (uih, "/Tools/vFolder Editor ..."); diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 0bb82c843c..a7388a81e2 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -834,8 +834,7 @@ mark_all_seen (BonoboUIHandler *uih, void *user_data, const char *path) int i; uids = camel_folder_get_uids (ml->folder); - for (i = 0; i < uids->len; i++) - { + for (i = 0; i < uids->len; i++) { camel_folder_set_message_flags (ml->folder, uids->pdata[i], CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN); @@ -843,6 +842,38 @@ mark_all_seen (BonoboUIHandler *uih, void *user_data, const char *path) } static void +real_edit_msg (MessageList *ml, const char *uid, gpointer user_data) +{ + CamelException *ex = user_data; + CamelMimeMessage *msg; + GtkWidget *composer; + + if (camel_exception_is_set (ex)) + return; + + msg = camel_folder_get_message (ml->folder, uid, ex); + + composer = e_msg_composer_new_with_message (msg); + gtk_widget_show (composer); +} + +void +edit_message (BonoboUIHandler *uih, void *user_data, const char *path) +{ + FolderBrowser *fb = FOLDER_BROWSER (user_data); + MessageList *ml = fb->message_list; + CamelException ex; + + camel_exception_init (&ex); + message_list_foreach (ml, real_edit_msg, &ex); + if (camel_exception_is_set (&ex)) { + mail_exception_dialog ("Could not open message for editing", &ex, fb); + camel_exception_clear (&ex); + return; + } +} + +static void real_delete_msg (MessageList *ml, const char *uid, gpointer user_data) { CamelException *ex = user_data; diff --git a/mail/mail.h b/mail/mail.h index 6247ae5d24..3f5563c378 100644 --- a/mail/mail.h +++ b/mail/mail.h @@ -67,6 +67,7 @@ void move_msg (GtkWidget *button, gpointer user_data); void print_msg (GtkWidget *button, gpointer user_data); void mark_all_seen (BonoboUIHandler *uih, void *user_data, const char *path); +void edit_message (BonoboUIHandler *uih, void *user_data, const char *path); void expunge_folder (BonoboUIHandler *uih, void *user_data, const char *path); void filter_edit (BonoboUIHandler *uih, void *user_data, const char *path); void vfolder_edit_vfolders (BonoboUIHandler *uih, void *user_data, const char *path); |