aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-account-editor.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-01-13 05:59:42 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-01-13 05:59:42 +0800
commitc650d5467d924784a62a2049616c39af8ce27e15 (patch)
tree6b122433238f112892fff6d9b3cdd700a72a9ec1 /mail/mail-account-editor.c
parentd7e1a6d3934598736ac3497faf8afb9bdbdf9400 (diff)
downloadgsoc2013-evolution-c650d5467d924784a62a2049616c39af8ce27e15.tar.gz
gsoc2013-evolution-c650d5467d924784a62a2049616c39af8ce27e15.tar.zst
gsoc2013-evolution-c650d5467d924784a62a2049616c39af8ce27e15.zip
Anna's dialogs.
2001-01-12 Jeffrey Stedfast <fejj@ximian.com> * mail-config.glade: Anna's dialogs. * mail-config.c (mail_config_get_account_by_address): Removed. Danw and I decided on setting a X-Evolution-Transport header on messages going to the Outbox so we can later guess which transport to use when sending it. * mail-account-editor.c (apply_changes): Update to some day be able to support SSL. (construct): Update for Anna's dialogs... * subscribe-dialog.c (populate_store_list): Updated to reflect past changes to the mail-config API. svn path=/trunk/; revision=7461
Diffstat (limited to 'mail/mail-account-editor.c')
-rw-r--r--mail/mail-account-editor.c51
1 files changed, 37 insertions, 14 deletions
diff --git a/mail/mail-account-editor.c b/mail/mail-account-editor.c
index 6336bc5635..60f4c0ec09 100644
--- a/mail/mail-account-editor.c
+++ b/mail/mail-account-editor.c
@@ -114,8 +114,10 @@ apply_changes (MailAccountEditor *editor)
account = (MailConfigAccount *) editor->account;
/* account name */
- g_free (account->name);
- account->name = g_strdup (gtk_entry_get_text (editor->account_name));
+ if (editor->account_name) {
+ g_free (account->name);
+ account->name = g_strdup (gtk_entry_get_text (editor->account_name));
+ }
/* identity info */
g_free (account->id->name);
@@ -124,14 +126,20 @@ apply_changes (MailAccountEditor *editor)
g_free (account->id->address);
account->id->address = g_strdup (gtk_entry_get_text (editor->email));
- g_free (account->id->reply_to);
- account->id->reply_to = g_strdup (gtk_entry_get_text (editor->reply_to));
+ if (editor->reply_to) {
+ g_free (account->id->reply_to);
+ account->id->reply_to = g_strdup (gtk_entry_get_text (editor->reply_to));
+ }
- g_free (account->id->organization);
- account->id->organization = g_strdup (gtk_entry_get_text (editor->organization));
+ if (editor->organization) {
+ g_free (account->id->organization);
+ account->id->organization = g_strdup (gtk_entry_get_text (editor->organization));
+ }
- g_free (account->id->signature);
- account->id->signature = gnome_file_entry_get_full_path (editor->signature, TRUE);
+ if (editor->signature) {
+ g_free (account->id->signature);
+ account->id->signature = gnome_file_entry_get_full_path (editor->signature, TRUE);
+ }
/* source */
url = camel_url_new (account->source->url, NULL);
@@ -163,6 +171,9 @@ apply_changes (MailAccountEditor *editor)
account->source->save_passwd = GTK_TOGGLE_BUTTON (editor->save_passwd)->active;
account->source->keep_on_server = GTK_TOGGLE_BUTTON (editor->keep_on_server)->active;
+ if (editor->source_ssl)
+ account->source->use_ssl = GTK_TOGGLE_BUTTON (editor->source_ssl)->active;
+
/* check to make sure the source works */
if (!mail_config_check_service (url, CAMEL_PROVIDER_STORE, NULL)) {
camel_url_free (url);
@@ -197,6 +208,9 @@ apply_changes (MailAccountEditor *editor)
url->host = host;
url->port = port;
+ if (editor->transport_ssl)
+ account->transport->use_ssl = GTK_TOGGLE_BUTTON (editor->transport_ssl)->active;
+
/* check to make sure the transport works */
if (!mail_config_check_service (url, CAMEL_PROVIDER_TRANSPORT, NULL)) {
camel_url_free (url);
@@ -577,7 +591,7 @@ construct (MailAccountEditor *editor, const MailConfigAccount *account)
editor->gui = gui;
/* get our toplevel widget */
- notebook = glade_xml_get_widget (gui, "notebook");
+ notebook = glade_xml_get_widget (gui, "toplevel");
/* reparent */
gtk_widget_reparent (notebook, GNOME_DIALOG (editor)->vbox);
@@ -604,7 +618,9 @@ construct (MailAccountEditor *editor, const MailConfigAccount *account)
/* General */
editor->account_name = GTK_ENTRY (glade_xml_get_widget (gui, "txtAccountName"));
- gtk_entry_set_text (editor->account_name, account->name);
+ /* Anna's dialog doesn't have a way to edit the Account name... */
+ if (editor->account_name)
+ gtk_entry_set_text (editor->account_name, account->name);
gtk_signal_connect (GTK_OBJECT (editor->account_name), "changed", entry_changed, editor);
editor->name = GTK_ENTRY (glade_xml_get_widget (gui, "txtName"));
gtk_entry_set_text (editor->name, account->id->name);
@@ -622,8 +638,11 @@ construct (MailAccountEditor *editor, const MailConfigAccount *account)
/* Servers */
url = camel_url_new (account->source->url, NULL);
- editor->source_type = GTK_ENTRY (glade_xml_get_widget (gui, "txtSourceType"));
- gtk_entry_set_text (editor->source_type, url->protocol);
+ editor->source_type = glade_xml_get_widget (gui, "txtSourceType");
+ if (GTK_IS_LABEL (editor->source_type))
+ gtk_label_set_text (GTK_LABEL (editor->source_type), url->protocol);
+ else
+ gtk_entry_set_text (GTK_ENTRY (editor->source_type), url->protocol);
editor->source_host = GTK_ENTRY (glade_xml_get_widget (gui, "txtSourceHost"));
gtk_entry_set_text (editor->source_host, url->host ? url->host : "");
if (url->port) {
@@ -642,7 +661,9 @@ construct (MailAccountEditor *editor, const MailConfigAccount *account)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->save_passwd), account->source->save_passwd);
editor->source_auth = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuSourceAuth"));
editor->source_ssl = GTK_CHECK_BUTTON (glade_xml_get_widget (gui, "chkSourceSSL"));
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->source_ssl), account->source->use_ssl);
+ /* Anna's dialog doesn't have SSL either... */
+ if (editor->source_ssl)
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->source_ssl), account->source->use_ssl);
editor->keep_on_server = GTK_CHECK_BUTTON (glade_xml_get_widget (gui, "chkKeepMailOnServer"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->keep_on_server), account->source->keep_on_server);
source_check (editor, url);
@@ -662,7 +683,9 @@ construct (MailAccountEditor *editor, const MailConfigAccount *account)
}
editor->transport_auth = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuTransportAuth"));
editor->transport_ssl = GTK_CHECK_BUTTON (glade_xml_get_widget (gui, "chkTransportSSL"));
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->transport_ssl), account->transport->use_ssl);
+ /* Anna's dialog doesn't have SSL... */
+ if (editor->transport_ssl)
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->transport_ssl), account->transport->use_ssl);
transport_type_init (editor, url);
camel_url_free (url);