diff options
author | Chenthill Palanisamy <pchen@src.gnome.org> | 2005-09-29 21:02:56 +0800 |
---|---|---|
committer | Chenthill Palanisamy <pchen@src.gnome.org> | 2005-09-29 21:02:56 +0800 |
commit | d097ac6883dab98ffe326299f7293062573433f8 (patch) | |
tree | dec701b00faadb4b2f2aeeb1232561717a5a96ce /calendar/gui | |
parent | 4dddf579f7e114957c38a8df0903c1476e79c267 (diff) | |
download | gsoc2013-evolution-d097ac6883dab98ffe326299f7293062573433f8.tar gsoc2013-evolution-d097ac6883dab98ffe326299f7293062573433f8.tar.gz gsoc2013-evolution-d097ac6883dab98ffe326299f7293062573433f8.tar.bz2 gsoc2013-evolution-d097ac6883dab98ffe326299f7293062573433f8.tar.lz gsoc2013-evolution-d097ac6883dab98ffe326299f7293062573433f8.tar.xz gsoc2013-evolution-d097ac6883dab98ffe326299f7293062573433f8.tar.zst gsoc2013-evolution-d097ac6883dab98ffe326299f7293062573433f8.zip |
Fixes #317014
svn path=/trunk/; revision=30418
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/comp-editor-factory.c | 8 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor-page.h | 1 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor.h | 1 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-editor.c | 10 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-editor.h | 4 | ||||
-rw-r--r-- | calendar/gui/e-calendar-table.c | 17 | ||||
-rw-r--r-- | calendar/gui/e-tasks.c | 5 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.c | 5 | ||||
-rw-r--r-- | calendar/gui/tasks-component.c | 8 |
9 files changed, 41 insertions, 18 deletions
diff --git a/calendar/gui/comp-editor-factory.c b/calendar/gui/comp-editor-factory.c index ea6507ad06..6a69cb48c9 100644 --- a/calendar/gui/comp-editor-factory.c +++ b/calendar/gui/comp-editor-factory.c @@ -267,20 +267,20 @@ edit_existing (OpenClient *oc, const char *uid) /* Create the appropriate type of editor */ vtype = e_cal_component_get_vtype (comp); + if (itip_organizer_is_user (comp, oc->client)) + flags |= COMP_EDITOR_USER_ORG; + switch (vtype) { case E_CAL_COMPONENT_EVENT: if (e_cal_component_has_attendees (comp)) flags |= COMP_EDITOR_MEETING; - if (itip_organizer_is_user (comp, oc->client)) - flags |= COMP_EDITOR_USER_ORG; - editor = COMP_EDITOR (event_editor_new (oc->client, flags)); break; case E_CAL_COMPONENT_TODO: - editor = COMP_EDITOR (task_editor_new (oc->client, e_cal_component_has_attendees (comp))); + editor = COMP_EDITOR (task_editor_new (oc->client, flags)); break; default: diff --git a/calendar/gui/dialogs/comp-editor-page.h b/calendar/gui/dialogs/comp-editor-page.h index 72a8f057a2..9da69da076 100644 --- a/calendar/gui/dialogs/comp-editor-page.h +++ b/calendar/gui/dialogs/comp-editor-page.h @@ -48,6 +48,7 @@ typedef enum { COMP_EDITOR_PAGE_MEETING = 1<<1, COMP_EDITOR_PAGE_DELEGATE = 1<<2, COMP_EDITOR_PAGE_USER_ORG = 1<<3, + COMP_EDITOR_PAGE_IS_ASSIGNED = 1<<4, } CompEditorPageFlags; typedef struct { diff --git a/calendar/gui/dialogs/comp-editor.h b/calendar/gui/dialogs/comp-editor.h index 3ce43fa825..31f977e3ff 100644 --- a/calendar/gui/dialogs/comp-editor.h +++ b/calendar/gui/dialogs/comp-editor.h @@ -59,6 +59,7 @@ typedef enum { COMP_EDITOR_MEETING = 1<<1, COMP_EDITOR_DELEGATE = 1<<2, COMP_EDITOR_USER_ORG = 1<<3, + COMP_EDITOR_IS_ASSIGNED = 1<<4, } CompEditorFlags; GtkType comp_editor_get_type (void); diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c index 4a393f6bf8..85ddbabbc4 100644 --- a/calendar/gui/dialogs/task-editor.c +++ b/calendar/gui/dialogs/task-editor.c @@ -122,14 +122,13 @@ task_editor_init (TaskEditor *te) } TaskEditor * -task_editor_construct (TaskEditor *te, ECal *client, gboolean is_assigned) +task_editor_construct (TaskEditor *te, ECal *client) { TaskEditorPrivate *priv; gboolean read_only = FALSE; priv = te->priv; - priv->is_assigned = is_assigned; priv->task_page = task_page_new (); g_object_ref (priv->task_page); gtk_object_sink (GTK_OBJECT (priv->task_page)); @@ -356,12 +355,15 @@ task_editor_finalize (GObject *object) * editor could not be created. **/ TaskEditor * -task_editor_new (ECal *client, gboolean is_assigned) +task_editor_new (ECal *client, CompEditorFlags flags) { TaskEditor *te; te = g_object_new (TYPE_TASK_EDITOR, NULL); - return task_editor_construct (te, client, is_assigned); + te->priv->is_assigned = flags & COMP_EDITOR_IS_ASSIGNED; + comp_editor_set_flags (COMP_EDITOR (te), flags); + + return task_editor_construct (te, client); } static void diff --git a/calendar/gui/dialogs/task-editor.h b/calendar/gui/dialogs/task-editor.h index d1b8b327d5..a8134829ae 100644 --- a/calendar/gui/dialogs/task-editor.h +++ b/calendar/gui/dialogs/task-editor.h @@ -53,8 +53,8 @@ struct _TaskEditorClass { GtkType task_editor_get_type (void); TaskEditor *task_editor_construct (TaskEditor *te, - ECal *client, gboolean is_assigned); -TaskEditor *task_editor_new (ECal *client, gboolean is_assigned); + ECal *client); +TaskEditor *task_editor_new (ECal *client, CompEditorFlags flags); void task_editor_show_assignment(TaskEditor *te); diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c index 71eaec8193..6ea5514f45 100644 --- a/calendar/gui/e-calendar-table.c +++ b/calendar/gui/e-calendar-table.c @@ -938,6 +938,7 @@ e_calendar_table_open_task (ECalendarTable *cal_table, ECalModelComponent *comp_ { CompEditor *tedit; const char *uid; + guint32 flags = 0; uid = icalcomponent_get_uid (comp_data->icalcomp); @@ -945,17 +946,25 @@ e_calendar_table_open_task (ECalendarTable *cal_table, ECalModelComponent *comp_ if (tedit == NULL) { ECalComponent *comp; - tedit = COMP_EDITOR (task_editor_new (comp_data->client, assign)); - comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp)); + + if (assign) { + flags |= COMP_EDITOR_IS_ASSIGNED; + + if (itip_organizer_is_user (comp, comp_data->client) || + !e_cal_component_has_attendees (comp)) + flags |= COMP_EDITOR_USER_ORG; + } + + tedit = COMP_EDITOR (task_editor_new (comp_data->client, flags)); comp_editor_edit_comp (tedit, comp); - if (assign) + + if (flags & COMP_EDITOR_IS_ASSIGNED) task_editor_show_assignment (TASK_EDITOR (tedit)); e_comp_editor_registry_add (comp_editor_registry, tedit, FALSE); } - comp_editor_focus (tedit); } diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c index 98b86d929f..dc6401d330 100644 --- a/calendar/gui/e-tasks.c +++ b/calendar/gui/e-tasks.c @@ -952,6 +952,7 @@ e_tasks_new_task (ETasks *tasks) ECalComponent *comp; const char *category; ECal *ecal; + guint32 flags = 0; g_return_if_fail (E_IS_TASKS (tasks)); @@ -962,12 +963,14 @@ e_tasks_new_task (ETasks *tasks) if (!ecal) return; + flags |= COMP_EDITOR_NEW_ITEM | COMP_EDITOR_USER_ORG; + comp = cal_comp_task_new_with_defaults (ecal); category = cal_search_bar_get_category (CAL_SEARCH_BAR (priv->search_bar)); e_cal_component_set_categories (comp, category); - tedit = task_editor_new (ecal, FALSE); + tedit = task_editor_new (ecal, flags); comp_editor_edit_comp (COMP_EDITOR (tedit), comp); g_object_unref (comp); diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index e72b96bf53..e0e68fb723 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -2924,18 +2924,19 @@ gnome_calendar_new_task (GnomeCalendar *gcal) ECalComponent *comp; icalcomponent *icalcomp; const char *category; + guint32 flags = 0; g_return_if_fail (gcal != NULL); g_return_if_fail (GNOME_IS_CALENDAR (gcal)); priv = gcal->priv; - model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo)); ecal = e_cal_model_get_default_client (model); if (!ecal) return; - tedit = task_editor_new (ecal, FALSE); + flags |= COMP_EDITOR_NEW_ITEM; + tedit = task_editor_new (ecal, flags); icalcomp = e_cal_model_create_component_with_defaults (model); comp = e_cal_component_new (); diff --git a/calendar/gui/tasks-component.c b/calendar/gui/tasks-component.c index 4cd9994a32..cecab0726d 100644 --- a/calendar/gui/tasks-component.c +++ b/calendar/gui/tasks-component.c @@ -909,6 +909,7 @@ create_new_todo (TasksComponent *task_component, gboolean is_assigned, TasksComp TasksComponentPrivate *priv; ECalComponent *comp; TaskEditor *editor; + guint32 flags = 0; priv = task_component->priv; @@ -916,7 +917,12 @@ create_new_todo (TasksComponent *task_component, gboolean is_assigned, TasksComp if (!ecal) return FALSE; - editor = task_editor_new (ecal, is_assigned); + if (is_assigned) + flags |= COMP_EDITOR_IS_ASSIGNED; + + flags |= COMP_EDITOR_NEW_ITEM | COMP_EDITOR_USER_ORG; + + editor = task_editor_new (ecal, flags); comp = cal_comp_task_new_with_defaults (ecal); comp_editor_edit_comp (COMP_EDITOR (editor), comp); |