aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs/task-editor.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@src.gnome.org>2003-03-05 03:52:37 +0800
committerJP Rosevear <jpr@src.gnome.org>2003-03-05 03:52:37 +0800
commit6b4c3984d52cfbf88ae84ee0102f4aa0c17a2a62 (patch)
treebba07b5f28966c10a90de8f550af895014b0b9bb /calendar/gui/dialogs/task-editor.c
parentcd4477930e72b1be069d5c97b90d96e989645bfc (diff)
downloadgsoc2013-evolution-6b4c3984d52cfbf88ae84ee0102f4aa0c17a2a62.tar
gsoc2013-evolution-6b4c3984d52cfbf88ae84ee0102f4aa0c17a2a62.tar.gz
gsoc2013-evolution-6b4c3984d52cfbf88ae84ee0102f4aa0c17a2a62.tar.bz2
gsoc2013-evolution-6b4c3984d52cfbf88ae84ee0102f4aa0c17a2a62.tar.lz
gsoc2013-evolution-6b4c3984d52cfbf88ae84ee0102f4aa0c17a2a62.tar.xz
gsoc2013-evolution-6b4c3984d52cfbf88ae84ee0102f4aa0c17a2a62.tar.zst
gsoc2013-evolution-6b4c3984d52cfbf88ae84ee0102f4aa0c17a2a62.zip
If only the pipe wouldn't break.
svn path=/trunk/; revision=20143
Diffstat (limited to 'calendar/gui/dialogs/task-editor.c')
-rw-r--r--calendar/gui/dialogs/task-editor.c66
1 files changed, 39 insertions, 27 deletions
diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c
index 5b76c68c75..0b2aee9827 100644
--- a/calendar/gui/dialogs/task-editor.c
+++ b/calendar/gui/dialogs/task-editor.c
@@ -117,7 +117,8 @@ set_menu_sens (TaskEditor *te)
user = comp_editor_get_user_org (COMP_EDITOR (te));
read_only = cal_client_is_read_only (comp_editor_get_cal_client (COMP_EDITOR (te)));
- sens = priv->assignment_shown || read_only;
+ sens = cal_client_get_static_capability (comp_editor_get_cal_client (COMP_EDITOR (te)), "no-task-assignment")
+ || priv->assignment_shown || read_only;
comp_editor_set_ui_prop (COMP_EDITOR (te),
"/commands/ActionAssignTask",
"sensitive", sens ? "0" : "1");
@@ -217,6 +218,7 @@ task_editor_edit_comp (CompEditor *editor, CalComponent *comp)
TaskEditor *te;
TaskEditorPrivate *priv;
CalComponentOrganizer organizer;
+ CalClient *client;
GSList *attendees = NULL;
te = TASK_EDITOR (editor);
@@ -227,12 +229,13 @@ task_editor_edit_comp (CompEditor *editor, CalComponent *comp)
if (parent_class->edit_comp)
parent_class->edit_comp (editor, comp);
+ client = comp_editor_get_cal_client (COMP_EDITOR (editor));
+
/* Get meeting related stuff */
cal_component_get_organizer (comp, &organizer);
cal_component_get_attendee_list (comp, &attendees);
-
+
/* Clear things up */
- e_meeting_model_restricted_clear (priv->model);
e_meeting_model_remove_all_attendees (priv->model);
if (attendees == NULL) {
@@ -240,7 +243,8 @@ task_editor_edit_comp (CompEditor *editor, CalComponent *comp)
priv->assignment_shown = FALSE;
} else {
GSList *l;
-
+ int row;
+
if (!priv->assignment_shown)
comp_editor_append_page (COMP_EDITOR (te),
COMP_EDITOR_PAGE (priv->meet_page),
@@ -248,39 +252,47 @@ task_editor_edit_comp (CompEditor *editor, CalComponent *comp)
for (l = attendees; l != NULL; l = l->next) {
CalComponentAttendee *ca = l->data;
- EMeetingAttendee *ia = E_MEETING_ATTENDEE (e_meeting_attendee_new_from_cal_component_attendee (ca));
-
- e_meeting_model_add_attendee (priv->model, ia);
- g_object_unref((ia));
+ EMeetingAttendee *ia;
+
+ ia = E_MEETING_ATTENDEE (e_meeting_attendee_new_from_cal_component_attendee (ca));
+ if (!comp_editor_get_user_org (editor))
+ e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_NONE);
+ e_meeting_model_add_attendee (priv->model, ia);
+
+ g_object_unref(ia);
}
- if (organizer.value != NULL) {
- const char *strip;
- int row;
+ /* If we aren't the organizer we can still change our own status */
+ if (!comp_editor_get_user_org (editor)) {
+ EAccountList *accounts;
+ EAccount *account;
EIterator *it;
-
- strip = itip_strip_mailto (organizer.value);
-
- for (it = e_list_get_iterator((EList *)itip_addresses_get ());
- e_iterator_is_valid(it);
- e_iterator_next(it)) {
- EAccount *a = (EAccount *)e_iterator_get(it);
-
- if (e_meeting_model_find_attendee (priv->model, a->id->address, &row))
- e_meeting_model_restricted_add (priv->model, row);
- }
+
+ accounts = itip_addresses_get ();
+ for (it = e_list_get_iterator((EList *)accounts);e_iterator_is_valid(it);e_iterator_next(it)) {
+ EMeetingAttendee *ia;
+
+ account = (EAccount*)e_iterator_get(it);
+
+ ia = e_meeting_model_find_attendee (priv->model, account->id->address, &row);
+ if (ia != NULL)
+ e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_STATUS);
+ }
g_object_unref(it);
- }
+ } else if (cal_client_get_organizer_must_attend (client)) {
+ EMeetingAttendee *ia;
- if (comp_editor_get_user_org (editor))
- e_meeting_model_restricted_clear (priv->model);
+ ia = e_meeting_model_find_attendee (priv->model, organizer.value, &row);
+ if (ia != NULL)
+ e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_NONE);
+ }
priv->assignment_shown = TRUE;
}
cal_component_free_attendee_list (attendees);
set_menu_sens (te);
- comp_editor_set_needs_send (COMP_EDITOR (te), priv->assignment_shown && itip_organizer_is_user (comp));
+ comp_editor_set_needs_send (COMP_EDITOR (te), priv->assignment_shown && itip_organizer_is_user (comp, client));
priv->updating = FALSE;
}
@@ -414,7 +426,7 @@ cancel_task_cmd (GtkWidget *widget, gpointer data)
CalComponent *comp;
comp = comp_editor_get_current_comp (COMP_EDITOR (te));
- if (cancel_component_dialog (comp, FALSE)) {
+ if (cancel_component_dialog (comp_editor_get_cal_client (COMP_EDITOR (te)), comp, FALSE)) {
comp_editor_send_comp (COMP_EDITOR (te), CAL_COMPONENT_METHOD_CANCEL);
comp_editor_delete_comp (COMP_EDITOR (te));
}