[evolution-patches] UI HACKFEST: patch for showing the summary as bolded text for unaccepted meetings
- From: chenthill <pchenthill novell com>
- To: "evolution-patches lists ximian com" <evolution-patches lists ximian com>
- Subject: [evolution-patches] UI HACKFEST: patch for showing the summary as bolded text for unaccepted meetings
- Date: Thu, 21 Jul 2005 18:37:35 +0530
Hi,
Since unaccepted accepted meetings appear only for groupwise calendars, have added a static capability for the same.
thanks, chenthill.
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2774
diff -u -p -r1.2774 ChangeLog
--- ChangeLog 21 Jul 2005 11:54:48 -0000 1.2774
+++ ChangeLog 21 Jul 2005 12:51:52 -0000
@@ -1,3 +1,14 @@
+2005-07-21 Chenthill Palanisamy <pchenthill novell com>
+
+ * 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),
Index: gui/e-day-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-day-view.c,v
retrieving revision 1.279
diff -u -p -r1.279 e-day-view.c
--- gui/e-day-view.c 27 Jun 2005 00:43:07 -0000 1.279
+++ gui/e-day-view.c 21 Jul 2005 12:51:56 -0000
@@ -1752,6 +1752,38 @@ e_day_view_remove_event_cb (EDayView *da
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
"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 (EDay
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);
}
@@ -5612,7 +5652,6 @@ e_day_view_ensure_rows_visible (EDayView
gtk_adjustment_value_changed (adj);
}
}
-
static void
e_day_view_start_editing_event (EDayView *day_view,
Index: gui/e-week-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-week-view.c,v
retrieving revision 1.244
diff -u -p -r1.244 e-week-view.c
--- gui/e-week-view.c 23 Jun 2005 09:11:05 -0000 1.244
+++ gui/e-week-view.c 21 Jul 2005 12:51:57 -0000
@@ -1805,6 +1805,38 @@ e_week_view_recalc_display_start_day (EW
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 *
}
}
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 (EWeekVie
"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),
Index: libecal/e-cal-util.h
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/libecal/e-cal-util.h,v
retrieving revision 1.12
diff -u -p -r1.12 e-cal-util.h
--- libecal/e-cal-util.h 8 Jul 2005 11:04:19 -0000 1.12
+++ libecal/e-cal-util.h 21 Jul 2005 12:56:32 -0000
@@ -128,6 +128,7 @@ gboolean e_cal_util_event_dates_match (i
#define CAL_STATIC_CAPABILITY_DELEGATE_SUPPORTED "delegate-support"
#define CAL_STATIC_CAPABILITY_NO_ORGANIZER "no-organizer"
#define CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY "delegate-to-many"
+#define CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING "has-unaccepted-meeting"
/* Recurrent events. Management for instances */
icalcomponent *e_cal_util_construct_instance (icalcomponent *icalcomp,
Index: backends/groupwise/e-cal-backend-groupwise.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/backends/groupwise/e-cal-backend-groupwise.c,v
retrieving revision 1.157
diff -u -p -r1.157 e-cal-backend-groupwise.c
--- backends/groupwise/e-cal-backend-groupwise.c 19 Jul 2005 14:21:46 -0000 1.157
+++ backends/groupwise/e-cal-backend-groupwise.c 21 Jul 2005 12:56:32 -0000
@@ -1006,6 +1006,7 @@ e_cal_backend_groupwise_get_static_capab
CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY "," \
CAL_STATIC_CAPABILITY_NO_ORGANIZER "," \
CAL_STATIC_CAPABILITY_RECURRENCES_NO_MASTER "," \
+ CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING "," \
CAL_STATIC_CAPABILITY_SAVE_SCHEDULES);
return GNOME_Evolution_Calendar_Success;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]