diff options
Diffstat (limited to 'composer')
-rw-r--r-- | composer/ChangeLog | 74 | ||||
-rw-r--r-- | composer/e-msg-composer.c | 225 | ||||
-rw-r--r-- | composer/mail-composer-errors.xml | 2 | ||||
-rw-r--r-- | composer/mail-composer-errors.xml.h | 2 |
4 files changed, 34 insertions, 269 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog index 1f4c44f112..8f45bf86a8 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,70 +1,13 @@ -2004-11-26 JP Rosevear <jpr@novell.com> - - * e-msg-composer.c (create_composer): get image from icon factory - directly - -2004-11-15 Not Zed <NotZed@Ximian.com> - - * e-msg-composer.c (handle_multipart_encrypted): remove the old - camel_multipart_encrypted api. - -2004-10-28 Not Zed <NotZed@Ximian.com> - - * e-msg-composer.c (drag_data_received): fix the popup id. - - * e-msg-composer-attachment-bar.c (emcab_popup): added popup doco. - -2004-10-27 Jeffrey Stedfast <fejj@ximian.com> - - * e-msg-composer.c (composer_key_pressed): Close on Esc. - (create_composer): Connect to the key-press-event signal. - -2004-10-26 mengjie yu <meng-jie.yu@sun.com> - - fix for bugzilla #44876 - - * e-msg-composer-hdrs.c (header_new_recipient, create_headers): - add access key for Reply_to, From, Subject, To, Cc, Bcc, Post_to - - * e-msg-composer.c (setup_signatures_menu): Add accesss key for - Signature. - -2004-10-19 JP Rosevear <jpr@novell.com> - - * e-msg-composer.c, e-msg-composer-attachment-bar.c: convert to - org.gnome hook names - 2004-10-08 Jeffrey Stedfast <fejj@novell.com> * e-msg-composer.c (build_message): g_strdup() the gpg/smime keys into the recipients list or else we end up free'ing them later when we shouldn't. Fixes bug #66703 -2004-10-06 Not Zed <NotZed@Ximian.com> - - * e-msg-composer.c (drag_data_received): - * e-msg-composer-attachment-bar.c (emcab_popup): e-popup api changes. - -2004-10-01 JP Rosevear <jpr@novell.com> - - * e-msg-composer.c: uses GTKHTML_API_VERSION for the bonobo server - look up - -2004-10-01 Not Zed <NotZed@Ximian.com> +2004-10-08 JP Rosevear <jpr@novell.com> - * e-msg-composer.c (create_composer): enable ask drop action and - hook onto drag motion. - (drag_motion): implement. - (drop_action): do the work here now. - (drag_data_received): popup a menu if the action is ask. - (drop_popup_copy, drop_popup_move, drop_popup_cancel): - (drop_popup_free): Popup callbacks. - -2004-09-30 Kjartan Maraas <kmaraas@gnome.org> - - * e-msg-composer.c: (autosave_manager_start), - (autosave_manager_stop), (create_composer): Use non-deprecated - functions. + * mail-composer-errors.xml: remove acceleratoer from _Save Message + to not break string freeze 2004-08-17 Michael Meeks <michael@ximian.com> @@ -119,17 +62,6 @@ * e-msg-composer-attachment.c: include config.h. See #61395. -2004-09-04 Not Zed <NotZed@Ximian.com> - - * e-msg-composer-*.c: include gnome-i18n.h if required. - -2004-08-30 Not Zed <NotZed@Ximian.com> - - * e-msg-composer-attachment-bar.c (emcab_popup): em-popup based - popup menu to replace the gnome one. - (popup_menu_event): use new func above. - (button_press_event): ", some cleanup. - 2004-06-18 Not Zed <NotZed@Ximian.com> ** Fix for #60387. diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 9d0c6e7fa6..5012637c67 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -70,7 +70,6 @@ #include <gconf/gconf-client.h> #include <libgnome/gnome-exec.h> -#include <libgnome/gnome-i18n.h> #include <libgnomeui/gnome-uidefs.h> #include <libgnomeui/gnome-window-icon.h> @@ -86,7 +85,7 @@ #include <glade/glade.h> -#include <libedataserver/e-iconv.h> +#include <gal/util/e-iconv.h> #include <gal/e-text/e-entry.h> #include "e-util/e-dialog-utils.h" @@ -117,7 +116,6 @@ #include "mail/mail-ops.h" #include "mail/mail-mt.h" #include "mail/mail-session.h" -#include "mail/em-popup.h" #include "e-msg-composer.h" #include "e-msg-composer-attachment-bar.h" @@ -130,7 +128,7 @@ #include "Editor.h" #include "listener.h" -#define GNOME_GTKHTML_EDITOR_CONTROL_ID "OAFIID:GNOME_GtkHTML_Editor:" GTKHTML_API_VERSION +#define GNOME_GTKHTML_EDITOR_CONTROL_ID "OAFIID:GNOME_GtkHTML_Editor:3.1" #define d(x) x @@ -162,19 +160,6 @@ static GtkTargetEntry drop_types[] = { #define num_drop_types (sizeof (drop_types) / sizeof (drop_types[0])) -static struct { - char *target; - GdkAtom atom; - guint32 actions; -} drag_info[] = { - { "message/rfc822", 0, GDK_ACTION_COPY }, - { "x-uid-list", 0, GDK_ACTION_ASK|GDK_ACTION_MOVE|GDK_ACTION_COPY }, - { "text/uri-list", 0, GDK_ACTION_COPY }, - { "_NETSCAPE_URL", 0, GDK_ACTION_COPY }, - { "text/x-vcard", 0, GDK_ACTION_COPY }, - { "text/calendar", 0, GDK_ACTION_COPY }, -}; - static const char *emc_draft_format_names[] = { "pgp-sign", "pgp-encrypt", "smime-sign", "smime-encrypt" }; @@ -1458,14 +1443,14 @@ static void autosave_manager_start (AutosaveManager *am) { if (am->id == 0) - am->id = g_timeout_add (AUTOSAVE_INTERVAL, autosave_run, am); + am->id = gtk_timeout_add (AUTOSAVE_INTERVAL, autosave_run, am); } static void autosave_manager_stop (AutosaveManager *am) { if (am->id) { - g_source_remove (am->id); + gtk_timeout_remove (am->id); am->id = 0; } } @@ -2093,14 +2078,12 @@ setup_signatures_menu (EMsgComposer *composer) EIterator *it; hbox = e_msg_composer_hdrs_get_from_hbox (E_MSG_COMPOSER_HDRS (composer->hdrs)); - - label = gtk_label_new_with_mnemonic (_("Si_gnature:")); + + label = gtk_label_new (_("Signature:")); gtk_widget_show (label); - + composer->sig_menu = (GtkOptionMenu *) gtk_option_menu_new (); - - gtk_label_set_mnemonic_widget (label, composer->sig_menu); - + gtk_box_pack_end_defaults (GTK_BOX (hbox), (GtkWidget *) composer->sig_menu); gtk_box_pack_end (GTK_BOX (hbox), label, FALSE, TRUE, 0); hspace = gtk_hbox_new (FALSE, 0); @@ -2661,24 +2644,10 @@ attach_message(EMsgComposer *composer, CamelMimeMessage *msg) camel_object_unref(mime_part); } -struct _drop_data { - EMsgComposer *composer; - - GdkDragContext *context; - /* Only selection->data and selection->length are valid */ - GtkSelectionData *selection; - - guint32 action; - guint info; - guint time; - - unsigned int move:1; - unsigned int moved:1; - unsigned int aborted:1; -}; - static void -drop_action(EMsgComposer *composer, GdkDragContext *context, guint32 action, GtkSelectionData *selection, guint info, guint time) +drag_data_received (EMsgComposer *composer, GdkDragContext *context, + int x, int y, GtkSelectionData *selection, + guint info, guint time) { char *tmp, *str, **urls; CamelMimePart *mime_part; @@ -2686,8 +2655,8 @@ drop_action(EMsgComposer *composer, GdkDragContext *context, guint32 action, Gtk CamelURL *url; CamelMimeMessage *msg; char *content_type; - int i, success=FALSE, delete=FALSE; - + int i; + switch (info) { case DND_TYPE_MESSAGE_RFC822: d(printf ("dropping a message/rfc822\n")); @@ -2697,11 +2666,8 @@ drop_action(EMsgComposer *composer, GdkDragContext *context, guint32 action, Gtk camel_stream_reset (stream); msg = camel_mime_message_new (); - if (camel_data_wrapper_construct_from_stream((CamelDataWrapper *)msg, stream) != -1) { + if (camel_data_wrapper_construct_from_stream((CamelDataWrapper *)msg, stream) != -1) attach_message(composer, msg); - success = TRUE; - delete = action == GDK_ACTION_MOVE; - } camel_object_unref(msg); camel_object_unref(stream); @@ -2740,7 +2706,6 @@ drop_action(EMsgComposer *composer, GdkDragContext *context, guint32 action, Gtk } g_free (urls); - success = TRUE; break; case DND_TYPE_TEXT_VCARD: case DND_TYPE_TEXT_CALENDAR: @@ -2758,7 +2723,6 @@ drop_action(EMsgComposer *composer, GdkDragContext *context, guint32 action, Gtk camel_object_unref (mime_part); g_free (content_type); - success = TRUE; break; case DND_TYPE_X_UID_LIST: { GPtrArray *uids; @@ -2823,8 +2787,6 @@ drop_action(EMsgComposer *composer, GdkDragContext *context, guint32 action, Gtk camel_object_unref(mime_part); camel_object_unref(mp); } - success = TRUE; - delete = action == GDK_ACTION_MOVE; fail: if (camel_exception_is_set(&ex)) { char *name; @@ -2850,117 +2812,6 @@ drop_action(EMsgComposer *composer, GdkDragContext *context, guint32 action, Gtk d(printf ("dropping an unknown\n")); break; } - - printf("Drag finished, success %d delete %d\n", success, delete); - - gtk_drag_finish(context, success, delete, time); -} - -static void -drop_popup_copy(EPopup *ep, EPopupItem *item, void *data) -{ - struct _drop_data *m = data; - drop_action(m->composer, m->context, GDK_ACTION_COPY, m->selection, m->info, m->time); -} - -static void -drop_popup_move(EPopup *ep, EPopupItem *item, void *data) -{ - struct _drop_data *m = data; - drop_action(m->composer, m->context, GDK_ACTION_MOVE, m->selection, m->info, m->time); -} - -static void -drop_popup_cancel(EPopup *ep, EPopupItem *item, void *data) -{ - struct _drop_data *m = data; - gtk_drag_finish(m->context, FALSE, FALSE, m->time); -} - -static EPopupItem drop_popup_menu[] = { - { E_POPUP_ITEM, "00.emc.02", N_("_Copy"), drop_popup_copy, NULL, "stock_mail-copy", 0 }, - { E_POPUP_ITEM, "00.emc.03", N_("_Move"), drop_popup_move, NULL, "stock_mail-move", 0 }, - { E_POPUP_BAR, "10.emc" }, - { E_POPUP_ITEM, "99.emc.00", N_("Cancel _Drag"), drop_popup_cancel, NULL, NULL, 0 }, -}; - -static void -drop_popup_free(EPopup *ep, GSList *items, void *data) -{ - struct _drop_data *m = data; - - g_slist_free(items); - - g_object_unref(m->context); - g_object_unref(m->composer); - g_free(m->selection->data); - g_free(m->selection); - g_free(m); -} - -static void -drag_data_received (EMsgComposer *composer, GdkDragContext *context, - int x, int y, GtkSelectionData *selection, - guint info, guint time) -{ - if (selection->data == NULL || selection->length == -1) - return; - - if (context->action == GDK_ACTION_ASK) { - EMPopup *emp; - GSList *menus = NULL; - GtkMenu *menu; - int i; - struct _drop_data *m; - - m = g_malloc0(sizeof(*m)); - m->context = context; - g_object_ref(context); - m->composer = composer; - g_object_ref(composer); - m->action = context->action; - m->info = info; - m->time = time; - m->selection = g_malloc0(sizeof(*m->selection)); - m->selection->data = g_malloc(selection->length); - memcpy(m->selection->data, selection->data, selection->length); - m->selection->length = selection->length; - - emp = em_popup_new("org.gnome.evolution.mail.composer.popup.drop"); - for (i=0;i<sizeof(drop_popup_menu)/sizeof(drop_popup_menu[0]);i++) - menus = g_slist_append(menus, &drop_popup_menu[i]); - - e_popup_add_items((EPopup *)emp, menus, drop_popup_free, m); - menu = e_popup_create_menu_once((EPopup *)emp, NULL, 0); - gtk_menu_popup(menu, NULL, NULL, NULL, NULL, 0, time); - } else { - drop_action(composer, context, context->action, selection, info, time); - } -} - -static gboolean -drag_motion(GObject *o, GdkDragContext *context, gint x, gint y, guint time, EMsgComposer *composer) -{ - GList *targets; - GdkDragAction action, actions = 0; - - for (targets = context->targets; targets; targets = targets->next) { - int i; - - for (i=0;i<sizeof(drag_info)/sizeof(drag_info[0]);i++) - if (targets->data == (void *)drag_info[i].atom) - actions |= drag_info[i].actions; - } - - actions &= context->actions; - action = context->suggested_action; - /* we default to copy */ - if (action == GDK_ACTION_ASK && (actions & (GDK_ACTION_MOVE|GDK_ACTION_COPY)) != (GDK_ACTION_MOVE|GDK_ACTION_COPY)) - action = GDK_ACTION_COPY; - - gdk_drag_status(context, action, time); - - return action != 0; } static void @@ -2969,10 +2820,6 @@ class_init (EMsgComposerClass *klass) GtkObjectClass *object_class; GtkWidgetClass *widget_class; GObjectClass *gobject_class; - int i; - - for (i=0;i<sizeof(drag_info)/sizeof(drag_info[0]);i++) - drag_info[i].atom = gdk_atom_intern(drag_info[i].target, FALSE); gobject_class = G_OBJECT_CLASS(klass); object_class = GTK_OBJECT_CLASS (klass); @@ -3199,19 +3046,6 @@ msg_composer_destroy_notify (void *data) all_composers = g_slist_remove (all_composers, composer); } -static int -composer_key_pressed (EMsgComposer *composer, GdkEventKey *event, void *user_data) -{ - if (event->keyval == GDK_Escape) { - do_exit (composer); - g_signal_stop_emission_by_name (composer, "key-press-event"); - return TRUE; - } - - return FALSE; -} - - /* Verbs for non-control entries */ static BonoboUIVerb entry_verbs [] = { BONOBO_UI_VERB ("EditCut", menu_edit_cut_cb), @@ -3324,16 +3158,13 @@ create_composer (int visible_mask) int vis; GList *icon_list; BonoboControlFrame *control_frame; + GdkPixbuf *attachment_pixbuf; composer = g_object_new (E_TYPE_MSG_COMPOSER, "win_name", _("Compose a message"), NULL); gtk_window_set_title ((GtkWindow *) composer, _("Compose a message")); all_composers = g_slist_prepend (all_composers, composer); - g_signal_connect (composer, "key-press-event", - G_CALLBACK (composer_key_pressed), - NULL); - g_signal_connect (composer, "destroy", G_CALLBACK (msg_composer_destroy_notify), NULL); @@ -3346,9 +3177,10 @@ create_composer (int visible_mask) } /* DND support */ - gtk_drag_dest_set (GTK_WIDGET (composer), GTK_DEST_DEFAULT_ALL, drop_types, num_drop_types, GDK_ACTION_COPY|GDK_ACTION_ASK|GDK_ACTION_MOVE); - g_signal_connect(composer, "drag_data_received", G_CALLBACK (drag_data_received), NULL); - g_signal_connect(composer, "drag-motion", G_CALLBACK(drag_motion), composer); + gtk_drag_dest_set (GTK_WIDGET (composer), GTK_DEST_DEFAULT_ALL, + drop_types, num_drop_types, GDK_ACTION_COPY); + g_signal_connect (composer, "drag_data_received", + G_CALLBACK (drag_data_received), NULL); e_msg_composer_load_config (composer, visible_mask); setup_ui (composer); @@ -3443,9 +3275,11 @@ create_composer (int visible_mask) gtk_misc_set_alignment (GTK_MISC (composer->attachment_expander_num), 1.0, 0.5); expander_hbox = gtk_hbox_new (FALSE, 0); - composer->attachment_expander_icon = e_icon_factory_get_image ("stock_attach", E_ICON_SIZE_MENU); + attachment_pixbuf = e_icon_factory_get_icon ("stock_attach", E_ICON_SIZE_MENU); + composer->attachment_expander_icon = gtk_image_new_from_pixbuf (attachment_pixbuf); gtk_misc_set_alignment (GTK_MISC (composer->attachment_expander_icon), 1, 0.5); gtk_widget_set_size_request (composer->attachment_expander_icon, 100, -1); + gdk_pixbuf_unref (attachment_pixbuf); gtk_box_pack_start (GTK_BOX (expander_hbox), composer->attachment_expander_label, TRUE, TRUE, 0); @@ -3744,25 +3578,24 @@ handle_multipart_signed (EMsgComposer *composer, CamelMultipart *multipart, int static void handle_multipart_encrypted (EMsgComposer *composer, CamelMultipart *multipart, int depth) { + CamelMultipartEncrypted *mpe = (CamelMultipartEncrypted *) multipart; CamelContentType *content_type; CamelCipherContext *cipher; CamelDataWrapper *content; CamelMimePart *mime_part; CamelException ex; - CamelCipherValidity *valid; - + /* FIXME: make sure this is a PGP/MIME encrypted part?? */ e_msg_composer_set_pgp_encrypt (composer, TRUE); camel_exception_init (&ex); cipher = mail_crypto_get_pgp_cipher_context (NULL); - mime_part = camel_mime_part_new(); - valid = camel_cipher_decrypt(cipher, (CamelMimePart *)multipart, mime_part, &ex); - camel_object_unref(cipher); + mime_part = camel_multipart_encrypted_decrypt (mpe, cipher, &ex); + camel_object_unref (cipher); camel_exception_clear (&ex); - if (valid == NULL) - return; - camel_cipher_validity_free(valid); + + if (!mime_part) + return; content_type = camel_mime_part_get_content_type (mime_part); diff --git a/composer/mail-composer-errors.xml b/composer/mail-composer-errors.xml index 1a52225ca3..dc696a5f02 100644 --- a/composer/mail-composer-errors.xml +++ b/composer/mail-composer-errors.xml @@ -39,7 +39,7 @@ <secondary>Closing this composer window will discard the message permanently, unless you choose to save the message in your Drafts folder. This will allow you to continue the message at a later date.</secondary> <button label="_Discard Changes" response="GTK_RESPONSE_NO"/> <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/> - <button label="_Save Message" response="GTK_RESPONSE_YES"/> + <button label="Save Message" response="GTK_RESPONSE_YES"/> </error> <error id="no-build-message" type="error" modal="true"> diff --git a/composer/mail-composer-errors.xml.h b/composer/mail-composer-errors.xml.h index 30f0005258..1f6668c58f 100644 --- a/composer/mail-composer-errors.xml.h +++ b/composer/mail-composer-errors.xml.h @@ -31,7 +31,7 @@ char *s = N_("Are you sure you want to discard the message, titled '{0}', you ar /* mail-composer:exit-unsaved secondary */ char *s = N_("Closing this composer window will discard the message permanently, unless you choose to save the message in your Drafts folder. This will allow you to continue the message at a later date."); char *s = N_("_Discard Changes"); -char *s = N_("_Save Message"); +char *s = N_("Save Message"); /* mail-composer:no-build-message primary */ char *s = N_("Could not create message."); /* mail-composer:no-build-message secondary */ |