diff options
author | Iain Holmes <iain@src.gnome.org> | 2001-09-20 04:29:29 +0800 |
---|---|---|
committer | Iain Holmes <iain@src.gnome.org> | 2001-09-20 04:29:29 +0800 |
commit | 11c1a83ffcae03776ff109e6ac085c1975af4b29 (patch) | |
tree | af9d26fdf558eebb6a6eae5c56d6cfd2f108c733 | |
parent | cfe4b2026b5711caa63aaacce433a368e31adebb (diff) | |
download | gsoc2013-evolution-11c1a83ffcae03776ff109e6ac085c1975af4b29.tar gsoc2013-evolution-11c1a83ffcae03776ff109e6ac085c1975af4b29.tar.gz gsoc2013-evolution-11c1a83ffcae03776ff109e6ac085c1975af4b29.tar.bz2 gsoc2013-evolution-11c1a83ffcae03776ff109e6ac085c1975af4b29.tar.lz gsoc2013-evolution-11c1a83ffcae03776ff109e6ac085c1975af4b29.tar.xz gsoc2013-evolution-11c1a83ffcae03776ff109e6ac085c1975af4b29.tar.zst gsoc2013-evolution-11c1a83ffcae03776ff109e6ac085c1975af4b29.zip |
Open editors for tasks and appointments
svn path=/trunk/; revision=12986
-rw-r--r-- | my-evolution/ChangeLog | 9 | ||||
-rw-r--r-- | my-evolution/e-summary-calendar.c | 36 | ||||
-rw-r--r-- | my-evolution/e-summary-tasks.c | 38 |
3 files changed, 77 insertions, 6 deletions
diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog index 21d40bdd8d..c6896838ff 100644 --- a/my-evolution/ChangeLog +++ b/my-evolution/ChangeLog @@ -1,3 +1,12 @@ +2001-09-19 Iain Holmes <iain@ximian.com> + + * e-summary-tasks.c (e_summary_tasks_protocol): Open a task editor. + (generate_html): Embed the uid of the task in the url. + + * e-summary-calendar.c (e_summary_calendar_protocol): Open a calendar + editor. + (generate_html): Embed the uid of the task in the url. + 2001-09-19 Larry Ewing <lewing@ximian.com> * e-summary-rdf.c (read_callback): remove redundant if. diff --git a/my-evolution/e-summary-calendar.c b/my-evolution/e-summary-calendar.c index 85c14546b0..d06496209b 100644 --- a/my-evolution/e-summary-calendar.c +++ b/my-evolution/e-summary-calendar.c @@ -22,6 +22,8 @@ #include <bonobo/bonobo-moniker-util.h> #include <bonobo-conf/bonobo-config-database.h> +#include <liboaf/liboaf.h> + struct _ESummaryCalendar { CalClient *client; @@ -40,6 +42,7 @@ e_summary_calendar_get_html (ESummary *summary) } typedef struct { + char *uid; CalComponent *comp; CalComponentDateTime dt; icaltimezone *zone; @@ -80,6 +83,7 @@ uids_to_array (ESummary *summary, event = g_new (ESummaryCalEvent, 1); + event->uid = g_strdup (p->data); status = cal_client_get_object (client, p->data, &event->comp); if (status != CAL_CLIENT_GET_SUCCESS) { g_free (event); @@ -113,6 +117,7 @@ free_event_array (GPtrArray *array) ESummaryCalEvent *event; event = array->pdata[i]; + g_free (event->uid); gtk_object_unref (GTK_OBJECT (event->comp)); } @@ -203,8 +208,8 @@ generate_html (gpointer data) tmp = g_strdup_printf ("<img align=\"middle\" src=\"new_appointment.xpm\" " "alt=\"\" width=\"16\" height=\"16\">   " - "<font size=\"-1\"><a href=\"evolution:/local/Calendar\">%s, %s</a></font><br>", - start_str, text.value); + "<font size=\"-1\"><a href=\"calendar:/%s\">%s, %s</a></font><br>", + event->uid, start_str, text.value); g_free (start_str); g_string_append (string, tmp); @@ -249,7 +254,34 @@ e_summary_calendar_protocol (ESummary *summary, const char *uri, void *closure) { + ESummaryCalendar *calendar; + CORBA_Environment ev; + const char *comp_uri; + GNOME_Evolution_Calendar_CompEditorFactory factory; + + calendar = (ESummaryCalendar *) closure; + + comp_uri = cal_client_get_uri (calendar->client); + + /* Get the factory */ + CORBA_exception_init (&ev); + factory = oaf_activate_from_id ("OAFIID:GNOME_Evolution_Calendar_CompEditorFactory", 0, NULL, &ev); + if (BONOBO_EX (&ev)) { + g_message ("%d: Could not activate the component editor factory (%s)", __FUNCTION__, + CORBA_exception_id (&ev)); + CORBA_exception_free (&ev); + return; + } + + GNOME_Evolution_Calendar_CompEditorFactory_editExisting (factory, comp_uri, (char *)uri + 10, &ev); + if (BONOBO_EX (&ev)) { + g_message ("%s: Execption while editing the component (%s)", __FUNCTION__, + CORBA_exception_id (&ev)); + } + + CORBA_exception_free (&ev); + bonobo_object_release_unref (factory, NULL); } static gboolean diff --git a/my-evolution/e-summary-tasks.c b/my-evolution/e-summary-tasks.c index a44b0dbae2..5108e909a1 100644 --- a/my-evolution/e-summary-tasks.c +++ b/my-evolution/e-summary-tasks.c @@ -18,6 +18,9 @@ #include <cal-client/cal-client.h> #include <cal-util/timeutil.h> +#include <bonobo/bonobo-exception.h> +#include <liboaf/liboaf.h> + struct _ESummaryTasks { CalClient *client; @@ -248,8 +251,8 @@ generate_html (gpointer data) if (completed == NULL) { tmp = g_strdup_printf ("<img align=\"middle\" src=\"task.xpm\" " "alt=\"\" width=\"16\" height=\"16\">   " - "<font size=\"-1\"><a href=\"evolution:/local/Tasks\">%s</a></font><br>", - text.value ? text.value : _("(No Description)")); + "<font size=\"-1\"><a href=\"tasks:/%s\">%s</a></font><br>", + uid, text.value ? text.value : _("(No Description)")); } else { #if 0 tmp = g_strdup_printf ("<img align=\"middle\" src=\"task.xpm\" " @@ -300,10 +303,37 @@ obj_changed_cb (CalClient *client, static void e_summary_tasks_protocol (ESummary *summary, - const char *uri, - void *closure) + const char *uri, + void *closure) { + ESummaryTasks *tasks; + CORBA_Environment ev; + const char *comp_uri; + GNOME_Evolution_Calendar_CompEditorFactory factory; + + tasks = (ESummaryTasks *) closure; + comp_uri = cal_client_get_uri (tasks->client); + + /* Get the factory */ + CORBA_exception_init (&ev); + factory = oaf_activate_from_id ("OAFIID:GNOME_Evolution_Calendar_CompEditorFactory", 0, NULL, &ev); + if (BONOBO_EX (&ev)) { + g_message ("%d: Could not activate the component editor factory (%s)", __FUNCTION__, + CORBA_exception_id (&ev)); + CORBA_exception_free (&ev); + return; + } + + GNOME_Evolution_Calendar_CompEditorFactory_editExisting (factory, comp_uri, (char *)uri + 7, &ev); + + if (BONOBO_EX (&ev)) { + g_message ("%s: Execption while editing the component (%s)", __FUNCTION__, + CORBA_exception_id (&ev)); + } + + CORBA_exception_free (&ev); + bonobo_object_release_unref (factory, NULL); } void |