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
This commit is contained in:
committed by
Jeffrey Stedfast
parent
c6c1164cca
commit
9739fb5219
@ -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
|
||||
|
||||
|
||||
@ -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 ...");
|
||||
|
||||
@ -834,14 +834,45 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user