aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2004-01-06 02:28:04 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2004-01-06 02:28:04 +0800
commit222ffe3a377d085079a8c69457bef3a6a1523241 (patch)
tree36d4967e19f34c1727d379a708a36bc72f143184 /calendar/gui
parent4261a67f4a81d66ec336516eddc3fd0dd8124a9d (diff)
downloadgsoc2013-evolution-222ffe3a377d085079a8c69457bef3a6a1523241.tar
gsoc2013-evolution-222ffe3a377d085079a8c69457bef3a6a1523241.tar.gz
gsoc2013-evolution-222ffe3a377d085079a8c69457bef3a6a1523241.tar.bz2
gsoc2013-evolution-222ffe3a377d085079a8c69457bef3a6a1523241.tar.lz
gsoc2013-evolution-222ffe3a377d085079a8c69457bef3a6a1523241.tar.xz
gsoc2013-evolution-222ffe3a377d085079a8c69457bef3a6a1523241.tar.zst
gsoc2013-evolution-222ffe3a377d085079a8c69457bef3a6a1523241.zip
display the tasks' primary selection in the task list, and actually open
2004-01-05 Rodrigo Moya <rodrigo@ximian.com> * gui/gnome-cal.c (gnome_calendar_construct): display the tasks' primary selection in the task list, and actually open the tasks folder. svn path=/trunk/; revision=24048
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/gnome-cal.c42
1 files changed, 31 insertions, 11 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index a836047e90..e6a4cd3fd4 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -2023,6 +2023,7 @@ gnome_calendar_construct (GnomeCalendar *gcal)
{
GnomeCalendarPrivate *priv;
GnomeCalendarViewType view_type;
+ char *uid;
g_return_val_if_fail (gcal != NULL, NULL);
g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), NULL);
@@ -2032,18 +2033,37 @@ gnome_calendar_construct (GnomeCalendar *gcal)
/*
* TaskPad Folder Client.
*/
- priv->task_pad_client = auth_new_cal_from_uri ("", E_CAL_SOURCE_TYPE_TODO); /* FIXME: use default tasks */
- if (!priv->task_pad_client)
- return NULL;
+ uid = calendar_config_get_primary_tasks ();
+ if (uid) {
+ ESourceList *source_list;
+ GConfClient *conf_client;
+
+ conf_client = gconf_client_get_default ();
+ source_list = e_source_list_new_for_gconf (conf_client, "/apps/evolution/tasks/sources");
+
+ priv->task_pad_client = auth_new_cal_from_source (
+ e_source_list_peek_source_by_uid (source_list, uid), E_CAL_SOURCE_TYPE_TODO);
+
+ g_object_unref (conf_client);
+ g_object_unref (source_list);
- g_signal_connect (priv->task_pad_client, "cal_opened",
- G_CALLBACK (client_cal_opened_cb), gcal);
- g_signal_connect (priv->task_pad_client, "backend_error",
- G_CALLBACK (backend_error_cb), gcal);
- g_signal_connect (priv->task_pad_client, "categories_changed",
- G_CALLBACK (client_categories_changed_cb), gcal);
- g_signal_connect (priv->task_pad_client, "backend_died",
- G_CALLBACK (backend_died_cb), gcal);
+ if (!priv->task_pad_client)
+ return NULL;
+
+ g_signal_connect (priv->task_pad_client, "cal_opened",
+ G_CALLBACK (client_cal_opened_cb), gcal);
+ g_signal_connect (priv->task_pad_client, "backend_error",
+ G_CALLBACK (backend_error_cb), gcal);
+ g_signal_connect (priv->task_pad_client, "categories_changed",
+ G_CALLBACK (client_categories_changed_cb), gcal);
+ g_signal_connect (priv->task_pad_client, "backend_died",
+ G_CALLBACK (backend_died_cb), gcal);
+
+ g_free (uid);
+
+ if (!e_cal_open (priv->task_pad_client, TRUE, NULL))
+ return NULL;
+ }
/* Get the default view to show. */
view_type = calendar_config_get_default_view ();