aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs
diff options
context:
space:
mode:
authorChenthill Palanisamy <pchen@src.gnome.org>2005-06-22 16:16:27 +0800
committerChenthill Palanisamy <pchen@src.gnome.org>2005-06-22 16:16:27 +0800
commita837b9e89989e1ddf2750099f8f06e807dd0f510 (patch)
tree8a5cae1f4aad278e9875c3d0cebaa4b92f11e4b4 /calendar/gui/dialogs
parent7145e440a5be056332cd1210eb45e746ba25e527 (diff)
downloadgsoc2013-evolution-a837b9e89989e1ddf2750099f8f06e807dd0f510.tar.gz
gsoc2013-evolution-a837b9e89989e1ddf2750099f8f06e807dd0f510.tar.zst
gsoc2013-evolution-a837b9e89989e1ddf2750099f8f06e807dd0f510.zip
Commiting the delegation support for recurrence events
svn path=/trunk/; revision=29564
Diffstat (limited to 'calendar/gui/dialogs')
-rw-r--r--calendar/gui/dialogs/comp-editor.c16
-rw-r--r--calendar/gui/dialogs/event-page.c7
-rw-r--r--calendar/gui/dialogs/recur-comp.c7
-rw-r--r--calendar/gui/dialogs/recur-comp.h3
4 files changed, 24 insertions, 9 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index abd16741c4..e7bc7efa9c 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -666,6 +666,14 @@ save_comp (CompEditor *editor)
e_cal_component_set_exrule_list (priv->comp, NULL);
}
result = e_cal_modify_object (priv->client, icalcomp, priv->mod, &error);
+
+ if (result && priv->mod == CALOBJ_MOD_THIS) {
+ /* FIXME do we really need to do this ? */
+ if ((priv->flags & COMP_EDITOR_DELEGATE) || !e_cal_component_has_organizer (clone) || itip_organizer_is_user (clone, priv->client))
+ e_cal_component_commit_sequence (clone);
+ else
+ e_cal_component_abort_sequence (clone);
+ }
}
/* If the delay delivery is set, the items will not be created in the server immediately,
@@ -773,7 +781,7 @@ prompt_to_save_changes (CompEditor *editor, gboolean send)
switch (save_component_dialog (GTK_WINDOW(editor), priv->comp)) {
case GTK_RESPONSE_YES: /* Save */
if (e_cal_component_is_instance (priv->comp))
- if (!recur_component_dialog (priv->client, priv->comp, &priv->mod, GTK_WINDOW (editor)))
+ if (!recur_component_dialog (priv->client, priv->comp, &priv->mod, GTK_WINDOW (editor), FALSE))
return FALSE;
if (send && save_comp_with_send (editor))
@@ -796,8 +804,10 @@ response_cb (GtkWidget *widget, int response, gpointer data)
CompEditor *editor = COMP_EDITOR (data);
CompEditorPrivate *priv;
ECalComponentText text;
+ gboolean delegated;
priv = editor->priv;
+ delegated = (priv->flags & COMP_EDITOR_DELEGATE);
switch (response) {
case GTK_RESPONSE_OK:
@@ -822,7 +832,7 @@ response_cb (GtkWidget *widget, int response, gpointer data)
commit_all_fields (editor);
if (e_cal_component_is_instance (priv->comp))
- if (!recur_component_dialog (priv->client, priv->comp, &priv->mod, GTK_WINDOW (editor)))
+ if (!recur_component_dialog (priv->client, priv->comp, &priv->mod, GTK_WINDOW (editor), delegated))
return;
if (save_comp_with_send (editor)) {
@@ -858,7 +868,6 @@ delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data)
{
CompEditor *editor = COMP_EDITOR (data);
CompEditorPrivate *priv;
- ECalComponentText text;
priv = editor->priv;
@@ -1822,7 +1831,6 @@ real_edit_comp (CompEditor *editor, ECalComponent *comp)
static void
set_attendees_for_delegation (ECalComponent *comp, const char *address, ECalComponentItipMethod method)
{
- GSList *attendees, *l, *new;
icalproperty *prop;
icalparameter *param;
icalcomponent *icalcomp;
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index 3671e7267e..5c934f338f 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -638,6 +638,9 @@ sensitize_widgets (EventPage *epage)
gtk_widget_set_sensitive (priv->categories_btn, !read_only && sens);
gtk_widget_set_sensitive (priv->sendoptions_button, !read_only && sens);
gtk_entry_set_editable (GTK_ENTRY (priv->categories), !read_only && sens);
+
+ if (COMP_EDITOR_PAGE (epage)->flags & COMP_EDITOR_PAGE_DELEGATE)
+ gtk_widget_set_sensitive (priv->sendoptions_button, TRUE);
}
void
@@ -677,7 +680,7 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
ECalComponentClassification cl;
ECalComponentTransparency transparency;
ECalComponentDateTime start_date, end_date;
- icalcomponent *icalcomp;
+ icalcomponent *icalcomp = NULL;
const char *location, *uid = NULL;
const char *categories;
ESource *source;
@@ -799,7 +802,7 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
e_source_option_menu_select (E_SOURCE_OPTION_MENU (priv->source_selector), source);
e_cal_component_get_uid (comp, &uid);
- if (e_cal_get_object (COMP_EDITOR_PAGE (epage)->client, uid, NULL, &icalcomp, NULL)) {
+ if (!(COMP_EDITOR_PAGE (epage)->flags & COMP_EDITOR_PAGE_DELEGATE) && e_cal_get_object (COMP_EDITOR_PAGE (epage)->client, uid, NULL, &icalcomp, NULL)) {
icalcomponent_free (icalcomp);
event_page_hide_options (epage);
}
diff --git a/calendar/gui/dialogs/recur-comp.c b/calendar/gui/dialogs/recur-comp.c
index cfffa29c69..de6d4ca0be 100644
--- a/calendar/gui/dialogs/recur-comp.c
+++ b/calendar/gui/dialogs/recur-comp.c
@@ -34,7 +34,7 @@ gboolean
recur_component_dialog (ECal *client,
ECalComponent *comp,
CalObjModType *mod,
- GtkWindow *parent)
+ GtkWindow *parent, gboolean delegated)
{
char *str;
GtkWidget *dialog, *rb_this, *rb_prior, *rb_future, *rb_all, *hbox;
@@ -48,7 +48,10 @@ recur_component_dialog (ECal *client,
switch (vtype) {
case E_CAL_COMPONENT_EVENT:
- str = g_strdup_printf (_("You are modifying a recurring event, what would you like to modify?"));
+ if (!delegated)
+ str = g_strdup_printf (_("You are modifying a recurring event, what would you like to modify?"));
+ else
+ str = g_strdup_printf (_("You are delegating a recurring event, what would like to delegate?"));
break;
case E_CAL_COMPONENT_TODO:
diff --git a/calendar/gui/dialogs/recur-comp.h b/calendar/gui/dialogs/recur-comp.h
index 94ccbdae87..6016ece436 100644
--- a/calendar/gui/dialogs/recur-comp.h
+++ b/calendar/gui/dialogs/recur-comp.h
@@ -29,6 +29,7 @@
gboolean recur_component_dialog (ECal *client,
ECalComponent *comp,
CalObjModType *mod,
- GtkWindow *parent);
+ GtkWindow *parent,
+ gboolean delegated);
#endif