diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-07-31 01:34:33 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-07-31 01:34:33 +0800 |
commit | 59abc016932b2efae32c93d2767f0dfa06a79134 (patch) | |
tree | d840cbfd145df3f3681b55596b6dfcb5d74f35ab | |
parent | 101e668310971c48e6a5f760c47327a7ccf95b50 (diff) | |
download | gsoc2013-evolution-59abc016932b2efae32c93d2767f0dfa06a79134.tar gsoc2013-evolution-59abc016932b2efae32c93d2767f0dfa06a79134.tar.gz gsoc2013-evolution-59abc016932b2efae32c93d2767f0dfa06a79134.tar.bz2 gsoc2013-evolution-59abc016932b2efae32c93d2767f0dfa06a79134.tar.lz gsoc2013-evolution-59abc016932b2efae32c93d2767f0dfa06a79134.tar.xz gsoc2013-evolution-59abc016932b2efae32c93d2767f0dfa06a79134.tar.zst gsoc2013-evolution-59abc016932b2efae32c93d2767f0dfa06a79134.zip |
Restore old security settings from the saved configuration. Fixes bug
2001-07-30 Jeffrey Stedfast <fejj@ximian.com>
* mail-account-gui.c (mail_account_gui_new): Restore old security
settings from the saved configuration. Fixes bug #5710.
svn path=/trunk/; revision=11479
-rw-r--r-- | mail/ChangeLog | 5 | ||||
-rw-r--r-- | mail/mail-account-gui.c | 8 | ||||
-rw-r--r-- | mail/mail-config.c | 64 | ||||
-rw-r--r-- | mail/mail-tools.c | 12 |
4 files changed, 49 insertions, 40 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 8539ca7671..79e945f372 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,8 @@ +2001-07-30 Jeffrey Stedfast <fejj@ximian.com> + + * mail-account-gui.c (mail_account_gui_new): Restore old security + settings from the saved configuration. Fixes bug #5710. + 2001-07-30 Not Zed <NotZed@Ximian.com> * mail-session.c (do_register_timeout): Actually add the timeout, diff --git a/mail/mail-account-gui.c b/mail/mail-account-gui.c index 34ed21c5f8..19d7789742 100644 --- a/mail/mail-account-gui.c +++ b/mail/mail-account-gui.c @@ -1253,9 +1253,15 @@ mail_account_gui_new (MailConfigAccount *account) /* Security */ gui->pgp_key = GTK_ENTRY (glade_xml_get_widget (gui->xml, "pgp_key")); + if (account->pgp_key) + e_utf8_gtk_entry_set_text (gui->pgp_key, account->pgp_key); gui->pgp_encrypt_to_self = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "pgp_encrypt_to_self")); + gtk_toggle_button_set_active (gui->pgp_encrypt_to_self, account->pgp_encrypt_to_self); gui->smime_key = GTK_ENTRY (glade_xml_get_widget (gui->xml, "smime_key")); + if (account->smime_key) + e_utf8_gtk_entry_set_text (gui->smime_key, account->smime_key); gui->smime_encrypt_to_self = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui->xml, "smime_encrypt_to_self")); + gtk_toggle_button_set_active (gui->smime_encrypt_to_self, account->smime_encrypt_to_self); #ifndef HAVE_NSS { @@ -1263,7 +1269,7 @@ mail_account_gui_new (MailConfigAccount *account) GtkWidget *frame; frame = glade_xml_get_widget (gui->xml, "smime_frame"); - gtk_widget_hide (frame); + gtk_widget_set_sensitive (frame, FALSE); } #endif diff --git a/mail/mail-config.c b/mail/mail-config.c index e88c9a5a1f..c14826353e 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -55,7 +55,7 @@ typedef struct { Bonobo_ConfigDatabase db; - + gboolean show_preview; gboolean thread_list; gboolean hide_deleted; @@ -71,13 +71,13 @@ typedef struct { GSList *accounts; gint default_account; - + GSList *news; char *pgp_path; CamelPgpType pgp_type; gboolean remember_pgp_passphrase; - + MailConfigHTTPMode http_mode; MailConfigForwardStyle default_forward_style; MailConfigDisplayStyle message_display_style; @@ -111,7 +111,7 @@ identity_copy (const MailConfigIdentity *id) new->signature = g_strdup (id->signature); new->html_signature = g_strdup (id->html_signature); new->has_html_signature = id->has_html_signature; - + return new; } @@ -230,12 +230,12 @@ mail_config_init (void) { Bonobo_ConfigDatabase db; CORBA_Environment ev; - + if (config) return; CORBA_exception_init (&ev); - + db = bonobo_get_object ("wombat:", "Bonobo/ConfigDatabase", &ev); if (BONOBO_EX (&ev) || db == CORBA_OBJECT_NIL) { @@ -243,11 +243,11 @@ mail_config_init (void) CORBA_exception_free (&ev); return; } - + CORBA_exception_free (&ev); - + config = g_new0 (MailConfig, 1); - + config->db = db; config_read (); @@ -276,12 +276,12 @@ static void config_read (void) { gint len, i, default_num; - + mail_config_clear (); len = bonobo_config_get_long_with_default (config->db, "/Mail/Accounts/num", 0, NULL); - + for (i = 0; i < len; i++) { MailConfigAccount *account; MailConfigIdentity *id; @@ -359,15 +359,15 @@ config_read (void) path = g_strdup_printf ("/Mail/Accounts/identity_name_%d", i); id->name = bonobo_config_get_string (config->db, path, NULL); g_free (path); - + path = g_strdup_printf ("/Mail/Accounts/identity_address_%d", i); id->address = bonobo_config_get_string (config->db, path, NULL); g_free (path); - + path = g_strdup_printf ("/Mail/Accounts/identity_organization_%d", i); id->organization = bonobo_config_get_string (config->db, path, NULL); g_free (path); - + path = g_strdup_printf ("/Mail/Accounts/identity_signature_%d", i); id->signature = bonobo_config_get_string (config->db, path, NULL); g_free (path); @@ -378,10 +378,10 @@ config_read (void) id->has_html_signature = bonobo_config_get_boolean_with_default ( config->db, path, FALSE, NULL); g_free (path); - + /* get the source */ source = g_new0 (MailConfigService, 1); - + path = g_strdup_printf ("/Mail/Accounts/source_url_%d", i); val = bonobo_config_get_string (config->db, path, NULL); g_free (path); @@ -393,28 +393,28 @@ config_read (void) path = g_strdup_printf ("/Mail/Accounts/source_keep_on_server_%d", i); source->keep_on_server = bonobo_config_get_boolean (config->db, path, NULL); g_free (path); - + path = g_strdup_printf ("/Mail/Accounts/source_auto_check_%d", i); source->auto_check = bonobo_config_get_boolean_with_default ( config->db, path, FALSE, NULL); g_free (path); - + path = g_strdup_printf ("/Mail/Accounts/source_auto_check_time_%d", i); source->auto_check_time = bonobo_config_get_long_with_default ( config->db, path, -1, NULL); - + if (source->auto_check && source->auto_check_time <= 0) { source->auto_check_time = 5; source->auto_check = FALSE; } - + g_free (path); - + path = g_strdup_printf ("/Mail/Accounts/source_enabled_%d", i); source->enabled = bonobo_config_get_boolean_with_default ( config->db, path, TRUE, NULL); g_free (path); - + path = g_strdup_printf ("/Mail/Accounts/source_save_passwd_%d", i); source->save_passwd = bonobo_config_get_boolean_with_default ( @@ -441,13 +441,12 @@ config_read (void) config->accounts = g_slist_append (config->accounts, account); } - - + default_num = bonobo_config_get_long_with_default (config->db, "/Mail/Accounts/default_account", 0, NULL); mail_config_set_default_account_num (default_num); - + #ifdef ENABLE_NNTP /* News */ @@ -458,14 +457,13 @@ config_read (void) gchar *path, *r; path = g_strdup_printf ("/News/Sources/url_%d", i); - + if ((r = bonobo_config_get_string (config->db, path, NULL))) { - n = g_new0 (MailConfigService, 1); n->url = r; config->news = g_slist_append (config->news, n); } - + g_free (path); } @@ -474,7 +472,7 @@ config_read (void) /* Format */ config->send_html = bonobo_config_get_boolean_with_default (config->db, "/Mail/Format/send_html", FALSE, NULL); - + /* Citation */ config->citation_highlight = bonobo_config_get_boolean_with_default ( config->db, "/Mail/Display/citation_highlight", TRUE, NULL); @@ -485,7 +483,7 @@ config_read (void) /* Mark as seen toggle */ config->do_seen_timeout = bonobo_config_get_boolean_with_default ( config->db, "/Mail/Display/do_seen_timeout", TRUE, NULL); - + /* Mark as seen timeout */ config->seen_timeout = bonobo_config_get_long_with_default (config->db, "/Mail/Display/seen_timeout", 1500, NULL); @@ -504,7 +502,7 @@ config_read (void) /* Size of vpaned in mail view */ config->paned_size = bonobo_config_get_long_with_default (config->db, "/Mail/Display/paned_size", 200, NULL); - + /* Empty Subject */ config->prompt_empty_subject = bonobo_config_get_boolean_with_default ( config->db, "/Mail/Prompts/empty_subject", TRUE, NULL); @@ -512,7 +510,7 @@ config_read (void) /* Only Bcc */ config->prompt_only_bcc = bonobo_config_get_boolean_with_default ( config->db, "/Mail/Prompts/only_bcc", TRUE, NULL); - + /* PGP/GPG */ config->pgp_path = bonobo_config_get_string (config->db, "/Mail/PGP/path", NULL); @@ -753,7 +751,7 @@ mail_config_write_on_exit (void) /* Size of vpaned in mail view */ bonobo_config_set_long (config->db, "/Mail/Display/paned_size", config->paned_size, NULL); - + /* Mark as seen toggle */ bonobo_config_set_boolean (config->db, "/Mail/Display/do_seen_timeout", config->do_seen_timeout, NULL); diff --git a/mail/mail-tools.c b/mail/mail-tools.c index c1da8fea98..624afa324d 100644 --- a/mail/mail-tools.c +++ b/mail/mail-tools.c @@ -237,23 +237,23 @@ mail_tool_make_message_attachment (CamelMimeMessage *message) CamelMimePart *part; const char *subject; gchar *desc; - - /*camel_object_ref (CAMEL_OBJECT (message));*/ - + subject = camel_mime_message_get_subject (message); if (subject) desc = g_strdup_printf (_("Forwarded message - %s"), subject); else desc = g_strdup (_("Forwarded message (no subject)")); - + + /* FIXME: shouldn't we utf-8ify the description? */ + part = camel_mime_part_new (); camel_mime_part_set_disposition (part, "inline"); camel_mime_part_set_description (part, desc); camel_medium_set_content_object (CAMEL_MEDIUM (part), CAMEL_DATA_WRAPPER (message)); camel_mime_part_set_content_type (part, "message/rfc822"); - g_free(desc); - /*camel_object_unref (CAMEL_OBJECT (message));*/ + g_free (desc); + return part; } |