From 601b97decb3c0f34a38eee8d59b5378f4c19de40 Mon Sep 17 00:00:00 2001 From: Sushma Rai Date: Mon, 24 Jan 2005 14:39:32 +0000 Subject: Disabling auth sections in druid, and having it only in editor. svn path=/trunk/; revision=28526 --- .../exchange-account-setup.c | 2 +- .../exchange-account-setup/exchange-ask-password.c | 71 +++++++++++++++++++++- .../org-gnome-exchange-account-setup.eplug.in | 9 +++ 3 files changed, 80 insertions(+), 2 deletions(-) diff --git a/plugins/exchange-account-setup/exchange-account-setup.c b/plugins/exchange-account-setup/exchange-account-setup.c index 5448a7ec79..4d4fd6187d 100644 --- a/plugins/exchange-account-setup/exchange-account-setup.c +++ b/plugins/exchange-account-setup/exchange-account-setup.c @@ -326,7 +326,7 @@ add_owa_entry_to_editor (GtkWidget *parent, EConfig *config, gtk_entry_set_text (GTK_ENTRY (owa_entry), url_value); gtk_widget_show (owa_entry); - button = gtk_button_new_from_stock (GTK_STOCK_OK); + button = gtk_button_new_with_mnemonic (_("A_uthenticate")); gtk_widget_set_sensitive (button, FALSE); gtk_widget_show (button); diff --git a/plugins/exchange-account-setup/exchange-ask-password.c b/plugins/exchange-account-setup/exchange-ask-password.c index c0798b97ca..c21bd67c07 100644 --- a/plugins/exchange-account-setup/exchange-ask-password.c +++ b/plugins/exchange-account-setup/exchange-ask-password.c @@ -190,7 +190,7 @@ add_owa_entry (GtkWidget *parent, owa_entry = gtk_entry_new (); gtk_widget_show (owa_entry); - button = gtk_button_new_from_stock (GTK_STOCK_OK); + button = gtk_button_new_with_mnemonic (_("A_uthenticate")); gtk_widget_set_sensitive (button, FALSE); gtk_widget_show (button); @@ -247,6 +247,75 @@ org_gnome_exchange_read_url (EPlugin *epl, EConfigHookItemFactoryData *data) return owa_entry; } + +GtkWidget * +org_gnome_exchange_handle_auth (EPlugin *epl, EConfigHookItemFactoryData *data) +{ + EMConfigTargetAccount *target_account; + EConfig *config; + char *account_url = NULL, *exchange_url = NULL, *url_string; + const char *source_url; + char *auth_type; + GtkWidget *auth_section=NULL, *parent, *section; + + config = data->config; + target_account = (EMConfigTargetAccount *)data->config->target; + + source_url = e_account_get_string (target_account->account, + E_ACCOUNT_SOURCE_URL); + account_url = g_strdup (source_url); + exchange_url = g_strrstr (account_url, "exchange"); + + if (exchange_url) { + parent = data->parent; + + /* We don't need auth section while creating the account. But + * we need that in the Editor. And since we get the child vbox + * from the plugin, we are finding the parent section and + * hiding it. This is a temporary fix and this needs to be handled + * in the proper way. */ + section = gtk_widget_get_parent (gtk_widget_get_parent (parent)); + gtk_widget_hide (section); + } + auth_section = gtk_entry_new (); + gtk_widget_hide (auth_section); + return auth_section; +} + +GtkWidget * +org_gnome_exchange_handle_send_auth_option (EPlugin *epl, EConfigHookItemFactoryData *data) +{ + EMConfigTargetAccount *target_account; + EConfig *config; + char *account_url = NULL, *exchange_url = NULL, *url_string; + const char *source_url; + char *auth_type; + GtkWidget *auth_section=NULL, *parent, *section; + + config = data->config; + target_account = (EMConfigTargetAccount *)data->config->target; + + source_url = e_account_get_string (target_account->account, + E_ACCOUNT_SOURCE_URL); + account_url = g_strdup (source_url); + exchange_url = g_strrstr (account_url, "exchange"); + + if (exchange_url) { + parent = data->parent; + /* We don't need auth section while creating the account. But + * we need that in the Editor. And since we get the child vbox + * from the plugin, we are finding the parent section and + * hiding it. This is a temporary fix and this needs to be handled + * in the proper way. */ + section = gtk_widget_get_parent ( + gtk_widget_get_parent (gtk_widget_get_parent(parent))); + gtk_widget_hide (section); + } + auth_section = gtk_entry_new (); + gtk_widget_hide (auth_section); + return auth_section; +} + gboolean org_gnome_exchange_check_options (EPlugin *epl, EConfigHookPageCheckData *data) { diff --git a/plugins/exchange-account-setup/org-gnome-exchange-account-setup.eplug.in b/plugins/exchange-account-setup/org-gnome-exchange-account-setup.eplug.in index 251824f96d..6542cf8313 100644 --- a/plugins/exchange-account-setup/org-gnome-exchange-account-setup.eplug.in +++ b/plugins/exchange-account-setup/org-gnome-exchange-account-setup.eplug.in @@ -29,6 +29,15 @@ + + +