diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2010-01-27 07:31:43 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2010-01-27 07:31:43 +0000 |
commit | 2d4db65cb1117264a869b5a1afa349deb6a26bd2 (patch) | |
tree | 5eb4bc19da6ac09947376eefd802333841bfe940 /src | |
parent | c46ac89a27c4efd60921bc075fc79ef7b1a56364 (diff) |
made address auto-registration configurable.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2444 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r-- | src/compose.c | 4 | ||||
-rw-r--r-- | src/prefs_common_dialog.c | 135 |
2 files changed, 81 insertions, 58 deletions
diff --git a/src/compose.c b/src/compose.c index e538b3f4..830eb544 100644 --- a/src/compose.c +++ b/src/compose.c @@ -3508,7 +3508,7 @@ static gint compose_send(Compose *compose) } /* Add recipients to addressbook automatically */ - if (1) { + if (prefs_common.recipients_autoreg) { compose_add_new_recipients_to_addressbook(compose); } } @@ -4302,7 +4302,7 @@ static gint compose_queue(Compose *compose, const gchar *file) folderview_update_item(queue, TRUE); /* Add recipients to addressbook automatically */ - if (1) { + if (prefs_common.recipients_autoreg) { compose_add_new_recipients_to_addressbook(compose); } diff --git a/src/prefs_common_dialog.c b/src/prefs_common_dialog.c index 08535c66..38ae3d40 100644 --- a/src/prefs_common_dialog.c +++ b/src/prefs_common_dialog.c @@ -79,6 +79,7 @@ static struct Receive { static struct Send { GtkWidget *checkbtn_savemsg; GtkWidget *checkbtn_filter_sent; + GtkWidget *checkbtn_recipients_autoreg; GtkWidget *optmenu_encoding_method; GtkWidget *optmenu_mime_fencoding_method; @@ -307,6 +308,8 @@ static PrefsUIData ui_data[] = { prefs_set_data_from_toggle, prefs_set_toggle}, {"filter_sent_message", &p_send.checkbtn_filter_sent, prefs_set_data_from_toggle, prefs_set_toggle}, + {"recipients_autoreg", &p_send.checkbtn_recipients_autoreg, + prefs_set_data_from_toggle, prefs_set_toggle}, {"encoding_method", &p_send.optmenu_encoding_method, prefs_set_data_from_optmenu, prefs_set_optmenu}, @@ -910,10 +913,21 @@ static void prefs_receive_create(void) static void prefs_send_create(void) { GtkWidget *vbox1; + + GtkWidget *notebook; + GtkWidget *vbox_tab; + GtkWidget *vbox2; GtkWidget *hbox1; GtkWidget *checkbtn_savemsg; GtkWidget *checkbtn_filter_sent; + GtkWidget *checkbtn_recipients_autoreg; + GtkWidget *label; + GtkWidget *checkbtn_check_attach; + GtkWidget *entry_check_attach_str; + GtkWidget *checkbtn_check_recp; + GtkWidget *entry_check_recp_excl; + GtkWidget *optmenu_trencoding; GtkWidget *optmenu_menu; GtkWidget *menuitem; @@ -922,30 +936,81 @@ static void prefs_send_create(void) GtkWidget *label_encoding_desc; GtkWidget *label_fencoding; GtkWidget *label_fencoding_desc; - GtkWidget *label; - GtkWidget *checkbtn_check_attach; - GtkWidget *entry_check_attach_str; - GtkWidget *checkbtn_check_recp; - GtkWidget *entry_check_recp_excl; vbox1 = gtk_vbox_new (FALSE, VSPACING); gtk_widget_show (vbox1); gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1); gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER); + notebook = gtk_notebook_new(); + gtk_widget_show(notebook); + gtk_box_pack_start(GTK_BOX(vbox1), notebook, TRUE, TRUE, 0); + + APPEND_SUB_NOTEBOOK(notebook, vbox_tab, _("General")); + vbox2 = gtk_vbox_new (FALSE, 0); gtk_widget_show (vbox2); - gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox_tab), vbox2, FALSE, FALSE, 0); PACK_CHECK_BUTTON (vbox2, checkbtn_savemsg, _("Save sent messages to outbox")); PACK_CHECK_BUTTON (vbox2, checkbtn_filter_sent, _("Apply filter rules to sent messages")); SET_TOGGLE_SENSITIVITY (checkbtn_savemsg, checkbtn_filter_sent); + PACK_CHECK_BUTTON (vbox2, checkbtn_recipients_autoreg, + _("Automatically add recipients to address book")); + + vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW); + gtk_widget_show (vbox2); + gtk_box_pack_start (GTK_BOX (vbox_tab), vbox2, FALSE, FALSE, 0); + + PACK_CHECK_BUTTON (vbox2, checkbtn_check_attach, + _("Notify for missing attachments when the following strings (comma-separated) are found in the message body")); + gtk_label_set_line_wrap(GTK_LABEL(GTK_BIN(checkbtn_check_attach)->child), TRUE); hbox1 = gtk_hbox_new (FALSE, 8); gtk_widget_show (hbox1); - gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0); + + entry_check_attach_str = gtk_entry_new (); + gtk_widget_show (entry_check_attach_str); + gtk_box_pack_start (GTK_BOX (hbox1), entry_check_attach_str, + TRUE, TRUE, 0); + label = gtk_label_new (_("(Ex: attach)")); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0); + + SET_TOGGLE_SENSITIVITY(checkbtn_check_attach, entry_check_attach_str); + + vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW); + gtk_widget_show (vbox2); + gtk_box_pack_start (GTK_BOX (vbox_tab), vbox2, FALSE, FALSE, 0); + + PACK_CHECK_BUTTON (vbox2, checkbtn_check_recp, + _("Confirm recipients before sending")); + + hbox1 = gtk_hbox_new (FALSE, 8); + gtk_widget_show (hbox1); + gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0); + label = gtk_label_new + (_("Excluded addresses/domains (comma-separated):")); + gtk_widget_show (label); + gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0); + + entry_check_recp_excl = gtk_entry_new (); + gtk_widget_show (entry_check_recp_excl); + gtk_box_pack_start (GTK_BOX (vbox2), entry_check_recp_excl, + FALSE, FALSE, 0); + + SET_TOGGLE_SENSITIVITY(checkbtn_check_recp, entry_check_recp_excl); + + /* Encoding */ + + APPEND_SUB_NOTEBOOK(notebook, vbox_tab, _("Encoding")); + + hbox1 = gtk_hbox_new (FALSE, 8); + gtk_widget_show (hbox1); + gtk_box_pack_start (GTK_BOX (vbox_tab), hbox1, FALSE, FALSE, 0); label_encoding = gtk_label_new (_("Transfer encoding")); gtk_widget_show (label_encoding); @@ -956,7 +1021,7 @@ static void prefs_send_create(void) gtk_box_pack_start (GTK_BOX (hbox1), optmenu_trencoding, FALSE, FALSE, 0); - optmenu_menu = gtk_menu_new (); + optmenu_menu = gtk_menu_new(); #define SET_MENUITEM(str, data) \ MENUITEM_ADD(optmenu_menu, menuitem, str, data) @@ -969,13 +1034,13 @@ static void prefs_send_create(void) gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_trencoding), optmenu_menu); - PACK_SMALL_LABEL (vbox1, label_encoding_desc, + PACK_SMALL_LABEL (vbox_tab, label_encoding_desc, _("Specify Content-Transfer-Encoding used when " "message body contains non-ASCII characters.")); hbox1 = gtk_hbox_new (FALSE, 8); gtk_widget_show (hbox1); - gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox_tab), hbox1, FALSE, FALSE, 0); label_fencoding = gtk_label_new (_("MIME filename encoding")); gtk_widget_show (label_fencoding); @@ -986,7 +1051,7 @@ static void prefs_send_create(void) gtk_box_pack_start (GTK_BOX (hbox1), optmenu_fencoding, FALSE, FALSE, 0); - optmenu_menu = gtk_menu_new (); + optmenu_menu = gtk_menu_new(); SET_MENUITEM(_("MIME header"), FENC_MIME); SET_MENUITEM("RFC 2231", FENC_RFC2231); @@ -997,58 +1062,16 @@ static void prefs_send_create(void) #undef SET_MENUITEM PACK_SMALL_LABEL - (vbox1, label_fencoding_desc, + (vbox_tab, label_fencoding_desc, _("Specify encoding method for MIME filename with " "non-ASCII characters.\n" "MIME header: most popular, but violates RFC 2047\n" "RFC 2231: conforms to standard, but not popular")); - vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW); - gtk_widget_show (vbox2); - gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0); - - PACK_CHECK_BUTTON (vbox2, checkbtn_check_attach, - _("Notify for missing attachments when the following strings (comma-separated) are found in the message body")); - gtk_label_set_line_wrap(GTK_LABEL(GTK_BIN(checkbtn_check_attach)->child), TRUE); - - hbox1 = gtk_hbox_new (FALSE, 8); - gtk_widget_show (hbox1); - gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0); - - entry_check_attach_str = gtk_entry_new (); - gtk_widget_show (entry_check_attach_str); - gtk_box_pack_start (GTK_BOX (hbox1), entry_check_attach_str, - TRUE, TRUE, 0); - label = gtk_label_new (_("(Ex: attach)")); - gtk_widget_show (label); - gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0); - - SET_TOGGLE_SENSITIVITY(checkbtn_check_attach, entry_check_attach_str); - - vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW); - gtk_widget_show (vbox2); - gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0); - - PACK_CHECK_BUTTON (vbox2, checkbtn_check_recp, - _("Confirm recipients before sending")); - - hbox1 = gtk_hbox_new (FALSE, 8); - gtk_widget_show (hbox1); - gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0); - label = gtk_label_new - (_("Excluded addresses/domains (comma-separated):")); - gtk_widget_show (label); - gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0); - - entry_check_recp_excl = gtk_entry_new (); - gtk_widget_show (entry_check_recp_excl); - gtk_box_pack_start (GTK_BOX (vbox2), entry_check_recp_excl, - FALSE, FALSE, 0); - - SET_TOGGLE_SENSITIVITY(checkbtn_check_recp, entry_check_recp_excl); - p_send.checkbtn_savemsg = checkbtn_savemsg; + p_send.checkbtn_savemsg = checkbtn_savemsg; p_send.checkbtn_filter_sent = checkbtn_filter_sent; + p_send.checkbtn_recipients_autoreg = checkbtn_recipients_autoreg; p_send.optmenu_encoding_method = optmenu_trencoding; p_send.optmenu_mime_fencoding_method = optmenu_fencoding; |