aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/ChangeLog12
-rw-r--r--calendar/gui/e-day-view.c41
-rw-r--r--calendar/gui/e-week-view.c39
3 files changed, 90 insertions, 2 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 018d148ba9..43e9008dfc 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,15 @@
+2005-07-21 Chenthill Palanisamy <pchenthill@novell.com>
+
+ Fixes #309602
+ * gui/e-day-view.c: (set_text_as_bold),
+ (e_day_view_update_event_label),
+ (e_day_view_update_long_event_label),
+ (e_day_view_ensure_rows_visible):
+ * gui/e-week-view.c: (set_text_as_bold),
+ (e_week_view_update_event_cb): Check if the backend
+ allows to adding the unaccepted appointments to calendar
+ and show its summary as bold text.
+
2005-07-21 Harish Krishnaswamy <kharish@novell.com>
* gui/gnome-cal.c (gnome_calendar_class_init),
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index bfe848103a..c429f5771f 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -1752,6 +1752,38 @@ e_day_view_remove_event_cb (EDayView *day_view,
return TRUE;
}
+/* Checks if the users participation status is Needs action and shows the summary as bold text*/
+static void
+set_text_as_bold (EDayViewEvent *event)
+{
+ ECalComponent *comp;
+ char *address;
+ GSList *attendees, *l;
+ ECalComponentAttendee *at = NULL;
+
+ comp = e_cal_component_new ();
+ e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
+ address = itip_get_comp_attendee (comp, event->comp_data->client);
+ e_cal_component_get_attendee_list (comp, &attendees);
+
+ for (l = attendees; l; l = l->next) {
+ ECalComponentAttendee *attendee = l->data;
+
+ if (g_str_equal (itip_strip_mailto (attendee->value), address)) {
+ at = attendee;
+ break;
+ }
+ }
+
+ /* The attendee has not yet accepted the meeting, display the summary as bolded */
+ if (at && (at->status == ICAL_PARTSTAT_NEEDSACTION)) {
+ gnome_canvas_item_set (event->canvas_item, "bold", TRUE, NULL);
+ }
+
+ e_cal_component_free_attendee_list (attendees);
+ g_object_unref (comp);
+ g_free (address);
+}
/* This updates the text shown for an event. If the event start or end do not
lie on a row boundary, the time is displayed before the summary. */
@@ -1847,6 +1879,10 @@ e_day_view_update_event_label (EDayView *day_view,
"text", text,
NULL);
+ if (e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING)
+ && e_cal_util_component_has_attendee (event->comp_data->icalcomp))
+ set_text_as_bold (event);
+
if (free_text)
g_free (text);
}
@@ -1870,6 +1906,10 @@ e_day_view_update_long_event_label (EDayView *day_view,
gnome_canvas_item_set (event->canvas_item,
"text", summary ? summary : "",
NULL);
+
+ if (e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING)
+ && e_cal_util_component_has_attendee (event->comp_data->icalcomp))
+ set_text_as_bold (event);
}
@@ -5613,7 +5653,6 @@ e_day_view_ensure_rows_visible (EDayView *day_view,
}
}
-
static void
e_day_view_start_editing_event (EDayView *day_view,
gint day,
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index f41de4baba..68997cc5c1 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -1805,6 +1805,38 @@ e_week_view_recalc_display_start_day (EWeekView *week_view)
return FALSE;
}
+/* Checks if the users participation status is Needs action and shows the summary as bold text*/
+static void
+set_text_as_bold (EWeekViewEvent *event, EWeekViewEventSpan *span)
+{
+ ECalComponent *comp;
+ char *address;
+ GSList *attendees, *l;
+ ECalComponentAttendee *at = NULL;
+
+ comp = e_cal_component_new ();
+ e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
+ address = itip_get_comp_attendee (comp, event->comp_data->client);
+ e_cal_component_get_attendee_list (comp, &attendees);
+
+ for (l = attendees; l; l = l->next) {
+ ECalComponentAttendee *attendee = l->data;
+
+ if (g_str_equal (itip_strip_mailto (attendee->value), address)) {
+ at = attendee;
+ break;
+ }
+ }
+
+ /* The attendee has not yet accepted the meeting, display the summary as bolded */
+ if (at && (at->status == ICAL_PARTSTAT_NEEDSACTION)) {
+ gnome_canvas_item_set (span->text_item, "bold", TRUE, NULL);
+ }
+
+ e_cal_component_free_attendee_list (attendees);
+ g_object_unref (comp);
+ g_free (address);
+}
static gboolean
e_week_view_update_event_cb (EWeekView *week_view,
@@ -1839,7 +1871,7 @@ e_week_view_update_event_cb (EWeekView *week_view,
}
}
g_signal_emit_by_name (G_OBJECT(week_view),
- "event_changed", event);
+ "event_changed", event);
return TRUE;
@@ -2634,6 +2666,11 @@ e_week_view_reshape_event_span (EWeekView *week_view,
"fill_color_gdk", &widget->style->text[GTK_STATE_NORMAL],
"im_context", E_CANVAS (week_view->main_canvas)->im_context,
NULL);
+
+ if (e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING)
+ && e_cal_util_component_has_attendee (event->comp_data->icalcomp)) {
+ set_text_as_bold (event, span);
+ }
g_signal_connect (span->text_item, "event",
G_CALLBACK (e_week_view_on_text_item_event),