diff options
author | Chenthill Palanisamy <pchenthill@novell.com> | 2004-11-25 15:59:05 +0800 |
---|---|---|
committer | Chenthill Palanisamy <pchen@src.gnome.org> | 2004-11-25 15:59:05 +0800 |
commit | 28e3f4b36be3dac5eea28e06c63384e81011a41e (patch) | |
tree | 7288764d1918241ad98e6a59b9365efe09ca7a0a /calendar | |
parent | 8ac90709191dc3bbd8927726b0b3f47d83a3ee05 (diff) | |
download | gsoc2013-evolution-28e3f4b36be3dac5eea28e06c63384e81011a41e.tar.gz gsoc2013-evolution-28e3f4b36be3dac5eea28e06c63384e81011a41e.tar.zst gsoc2013-evolution-28e3f4b36be3dac5eea28e06c63384e81011a41e.zip |
Added two error ids to display use it when the meeting is created without
2004-11-25 Chenthill Palanisamy <pchenthill@novell.com>
* calendar-errors.xml: Added two error ids to display use
it when the meeting is created without a summary.
* gui/dialogs/send-comp.[ch] (send_component_prompt_subject): Added a
function to prompt for a dialog when a meeting/assigned task is sent
without a summary.
* gui/dialogs/comp-editor.c (response_cb): Called the above mentioned
function when the summary is not present.
svn path=/trunk/; revision=27987
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/ChangeLog | 10 | ||||
-rw-r--r-- | calendar/calendar-errors.xml | 14 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 10 | ||||
-rw-r--r-- | calendar/gui/dialogs/send-comp.c | 31 | ||||
-rw-r--r-- | calendar/gui/dialogs/send-comp.h | 1 |
5 files changed, 65 insertions, 1 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index a90b630991..7bd759aa34 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,13 @@ +2004-11-25 Chenthill Palanisamy <pchenthill@novell.com> + + * calendar-errors.xml: Added two error ids to display use + it when the meeting is created without a summary. + * gui/dialogs/send-comp.[ch] (send_component_prompt_subject): Added a + function to prompt for a dialog when a meeting/assigned task is sent + without a summary. + * gui/dialogs/comp-editor.c (response_cb): Called the above mentioned + function when the summary is not present. + 2004-11-23 Rodney Dawes <dobey@novell.com> * gui/alarm-notify/alarm-notify-dialog.[ch]: diff --git a/calendar/calendar-errors.xml b/calendar/calendar-errors.xml index 9ed07ca503..0e9cac856d 100644 --- a/calendar/calendar-errors.xml +++ b/calendar/calendar-errors.xml @@ -176,5 +176,19 @@ <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/> <button stock="gtk-delete" response="GTK_RESPONSE_YES"/> </error> + + <error id="prompt-send-no-subject-calendar" type="question" default="GTK_RESPONSE_YES"> + <primary>Are you sure you want to send the appointment without a summary?</primary> + <secondary>Adding a meaningful Summary to your appointment will give your recipients an idea of what your appointment is about.</secondary> + <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/> + <button label="_Send" response="GTK_RESPONSE_YES"/> + </error> + + <error id="prompt-send-no-subject-task" type="question" default="GTK_RESPONSE_YES"> + <primary>Are you sure you want to send the task without a summary?</primary> + <secondary>Adding a meaningful Summary to your task will give your recipients an idea of what your appointment is about.</secondary> + <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/> + <button label="_Send" response="GTK_RESPONSE_YES"/> + </error> </error-list> diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 824bb7ceb7..8003f85f69 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -327,7 +327,7 @@ prompt_to_save_changes (CompEditor *editor, gboolean send) if (e_cal_component_is_instance (priv->comp)) if (!recur_component_dialog (priv->client, priv->comp, &priv->mod, GTK_WINDOW (editor))) return FALSE; - + if (send && save_comp_with_send (editor)) return TRUE; else if (!send && save_comp (editor)) @@ -347,6 +347,7 @@ response_cb (GtkWidget *widget, int response, gpointer data) { CompEditor *editor = COMP_EDITOR (data); CompEditorPrivate *priv; + ECalComponentText text; priv = editor->priv; @@ -358,6 +359,13 @@ response_cb (GtkWidget *widget, int response, gpointer data) if (!recur_component_dialog (priv->client, priv->comp, &priv->mod, GTK_WINDOW (editor))) return; + e_cal_component_get_summary (priv->comp, &text); + + if (!text.value) { + if (!send_component_prompt_subject ((GtkWindow *) editor, priv->client, priv->comp)) + return; + } + if (save_comp_with_send (editor)) close_dialog (editor); break; diff --git a/calendar/gui/dialogs/send-comp.c b/calendar/gui/dialogs/send-comp.c index 882368a4d6..bc5ce3a35e 100644 --- a/calendar/gui/dialogs/send-comp.c +++ b/calendar/gui/dialogs/send-comp.c @@ -73,3 +73,34 @@ send_component_dialog (GtkWindow *parent, ECal *client, ECalComponent *comp, gbo else return FALSE; } + +gboolean +send_component_prompt_subject (GtkWindow *parent, ECal *client, ECalComponent *comp) +{ + ECalComponentVType vtype; + const char *id; + + vtype = e_cal_component_get_vtype (comp); + + switch (vtype) { + case E_CAL_COMPONENT_EVENT: + id = "calendar:prompt-send-no-subject-calendar"; + break; + + case E_CAL_COMPONENT_TODO: + id = "calendar:prompt-send-no-subject-task"; + break; + + default: + g_message ("send_component_prompt_subject(): " + "Cannot handle object of type %d", vtype); + return FALSE; + } + + if (e_error_run (parent, id, NULL) == GTK_RESPONSE_YES) + return TRUE; + else + return FALSE; +} + + diff --git a/calendar/gui/dialogs/send-comp.h b/calendar/gui/dialogs/send-comp.h index 86be94ccdb..7e007f9edb 100644 --- a/calendar/gui/dialogs/send-comp.h +++ b/calendar/gui/dialogs/send-comp.h @@ -27,5 +27,6 @@ #include <libecal/e-cal-component.h> gboolean send_component_dialog (GtkWindow *parent, ECal *client, ECalComponent *comp, gboolean new); +gboolean send_component_prompt_subject (GtkWindow *parent, ECal *client, ECalComponent *comp); #endif |