diff options
author | Chenthill Palanisamy <pchenthill@novell.com> | 2005-07-25 12:55:59 +0800 |
---|---|---|
committer | Chenthill Palanisamy <pchen@src.gnome.org> | 2005-07-25 12:55:59 +0800 |
commit | be569b6675e0b237beec88b2d2510c6bf68f0e16 (patch) | |
tree | 2fe23821706100a33f41342cd489587a304d18ef | |
parent | 72aa1e526eb622875ccee293451343a377aa2993 (diff) | |
download | gsoc2013-evolution-be569b6675e0b237beec88b2d2510c6bf68f0e16.tar.gz gsoc2013-evolution-be569b6675e0b237beec88b2d2510c6bf68f0e16.tar.zst gsoc2013-evolution-be569b6675e0b237beec88b2d2510c6bf68f0e16.zip |
Added a mask to check if the meeting needs to be accepted. Increased the
2005-07-23 Chenthill Palanisamy <pchenthill@novell.com>
* gui/e-cal-popup.[ch]: (needs_to_accept),
(e_cal_popup_target_new_select): Added a mask
to check if the meeting needs to be accepted.
* gui/e-calendar-view.c: Increased the index of the
labels.
* gui/e-day-view.c: (set_text_as_bold):
* gui/e-week-view.c: (set_text_as_bold): Show as bold
even if the attendee property is not found, since it might
be a mailing list. The attendee will be added once he accepts
meeting.
svn path=/trunk/; revision=29869
-rw-r--r-- | calendar/ChangeLog | 13 | ||||
-rw-r--r-- | calendar/gui/e-cal-popup.c | 36 | ||||
-rw-r--r-- | calendar/gui/e-calendar-view.c | 10 | ||||
-rw-r--r-- | calendar/gui/e-day-view.c | 5 | ||||
-rw-r--r-- | calendar/gui/e-week-view.c | 5 |
5 files changed, 56 insertions, 13 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 3130a1561b..283f3e1322 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,16 @@ +2005-07-23 Chenthill Palanisamy <pchenthill@novell.com> + + * gui/e-cal-popup.[ch]: (needs_to_accept), + (e_cal_popup_target_new_select): Added a mask + to check if the meeting needs to be accepted. + * gui/e-calendar-view.c: Increased the index of the + labels. + * gui/e-day-view.c: (set_text_as_bold): + * gui/e-week-view.c: (set_text_as_bold): Show as bold + even if the attendee property is not found, since it might + be a mailing list. The attendee will be added once he accepts + meeting. + 2005-07-22 Chenthill Palanisamy <pchenthill@novell.com> Fixes #309991 diff --git a/calendar/gui/e-cal-popup.c b/calendar/gui/e-cal-popup.c index 441bad505c..02390d44b9 100644 --- a/calendar/gui/e-cal-popup.c +++ b/calendar/gui/e-cal-popup.c @@ -163,6 +163,28 @@ is_delegated (icalcomponent *icalcomp, char *user_email) return FALSE; } +static gboolean +needs_to_accept (icalcomponent *icalcomp, char *user_email) +{ + icalproperty *prop; + icalparameter *param; + icalparameter_partstat status; + const char *delto = NULL; + + prop = get_attendee_prop (icalcomp, user_email); + + /* It might be a mailing list */ + if (!prop) + return TRUE; + param = icalproperty_get_first_parameter (prop, ICAL_PARTSTAT_PARAMETER); + status = icalparameter_get_partstat (param); + + if (status == ICAL_PARTSTAT_ACCEPTED || status == ICAL_PARTSTAT_TENTATIVE) + return FALSE; + + return TRUE; +} + /** * e_cal_popup_target_new_select: * @eabp: @@ -194,9 +216,11 @@ e_cal_popup_target_new_select(ECalPopup *eabp, struct _ECalModel *model, GPtrArr } else { ECalModelComponent *comp_data = (ECalModelComponent *)t->events->pdata[0]; ECalComponent *comp; + char *user_email = NULL; comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp)); + user_email = itip_get_comp_attendee (comp, client); mask &= ~E_CAL_POPUP_SELECT_ANY; if (t->events->len == 1) @@ -235,16 +259,19 @@ e_cal_popup_target_new_select(ECalPopup *eabp, struct _ECalModel *model, GPtrArr client = comp_data->client; if (e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_DELEGATE_SUPPORTED)) { - char *user_email = itip_get_comp_attendee (comp, client); if (e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY)) mask &= ~E_CAL_POPUP_SELECT_DELEGATABLE; else if (!user_org && !is_delegated (comp_data->icalcomp, user_email)) mask &= ~E_CAL_POPUP_SELECT_DELEGATABLE; - - g_object_unref (comp); - } + + if (e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING) && + needs_to_accept (comp_data->icalcomp, user_email)) + mask &= ~E_CAL_POPUP_SELECT_ACCEPTABLE; + + g_object_unref (comp); + g_free (user_email); } e_cal_is_read_only(client, &read_only, NULL); @@ -380,6 +407,7 @@ static const EPopupHookTargetMask ecalph_select_masks[] = { { "assignable", E_CAL_POPUP_SELECT_ASSIGNABLE }, { "hasurl", E_CAL_POPUP_SELECT_HASURL }, { "delegate", E_CAL_POPUP_SELECT_DELEGATABLE }, + { "accept", E_CAL_POPUP_SELECT_ACCEPTABLE }, { 0 } }; diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index 9b7c75a874..88c1743738 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -1531,11 +1531,11 @@ static EPopupItem ecv_child_items [] = { { E_POPUP_BAR, "40." }, - { E_POPUP_ITEM, "41.copyto", N_("Cop_y to Calendar..."), on_copy_to, NULL, NULL, 0, E_CAL_POPUP_SELECT_NOTEDITING }, - { E_POPUP_ITEM, "42.moveto", N_("Mo_ve to Calendar..."), on_move_to, NULL, NULL, 0, E_CAL_POPUP_SELECT_NOTEDITING | E_CAL_POPUP_SELECT_EDITABLE }, - { E_POPUP_ITEM, "43.delegate", N_("_Delegate Meeting..."), on_delegate, NULL, NULL, 0, E_CAL_POPUP_SELECT_NOTEDITING | E_CAL_POPUP_SELECT_EDITABLE | E_CAL_POPUP_SELECT_DELEGATABLE | E_CAL_POPUP_SELECT_MEETING}, - { E_POPUP_ITEM, "44.schedule", N_("_Schedule Meeting..."), on_meeting, NULL, NULL, 0, E_CAL_POPUP_SELECT_NOTEDITING | E_CAL_POPUP_SELECT_EDITABLE | E_CAL_POPUP_SELECT_NOTMEETING }, - { E_POPUP_ITEM, "45.forward", N_("_Forward as iCalendar..."), on_forward, NULL, "stock_mail-forward", 0, E_CAL_POPUP_SELECT_NOTEDITING }, + { E_POPUP_ITEM, "44.copyto", N_("Cop_y to Calendar..."), on_copy_to, NULL, NULL, 0, E_CAL_POPUP_SELECT_NOTEDITING }, + { E_POPUP_ITEM, "45.moveto", N_("Mo_ve to Calendar..."), on_move_to, NULL, NULL, 0, E_CAL_POPUP_SELECT_NOTEDITING | E_CAL_POPUP_SELECT_EDITABLE }, + { E_POPUP_ITEM, "46.delegate", N_("_Delegate Meeting..."), on_delegate, NULL, NULL, 0, E_CAL_POPUP_SELECT_NOTEDITING | E_CAL_POPUP_SELECT_EDITABLE | E_CAL_POPUP_SELECT_DELEGATABLE | E_CAL_POPUP_SELECT_MEETING}, + { E_POPUP_ITEM, "47.schedule", N_("_Schedule Meeting..."), on_meeting, NULL, NULL, 0, E_CAL_POPUP_SELECT_NOTEDITING | E_CAL_POPUP_SELECT_EDITABLE | E_CAL_POPUP_SELECT_NOTMEETING }, + { E_POPUP_ITEM, "48.forward", N_("_Forward as iCalendar..."), on_forward, NULL, "stock_mail-forward", 0, E_CAL_POPUP_SELECT_NOTEDITING }, { E_POPUP_BAR, "50." }, diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index c429f5771f..0cfcab019c 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -1775,8 +1775,9 @@ set_text_as_bold (EDayViewEvent *event) } } - /* The attendee has not yet accepted the meeting, display the summary as bolded */ - if (at && (at->status == ICAL_PARTSTAT_NEEDSACTION)) { + /* The attendee has not yet accepted the meeting, display the summary as bolded . + If the attendee is not present, it might have come through a mailing list*/ + if (!at || (at->status == ICAL_PARTSTAT_NEEDSACTION)) { gnome_canvas_item_set (event->canvas_item, "bold", TRUE, NULL); } diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index 68997cc5c1..6c3157da5e 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -1828,8 +1828,9 @@ set_text_as_bold (EWeekViewEvent *event, EWeekViewEventSpan *span) } } - /* The attendee has not yet accepted the meeting, display the summary as bolded */ - if (at && (at->status == ICAL_PARTSTAT_NEEDSACTION)) { + /* The attendee has not yet accepted the meeting, display the summary as bolded. + If the attendee is not present, it might have come through a mailing list*/ + if (!at || (at->status == ICAL_PARTSTAT_NEEDSACTION)) { gnome_canvas_item_set (span->text_item, "bold", TRUE, NULL); } |