aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-calendar-table.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@ximian.com>2001-07-03 12:21:37 +0800
committerDamon Chaplin <damon@src.gnome.org>2001-07-03 12:21:37 +0800
commit642d32d63f226cd1ba049a9d979132e1a1cef94d (patch)
treebe4ef8fb72ca41391007554a6cbe97af41533555 /calendar/gui/e-calendar-table.c
parentbacd3a85a434032316b3e63b95282175ce2b0659 (diff)
downloadgsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.tar.gz
gsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.tar.zst
gsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.zip
cal-client/cal-client.[hc] cal-util/cal-component.c
2001-07-03 Damon Chaplin <damon@ximian.com> * cal-client/cal-client.[hc] * cal-util/cal-component.c * cal-util/cal-recur.[hc] * cal-util/test-recur.c * cal-util/timeutil.c * gui/calendar-config.c * gui/calendar-model.[hc] * gui/comp-util.[hc] * gui/e-calendar-table.c * gui/e-day-view-main-item.c * gui/e-day-view-top-item.c * gui/e-day-view.[hc] * gui/e-itip-control.c * gui/e-timezone-entry.[hc] * gui/e-week-view.[hc] * gui/gnome-cal.[hc] * gui/goto.c * gui/tag-calendar.[hc] * gui/dialogs/cal-prefs-dialog.c * gui/dialogs/comp-editor-page.[hc] * gui/dialogs/comp-editor-util.[hc] * gui/dialogs/comp-editor.c * gui/dialogs/e-timezone-dialog.[hc] * gui/dialogs/event-page.c * gui/dialogs/meeting-page.c * gui/dialogs/recurrence-page.c * gui/dialogs/task-details-page.c * gui/dialogs/task-details-page.glade * gui/dialogs/task-page.c * idl/evolution-calendar.idl * pcs/cal-backend-file.c * pcs/cal-backend.c * pcs/cal-backend.h * pcs/cal.c * pcs/query.c: timezone changes everywhere. There's still quite a few things to update, and its not working well at present. svn path=/trunk/; revision=10729
Diffstat (limited to 'calendar/gui/e-calendar-table.c')
-rw-r--r--calendar/gui/e-calendar-table.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c
index 931c721dd4..9f5726b01e 100644
--- a/calendar/gui/e-calendar-table.c
+++ b/calendar/gui/e-calendar-table.c
@@ -40,6 +40,7 @@
#include <gal/e-table/e-cell-combo.h>
#include <widgets/misc/e-cell-date-edit.h>
#include "e-calendar-table.h"
+#include "calendar-config.h"
#include "calendar-model.h"
#include "dialogs/delete-comp.h"
#include "dialogs/task-editor.h"
@@ -107,6 +108,8 @@ static void selection_get (GtkWidget *invisible,
ECalendarTable *cal_table);
static void invisible_destroyed (GtkWidget *invisible,
ECalendarTable *cal_table);
+static struct tm e_calendar_table_get_current_time (ECellDateEdit *ecde,
+ gpointer data);
/* The icons to represent the task. */
@@ -396,6 +399,10 @@ e_calendar_table_init (ECalendarTable *cal_table)
e_table_extras_add_cell (extras, "dateedit", popup_cell);
cal_table->dates_cell = E_CELL_DATE_EDIT (popup_cell);
+ e_cell_date_edit_set_get_time_callback (E_CELL_DATE_EDIT (popup_cell),
+ e_calendar_table_get_current_time,
+ cal_table, NULL);
+
/*
* Combo fields.
@@ -1281,3 +1288,33 @@ selection_received (GtkWidget *invisible,
gtk_object_unref (GTK_OBJECT (comp));
}
}
+
+
+/* Returns the current time, for the ECellDateEdit items.
+ FIXME: Should probably use the timezone of the item rather than the
+ current timezone, though that may be difficult to get from here. */
+static struct tm
+e_calendar_table_get_current_time (ECellDateEdit *ecde, gpointer data)
+{
+ char *location;
+ icaltimezone *zone;
+ struct tm tmp_tm = { 0 };
+ struct icaltimetype tt;
+
+ /* Get the current timezone. */
+ location = calendar_config_get_timezone ();
+ zone = icaltimezone_get_builtin_timezone (location);
+
+ tt = icaltime_from_timet_with_zone (time (NULL), FALSE, zone);
+
+ /* Now copy it to the struct tm and return it. */
+ tmp_tm.tm_year = tt.year - 1900;
+ tmp_tm.tm_mon = tt.month - 1;
+ tmp_tm.tm_mday = tt.day;
+ tmp_tm.tm_hour = tt.hour;
+ tmp_tm.tm_min = tt.minute;
+ tmp_tm.tm_sec = tt.second;
+ tmp_tm.tm_isdst = -1;
+
+ return tmp_tm;
+}