Disabling auth sections in druid, and having it only in editor.

svn path=/trunk/; revision=28526
This commit is contained in:
Sushma Rai
2005-01-24 14:39:32 +00:00
parent 41b8acd59d
commit 601b97decb
3 changed files with 80 additions and 2 deletions

View File

@ -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);

View File

@ -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)
{

View File

@ -29,6 +29,15 @@
<item type="section"
path="10.receive/00.config"
factory="org_gnome_exchange_read_url"/>
<item type="section"
path="10.receive/00.config"
label=""/>
<item type="item"
path="10.receive/30.auth/00.hide"
factory="org_gnome_exchange_handle_auth"/>
<item type="item"
path="30.send/30.auth/00.hide"
factory="org_gnome_exchange_handle_send_auth_option"/>
</group>
<group
target="account"