aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShakti Sen <shprasad@novell.com>2005-08-24 18:10:10 +0800
committerShakti Prasad Sen <shaktis@src.gnome.org>2005-08-24 18:10:10 +0800
commit294ca271decb4567cb0f4bfa1cbfe2365a7a236d (patch)
tree9272ef73fbaa10391bf7eab6862c6c7b8a0578d8
parent90f4d3fa8f48c3e2a8a0f0a668499eac0d9675a1 (diff)
downloadgsoc2013-evolution-294ca271decb4567cb0f4bfa1cbfe2365a7a236d.tar
gsoc2013-evolution-294ca271decb4567cb0f4bfa1cbfe2365a7a236d.tar.gz
gsoc2013-evolution-294ca271decb4567cb0f4bfa1cbfe2365a7a236d.tar.bz2
gsoc2013-evolution-294ca271decb4567cb0f4bfa1cbfe2365a7a236d.tar.lz
gsoc2013-evolution-294ca271decb4567cb0f4bfa1cbfe2365a7a236d.tar.xz
gsoc2013-evolution-294ca271decb4567cb0f4bfa1cbfe2365a7a236d.tar.zst
gsoc2013-evolution-294ca271decb4567cb0f4bfa1cbfe2365a7a236d.zip
Getting list of mail-ids instead of a single mail-id. Added support for
2005-08-24 Shakti Sen <shprasad@novell.com> * exchange-permissions-dialog.c (add_clicked): Getting list of mail-ids instead of a single mail-id. * exchange-user-dialog.[c/h] (e2k_user_dialog_get_user_list): Added support for adding multiple IDs. Fixes bug #313919. svn path=/trunk/; revision=30239
-rw-r--r--plugins/exchange-operations/ChangeLog9
-rw-r--r--plugins/exchange-operations/exchange-permissions-dialog.c97
-rw-r--r--plugins/exchange-operations/exchange-user-dialog.c36
-rw-r--r--plugins/exchange-operations/exchange-user-dialog.h1
4 files changed, 96 insertions, 47 deletions
diff --git a/plugins/exchange-operations/ChangeLog b/plugins/exchange-operations/ChangeLog
index 1a7b806af0..25bd9f4d2c 100644
--- a/plugins/exchange-operations/ChangeLog
+++ b/plugins/exchange-operations/ChangeLog
@@ -1,3 +1,12 @@
+2005-08-24 Shakti Sen <shprasad@novell.com>
+
+ * exchange-permissions-dialog.c (add_clicked): Getting list of mail-ids
+ instead of a single mail-id.
+ * exchange-user-dialog.[c/h] (e2k_user_dialog_get_user_list): Added
+ support for adding multiple IDs.
+
+ Fixes bug #313919.
+
2005-08-24 Praveen Kumar <kpraveen@novell.com>
* plugins/exchange-operations/exchange-account-setup.c:
diff --git a/plugins/exchange-operations/exchange-permissions-dialog.c b/plugins/exchange-operations/exchange-permissions-dialog.c
index 68b152bdfc..b8a3fd45a4 100644
--- a/plugins/exchange-operations/exchange-permissions-dialog.c
+++ b/plugins/exchange-operations/exchange-permissions-dialog.c
@@ -392,6 +392,8 @@ add_clicked (GtkButton *button, gpointer user_data)
GtkTreeIter iter;
GtkWidget *user_dialog;
const guint8 *bsid, *bsid2;
+ GList *email_list = NULL;
+ GList *l = NULL;
char *email = NULL;
gboolean valid;
gint result;
@@ -408,61 +410,62 @@ add_clicked (GtkButton *button, gpointer user_data)
result = gtk_dialog_run (GTK_DIALOG (user_dialog));
if (result == GTK_RESPONSE_OK)
- email = e2k_user_dialog_get_user (E2K_USER_DIALOG (user_dialog));
- else
- email = NULL;
+ email_list = e2k_user_dialog_get_user_list (E2K_USER_DIALOG (user_dialog));
gtk_widget_destroy (user_dialog);
- if (email == NULL)
- return;
-
- status = e2k_global_catalog_lookup (
- gc, NULL, /* FIXME: cancellable */
- E2K_GLOBAL_CATALOG_LOOKUP_BY_EMAIL, email,
- E2K_GLOBAL_CATALOG_LOOKUP_SID, &entry);
- switch (status) {
- case E2K_GLOBAL_CATALOG_OK:
- break;
- case E2K_GLOBAL_CATALOG_NO_SUCH_USER:
- e_error_run (GTK_WINDOW (dialog), ERROR_DOMAIN ":no-user-error", email, NULL);
- break;
- case E2K_GLOBAL_CATALOG_NO_DATA:
- e_error_run (GTK_WINDOW (dialog), ERROR_DOMAIN ":acl-add-error", email, NULL);
- break;
- default:
- e_error_run (GTK_WINDOW (dialog), ERROR_DOMAIN ":perm-unknown-error", email, NULL);
- break;
- }
- g_free (email);
- if (status != E2K_GLOBAL_CATALOG_OK)
+ if (email_list == NULL)
return;
- /* Make sure the user isn't already there. */
- bsid = e2k_sid_get_binary_sid (entry->sid);
- valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (dialog->priv->list_store), &iter);
- while (valid) {
- gtk_tree_model_get (GTK_TREE_MODEL (dialog->priv->list_store), &iter,
- EXCHANGE_PERMISSIONS_DIALOG_SID_COLUMN, &sid2,
- -1);
- bsid2 = e2k_sid_get_binary_sid (sid2);
- if (e2k_sid_binary_sid_equal (bsid, bsid2)) {
- e_error_run (GTK_WINDOW (dialog), ERROR_DOMAIN ":perm-existing-error",
- entry->display_name, NULL);
- e2k_global_catalog_entry_free (gc, entry);
- gtk_tree_selection_select_iter (dialog->priv->list_selection, &iter);
- return;
+ for (l = email_list; l; l = g_list_next (l)) {
+ email = l->data;
+ status = e2k_global_catalog_lookup (
+ gc, NULL, /* FIXME: cancellable */
+ E2K_GLOBAL_CATALOG_LOOKUP_BY_EMAIL, email,
+ E2K_GLOBAL_CATALOG_LOOKUP_SID, &entry);
+ switch (status) {
+ case E2K_GLOBAL_CATALOG_OK:
+ break;
+ case E2K_GLOBAL_CATALOG_NO_SUCH_USER:
+ e_error_run (GTK_WINDOW (dialog), ERROR_DOMAIN ":no-user-error", email, NULL);
+ break;
+ case E2K_GLOBAL_CATALOG_NO_DATA:
+ e_error_run (GTK_WINDOW (dialog), ERROR_DOMAIN ":acl-add-error", email, NULL);
+ break;
+ default:
+ e_error_run (GTK_WINDOW (dialog), ERROR_DOMAIN ":perm-unknown-error", email, NULL);
+ break;
}
+ if (status != E2K_GLOBAL_CATALOG_OK)
+ return;
- valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (dialog->priv->list_store), &iter);
- }
+ /* Make sure the user isn't already there. */
+ bsid = e2k_sid_get_binary_sid (entry->sid);
+ valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (dialog->priv->list_store), &iter);
+ while (valid) {
+ gtk_tree_model_get (GTK_TREE_MODEL (dialog->priv->list_store), &iter,
+ EXCHANGE_PERMISSIONS_DIALOG_SID_COLUMN, &sid2,
+ -1);
+ bsid2 = e2k_sid_get_binary_sid (sid2);
+ if (e2k_sid_binary_sid_equal (bsid, bsid2)) {
+ e_error_run (GTK_WINDOW (dialog), ERROR_DOMAIN ":perm-existing-error",
+ entry->display_name, NULL);
+ e2k_global_catalog_entry_free (gc, entry);
+ gtk_tree_selection_select_iter (dialog->priv->list_selection, &iter);
+ return;
+ }
+
+ valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (dialog->priv->list_store), &iter);
+ }
- add_user_to_list (dialog, entry->sid, TRUE);
+ add_user_to_list (dialog, entry->sid, TRUE);
- /* Calling set_permissions will cause the sd to take a
- * ref on the sid, allowing us to unref it.
- */
- set_permissions (dialog, 0);
- e2k_global_catalog_entry_free (gc, entry);
+ /* Calling set_permissions will cause the sd to take a
+ * ref on the sid, allowing us to unref it.
+ */
+ set_permissions (dialog, 0);
+ e2k_global_catalog_entry_free (gc, entry);
+ }
+ g_list_free (email_list);
}
static void
diff --git a/plugins/exchange-operations/exchange-user-dialog.c b/plugins/exchange-operations/exchange-user-dialog.c
index a9c78cc493..da80a1244c 100644
--- a/plugins/exchange-operations/exchange-user-dialog.c
+++ b/plugins/exchange-operations/exchange-user-dialog.c
@@ -224,6 +224,42 @@ e2k_user_dialog_new (GtkWidget *parent_window,
}
/**
+ * e2k_user_dialog_get_user_list:
+ * @dialog: the dialog
+ *
+ * Gets the email addresses of the selected user from the dialog.
+ *
+ * Return value: the email addresses.
+ **/
+GList *
+e2k_user_dialog_get_user_list (E2kUserDialog *dialog)
+{
+ E2kUserDialogPrivate *priv;
+ EDestinationStore *destination_store;
+ GList *destinations;
+ GList *l;
+ GList *email_list = NULL;
+ EDestination *destination;
+
+ g_return_val_if_fail (E2K_IS_USER_DIALOG (dialog), NULL);
+
+ priv = dialog->priv;
+
+ destination_store = e_name_selector_entry_peek_destination_store (E_NAME_SELECTOR_ENTRY (priv->entry));
+ destinations = e_destination_store_list_destinations (destination_store);
+ if (!destinations)
+ return NULL;
+
+ for (l = destinations; l; l = g_list_next (l)) {
+ destination = l->data;
+ email_list = g_list_prepend (email_list, g_strdup (e_destination_get_email (destination)));
+ }
+ g_list_free (destinations);
+
+ return email_list;
+}
+
+/**
* e2k_user_dialog_get_user:
* @dialog: the dialog
*
diff --git a/plugins/exchange-operations/exchange-user-dialog.h b/plugins/exchange-operations/exchange-user-dialog.h
index b212172b85..cd8059b00f 100644
--- a/plugins/exchange-operations/exchange-user-dialog.h
+++ b/plugins/exchange-operations/exchange-user-dialog.h
@@ -33,5 +33,6 @@ GtkWidget *e2k_user_dialog_new (GtkWidget *parent_window,
const char *label_text,
const char *section_name);
char *e2k_user_dialog_get_user (E2kUserDialog *dialog);
+GList *e2k_user_dialog_get_user_list (E2kUserDialog *dialog);
#endif /* __E2K_USER_DIALOG_H__ */