diff options
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 2 | ||||
-rw-r--r-- | calendar/gui/dialogs/save-comp.c | 18 | ||||
-rw-r--r-- | calendar/gui/dialogs/save-comp.h | 3 |
3 files changed, 17 insertions, 6 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 2ce4647c19..8d26689eca 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -330,7 +330,7 @@ prompt_to_save_changes (CompEditor *editor, gboolean send) if (!e_cal_is_read_only (priv->client, &read_only, NULL) || read_only) return TRUE; - switch (save_component_dialog (GTK_WINDOW (editor))) { + 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))) diff --git a/calendar/gui/dialogs/save-comp.c b/calendar/gui/dialogs/save-comp.c index 47a4b7221c..fa5eae8659 100644 --- a/calendar/gui/dialogs/save-comp.c +++ b/calendar/gui/dialogs/save-comp.c @@ -25,12 +25,13 @@ #include "widgets/misc/e-error.h" #include "save-comp.h" - +#include "comp-editor.h" /** * save_component_dialog: * @parent: Window to use as the transient dialog's parent. - * + * @comp: Pointer to the EcalComponent + * * Pops up a dialog box asking the user whether he wants to save changes for * a calendar component. * @@ -38,7 +39,16 @@ **/ GtkResponseType -save_component_dialog (GtkWindow *parent) +save_component_dialog (GtkWindow *parent, ECalComponent *comp) { - return e_error_run (parent, "calendar:prompt-save-appointment", NULL); + ECalComponentVType vtype = e_cal_component_get_vtype(comp); + + switch(vtype) { + case E_CAL_COMPONENT_EVENT: + return e_error_run (parent, "calendar:prompt-save-appointment", NULL); + case E_CAL_COMPONENT_TODO: + return e_error_run (parent, "calendar:prompt-save-task", NULL); + default: + return GTK_RESPONSE_NO; + } } diff --git a/calendar/gui/dialogs/save-comp.h b/calendar/gui/dialogs/save-comp.h index a9aedd2bce..79abe30453 100644 --- a/calendar/gui/dialogs/save-comp.h +++ b/calendar/gui/dialogs/save-comp.h @@ -23,7 +23,8 @@ #define SAVE_COMP_H #include <gtk/gtkdialog.h> +#include <libecal/e-cal-component.h> -GtkResponseType save_component_dialog (GtkWindow *parent); +GtkResponseType save_component_dialog (GtkWindow *parent, ECalComponent *comp); #endif |