aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/exchange-operations
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2008-12-02 20:23:33 +0800
committerMilan Crha <mcrha@src.gnome.org>2008-12-02 20:23:33 +0800
commit2cdecac7c2567273027f5de0094605e19b73ad8c (patch)
tree12a747b5a4f607418d8bbcbbcf282af892153aed /plugins/exchange-operations
parent0563ff385f4217e1b713d0438bdff57742bd5e87 (diff)
downloadgsoc2013-evolution-2cdecac7c2567273027f5de0094605e19b73ad8c.tar.gz
gsoc2013-evolution-2cdecac7c2567273027f5de0094605e19b73ad8c.tar.zst
gsoc2013-evolution-2cdecac7c2567273027f5de0094605e19b73ad8c.zip
** Part of fix for bug #562228
2008-12-02 Milan Crha <mcrha@redhat.com> ** Part of fix for bug #562228 * exchange-account-setup.c: (want_mailbox_toggled), (org_gnome_exchange_owa_url): Make it clearer the mailbox entry is optional. svn path=/trunk/; revision=36825
Diffstat (limited to 'plugins/exchange-operations')
-rw-r--r--plugins/exchange-operations/ChangeLog8
-rw-r--r--plugins/exchange-operations/exchange-account-setup.c46
2 files changed, 52 insertions, 2 deletions
diff --git a/plugins/exchange-operations/ChangeLog b/plugins/exchange-operations/ChangeLog
index 0d526d6245..6c7483eaa4 100644
--- a/plugins/exchange-operations/ChangeLog
+++ b/plugins/exchange-operations/ChangeLog
@@ -1,3 +1,11 @@
+2008-12-02 Milan Crha <mcrha@redhat.com>
+
+ ** Part of fix for bug #562228
+
+ * exchange-account-setup.c: (want_mailbox_toggled),
+ (org_gnome_exchange_owa_url):
+ Make it clearer the mailbox entry is optional.
+
2008-10-22 Bharath Acharya <abharath@novell.com>
** Fix for bug #557246
diff --git a/plugins/exchange-operations/exchange-account-setup.c b/plugins/exchange-operations/exchange-account-setup.c
index 275a214b90..46b98d3acb 100644
--- a/plugins/exchange-operations/exchange-account-setup.c
+++ b/plugins/exchange-operations/exchange-account-setup.c
@@ -613,6 +613,30 @@ mailbox_editor_entry_changed (GtkWidget *entry, EConfig *config)
update_mailbox_param_in_url (target->account, E_ACCOUNT_TRANSPORT_URL, mailbox);
}
+static void
+want_mailbox_toggled (GtkWidget *toggle, EConfig *config)
+{
+ GtkWidget *entry;
+
+ g_return_if_fail (toggle != NULL);
+ g_return_if_fail (config != NULL);
+
+ entry = g_object_get_data (G_OBJECT (toggle), "mailbox-entry");
+ if (entry) {
+ gboolean is_active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle));
+ EMConfigTargetAccount *target;
+ const char *mailbox;
+
+ gtk_widget_set_sensitive (entry, is_active);
+
+ target = (EMConfigTargetAccount *)config->target;
+ mailbox = gtk_entry_get_text (GTK_ENTRY (entry));
+
+ update_mailbox_param_in_url (target->account, E_ACCOUNT_SOURCE_URL, is_active ? mailbox : NULL);
+ update_mailbox_param_in_url (target->account, E_ACCOUNT_TRANSPORT_URL, is_active ? mailbox : NULL);
+ }
+}
+
static char *
construct_owa_url (CamelURL *url)
{
@@ -645,8 +669,8 @@ org_gnome_exchange_owa_url(EPlugin *epl, EConfigHookItemFactoryData *data)
{
EMConfigTargetAccount *target_account;
const char *source_url;
- char *owa_url = NULL, *mailbox_name;
- GtkWidget *owa_entry, *mailbox_entry;
+ char *owa_url = NULL, *mailbox_name, *username;
+ GtkWidget *owa_entry, *mailbox_entry, *want_mailbox_check;
CamelURL *url;
int row;
GtkWidget *hbox, *label, *button;
@@ -679,6 +703,7 @@ org_gnome_exchange_owa_url(EPlugin *epl, EConfigHookItemFactoryData *data)
owa_url = g_strdup (camel_url_get_param(url, "owa_url"));
mailbox_name = g_strdup (camel_url_get_param (url, "mailbox"));
+ username = g_strdup (url->user);
/* if the host is null, then user+other info is dropped silently, force it to be kept */
if (url->host == NULL) {
@@ -740,6 +765,19 @@ org_gnome_exchange_owa_url(EPlugin *epl, EConfigHookItemFactoryData *data)
owa_editor_entry_changed (owa_entry, data->config);
row++;
+ want_mailbox_check = gtk_check_button_new_with_mnemonic (_("S_pecify the mailbox name"));
+ gtk_widget_show (want_mailbox_check);
+ gtk_table_attach (GTK_TABLE (data->parent), want_mailbox_check, 1, 2, row, row+1, GTK_FILL, GTK_FILL, 0, 0);
+ if (!username || !*username || !mailbox_name || !*mailbox_name ||
+ g_ascii_strcasecmp (username, mailbox_name) == 0 ||
+ (strchr (username, '/') && g_ascii_strcasecmp (strchr (username, '/') + 1, mailbox_name) == 0)) {
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (want_mailbox_check), FALSE);
+ } else {
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (want_mailbox_check), TRUE);
+ }
+ g_signal_connect (want_mailbox_check, "toggled", G_CALLBACK (want_mailbox_toggled), data->config);
+
+ row++;
label = gtk_label_new_with_mnemonic (_("_Mailbox:"));
gtk_widget_show (label);
@@ -750,14 +788,18 @@ org_gnome_exchange_owa_url(EPlugin *epl, EConfigHookItemFactoryData *data)
gtk_label_set_mnemonic_widget (GTK_LABEL (label), mailbox_entry);
+ gtk_widget_set_sensitive (mailbox_entry, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (want_mailbox_check)));
+
g_signal_connect (mailbox_entry, "changed", G_CALLBACK (mailbox_editor_entry_changed), data->config);
g_object_set_data (G_OBJECT (button), "mailbox-entry", mailbox_entry);
+ g_object_set_data (G_OBJECT (want_mailbox_check), "mailbox-entry", mailbox_entry);
gtk_table_attach (GTK_TABLE (data->parent), label, 0, 1, row, row+1, 0, 0, 0, 0);
gtk_table_attach (GTK_TABLE (data->parent), mailbox_entry, 1, 2, row, row+1, GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
g_free (owa_url);
g_free (mailbox_name);
+ g_free (username);
return hbox;
}