aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/pcs/cal.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@ximian.com>2001-06-14 14:00:21 +0800
committerDamon Chaplin <damon@src.gnome.org>2001-06-14 14:00:21 +0800
commit4517358debc8bcd761a469e901bae160704deaf2 (patch)
tree0233963c7d4d6a0d256f9a638c1e556f3364ee59 /calendar/pcs/cal.c
parent8089ac1639e1bf714bc8c467b0ad679b491e8088 (diff)
downloadgsoc2013-evolution-4517358debc8bcd761a469e901bae160704deaf2.tar.gz
gsoc2013-evolution-4517358debc8bcd761a469e901bae160704deaf2.tar.zst
gsoc2013-evolution-4517358debc8bcd761a469e901bae160704deaf2.zip
new dialog for setting the time zone.
2001-06-14 Damon Chaplin <damon@ximian.com> * gui/dialogs/e-timezone-dialog.[hc]: * gui/dialogs/e-timezone-dialog.glade: new dialog for setting the time zone. * gui/dialogs/Makefile.am: added timezone dialog files. * idl/evolution-calendar.idl: added CalTimezoneInfo struct and seq, and getBuiltinTimezoneInfo method. * pcs/cal.c (impl_Cal_get_builtin_timezone_info): implemented method. (cal_class_init): added method to epv. * cal-client/cal-client.c (struct CalClientPrivate): added timezone_info array to contain cached info on builtin timezone city names and coordinates. (cal_client_get_builtin_timezone_info): new function to get the info about builtin timezones. * cal-client/cal-client.h: added CalTimezoneInfo struct, to contain the city names and coords of the builtin timezones. svn path=/trunk/; revision=10223
Diffstat (limited to 'calendar/pcs/cal.c')
-rw-r--r--calendar/pcs/cal.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/calendar/pcs/cal.c b/calendar/pcs/cal.c
index 6eb951133b..a76d3a7f38 100644
--- a/calendar/pcs/cal.c
+++ b/calendar/pcs/cal.c
@@ -21,6 +21,7 @@
*/
#include <config.h>
+#include <ical.h>
#include "cal.h"
#include "query.h"
@@ -377,6 +378,46 @@ impl_Cal_get_query (PortableServer_Servant servant,
return query_copy;
}
+/* Cal::getBuiltinTimezoneInfo method */
+static GNOME_Evolution_Calendar_CalTimezoneInfoSeq *
+impl_Cal_get_builtin_timezone_info (PortableServer_Servant servant,
+ CORBA_Environment *ev)
+{
+ GNOME_Evolution_Calendar_CalTimezoneInfoSeq *seq;
+ icalarray *zones;
+ icaltimezone *zone;
+ int n, i;
+ char *location;
+
+ zones = icaltimezone_get_builtin_timezones ();
+ if (!zones) {
+ CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
+ ex_GNOME_Evolution_Calendar_Cal_NotFound,
+ NULL);
+ return CORBA_OBJECT_NIL;
+ }
+
+ n = zones->num_elements;
+
+ seq = GNOME_Evolution_Calendar_CalTimezoneInfoSeq__alloc ();
+ CORBA_sequence_set_release (seq, TRUE);
+ seq->_length = n;
+ seq->_buffer = CORBA_sequence_GNOME_Evolution_Calendar_CalTimezoneInfo_allocbuf (n);
+
+ /* Fill the sequence */
+
+ for (i = 0; i < n; i++) {
+ zone = icalarray_element_at (zones, i);
+ location = icaltimezone_get_location (zone);
+
+ seq->_buffer[i].location = CORBA_string_dup (location);
+ seq->_buffer[i].latitude = icaltimezone_get_latitude (zone);
+ seq->_buffer[i].longitude = icaltimezone_get_longitude (zone);
+ }
+
+ return seq;
+}
+
/**
* cal_construct:
* @cal: A calendar client interface.
@@ -507,6 +548,7 @@ cal_class_init (CalClass *klass)
epv->updateObject = impl_Cal_update_object;
epv->removeObject = impl_Cal_remove_object;
epv->getQuery = impl_Cal_get_query;
+ epv->getBuiltinTimezoneInfo = impl_Cal_get_builtin_timezone_info;
}