aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-ops.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-11-22 06:09:51 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-11-22 06:09:51 +0800
commit0fa1b87e9ee6b947b2706a44fc7429730655b3f9 (patch)
tree186d98fc1423fdd9d86a85a251c78230a2c3060c /mail/mail-ops.c
parentfb92b831ae35b70f52a9792422f610defa56517b (diff)
downloadgsoc2013-evolution-0fa1b87e9ee6b947b2706a44fc7429730655b3f9.tar.gz
gsoc2013-evolution-0fa1b87e9ee6b947b2706a44fc7429730655b3f9.tar.zst
gsoc2013-evolution-0fa1b87e9ee6b947b2706a44fc7429730655b3f9.zip
New function to return if user wants to view message source.
2000-11-21 Jeffrey Stedfast <fejj@helixcode.com> * mail-config.c (mail_config_view_source): New function to return if user wants to view message source. (mail_config_set_view_source): New function to set whether the view wants to view source. * mail-ops.c (mail_do_view_message_sources): Removed. We're not gonna view-source this way anymore. * folder-browser-factory.c: Removed the ViewSource bonobo verb from the Message menu. (control_activate): Added ViewSource. * folder-browser.c (on_right_click): Removed Message menu item to view message source. (folder_browser_toggle_view_source): New callback to set whether or not the MailDisplay shows the raw message or the pretty-ified message. * mail-callbacks.c: Removed view_source. * mail-display.c (redisplay): If toggle_raw is set then display the raw message else display the pretty formatted message. (mail_display_redisplay): New function to force the redisplay of a message. * mail-format.c (mail_format_raw_message): New function to write the raw message data. svn path=/trunk/; revision=6639
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r--mail/mail-ops.c131
1 files changed, 0 insertions, 131 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 728ab77484..60c7a3dad6 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -2387,137 +2387,6 @@ mail_do_view_messages (CamelFolder *folder, GPtrArray *uids,
mail_operation_queue (&op_view_messages, input, TRUE);
}
-/* ** VIEW MESSAGE SOURCE ******************************************************* */
-
-typedef struct view_message_sources_input_s {
- CamelFolder *folder;
- GPtrArray *uids;
- FolderBrowser *fb;
-} view_message_sources_input_t;
-
-typedef struct view_message_sources_data_s {
- GPtrArray *messages;
-} view_message_sources_data_t;
-
-static gchar *
-describe_view_message_sources (gpointer in_data, gboolean gerund)
-{
- view_message_sources_input_t *input = (view_message_sources_input_t *) in_data;
-
- if (gerund)
- return g_strdup_printf
- (_("Viewing message sources from folder \"%s\""),
- mail_tool_get_folder_name (input->folder));
- else
- return g_strdup_printf (_("View message sources from \"%s\""),
- mail_tool_get_folder_name (input->folder));
-}
-
-static void
-setup_view_message_sources (gpointer in_data, gpointer op_data, CamelException *ex)
-{
- view_message_sources_input_t *input = (view_message_sources_input_t *) in_data;
-
- camel_object_ref (CAMEL_OBJECT (input->folder));
- gtk_object_ref (GTK_OBJECT (input->fb));
-}
-
-static void
-do_view_message_sources (gpointer in_data, gpointer op_data, CamelException *ex)
-{
- view_message_sources_input_t *input = (view_message_sources_input_t *) in_data;
- view_message_sources_data_t *data = (view_message_sources_data_t *) op_data;
- int i;
-
- data->messages = g_ptr_array_new ();
-
- for (i = 0; i < input->uids->len; i++) {
- CamelMimeMessage *message;
-
- mail_op_set_message (_("Retrieving message %d of %d (uid \"%s\")"),
- i + 1, input->uids->len, (char *)input->uids->pdata[i]);
-
- mail_tool_camel_lock_up ();
- message = camel_folder_get_message (input->folder, input->uids->pdata[i], ex);
- mail_tool_camel_lock_down ();
-
- g_ptr_array_add (data->messages, message);
- }
-}
-
-static void
-cleanup_view_message_sources (gpointer in_data, gpointer op_data,
- CamelException *ex)
-{
- view_message_sources_input_t *input = (view_message_sources_input_t *) in_data;
- view_message_sources_data_t *data = (view_message_sources_data_t *) op_data;
- int i;
-
- for (i = 0; i < data->messages->len; i++) {
- CamelMimeMessage *msg;
- CamelStream *stream;
- GtkWidget *dialog;
- GtkWidget *source;
-
- if (data->messages->pdata[i] == NULL)
- continue;
-
- msg = data->messages->pdata[i];
-
- stream = camel_stream_mem_new ();
- camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (msg), stream);
-
- dialog = gnome_dialog_new (camel_mime_message_get_subject (msg), GNOME_STOCK_BUTTON_OK, NULL);
- gtk_window_set_policy (GTK_WINDOW (dialog), FALSE, TRUE, FALSE);
- source = gtk_text_new (NULL, NULL);
- gtk_text_set_editable (GTK_TEXT (source), FALSE);
- gtk_text_freeze (GTK_TEXT (source));
- gtk_text_insert (GTK_TEXT (source), NULL, NULL, NULL,
- CAMEL_STREAM_MEM (stream)->buffer->data,
- CAMEL_STREAM_MEM (stream)->buffer->len);
- gtk_text_thaw (GTK_TEXT (source));
- gtk_widget_show (source);
- gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), source, TRUE, TRUE, 0);
-
- /* FIXME: this blocks, we should probably not use a run_and_close */
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
-
- camel_object_unref (CAMEL_OBJECT (stream));
- camel_object_unref (CAMEL_OBJECT (data->messages->pdata[i]));
- g_free (input->uids->pdata[i]);
- }
-
- g_ptr_array_free (input->uids, TRUE);
- g_ptr_array_free (data->messages, TRUE);
- camel_object_unref (CAMEL_OBJECT (input->folder));
- gtk_object_unref (GTK_OBJECT (input->fb));
-}
-
-static const mail_operation_spec op_view_message_sources = {
- describe_view_message_sources,
- sizeof (view_message_sources_data_t),
- setup_view_message_sources,
- do_view_message_sources,
- cleanup_view_message_sources
-};
-
-void
-mail_do_view_message_sources (CamelFolder *folder, GPtrArray *uids,
- FolderBrowser *fb)
-{
- view_message_sources_input_t *input;
-
- g_return_if_fail (CAMEL_IS_FOLDER (folder));
- g_return_if_fail (uids != NULL);
- g_return_if_fail (IS_FOLDER_BROWSER (fb));
-
- input = g_new (view_message_sources_input_t, 1);
- input->folder = folder;
- input->uids = uids;
- input->fb = fb;
-
- mail_operation_queue (&op_view_message_sources, input, TRUE);
-}
/* ** SAVE MESSAGES ******************************************************* */