diff options
author | JP Rosevear <jpr@ximian.com> | 2003-11-17 09:20:38 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2003-11-17 09:20:38 +0800 |
commit | 4daa7491aad977c5fa705076e3ca9b80e51b3ab5 (patch) | |
tree | 10eea8608e62b3c212da4fd17dda0fb1976cb66e | |
parent | 2bc14e22e9a7964cc73e6551acfe935f6f4d1b8f (diff) | |
download | gsoc2013-evolution-4daa7491aad977c5fa705076e3ca9b80e51b3ab5.tar.gz gsoc2013-evolution-4daa7491aad977c5fa705076e3ca9b80e51b3ab5.tar.zst gsoc2013-evolution-4daa7491aad977c5fa705076e3ca9b80e51b3ab5.zip |
add a uri
2003-11-16 JP Rosevear <jpr@ximian.com>
* gui/tasks-control.c (tasks_control_set_property): add a uri
* gui/e-tasks.c: kill e_tasks_open
* gui/e-tasks.h: remove proto
svn path=/trunk/; revision=23376
-rw-r--r-- | calendar/ChangeLog | 8 | ||||
-rw-r--r-- | calendar/gui/e-tasks.c | 66 | ||||
-rw-r--r-- | calendar/gui/e-tasks.h | 2 | ||||
-rw-r--r-- | calendar/gui/tasks-control.c | 3 |
4 files changed, 10 insertions, 69 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index a09b76a9a9..725e9445dd 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,5 +1,13 @@ 2003-11-16 JP Rosevear <jpr@ximian.com> + * gui/tasks-control.c (tasks_control_set_property): add a uri + + * gui/e-tasks.c: kill e_tasks_open + + * gui/e-tasks.h: remove proto + +2003-11-16 JP Rosevear <jpr@ximian.com> + * gui/e-cal-model.c (e_cal_view_objects_added_cb): emit the added signal for the correct rows diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c index ae915e49e2..e7b60ed8aa 100644 --- a/calendar/gui/e-tasks.c +++ b/calendar/gui/e-tasks.c @@ -698,72 +698,6 @@ set_status_message (ETasks *tasks, const char *message) e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->tasks_view), message); } -gboolean -e_tasks_open (ETasks *tasks, - char *file) -{ -#if 0 - ETasksPrivate *priv; - char *message; - EUri *uri; - char *real_uri; - char *urinopwd; - ECalModel *model; - GError *error = NULL; - - g_return_val_if_fail (tasks != NULL, FALSE); - g_return_val_if_fail (E_IS_TASKS (tasks), FALSE); - g_return_val_if_fail (file != NULL, FALSE); - - priv = tasks->priv; - - uri = e_uri_new (file); - if (!uri || !g_strncasecmp (uri->protocol, "file", 4)) - real_uri = g_concat_dir_and_file (file, "tasks.ics"); - else - real_uri = g_strdup (file); - - urinopwd = get_uri_without_password (real_uri); - message = g_strdup_printf (_("Opening tasks at %s"), urinopwd); - set_status_message (tasks, message); - g_free (message); - g_free (urinopwd); - - /* create the ECal */ - priv->client = e_cal_new (real_uri, CALOBJ_TYPE_TODO); - if (!priv->client) - return FALSE; - - g_signal_connect (priv->client, "cal_opened", - G_CALLBACK (cal_opened_cb), tasks); - g_signal_connect (priv->client, "backend_error", - G_CALLBACK (backend_error_cb), tasks); - g_signal_connect (priv->client, "categories_changed", - G_CALLBACK (client_categories_changed_cb), tasks); - g_signal_connect (priv->client, "obj_updated", - G_CALLBACK (client_obj_updated_cb), tasks); - - model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view)); - g_assert (model != NULL); - - e_cal_model_add_client (model, priv->client); - - if (e_cal_open (priv->client, FALSE, &error)) { - g_message ("e_tasks_open(): %s", error->message); - g_free (real_uri); - e_uri_free (uri); - g_error_free (error); - - return FALSE; - } - - g_free (real_uri); - e_uri_free (uri); -#endif - return TRUE; -} - - /* Displays an error to indicate that loading a calendar failed */ static void load_error (ETasks *tasks, diff --git a/calendar/gui/e-tasks.h b/calendar/gui/e-tasks.h index 276149107f..10e79ef8c3 100644 --- a/calendar/gui/e-tasks.h +++ b/calendar/gui/e-tasks.h @@ -64,8 +64,6 @@ GtkWidget *e_tasks_new (void); void e_tasks_set_ui_component (ETasks *tasks, BonoboUIComponent *ui_component); -gboolean e_tasks_open (ETasks *tasks, - char *file); gboolean e_tasks_add_todo_uri (ETasks *tasks, const char *str_uri); gboolean e_tasks_remove_todo_uri (ETasks *tasks, const char *str_uri); gboolean e_tasks_set_default_uri (ETasks *tasks, const char *str_uri); diff --git a/calendar/gui/tasks-control.c b/calendar/gui/tasks-control.c index 8264393573..d046ac3283 100644 --- a/calendar/gui/tasks-control.c +++ b/calendar/gui/tasks-control.c @@ -192,8 +192,9 @@ tasks_control_set_property (BonoboPropertyBag *bag, switch (arg_id) { case TASKS_CONTROL_PROPERTY_URI_IDX: + /* FIXME Remove the old uri? */ uri = BONOBO_ARG_GET_STRING (arg); - if (!e_tasks_open (tasks, uri)) { + if (!e_tasks_add_todo_uri (tasks, uri)) { char *msg; msg = g_strdup_printf (_("Could not load the tasks in `%s'"), uri); |