aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-05-28 01:56:54 +0800
committerMilan Crha <mcrha@redhat.com>2010-05-28 01:56:54 +0800
commitd90c1d909de432f06c4c93543ce7f3b3b870b9ed (patch)
tree1b8a4ce8de1f01a4899bda4118a7c80e280fa02f /calendar
parentcf5d6aeca5525f4b59111e95f9515dd1dd6d4c81 (diff)
downloadgsoc2013-evolution-d90c1d909de432f06c4c93543ce7f3b3b870b9ed.tar
gsoc2013-evolution-d90c1d909de432f06c4c93543ce7f3b3b870b9ed.tar.gz
gsoc2013-evolution-d90c1d909de432f06c4c93543ce7f3b3b870b9ed.tar.bz2
gsoc2013-evolution-d90c1d909de432f06c4c93543ce7f3b3b870b9ed.tar.lz
gsoc2013-evolution-d90c1d909de432f06c4c93543ce7f3b3b870b9ed.tar.xz
gsoc2013-evolution-d90c1d909de432f06c4c93543ce7f3b3b870b9ed.tar.zst
gsoc2013-evolution-d90c1d909de432f06c4c93543ce7f3b3b870b9ed.zip
Bug #313791 - Delegator can be repeated when delegating a meeting
Diffstat (limited to 'calendar')
-rw-r--r--calendar/gui/dialogs/event-page.c30
-rw-r--r--calendar/gui/dialogs/task-page.c30
-rw-r--r--calendar/gui/e-meeting-list-view.c41
3 files changed, 46 insertions, 55 deletions
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index 5ceeb9e90b..d2b25c6280 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -1555,7 +1555,7 @@ event_page_fill_component (CompEditorPage *page, ECalComponent *comp)
ECalComponentAttendee *ca;
/* Remove the duplicate user from the component if present */
- if (e_meeting_attendee_is_set_delto (ia)) {
+ if (e_meeting_attendee_is_set_delfrom (ia) || e_meeting_attendee_is_set_delto (ia)) {
for (l = attendee_list; l; l = l->next) {
ECalComponentAttendee *a = l->data;
@@ -1931,24 +1931,20 @@ attendee_added_cb (EMeetingListView *emlv,
return;
}
- if (existing_attendee (ia, priv->comp)) {
- e_meeting_store_remove_attendee (priv->model, ia);
- } else {
- if (!e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY)) {
- const gchar *delegator_id = e_meeting_attendee_get_delfrom (ia);
- EMeetingAttendee *delegator;
+ /* do not remove here, it did EMeetingListView already */
+ e_meeting_attendee_set_delfrom (ia, g_strdup_printf ("MAILTO:%s", priv->user_add ? priv->user_add : ""));
- delegator = e_meeting_store_find_attendee (priv->model, delegator_id, NULL);
+ if (!e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY)) {
+ EMeetingAttendee *delegator;
- g_return_if_fail (delegator != NULL);
+ gtk_widget_set_sensitive (priv->invite, FALSE);
+ gtk_widget_set_sensitive (priv->add, FALSE);
+ gtk_widget_set_sensitive (priv->edit, FALSE);
- e_meeting_attendee_set_delto (delegator, g_strdup (e_meeting_attendee_get_address (ia)));
+ delegator = e_meeting_store_find_attendee (priv->model, priv->user_add, NULL);
+ g_return_if_fail (delegator != NULL);
- e_meeting_attendee_set_delfrom (ia, g_strdup_printf ("MAILTO:%s", delegator_id));
- gtk_widget_set_sensitive (priv->invite, FALSE);
- gtk_widget_set_sensitive (priv->add, FALSE);
- gtk_widget_set_sensitive (priv->edit, FALSE);
- }
+ e_meeting_attendee_set_delto (delegator, g_strdup (e_meeting_attendee_get_address (ia)));
}
}
@@ -3271,6 +3267,10 @@ event_page_add_attendee (EventPage *epage, EMeetingAttendee *attendee)
priv = epage->priv;
+ if ((comp_editor_get_flags (comp_editor_page_get_editor (COMP_EDITOR_PAGE (epage))) & COMP_EDITOR_DELEGATE) != 0) {
+ e_meeting_attendee_set_delfrom (attendee, g_strdup_printf ("MAILTO:%s", epage->priv->user_add));
+ }
+
e_meeting_store_add_attendee (priv->model, attendee);
e_meeting_list_view_add_attendee_to_name_selector (E_MEETING_LIST_VIEW (priv->list_view), attendee);
}
diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c
index 718d45497b..9bb57de918 100644
--- a/calendar/gui/dialogs/task-page.c
+++ b/calendar/gui/dialogs/task-page.c
@@ -1010,7 +1010,7 @@ task_page_fill_component (CompEditorPage *page, ECalComponent *comp)
ECalComponentAttendee *ca;
/* Remove the duplicate user from the component if present */
- if (e_meeting_attendee_is_set_delto (ia)) {
+ if (e_meeting_attendee_is_set_delfrom (ia) || e_meeting_attendee_is_set_delto (ia)) {
for (l = attendee_list; l; l = l->next) {
ECalComponentAttendee *a = l->data;
@@ -1242,24 +1242,20 @@ attendee_added_cb (EMeetingListView *emlv,
return;
}
- if (existing_attendee (ia, priv->comp))
- e_meeting_store_remove_attendee (priv->model, ia);
- else {
- if (!e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY)) {
- const gchar *delegator_id = e_meeting_attendee_get_delfrom (ia);
- EMeetingAttendee *delegator;
+ /* do not remove here, it did EMeetingListView already */
+ e_meeting_attendee_set_delfrom (ia, g_strdup_printf ("MAILTO:%s", priv->user_add ? priv->user_add : ""));
- delegator = e_meeting_store_find_attendee (priv->model, delegator_id, NULL);
+ if (!e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY)) {
+ EMeetingAttendee *delegator;
- g_return_if_fail (delegator != NULL);
+ gtk_widget_set_sensitive (priv->invite, FALSE);
+ gtk_widget_set_sensitive (priv->add, FALSE);
+ gtk_widget_set_sensitive (priv->edit, FALSE);
- e_meeting_attendee_set_delto (delegator,
- g_strdup (e_meeting_attendee_get_address (ia)));
+ delegator = e_meeting_store_find_attendee (priv->model, priv->user_add, NULL);
+ g_return_if_fail (delegator != NULL);
- gtk_widget_set_sensitive (priv->invite, FALSE);
- gtk_widget_set_sensitive (priv->add, FALSE);
- gtk_widget_set_sensitive (priv->edit, FALSE);
- }
+ e_meeting_attendee_set_delto (delegator, g_strdup (e_meeting_attendee_get_address (ia)));
}
}
@@ -2156,6 +2152,10 @@ task_page_add_attendee (TaskPage *tpage, EMeetingAttendee *attendee)
priv = tpage->priv;
+ if ((comp_editor_get_flags (comp_editor_page_get_editor (COMP_EDITOR_PAGE (tpage))) & COMP_EDITOR_DELEGATE) != 0) {
+ e_meeting_attendee_set_delfrom (attendee, g_strdup_printf ("MAILTO:%s", tpage->priv->user_add));
+ }
+
e_meeting_store_add_attendee (priv->model, attendee);
e_meeting_list_view_add_attendee_to_name_selector (E_MEETING_LIST_VIEW (priv->list_view), attendee);
}
diff --git a/calendar/gui/e-meeting-list-view.c b/calendar/gui/e-meeting-list-view.c
index 9920de85e1..b58122124a 100644
--- a/calendar/gui/e-meeting-list-view.c
+++ b/calendar/gui/e-meeting-list-view.c
@@ -351,7 +351,6 @@ attendee_edited_cb (GtkCellRenderer *renderer, const gchar *path, GList *address
GtkTreePath *treepath = gtk_tree_path_new_from_string (path);
gint row = gtk_tree_path_get_indices (treepath)[0];
EMeetingAttendee *existing_attendee;
- gboolean removed = FALSE, address_changed = FALSE;
existing_attendee = e_meeting_store_find_attendee_at_row (model, row);
@@ -385,28 +384,25 @@ attendee_edited_cb (GtkCellRenderer *renderer, const gchar *path, GList *address
e_meeting_attendee_set_delfrom (attendee, (gchar *)e_meeting_attendee_get_delfrom (existing_attendee));
}
e_meeting_list_view_add_attendee_to_name_selector (E_MEETING_LIST_VIEW (view), attendee);
+ g_signal_emit_by_name (G_OBJECT (view), "attendee_added", (gpointer) attendee);
}
if (existing_attendee && can_remove) {
- removed = TRUE;
- e_meeting_list_view_remove_attendee_from_name_selector (E_MEETING_LIST_VIEW (view),
- existing_attendee);
+ e_meeting_list_view_remove_attendee_from_name_selector (E_MEETING_LIST_VIEW (view), existing_attendee);
e_meeting_store_remove_attendee (model, existing_attendee);
}
-
} else if (g_list_length (addresses) == 1) {
gchar *name = names->data, *email = addresses->data;
gint existing_row;
if (!((name && *name) || (email && *email)) || ((e_meeting_store_find_attendee (model, email, &existing_row) != NULL) && existing_row != row)) {
if (existing_attendee) {
- removed = TRUE;
- e_meeting_list_view_remove_attendee_from_name_selector (E_MEETING_LIST_VIEW (view),
- existing_attendee);
+ e_meeting_list_view_remove_attendee_from_name_selector (E_MEETING_LIST_VIEW (view), existing_attendee);
e_meeting_store_remove_attendee (model, existing_attendee);
}
} else {
- EMeetingAttendee *attendee = E_MEETING_ATTENDEE (e_meeting_attendee_new ());
+ gboolean address_changed = FALSE;
+ EMeetingAttendee *attendee = e_meeting_store_add_attendee_with_defaults (model);
if (existing_attendee) {
const gchar *addr = e_meeting_attendee_get_address (existing_attendee);
@@ -417,6 +413,7 @@ attendee_edited_cb (GtkCellRenderer *renderer, const gchar *path, GList *address
address_changed = addr && g_ascii_strcasecmp (addr, email) != 0;
e_meeting_list_view_remove_attendee_from_name_selector (E_MEETING_LIST_VIEW (view), existing_attendee);
+ e_meeting_store_remove_attendee (model, existing_attendee);
}
value_edited (view, E_MEETING_STORE_ADDRESS_COL, path, email);
@@ -426,28 +423,22 @@ attendee_edited_cb (GtkCellRenderer *renderer, const gchar *path, GList *address
e_meeting_attendee_set_cn (attendee, g_strdup (name));
e_meeting_attendee_set_role (attendee, ICAL_ROLE_REQPARTICIPANT);
e_meeting_list_view_add_attendee_to_name_selector (E_MEETING_LIST_VIEW (view), attendee);
- g_object_unref (attendee);
+
+ if (address_changed)
+ e_meeting_attendee_set_status (existing_attendee, ICAL_PARTSTAT_NEEDSACTION);
+
+ g_signal_emit_by_name (G_OBJECT (view), "attendee_added", (gpointer) attendee);
}
- } else {
- if (existing_attendee) {
- const gchar *address = e_meeting_attendee_get_address (existing_attendee);
+ } else if (existing_attendee) {
+ const gchar *address = e_meeting_attendee_get_address (existing_attendee);
- if (!(address && *address)) {
- removed = TRUE;
- e_meeting_list_view_remove_attendee_from_name_selector (E_MEETING_LIST_VIEW (view), existing_attendee);
- e_meeting_store_remove_attendee (model, existing_attendee);
- }
+ if (!(address && *address)) {
+ e_meeting_list_view_remove_attendee_from_name_selector (E_MEETING_LIST_VIEW (view), existing_attendee);
+ e_meeting_store_remove_attendee (model, existing_attendee);
}
}
gtk_tree_path_free (treepath);
-
- if (!removed) {
- if (address_changed)
- e_meeting_attendee_set_status (existing_attendee, ICAL_PARTSTAT_NEEDSACTION);
-
- g_signal_emit_by_name (G_OBJECT (view), "attendee_added", (gpointer) existing_attendee);
- }
}
static void