diff options
author | Chenthill Palanisamy <pchenthill@novell.com> | 2004-12-02 22:05:50 +0800 |
---|---|---|
committer | Chenthill Palanisamy <pchen@src.gnome.org> | 2004-12-02 22:05:50 +0800 |
commit | 300ec3f74d9f2ea59503ad267c927723ea59fd3e (patch) | |
tree | 5b6c2f78eb177f049be8a3e9fd91163e5eb6e7da /calendar/gui/dialogs/comp-editor.c | |
parent | 2f70359db9a97a8e3f13d0ee9970d93a139f839e (diff) | |
download | gsoc2013-evolution-300ec3f74d9f2ea59503ad267c927723ea59fd3e.tar gsoc2013-evolution-300ec3f74d9f2ea59503ad267c927723ea59fd3e.tar.gz gsoc2013-evolution-300ec3f74d9f2ea59503ad267c927723ea59fd3e.tar.bz2 gsoc2013-evolution-300ec3f74d9f2ea59503ad267c927723ea59fd3e.tar.lz gsoc2013-evolution-300ec3f74d9f2ea59503ad267c927723ea59fd3e.tar.xz gsoc2013-evolution-300ec3f74d9f2ea59503ad267c927723ea59fd3e.tar.zst gsoc2013-evolution-300ec3f74d9f2ea59503ad267c927723ea59fd3e.zip |
Add a boolean variable to denote assigned task and construct the meeting
2004-12-02 Chenthill Palanisamy <pchenthill@novell.com>
* gui/dialogs/task-editor.[ch] (task_editor_new), (task_editor_construct),
(show_assignment):
Add a boolean variable to denote assigned task and construct the
meeting page only for the assigned task. Set it as a group item
in component editor.
(_TaskEditorPrivate): added the boolean variable (is_assigned).
(task_editor_init): initialized the variable.
* gui/dialogs/comp-editor.[ch]: Added functions to set and get whether comp
is a group item or individual item.
* gui/comp-editor.c (make_title_from_string), (make_title_from_comp):
Set the Title for the appointment editor window as "Meeting" or "Assigned
Task" if its a group calendar/task item.
(_CompEditorPrivate): added a boolean variable (is_group_item).
(comp_editor_init): initialized the same.
* gui/dialogs/event-editor.c (event_editor_construct), (show_meeting): Set whether
the component is a group item or not in comp editor.
* gui/e-calendar-table.c (e_calendar_table_open_task), (e_calendar_table_open_selected),
(open_task_by_row): Check whether the component being opened is an assigned task by
checking for attendees and call open_task with proper value for boolean variable assign.
* gui/comp-editor-factory.c (edit_existing):
* gui/e-calendar-table.c (open_task):
* gui/e-tasks.c (e_tasks_new_task):
* gui/gnome-cal.c (gnome_calendar_new_task):
* gui/tasks-component.c (create_new_todo):
Called the function task_editor_new with a added argument.
svn path=/trunk/; revision=28044
Diffstat (limited to 'calendar/gui/dialogs/comp-editor.c')
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 61 |
1 files changed, 50 insertions, 11 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 17e723d6f2..7a4040db78 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -76,6 +76,7 @@ struct _CompEditorPrivate { gboolean existing_org; gboolean user_org; + gboolean is_group_item; gboolean warned; }; @@ -358,16 +359,16 @@ response_cb (GtkWidget *widget, int response, gpointer data) if (e_cal_component_is_instance (priv->comp)) if (!recur_component_dialog (priv->client, priv->comp, &priv->mod, GTK_WINDOW (editor))) return; - + if (save_comp_with_send (editor)) { - + e_cal_component_get_summary (priv->comp, &text); if (!text.value) { if (!send_component_prompt_subject ((GtkWindow *) editor, priv->client, priv->comp)) return; } - close_dialog (editor); + close_dialog (editor); } break; @@ -421,6 +422,7 @@ comp_editor_init (CompEditor *editor) priv->existing_org = FALSE; priv->user_org = FALSE; priv->warned = FALSE; + priv->is_group_item = FALSE; gtk_window_set_type_hint (GTK_WINDOW (editor), GDK_WINDOW_TYPE_HINT_NORMAL); } @@ -578,6 +580,31 @@ comp_editor_get_user_org (CompEditor *editor) return priv->user_org; } +void +comp_editor_set_group_item (CompEditor *editor, gboolean group_item) +{ + CompEditorPrivate *priv; + + g_return_if_fail (editor != NULL); + g_return_if_fail (IS_COMP_EDITOR (editor)); + + priv = editor->priv; + + priv->is_group_item = group_item; +} + +gboolean +comp_editor_get_is_group_item (CompEditor *editor) +{ + CompEditorPrivate *priv; + + g_return_val_if_fail (editor != NULL, FALSE); + g_return_val_if_fail (IS_COMP_EDITOR (editor), FALSE); + + priv = editor->priv; + + return priv->is_group_item; +} /** * comp_editor_set_changed: @@ -861,7 +888,7 @@ comp_editor_get_e_cal (CompEditor *editor) /* Creates an appropriate title for the event editor dialog */ static char * -make_title_from_comp (ECalComponent *comp) +make_title_from_comp (ECalComponent *comp, gboolean is_group_item) { char *title; const char *type_string; @@ -874,10 +901,16 @@ make_title_from_comp (ECalComponent *comp) type = e_cal_component_get_vtype (comp); switch (type) { case E_CAL_COMPONENT_EVENT: - type_string = _("Appointment - %s"); + if (is_group_item) + type_string = _("Meeting - %s"); + else + type_string = _("Appointment - %s"); break; case E_CAL_COMPONENT_TODO: - type_string = _("Task - %s"); + if (is_group_item) + type_string = _("Assigned Task - %s"); + else + type_string = _("Task - %s"); break; case E_CAL_COMPONENT_JOURNAL: type_string = _("Journal entry - %s"); @@ -899,7 +932,7 @@ make_title_from_comp (ECalComponent *comp) /* Creates an appropriate title for the event editor dialog */ static char * -make_title_from_string (ECalComponent *comp, const char *str) +make_title_from_string (ECalComponent *comp, const char *str, gboolean is_group_item) { char *title; const char *type_string; @@ -911,10 +944,16 @@ make_title_from_string (ECalComponent *comp, const char *str) type = e_cal_component_get_vtype (comp); switch (type) { case E_CAL_COMPONENT_EVENT: - type_string = _("Appointment - %s"); + if (is_group_item) + type_string = _("Meeting - %s"); + else + type_string = _("Appointment - %s"); break; case E_CAL_COMPONENT_TODO: - type_string = _("Task - %s"); + if (is_group_item) + type_string = _("Assigned Task - %s"); + else + type_string = _("Task - %s"); break; case E_CAL_COMPONENT_JOURNAL: type_string = _("Journal entry - %s"); @@ -962,7 +1001,7 @@ set_title_from_comp (CompEditor *editor) char *title; priv = editor->priv; - title = make_title_from_comp (priv->comp); + title = make_title_from_comp (priv->comp, priv->is_group_item); gtk_window_set_title (GTK_WINDOW (editor), title); g_free (title); } @@ -974,7 +1013,7 @@ set_title_from_string (CompEditor *editor, const char *str) char *title; priv = editor->priv; - title = make_title_from_string (priv->comp, str); + title = make_title_from_string (priv->comp, str, priv->is_group_item); gtk_window_set_title (GTK_WINDOW (editor), title); g_free (title); } |