[evolution-patches] [Calendar] Bug #205804 Calendar Additional Timezone view in Tool tip



Hi all,
Modified code and submitting the patch,.

Chen, thanks for ur comments

with regards,
Rajeev


Yahoo! Photos ? Showcase holiday pictures in hardcover
Photo Books. You design it and we?ll bind it!
Index: calendar/gui/e-calendar-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-calendar-view.c,v
retrieving revision 1.108
diff -u -p -r1.108 e-calendar-view.c
--- calendar/gui/e-calendar-view.c	2 Jan 2006 14:12:39 -0000	1.108
+++ calendar/gui/e-calendar-view.c	15 Jan 2006 22:02:30 -0000
@@ -1898,6 +1898,7 @@ get_label (struct icaltimetype *tt)
  * 	Organiser: NameOfTheUser<email ofuser com>
  * 	Location: PlaceOfTheMeeting
  * 	Time : DateAndTime (xx Minutes)
+ *      Timezone : TimezoneoftheLocation
  */
 
 gboolean
@@ -1917,8 +1918,8 @@ e_calendar_view_get_tooltips (ECalendarV
 	g_free (data);
 
 	ECalComponent *newcomp = e_cal_component_new ();
-	icaltimezone *zone;
-
+	icaltimezone *zone, *default_zone,*new_zone;
+	
 	clone_comp = icalcomponent_new_clone (pevent->comp_data->icalcomp);
 	if (!e_cal_component_set_icalcomponent (newcomp, clone_comp))
 		g_warning ("couldn't update calendar component with modified data from backend\n");
@@ -1996,7 +1997,7 @@ e_calendar_view_get_tooltips (ECalendarV
 		zone = NULL;
 	}
 	t_end = icaltime_as_timet_with_zone (*dtend.value, zone);
-		
+	
 	tmp1 = get_label(dtstart.value);
 	tmp = calculate_time (t_start, t_end);
 	
@@ -2011,7 +2012,25 @@ e_calendar_view_get_tooltips (ECalendarV
 	g_free (tmp);
 	g_free (tmp2);
 	g_free (tmp1);
-
+	
+	default_zone = calendar_config_get_icaltimezone ();
+	if(dtstart.tzid){
+		if(strcmp(icaltimezone_get_tzid(default_zone),dtstart.tzid)!=0)
+		{
+			new_zone=icaltimezone_get_builtin_timezone_from_tzid(dtstart.tzid);
+			tmp1 = icaltimezone_get_display_name(new_zone);
+			tmp2 = g_strdup_printf(_("Timezone:%s "), tmp1);
+			hbox = gtk_hbox_new (FALSE, 0);
+			gtk_box_pack_start ((GtkBox *)hbox, gtk_label_new_with_mnemonic (tmp2), FALSE, FALSE, 0);
+			ebox = gtk_event_box_new ();
+			gtk_container_add ((GtkContainer *)ebox, hbox);
+			gtk_box_pack_start ((GtkBox *)box, ebox, FALSE, FALSE, 0);
+				
+			g_free (tmp2);
+			g_free(tmp1);
+		}
+	}
+	
 	pevent->tooltip = gtk_window_new (GTK_WINDOW_POPUP);
 	frame = gtk_frame_new (NULL);
 	gtk_frame_set_shadow_type ((GtkFrame *)frame, GTK_SHADOW_IN);


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