From 6245eada6fbe3e60eb099af84fe456ba867c1699 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 24 May 2001 14:42:19 +0000 Subject: new callback 2001-05-24 Radek Doulik * e-msg-composer.c (menu_edit_delete_all_cb): new callback svn path=/trunk/; revision=9959 --- composer/ChangeLog | 4 ++++ composer/e-msg-composer.c | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) (limited to 'composer') diff --git a/composer/ChangeLog b/composer/ChangeLog index 8962e0b678..6d7988ebcc 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,7 @@ +2001-05-24 Radek Doulik + + * e-msg-composer.c (menu_edit_delete_all_cb): new callback + 2001-05-23 Radek Doulik * e-msg-composer.c (e_msg_composer_set_sig_file): set orig to 0 diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 68746715d4..55e32e5325 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -1050,6 +1050,28 @@ menu_file_add_attachment_cb (BonoboUIComponent *uic, NULL); } +static void +menu_edit_delete_all_cb (BonoboUIComponent *uic, void *data, const char *path) +{ + CORBA_Environment ev; + EMsgComposer *composer; + + composer = E_MSG_COMPOSER (data); + CORBA_exception_init (&ev); + + GNOME_GtkHTML_Editor_Engine_undo_begin (composer->editor_engine, "Delete all but signature", "Undelete all", &ev); + GNOME_GtkHTML_Editor_Engine_freeze (composer->editor_engine, &ev); + GNOME_GtkHTML_Editor_Engine_runCommand (composer->editor_engine, "select-all", &ev); + GNOME_GtkHTML_Editor_Engine_runCommand (composer->editor_engine, "delete", &ev); + GNOME_GtkHTML_Editor_Engine_setParagraphData (composer->editor_engine, "signature", "0", &ev); + e_msg_composer_set_sig_file (composer, composer->sig_file); + GNOME_GtkHTML_Editor_Engine_thaw (composer->editor_engine, &ev); + GNOME_GtkHTML_Editor_Engine_undo_end (composer->editor_engine, &ev); + + CORBA_exception_free (&ev); + printf ("delete all\n"); +} + static void menu_view_attachments_activate_cb (BonoboUIComponent *component, const char *path, @@ -1372,6 +1394,8 @@ static BonoboUIVerb verbs [] = { BONOBO_UI_VERB ("FileSend", menu_file_send_cb), BONOBO_UI_VERB ("FileSendLater", menu_file_send_later_cb), + BONOBO_UI_VERB ("DeleteAll", menu_edit_delete_all_cb), + BONOBO_UI_VERB_END }; -- cgit