[evolution-patches] Exchange: patch for bug #313919
- From: "Shakti Prasad" <shprasad novell com>
- To: <evolution-patches lists ximian com>
- Subject: [evolution-patches] Exchange: patch for bug #313919
- Date: Mon, 22 Aug 2005 08:29:22 -0600
Hi,
I have attached a patch for bug #313919.
Please review this.
Thanks,
Shakti
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/ChangeLog,v
retrieving revision 1.45
diff -u -p -r1.45 ChangeLog
--- ChangeLog 22 Aug 2005 13:18:42 -0000 1.45
+++ ChangeLog 22 Aug 2005 14:06:13 -0000
@@ -1,3 +1,12 @@
+2005-08-22 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-22 Sarfraaz Ahmed <asarfraaz novell com>
* exchange-account-setup.c (btn_fsize_clicked)
Index: exchange-permissions-dialog.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/exchange-permissions-dialog.c,v
retrieving revision 1.8
diff -u -p -r1.8 exchange-permissions-dialog.c
--- exchange-permissions-dialog.c 2 Aug 2005 14:37:59 -0000 1.8
+++ exchange-permissions-dialog.c 22 Aug 2005 14:06:13 -0000
@@ -392,6 +392,8 @@ add_clicked (GtkButton *button, gpointer
GtkTreeIter iter;
GtkWidget *user_dialog;
const guint8 *bsid, *bsid2;
+ GList *email_list = NULL;
+ GList *list = NULL;
char *email = NULL;
gboolean valid;
gint result;
@@ -408,61 +410,62 @@ add_clicked (GtkButton *button, gpointer
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)
+ if (email_list == 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)
- 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 (list = email_list; list; list = g_list_next (list)) {
+ email = list->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
Index: exchange-user-dialog.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/exchange-user-dialog.c,v
retrieving revision 1.1
diff -u -p -r1.1 exchange-user-dialog.c
--- exchange-user-dialog.c 8 Jul 2005 13:45:19 -0000 1.1
+++ exchange-user-dialog.c 22 Aug 2005 14:06:13 -0000
@@ -224,6 +224,42 @@ e2k_user_dialog_new (GtkWidget *parent_w
}
/**
+ * 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
*
Index: exchange-user-dialog.h
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/exchange-user-dialog.h,v
retrieving revision 1.1
diff -u -p -r1.1 exchange-user-dialog.h
--- exchange-user-dialog.h 8 Jul 2005 13:45:19 -0000 1.1
+++ exchange-user-dialog.h 22 Aug 2005 14:06:13 -0000
@@ -33,5 +33,6 @@ GtkWidget *e2k_user_dialog_new (Gtk
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__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]