aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/gnome-cal.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-01-20 00:41:40 +0800
committerMilan Crha <mcrha@src.gnome.org>2009-01-20 00:41:40 +0800
commitfa2e93cedc1396a3e323c3a4a1bfdfee8ac3bf53 (patch)
tree2d817af9437b0f47477aee12947446d1fbce191c /calendar/gui/gnome-cal.c
parent324f78272ffa32c943600918a90a032ba94272dc (diff)
downloadgsoc2013-evolution-fa2e93cedc1396a3e323c3a4a1bfdfee8ac3bf53.tar.gz
gsoc2013-evolution-fa2e93cedc1396a3e323c3a4a1bfdfee8ac3bf53.tar.zst
gsoc2013-evolution-fa2e93cedc1396a3e323c3a4a1bfdfee8ac3bf53.zip
** Fix for bug #567850
2009-01-19 Milan Crha <mcrha@redhat.com> ** Fix for bug #567850 * gui/e-cal-model.h: (e_cal_model_set_default_time_func): * gui/e-cal-model.c: (struct _ECalModelPrivate), (ecm_append_row), (e_cal_model_set_default_time_func): New functionality to retrieve a default time for a model's new event created from a "click-to-add" row. * gui/gnome-cal.c: (gc_get_default_time), (setup_widgets): Set the new time callback for the memo table. svn path=/trunk/; revision=37100
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r--calendar/gui/gnome-cal.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index c2b1cb3d6c..782d1b76cb 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -1595,6 +1595,20 @@ gnome_calendar_get_tag (GnomeCalendar *gcal)
return GTK_WIDGET (gcal->priv->date_navigator);
}
+static time_t
+gc_get_default_time (ECalModel *model, gpointer user_data)
+{
+ GnomeCalendar *gcal = user_data;
+ time_t res = 0, end;
+
+ g_return_val_if_fail (model != NULL, 0);
+ g_return_val_if_fail (GNOME_IS_CALENDAR (user_data), 0);
+
+ gnome_calendar_get_current_time_range (gcal, &res, &end);
+
+ return res;
+}
+
static void
setup_widgets (GnomeCalendar *gcal)
{
@@ -1821,6 +1835,8 @@ setup_widgets (GnomeCalendar *gcal)
"MemoPad", NULL);
e_memo_table_load_state (E_MEMO_TABLE (priv->memo), filename);
+ e_cal_model_set_default_time_func (e_memo_table_get_model (E_MEMO_TABLE (priv->memo)), gc_get_default_time, gcal);
+
update_memo_view (gcal);
g_free (filename);