[evolution-patches] patch to enable the calendar selector menu for tasks



hi,
    This patch enables to view the selector menu (in the mail component)
 for the tasks also. This is there for calendar events, so included a
small function so that tasks and calendar can share the same. ref
#59983.

thanks, chenthill.

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2466
diff -u -r1.2466 ChangeLog
--- ChangeLog	30 Jul 2004 12:43:21 -0000	1.2466
+++ ChangeLog	2 Aug 2004 08:51:21 -0000
@@ -1,3 +1,13 @@
+2004-08-02 Chenthill Palanisamy <pchenthill novell com>
+
+	* gui/e-itip-control.c
+	(to_select_menu): added a function to check for the
participation 
+	status of the attendee and display the menu for selecting the 
+	calendar, if the e_cal component is already present and used it 
+       	for tasks and events.
+	(show_current_event), (show_current_todo): added to_select_menu
+	in both these functions.
+
 2004-07-30  Harish Krishnaswamy  <kharish novell com>
 	
 	* gui/e-tasks.c: (client_cal_opened_cb),
Index: gui/e-itip-control.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-itip-control.c,v
retrieving revision 1.155
diff -u -r1.155 e-itip-control.c
--- gui/e-itip-control.c	26 Jul 2004 12:07:04 -0000	1.155
+++ gui/e-itip-control.c	2 Aug 2004 08:51:21 -0000
@@ -1190,12 +1190,52 @@
 	}
 }
 
+static gboolean
+to_select_menu (EItipControl *itip)
+{	
+	EItipControlPrivate *priv;
+
+	priv = itip->priv;
+
+	if (priv->current_ecal) {
+		ECalComponentAttendee *attendee= NULL, *tmp;
+		GList *attendee_list, *l;
+		
+		e_cal_component_get_attendee_list (priv->comp,
&attendee_list);
+		if (priv->my_address == NULL)
+			find_my_address (itip, priv->ical_comp);
+		g_assert (priv->my_address != NULL);
+	
+		for (l = attendee_list; l ; l = g_slist_next (l)) {
+			tmp = (ECalComponentAttendee *) (l->data);
+			if (!strcmp (tmp->value + 7, priv->my_address))
{
+				attendee = tmp;
+				break;
+			}
+		 }
+		if (attendee) {
+			switch (attendee->status) {
+				case ICAL_PARTSTAT_ACCEPTED: 
+				case ICAL_PARTSTAT_DECLINED:
+				case ICAL_PARTSTAT_TENTATIVE:
+					return FALSE;
+					
+				/* otherwise it must be needs action */			
+				default:
+					return TRUE;
+			}
+		}
+	} else
+		return TRUE;
+}
+
 static void
 show_current_event (EItipControl *itip)
 {
 	EItipControlPrivate *priv;
 	const gchar *itip_title, *itip_desc;
 	char *options;
+	gboolean include_selector;
 
 	priv = itip->priv;
 
@@ -1217,37 +1257,8 @@
 		else
 			itip_desc = _("<b>%s</b> requests your presence
at a meeting.");
 		itip_title = _("Meeting Proposal");
-		if (priv->current_ecal) {
-			ECalComponentAttendee *attendee= NULL, *tmp;
-			GList *attendee_list, *l;
-			
-			e_cal_component_get_attendee_list (priv->comp,
&attendee_list);
-			if (priv->my_address == NULL)
-				find_my_address (itip, priv->ical_comp);
-			g_assert (priv->my_address != NULL);
-	
-			for (l = attendee_list; l ; l = g_slist_next
(l)) {
-				tmp = (ECalComponentAttendee *)
(l->data);
-				if (!strcmp (tmp->value + 7,
priv->my_address)) {
-					attendee = tmp;
-					break;
-				}
-			 }
-			if (attendee) {
-				switch (attendee->status) {
-					case ICAL_PARTSTAT_ACCEPTED: 
-					case ICAL_PARTSTAT_DECLINED:
-					case ICAL_PARTSTAT_TENTATIVE:
-						options =
get_request_options (FALSE);
-						break;
-
-					/* otherwise it must be needs
action */			
-					default:
-						options =
get_request_options (TRUE);
-				}
-			}
-		} else
-			options = get_request_options (TRUE);
+		include_selector = to_select_menu (itip);
+		options = get_request_options (include_selector);
 		break;
 	case ICAL_METHOD_ADD:
 		itip_desc = _("<b>%s</b> wishes to add to an existing
meeting.");
@@ -1294,6 +1305,7 @@
 	EItipControlPrivate *priv;
 	const gchar *itip_title, *itip_desc;
 	char *options;
+	gboolean include_selector;
 
 	priv = itip->priv;
 
@@ -1315,7 +1327,8 @@
 		else
 			itip_desc = _("<b>%s</b> requests you perform a
task.");
 		itip_title = _("Task Proposal");
-		options = get_request_options (priv->current_ecal ?
FALSE : TRUE);
+		include_selector = to_select_menu (itip);
+		options = get_request_options (include_selector);
 		break;
 	case ICAL_METHOD_ADD:
 		itip_desc = _("<b>%s</b> wishes to add to an existing
task.");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]