/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * Authors: Jeffrey Stedfast * * Copyright 2001 Ximian, Inc. (www.ximian.com) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. * */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include "widgets/misc/e-charset-picker.h" #include "mail.h" #include "mail-accounts.h" #include "mail-config.h" #include "mail-config-druid.h" #include "mail-account-editor.h" #ifdef ENABLE_NNTP #include "mail-account-editor-news.h" #endif #include "mail-send-recv.h" #include "mail-session.h" static void mail_accounts_dialog_class_init (MailAccountsDialogClass *class); static void mail_accounts_dialog_init (MailAccountsDialog *dialog); static void mail_accounts_dialog_finalise (GtkObject *obj); static void mail_unselect (GtkCList *clist, gint row, gint column, GdkEventButton *event, gpointer data); static GnomeDialogClass *parent_class; GtkType mail_accounts_dialog_get_type () { static GtkType type = 0; if (!type) { GtkTypeInfo type_info = { "MailAccountsDialog", sizeof (MailAccountsDialog), sizeof (MailAccountsDialogClass), (GtkClassInitFunc) mail_accounts_dialog_class_init, (GtkObjectInitFunc) mail_accounts_dialog_init, (GtkArgSetFunc) NULL, (GtkArgGetFunc) NULL }; type = gtk_type_unique (gnome_dialog_get_type (), &type_info); } return type; } static void mail_accounts_dialog_class_init (MailAccountsDialogClass *class) { GtkObjectClass *object_class; object_class = (GtkObjectClass *) class; parent_class = gtk_type_class (gnome_dialog_get_type ()); object_class->finalize = mail_accounts_dialog_finalise; /* override methods */ } static void mail_accounts_dialog_init (MailAccountsDialog *o) { ; } static void mail_accounts_dialog_finalise (GtkObject *obj) { MailAccountsDialog *dialog = (MailAccountsDialog *) obj; gtk_object_unref (GTK_OBJECT (dialog->gui)); ((GtkObjectClass *)(parent_class))->finalize (obj); } static void load_accounts (MailAccountsDialog *dialog) { const MailConfigAccount *account; const GSList *node = dialog->accounts; int i = 0; int default_account; gtk_clist_freeze (dialog->mail_accounts); gtk_clist_clear (dialog->mail_accounts); default_account = mail_config_get_default_account_num (); while (node) { CamelURL *url; gchar *text[3]; account = node->data; if (account->source && account->source->url) url = camel_url_new (account->source->url, NULL); else url = NULL; text[0] = (account->source && account->source->enabled) ? "+" : ""; text[1] = account->name; text[2] = g_strdup_printf ("%s%s", url && url->protocol ? url->protocol : _("None"), (i == default_account) ? _(" (default)") : ""); if (url) camel_url_free (url); gtk_clist_append (dialog->mail_accounts, text); g_free (text[2]); /* set the account on the row */ gtk_clist_set_row_data (dialog->mail_accounts, i, (gpointer) account); node = node->next; i++; } gtk_clist_thaw (dialog->mail_accounts); /* * The selection gets cleared when we rebuild the clist, but no * unselect event is emitted. So we simulate it here. * I hate the clist. */ mail_unselect (dialog->mail_accounts, 0, 0, NULL, dialog); } /* mail callbacks */ static void mail_select (GtkCList *clist, gint row, gint column, GdkEventButton *event, gpointer data) { MailAccountsDialog *dialog = data; MailConfigAccount *account = gtk_clist_get_row_data (clist, row); dialog->accounts_row = row; gtk_widget_set_sensitive (GTK_WIDGET (dialog->mail_edit), TRUE); gtk_widget_set_sensitive (GTK_WIDGET (dialog->mail_delete), TRUE); gtk_widget_set_sensitive (GTK_WIDGET (dialog->mail_default), TRUE); gtk_widget_set_sensitive (GTK_WIDGET (dialog->mail_able), TRUE); if (account->source && account->source->enabled) gtk_label_set_text (GTK_LABEL (GTK_BIN (dialog->mail_able)->child), _("Disable")); else gtk_label_set_text (GTK_LABEL (GTK_BIN (dialog->mail_able)->child), _("Enable")); } static void mail_unselect (GtkCList *clist, gint row, gint column, GdkEventButton *event, gpointer data) { MailAccountsDialog *dialog = data; dialog->accounts_row = -1; gtk_widget_set_sensitive (GTK_WIDGET (dialog->mail_edit), FALSE); gtk_widget_set_sensitive (GTK_WIDGET (dialog->mail_delete), FALSE); gtk_widget_set_sensitive (GTK_WIDGET (dialog->mail_default), FALSE); gtk_widget_set_sensitive (GTK_WIDGET (dialog->mail_able), FALSE); /* * If an insensitive button in a button box has the focus, and if you hit tab, * there is a segfault. I think that this might be a gtk bug. Anyway, this * is a workaround. */ gtk_widget_grab_focus (GTK_WIDGET (dialog->mail_add)); } static void mail_add_finished (GtkWidget *widget, gpointer data) { /* Either Cancel or Finished was clicked in the druid so reload the accounts */ MailAccountsDialog *dialog = data; dialog->accounts = mail_config_get_accounts (); load_accounts (dialog); } static void mail_add (GtkButton *button, gpointer data) { MailAccountsDialog *dialog = data; MailConfigDruid *druid; druid = mail_config_druid_new (dialog->shell); gtk_signal_connect (GTK_OBJECT (druid), "destroy", GTK_SIGNAL_FUNC (mail_add_finished), dialog); gtk_widget_show (GTK_WIDGET (druid)); } static void mail_editor_destroyed (GtkWidget *widget, gpointer data) { load_accounts (MAIL_ACCOUNTS_DIALOG (data)); } static void mail_edit (GtkButton *button, gpointer data) { MailAccountsDialog *dialog = data; if (dialog->accounts_row >= 0) { MailConfigAccount *account; MailAccountEditor *editor; account = gtk_clist_get_row_data (dialog->mail_accounts, dialog->accounts_row); editor = mail_account_editor_new (account); gtk_signal_connect (GTK_OBJECT (editor), "destroy", GTK_SIGNAL_FUNC (mail_editor_destroyed), dialog); gtk_widget_show (GTK_WIDGET (editor)); } } static void mail_double_click (GtkWidget *widget, GdkEventButton *event, gpointer data) { if (event->type == GDK_2BUTTON_PRESS) mail_edit (NULL, data); } static void mail_delete (GtkButton *button, gpointer data) { MailAccountsDialog *dialog = data; MailConfigAccount *account; GnomeDialog *confirm; GtkWidget *label; int ans; if (dialog->accounts_row < 0) return; confirm = GNOME_DIALOG (gnome_message_box_new (_("Are you sure you want to delete this account?"), GNOME_MESSAGE_BOX_QUESTION, NULL)); gnome_dialog_append_button_with_pixmap (confirm, _("Delete"), GNOME_STOCK_BUTTON_YES); gnome_dialog_append_button_with_pixmap (confirm, _("Don't delete"), GNOME_STOCK_BUTTON_NO); gtk_window_set_policy (GTK_WINDOW (confirm), TRUE, TRUE, TRUE); gtk_window_set_modal (GTK_WINDOW (confirm), TRUE); gtk_window_set_title (GTK_WINDOW (confirm), _("Really delete account?")); gnome_dialog_set_parent (confirm, GTK_WINDOW (dialog)); ans = gnome_dialog_run_and_close (confirm); if (ans == 0) { int sel, row, len; sel = dialog->accounts_row; account = gtk_clist_get_row_data (dialog->mail_accounts, sel); /* remove it from the folder-tree in the shell */ if (account->source && account->source->url) { MailConfigService *service = account->source; CamelProvider *prov; CamelException ex; camel_exception_init (&ex); prov = camel_session_get_provider (session, service->url, &ex); if (prov != NULL && prov->flags & CAMEL_PROVIDER_IS_STORAGE && prov->flags & CAMEL_PROVIDER_IS_REMOTE) { CamelService *store; store = camel_session_get_service (session, service->url, CAMEL_PROVIDER_STORE, &ex); if (store != NULL) { g_warning ("removing storage: %s", service->url); mail_remove_storage (CAMEL_STORE (store)); camel_object_unref (CAMEL_OBJECT (store)); } } else g_warning ("%s is not a remote storage.", service->url); camel_exception_clear (&ex); } /* remove it from the config file */ dialog->accounts = mail_config_remove_account (account); mail_config_write (); mail_autoreceive_setup (); gtk_clist_remove (dialog->mail_accounts, sel); len = dialog->accounts ? g_slist_length ((GSList *) dialog->accounts) : 0; if (len > 0) { row = sel >= len ? len - 1 : sel; load_accounts (dialog); gtk_clist_select_row (dialog->mail_accounts, row, 0); } else { dialog->accounts_row = -1; gtk_widget_set_sensitive (GTK_WIDGET (dialog->mail_edit), FALSE); gtk_widget_set_sensitive (GTK_WIDGET (dialog->mail_delete), FALSE); gtk_widget_set_sensitive (GTK_WIDGET (dialog->mail_default), FALSE); gtk_widget_set_sensitive (GTK_WIDGET (dialog->mail_able), FALSE); } } } static void mail_default (GtkButton *button, gpointer data) { MailAccountsDialog *dialog = data; const MailConfigAccount *account; if (dialog->accounts_row >= 0) { int row; row = dialog->accounts_row; account = gtk_clist_get_row_data (dialog->mail_accounts, row); mail_config_set_default_account (account); mail_config_write (); load_accounts (dialog); gtk_clist_select_row (dialog->mail_accounts, row, 0); } } static void mail_able (GtkButton *button, gpointer data) { MailAccountsDialog *dialog = data; const MailConfigAccount *account; if (dialog->accounts_row >= 0) { int row; row = dialog->accounts_row; account = gtk_clist_get_row_data (dialog->mail_accounts, row); account->source->enabled = !account->source->enabled; mail_autoreceive_setup (); mail_config_write (); load_accounts (dialog); gtk_clist_select_row (dialog->mail_accounts, row, 0); } } #ifdef ENABLE_NNTP static void load_news (MailAccountsDialog *dialog) { const MailConfigService *service; const GSList *node = dialog->news; int i = 0; gtk_clist_freeze (dialog->news_accounts); gtk_clist_clear (dialog->news_accounts); while (node) { CamelURL *url; gchar *text[1]; service = node->data; if (service->url) url = camel_url_new (service->url, NULL); else url = NULL; text[0] = g_strdup_printf ("%s", url && url->host ? url->host : _("None")); if (url) camel_url_free (url); gtk_clist_append (dialog->news_accounts, text); g_free (text[0]); /* set the account on the row */ gtk_clist_set_row_data (dialog->news_accounts, i, (gpointer) service); node = node->next; i++; } gtk_clist_thaw (dialog->news_accounts); } /* news callbacks */ static void news_select (GtkCList *clist, gint row, gint column, GdkEventButton *event, gpointer data) { MailAccountsDialog *dialog = data; dialog->news_row = row; gtk_widget_set_sensitive (GTK_WIDGET (dialog->news_edit), TRUE); gtk_widget_set_sensitive (GTK_WIDGET (dialog->news_delete), TRUE); } static void news_unselect (GtkCList *clist, gint row, gint column, GdkEventButton *event, gpointer data) { MailAccountsDialog *dialog = data; dialog->news_row = -1; gtk_widget_set_sensitive (GTK_WIDGET (dialog->news_edit), FALSE); gtk_widget_set_sensitive (GTK_WIDGET (dialog->news_delete), FALSE); } static void news_editor_destroyed (GtkWidget *widget, gpointer data) { load_news (MAIL_ACCOUNTS_DIALOG (data)); } static void news_edit (GtkButton *button, gpointer data) { MailAccountsDialog *dialog = data; if (dialog->news_row >= 0) { MailConfigService *service; MailAccountEditorNews *editor; service = gtk_clist_get_row_data (dialog->news_accounts, dialog->news_row); editor = mail_account_editor_news_new (service); gtk_signal_connect (GTK_OBJECT (editor), "destroy", GTK_SIGNAL_FUNC (news_editor_destroyed), dialog); gtk_widget_show (GTK_WIDGET (editor)); } } static void news_add_destroyed (GtkWidget *widget, gpointer data) { gpointer *send = data; MailAccountsDialog *dialog; MailConfigService *service; GSList *mini; service = send[0]; dialog = send[1]; g_free(send); dialog->news = mail_config_get_news (); load_news (dialog); mini = g_slist_prepend(NULL, service); mail_load_storages(dialog->shell, mini, FALSE); g_slist_free(mini); dialog->news = mail_config_get_news (); load_news (dialog); } static void news_add (GtkButton *button, gpointer data) { MailAccountsDialog *dialog = data; MailConfigService *service; MailAccountEditorNews *editor; gpointer *send; send = g_new(gpointer, 2); service = g_new0 (MailConfigService, 1); service->url = NULL; editor = mail_account_editor_news_new (service); send[0] = service; send[1] = dialog; gtk_signal_connect (GTK_OBJECT (editor), "destroy", GTK_SIGNAL_FUNC (news_add_destroyed), send); gtk_widget_show (GTK_WIDGET (editor)); } static void news_delete (GtkButton *button, gpointer data) { MailAccountsDialog *dialog = data; MailConfigService *server; GnomeDialog *confirm; GtkWidget *label; int ans; if (dialog->news_row < 0) return; confirm = GNOME_DIALOG (gnome_dialog_new (_("Are you sure you want to delete this news account?"), GNOME_STOCK_BUTTON_YES, GNOME_STOCK_BUTTON_NO, NULL)); gtk_window_set_policy (GTK_WINDOW (confirm), TRUE, TRUE, TRUE); gtk_window_set_modal (GTK_WINDOW (confirm), TRUE); label = gtk_label_new (_("Are you sure you want to delete this news account?")); gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_box_pack_start (GTK_BOX (confirm->vbox), label, TRUE, TRUE, 0); gtk_widget_show (label); gnome_dialog_set_parent (confirm, GTK_WINDOW (dialog)); ans = gnome_dialog_run_and_close (confirm); if (ans == 0) { int row, len; server = gtk_clist_get_row_data (dialog->news_accounts, dialog->news_row); /* remove it from the folder-tree in the shell */ if (server && server->url) { CamelProvider *prov; CamelException ex; camel_exception_init (&ex); prov = camel_session_get_provider (session, server->url, &ex); if (prov != NULL && prov->flags & CAMEL_PROVIDER_IS_STORAGE && prov->flags & CAMEL_PROVIDER_IS_REMOTE) { CamelService *store; store = camel_session_get_service (session, server->url, CAMEL_PROVIDER_STORE, &ex); if (store != NULL) { g_warning ("removing news storage: %s", server->url); mail_remove_storage (CAMEL_STORE (store)); camel_object_unref (CAMEL_OBJECT (store)); } } else g_warning ("%s is not a remote news storage.", server->url); camel_exception_clear (&ex); } /* remove it from the config file */ dialog->news = mail_config_remove_news (server); mail_config_write (); gtk_clist_remove (dialog->news_accounts, dialog->news_row); len = dialog->news ? g_slist_length ((GSList *) dialog->news) : 0; if (len > 0) { row = dialog->news_row; row = row >= len ? len - 1 : row; gtk_clist_select_row (dialog->news_accounts, row, 0); } else { dialog->news_row = -1; gtk_widget_set_sensitive (GTK_WIDGET (dialog->news_edit), FALSE); gtk_widget_set_sensitive (GTK_WIDGET (dialog->news_delete), FALSE); } } } #endif /* ENABLE_NNTP */ /* temp widget callbacks */ static void send_html_toggled (GtkToggleButton *button, gpointer data) { mail_config_set_send_html (gtk_toggle_button_get_active (button)); } static void citation_highlight_toggled (GtkToggleButton *button, gpointer data) { mail_config_set_citation_highlight (gtk_toggle_button_get_active (button)); } static void timeout_toggled (GtkToggleButton *button, gpointer data) { mail_config_set_do_seen_timeout (gtk_toggle_button_get_active (button)); } static void citation_color_set (GnomeColorPicker *cp, guint r, guint g, guint b, guint a) { guint32 rgb; rgb = r >> 8; rgb <<= 8; rgb |= g >> 8; rgb <<= 8; rgb |= b >> 8; mail_config_set_citation_color (rgb); } /* FIXME: */ static void timeout_changed (GtkEntry *entry, gpointer data) { MailAccountsDialog *dialog = data; gint val; val = (gint) (gtk_spin_button_get_value_as_float (dialog->timeout) * 1000); mail_config_set_mark_as_seen_timeout (val); } static void pgp_path_changed (GtkEntry *entry, gpointer data) { const char *path, *bin; CamelPgpType type = CAMEL_PGP_TYPE_NONE; path = gtk_entry_get_text (entry); bin = g_basename (path); /* FIXME: This detection should be better */ if (!strcmp (bin, "pgp")) type = CAMEL_PGP_TYPE_PGP2; else if (!strcmp (bin, "pgpv") || !strcmp (bin, "pgpe") || !strcmp (bin, "pgpk") || !strcmp (bin, "pgps")) type = CAMEL_PGP_TYPE_PGP5; else if (!strncmp (bin, "gpg", 3)) type = CAMEL_PGP_TYPE_GPG; mail_config_set_pgp_path (path && *path ? path : NULL); mail_config_set_pgp_type (type); } static void set_color (GnomeColorPicker *cp) { guint32 rgb = mail_config_get_citation_color (); gnome_color_picker_set_i8 (cp, (rgb & 0xff0000) >> 16, (rgb & 0xff00) >> 8, rgb & 0xff, 0xff); } static void images_radio_toggled (GtkWidget *radio, gpointer data) { MailAccountsDialog *dialog = data; if (radio == (GtkWidget *)dialog->images_always) mail_config_set_http_mode (MAIL_CONFIG_HTTP_ALWAYS); else if (radio == (GtkWidget *)dialog->images_sometimes) mail_config_set_http_mode (MAIL_CONFIG_HTTP_SOMETIMES); else mail_config_set_http_mode (MAIL_CONFIG_HTTP_NEVER); } static void empty_trash_toggled (GtkWidget *toggle, gpointer data) { mail_config_set_empty_trash_on_exit (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle))); } static void remember_pgp_passphrase_toggled (GtkWidget *toggle, gpointer data) { mail_config_set_remember_pgp_passphrase (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle))); } static void prompt_empty_subject_toggled (GtkWidget *toggle, gpointer data) { mail_config_set_prompt_empty_subject (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle))); } static void prompt_bcc_only_toggled (GtkWidget *toggle, gpointer data) { mail_config_set_prompt_only_bcc (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle))); } static void thread_list_toggled (GtkWidget *toggle, gpointer data) { mail_config_set_thread_list (NULL, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle))); } static void show_preview_toggled (GtkWidget *toggle, gpointer data) { mail_config_set_show_preview (NULL, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle))); } static void forward_style_activated (GtkWidget *item, gpointer data) { int style = GPOINTER_TO_INT (data); mail_config_set_default_forward_style (style); } static void attach_forward_style_signal (GtkWidget *item, gpointer data) { int *num = data; gtk_signal_connect (GTK_OBJECT (item), "activate", forward_style_activated, GINT_TO_POINTER (*num)); (*num)++; } static void charset_menu_deactivate (GtkWidget *menu, gpointer data) { char *charset; charset = e_charset_picker_get_charset (menu); if (charset) { mail_config_set_default_charset (charset); g_free (charset); } } static void construct (MailAccountsDialog *dialog) { GladeXML *gui; GtkWidget *notebook, *menu; int num; gui = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", NULL); dialog->gui = gui; /* get our toplevel widget */ notebook = glade_xml_get_widget (gui, "notebook"); /* reparent */ gtk_widget_reparent (notebook, GNOME_DIALOG (dialog)->vbox); /* give our dialog an Close button and title */ gtk_window_set_title (GTK_WINDOW (dialog), _("Evolution Account Manager")); gtk_window_set_policy (GTK_WINDOW (dialog), FALSE, TRUE, TRUE); gtk_window_set_default_size (GTK_WINDOW (dialog), 400, 300); gnome_dialog_append_button (GNOME_DIALOG (dialog), GNOME_STOCK_BUTTON_CLOSE); dialog->mail_accounts = GTK_CLIST (glade_xml_get_widget (gui, "clistAccounts")); gtk_signal_connect (GTK_OBJECT (dialog->mail_accounts), "select-row", GTK_SIGNAL_FUNC (mail_select), dialog); gtk_signal_connect (GTK_OBJECT (dialog->mail_accounts), "unselect-row", GTK_SIGNAL_FUNC (mail_unselect), dialog); gtk_signal_connect (GTK_OBJECT (dialog->mail_accounts), "button_press_event", mail_double_click, dialog); dialog->mail_add = GTK_BUTTON (glade_xml_get_widget (gui, "cmdMailAdd")); gtk_signal_connect (GTK_OBJECT (dialog->mail_add), "clicked", GTK_SIGNAL_FUNC (mail_add), dialog); dialog->mail_edit = GTK_BUTTON (glade_xml_get_widget (gui, "cmdMailEdit")); gtk_signal_connect (GTK_OBJECT (dialog->mail_edit), "clicked", GTK_SIGNAL_FUNC (mail_edit), dialog); dialog->mail_delete = GTK_BUTTON (glade_xml_get_widget (gui, "cmdMailDelete")); gtk_signal_connect (GTK_OBJECT (dialog->mail_delete), "clicked", GTK_SIGNAL_FUNC (mail_delete), dialog); dialog->mail_default = GTK_BUTTON (glade_xml_get_widget (gui, "cmdMailDefault")); gtk_signal_connect (GTK_OBJECT (dialog->mail_default), "clicked", GTK_SIGNAL_FUNC (mail_default), dialog); dialog->mail_able = GTK_BUTTON (glade_xml_get_widget (gui, "cmdMailAble")); gtk_signal_connect (GTK_OBJECT (dialog->mail_able), "clicked", GTK_SIGNAL_FUNC (mail_able), dialog); #ifdef ENABLE_NNTP dialog->news_accounts = GTK_CLIST (glade_xml_get_widget (gui, "clistNews")); gtk_signal_connect (GTK_OBJECT (dialog->news_accounts), "select-row", GTK_SIGNAL_FUNC (news_select), dialog); gtk_signal_connect (GTK_OBJECT (dialog->news_accounts), "unselect-row", GTK_SIGNAL_FUNC (news_unselect), dialog); dialog->news_add = GTK_BUTTON (glade_xml_get_widget (gui, "cmdNewsAdd")); gtk_signal_connect (GTK_OBJECT (dialog->news_add), "clicked", GTK_SIGNAL_FUNC (news_add), dialog); dialog->news_edit = GTK_BUTTON (glade_xml_get_widget (gui, "cmdNewsEdit")); gtk_signal_connect (GTK_OBJECT (dialog->news_edit), "clicked", GTK_SIGNAL_FUNC (news_edit), dialog); dialog->news_delete = GTK_BUTTON (glade_xml_get_widget (gui, "cmdNewsDelete")); gtk_signal_connect (GTK_OBJECT (dialog->news_delete), "clicked", GTK_SIGNAL_FUNC (news_delete), dialog); #else /* remove the news tab since we don't support nntp */ gtk_notebook_remove_page (GTK_NOTEBOOK (notebook), 1); #endif /* Display page */ dialog->citation_highlight = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chckHighlightCitations")); gtk_toggle_button_set_active (dialog->citation_highlight, mail_config_get_citation_highlight ()); gtk_signal_connect (GTK_OBJECT (dialog->citation_highlight), "toggled", GTK_SIGNAL_FUNC (citation_highlight_toggled), dialog); dialog->citation_color = GNOME_COLOR_PICKER (glade_xml_get_widget (gui, "colorpickerCitations")); set_color (dialog->citation_color); gtk_signal_connect (GTK_OBJECT (dialog->citation_color), "color_set", GTK_SIGNAL_FUNC (citation_color_set), dialog); dialog->timeout_toggle = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "checkMarkTimeout")); gtk_toggle_button_set_active (dialog->timeout_toggle, mail_config_get_do_seen_timeout ()); gtk_signal_connect (GTK_OBJECT (dialog->timeout_toggle), "toggled", GTK_SIGNAL_FUNC (timeout_toggled), dialog); dialog->timeout = GTK_SPIN_BUTTON (glade_xml_get_widget (gui, "spinMarkTimeout")); gtk_spin_button_set_value (dialog->timeout, (1.0 * mail_config_get_mark_as_seen_timeout ()) / 1000.0); gtk_signal_connect (GTK_OBJECT (dialog->timeout), "changed", GTK_SIGNAL_FUNC (timeout_changed), dialog); dialog->images_never = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "radioImagesNever")); gtk_toggle_button_set_active (dialog->images_never, mail_config_get_http_mode () == MAIL_CONFIG_HTTP_NEVER); gtk_signal_connect (GTK_OBJECT (dialog->images_never), "toggled", GTK_SIGNAL_FUNC (images_radio_toggled), dialog); dialog->images_sometimes = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "radioImagesSometimes")); gtk_toggle_button_set_active (dialog->images_sometimes, mail_config_get_http_mode () == MAIL_CONFIG_HTTP_SOMETIMES); gtk_signal_connect (GTK_OBJECT (dialog->images_sometimes), "toggled", GTK_SIGNAL_FUNC (images_radio_toggled), dialog); dialog->images_always = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "radioImagesAlways")); gtk_toggle_button_set_active (dialog->images_always, mail_config_get_http_mode () == MAIL_CONFIG_HTTP_ALWAYS); gtk_signal_connect (GTK_OBJECT (dialog->images_always), "toggled", GTK_SIGNAL_FUNC (images_radio_toggled), dialog); /* Composer page */ dialog->send_html = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkSendHTML")); gtk_toggle_button_set_active (dialog->send_html, mail_config_get_send_html ()); gtk_signal_connect (GTK_OBJECT (dialog->send_html), "toggled", GTK_SIGNAL_FUNC (send_html_toggled), dialog); dialog->forward_style = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuForwardStyle")); gtk_option_menu_set_history (dialog->forward_style, mail_config_get_default_forward_style ()); /* Hm. This sucks... */ num = 0; gtk_container_foreach (GTK_CONTAINER (gtk_option_menu_get_menu (dialog->forward_style)), attach_forward_style_signal, &num); /* Other page */ dialog->pgp_path = GNOME_FILE_ENTRY (glade_xml_get_widget (gui, "filePgpPath")); gtk_entry_set_text (GTK_ENTRY (gnome_file_entry_gtk_entry (dialog->pgp_path)), mail_config_get_pgp_path ()); gnome_file_entry_set_default_path (dialog->pgp_path, mail_config_get_pgp_path ()); gtk_signal_connect (GTK_OBJECT (gnome_file_entry_gtk_entry (dialog->pgp_path)), "changed", GTK_SIGNAL_FUNC (pgp_path_changed), dialog); dialog->remember_passwd = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkRememberPGPPassphrase")); gtk_toggle_button_set_active (dialog->remember_passwd, mail_config_get_remember_pgp_passphrase ()); gtk_signal_connect (GTK_OBJECT (dialog->remember_passwd), "toggled", GTK_SIGNAL_FUNC (remember_pgp_passphrase_toggled), dialog); dialog->charset = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuCharset")); menu = e_charset_picker_new (mail_config_get_default_charset ()); gtk_option_menu_set_menu (dialog->charset, GTK_WIDGET (menu)); gtk_signal_connect (GTK_OBJECT (menu), "deactivate", GTK_SIGNAL_FUNC (charset_menu_deactivate), NULL); dialog->empty_trash = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkEmptyTrashOnExit")); gtk_toggle_button_set_active (dialog->empty_trash, mail_config_get_empty_trash_on_exit ()); gtk_signal_connect (GTK_OBJECT (dialog->empty_trash), "toggled", GTK_SIGNAL_FUNC (empty_trash_toggled), dialog); dialog->prompt_empty_subject = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkPromptEmptySubject")); gtk_toggle_button_set_active (dialog->prompt_empty_subject, mail_config_get_prompt_empty_subject ()); gtk_signal_connect (GTK_OBJECT (dialog->prompt_empty_subject), "toggled", GTK_SIGNAL_FUNC (prompt_empty_subject_toggled), dialog); dialog->prompt_bcc_only = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkPromptBccOnly")); gtk_toggle_button_set_active (dialog->prompt_bcc_only, mail_config_get_prompt_only_bcc ()); gtk_signal_connect (GTK_OBJECT (dialog->prompt_bcc_only), "toggled", GTK_SIGNAL_FUNC (prompt_bcc_only_toggled), dialog); dialog->thread_list = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkThreadedList")); gtk_toggle_button_set_active (dialog->thread_list, mail_config_get_thread_list (NULL)); gtk_signal_connect (GTK_OBJECT (dialog->thread_list), "toggled", GTK_SIGNAL_FUNC (thread_list_toggled), dialog); dialog->show_preview = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkShowPreview")); gtk_toggle_button_set_active (dialog->show_preview, mail_config_get_show_preview (NULL)); gtk_signal_connect (GTK_OBJECT (dialog->show_preview), "toggled", GTK_SIGNAL_FUNC (show_preview_toggled), dialog); /* now to fill in the clists */ dialog->accounts_row = -1; dialog->accounts = mail_config_get_accounts (); if (dialog->accounts) { load_accounts (dialog); gtk_clist_select_row (dialog->mail_accounts, 0, 0); } else { gtk_widget_set_sensitive (GTK_WIDGET (dialog->mail_edit), FALSE); gtk_widget_set_sensitive (GTK_WIDGET (dialog->mail_delete), FALSE); gtk_widget_set_sensitive (GTK_WIDGET (dialog->mail_default), FALSE); } #ifdef ENABLE_NNTP dialog->news_row = -1; dialog->news = mail_config_get_news (); if (dialog->news) { load_news (dialog); gtk_clist_select_row (dialog->news_accounts, 0, 0); } else { gtk_widget_set_sensitive (GTK_WIDGET (dialog->news_edit), FALSE); gtk_widget_set_sensitive (GTK_WIDGET (dialog->news_delete), FALSE); } #endif /* ENABLE_NNTP */ } MailAccountsDialog * mail_accounts_dialog_new (GNOME_Evolution_Shell shell) { MailAccountsDialog *new; new = (MailAccountsDialog *) gtk_type_new (mail_accounts_dialog_get_type ()); construct (new); new->shell = shell; return new; } class='column1'>| | brokenness was actually somewhere else. (Still in Outlook, just not in the part of Outlook I was told it was.) svn path=/trunk/; revision=6241 * Add header-matches expressions ("is" / "is not").Jeffrey Stedfast2000-10-284-0/+107 | | | | | | | | | | | 2000-10-27 Jeffrey Stedfast <fejj@helixcode.com> * filtertypes.xml: Add header-matches expressions ("is" / "is not"). * filter-message-search.c (header_matches): New callback to match headers exactly (aka strcmp rather than strstr). svn path=/trunk/; revision=6240 * Fixed icalproperty_remove_parameter().Jesse Pavel2000-10-282-1/+23 | | | | svn path=/trunk/; revision=6239 * Check to make sure that the recipient list is neither NULL nor a 0-lengthJeffrey Stedfast2000-10-282-1/+19 | | | | | | | | | | | 2000-10-27 Jeffrey Stedfast <fejj@helixcode.com> * mail-callbacks.c (composer_send_cb): Check to make sure that the recipient list is neither NULL nor a 0-length list of addresses and pop up a dialog letting the user know why we are not allowing him/her to send the message. svn path=/trunk/; revision=6238 * Work around Outlook brokenness in iMIP parsing by only quotingDan Winship2000-10-282-2/+24 | | | | | | | | * camel-mime-utils.c (header_param_list_format_append): Work around Outlook brokenness in iMIP parsing by only quoting Content-type parameters when the quoting is mandatory. svn path=/trunk/; revision=6237 * Fixed my not-quite-right logic so that we don't accidently set the bodyJeffrey Stedfast2000-10-282-25/+89 | | | | | | | | | | | 2000-10-27 Jeffrey Stedfast <fejj@helixcode.com> * e-msg-composer.c (e_msg_composer_new_with_message): Fixed my not-quite-right logic so that we don't accidently set the body contents using a plain text attachment instead of the actual body of the message :-) svn path=/trunk/; revision=6236 * divide before multiple so that we don't overflow.Jacob "Ulysses" Berkman2000-10-282-2/+9 | | | | | | | | | 2000-10-27 Jacob "Ulysses" Berkman <jacob@helixcode.com> * filter-driver.c (filter_driver_filter_mbox): divide before multiple so that we don't overflow. svn path=/trunk/; revision=6235 * build md5-utils72000-10-288-37/+35 | | | | | | | | | | | | | | | | | | | | | | | | 2000-10-27 <jpr@helixcode.com> * Makefile.am: build md5-utils * md5-utils.c: Make part of util, get rid of camel stream util function include string.h * md5-utils.h: ditto 2000-10-27 <jpr@helixcode.com> * providers/pop3/Makefile.am: Tidy up build * providers/smtp/Makefile.am: ditto * Makefile.am: Move md5-utils.[hc] to e-util because the addressbook is going to use md5 hashes for pilot syncing. Maybe the calendar conduits as well because this is a good idea Chris had. svn path=/trunk/; revision=6234 * Check boundary case of fast sync72000-10-283-2/+9 | | | | | | | | | | | 2000-10-27 <jpr@helixcode.com> * conduits/calendar/calendar-conduit.c (check_for_slow_setting): Check boundary case of fast sync * conduits/todo/todo-conduit.c (check_for_slow_setting): ditto svn path=/trunk/; revision=6233 * Fixed these to include EXTRA_GNOME_CFLAGS.Christopher James Lahey2000-10-285-3/+15 | | | | | | | | | | | | 2000-10-27 Christopher James Lahey <clahey@helixcode.com> * backend/pas/Makefile.am, gui/search/Makefile.am, printing/Makefile.am: Fixed these to include EXTRA_GNOME_CFLAGS. * gui/component/select-names/e-select-names-manager.c: Turned off newlines in header fields. svn path=/trunk/; revision=6232 * Require gal cvs version.Christopher James Lahey2000-10-282-4/+8 | | | | | | | | 2000-10-27 Christopher James Lahey <clahey@helixcode.com> * configure.in: Require gal cvs version. svn path=/trunk/; revision=6231 * Remove invalid test. (local_record_from_comp): If the event is all day,72000-10-273-6/+20 | | | | | | | | | | | | | 2000-10-27 <jpr@helixcode.com> * conduits/calendar/calendar-conduit.c (add_archive_record): Remove invalid test. (local_record_from_comp): If the event is all day, mark it as timeless (comp_from_remote_record): Timeless events take up all day * conduits/todo/todo-conduit.c (add_archive_record): ditto svn path=/trunk/; revision=6230 * Return null if no pnode was found.72000-10-272-2/+10 | | | | | | | | | 2000-10-27 <jpr@helixcode.com> * e-pilot-map.c (e_pilot_map_lookup_uid): Return null if no pnode was found. svn path=/trunk/; revision=6229 * Newer better releaseKenneth Christiansen2000-10-271-102/+158 | | | | svn path=/trunk/; revision=6228 * updateKenneth Christiansen2000-10-271-713/+1845 | | | | svn path=/trunk/; revision=6227 * Added an "allow_newlines" argument.Christopher James Lahey2000-10-2710-43/+161 | | | | | | | | | | | | | 2000-10-27 Christopher James Lahey <clahey@helixcode.com> * gal/e-text/e-entry.c, gal/e-text/e-text-event-processor-emacs-like.c, gal/e-text/e-text-event-processor-emacs-like.h, gal/e-text/e-text-event-processor.c, gal/e-text/e-text-event-processor.h, gal/e-text/e-text.c: Added an "allow_newlines" argument. svn path=/trunk/; revision=6226 * Fixed this to include EXTRA_GNOME_CFLAGS.Christopher James Lahey2000-10-272-0/+5 | | | | | | | | 2000-10-27 Christopher James Lahey <clahey@helixcode.com> * Makefile.am: Fixed this to include EXTRA_GNOME_CFLAGS. svn path=/trunk/; revision=6225 * Get archive field while parsing (map_write_foreach): Write out archiveJP Rosevear2000-10-275-29/+86 | | | | | | | | | | | | | | | | 2000-10-27 JP Rosevear <jpr@helixcode.com> * e-pilot-map.c (map_sax_start_element): Get archive field while parsing (map_write_foreach): Write out archive field (e_pilot_map_pid_is_archived): implement (e_pilot_map_uid_is_archived): ditto (e_pilot_map_insert): Insert new node structures (e_pilot_map_lookup_pid): Take into account the list is now a list of structures (e_pilot_map_lookup_uid): ditto svn path=/trunk/; revision=6224 * Kill executive summary components72000-10-272-0/+7 | | | | | | | | 2000-10-27 <jpr@helixcode.com> * tools/killev: Kill executive summary components svn path=/trunk/; revision=6223 * Don't mark as deleted here, otherwise the message will have the DELETEDJeffrey Stedfast2000-10-272-2/+14 | | | | | | | | | | | | | | 2000-10-27 Jeffrey Stedfast <fejj@helixcode.com> * filter-driver.c (do_move): Don't mark as deleted here, otherwise the message will have the DELETED flag set in the folder it's being moved to. (do_delete): Don't set the DELETED flag here either...we'll only set it at the very end of the filtering process. (filter_driver_filter_message): Set the DELETED flag after all processing is completed. svn path=/trunk/; revision=6221 * SHUT THE FUCK UP, DONNIE. DUDE, THEY PEED YOUR FUCKING RUG.Federico Mena Quintero2000-10-275-18/+4 | | | | svn path=/trunk/; revision=6220 * This is the new recurrence page, partially finished. I just want it on CVSFederico Mena Quintero2000-10-278-255/+1478 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the new recurrence page, partially finished. I just want it on CVS for if my laptop explodes. This is highly disgusting code. It has to discriminate between the recurrence types we support and the ones we do not. I hate iCalendar. I hate it more than Hi-Fi\'s pizza. 2000-10-26 Federico Mena Quintero <federico@helixcode.com> * gui/event-editor.c (EventEditorPrivate): Integrate Anna's new recurrence page. Replace the old widget pointers with the new ones. Modified the relevant functions accordingly and added plenty of new ones. (event_editor_get_cal_client): New function. (fill_recurrence_widgets): This is *THE* tricky function for you. It has to discriminate whether we get a recurrence we support for editing or not. And this is not trivial. Sigh. (event_editor_update_widgets): Added preconditions and API docs. * event-editor-dialog.glade: Fixed all the spacings/ paddings/packing options so that the widgets will look right if the dialog box is resized. Also fixes some misaligned widgets. * cal-util/cal-component.c (cal_component_set_rdate_list): Removed incorrect assertion. svn path=/trunk/; revision=6219 * If we are inserting into the root level, we dont have to search the wholeNot Zed2000-10-271-1/+6 | | | | | | | | | | 2000-10-27 Not Zed <NotZed@HelixCode.com> * e-tree-model.c (e_tree_model_node_insert): If we are inserting into the root level, we dont have to search the whole array for a parent node we'll never find. svn path=/trunk/; revision=6218 * unsigned chars to isalphaMichael Meeks2000-10-274-4/+9 | | | | | | | | | | 2000-10-26 Michael Meeks <michael@helixcode.com> * pcs/cal-factory.c (str_tolower): unsigned chars to isalpha * cal-util/calobj.c (weekdaylist, weekdaynum): ditto. svn path=/trunk/; revision=6217 * Added small test for po/Makefile.i18npatch, so that if it exists it will ↵Kenneth Christiansen2000-10-271-0/+7 | | | | | | patch the gettext dependent po/Makefile.in.in file. This allows us to integrate the i18n scripts, etc even more. svn path=/trunk/; revision=6214 * unsigned charness.Michael Meeks2000-10-272-4/+10 | | | | | | | | | | 2000-10-26 Michael Meeks <michael@helixcode.com> * printing/e-contact-print.c (e_contact_print_letter_tab), (complete_sequence, e_contact_do_print_phone_list, lowify): unsigned charness. svn path=/trunk/; revision=6213 * unsigned chars.Michael Meeks2000-10-273-3/+13 | | | | | | | | | | | | 2000-10-26 Michael Meeks <michael@helixcode.com> * ename/e-address-western.c (e_address_western_is_postal): unsigned chars. * ename/e-name-western.c (e_name_western_get_one_prefix_at_str): cast to unsigned char. svn path=/trunk/; revision=6212 * Small fixes.Jesse Pavel2000-10-273-25/+60 | | | | svn path=/trunk/; revision=6211 * Updated French translation (to be continued)jfell2000-10-272-541/+560 | | | | svn path=/trunk/; revision=6210 * updating some pt_BR <ricardo@conectiva.com.br>Jorge Godoy2000-10-273-0/+6 | | | | | | any problem, just tell me, and i reverse the commit. svn path=/trunk/; revision=6209 * Updated Norwegian (bokmål) translation.Kjartan Maraas2000-10-272-1254/+2161 | | | | | | | | 2000-10-26 Kjartan Maraas <kmaraas@gnome.org> * no.po: Updated Norwegian (bokmål) translation. svn path=/trunk/; revision=6208 * i still hate cvsDan Winship2000-10-272-0/+273 | | | | svn path=/trunk/; revision=6207 * i hate cvsDan Winship2000-10-272-273/+0 | | | | svn path=/trunk/; revision=6206 * Added some functionality to the Executive SummaryIain Holmes2000-10-278-111/+481 | | | | | | | | Doesn't return to the top when refreshed Can execute programs when the user clicks on exec:// URLs and can compose an email when mailto:'s are clicked. svn path=/trunk/; revision=6205 * Getting this file in line, alas this comes too late for theMatthias Warkus2000-10-272-1163/+2357 | | | | | | | Procompsognathus release, I wonder why Evolution previews don't get announced beforehand so we can get the l10n done? svn path=/trunk/; revision=6204 * Don't destroy a dialog after run_and_close'ing it.Dan Winship2000-10-272-1/+5 | | | | | | | * mail-display.c (write_data_to_file): Don't destroy a dialog after run_and_close'ing it. svn path=/trunk/; revision=6203 * remove the save_id here, so we don't save state for nodes that no longerChris Toshok2000-10-261-9/+6 | | | | | | | | | | | | | 2000-10-25 Chris Toshok <toshok@helixcode.com> * e-tree-model.c (e_tree_model_node_remove): remove the save_id here, so we don't save state for nodes that no longer exist. (etree_destroy): remove the foreach, since all the save_id's should have been removed by now (don't destroy a tree without destroying the root node.) also, make sure to call g_hash_table_destroy. svn path=/trunk/; revision=6202 * Check for the TO recipient list being NULL and don't send.Jeffrey Stedfast2000-10-262-0/+11 | | | | | | | | | 2000-10-26 Jeffrey Stedfast <fejj@helixcode.com> * mail-callbacks.c (composer_send_cb): Check for the TO recipient list being NULL and don't send. svn path=/trunk/; revision=6201 * Readded Source url stuff.Jeffrey Stedfast2000-10-26