diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-09-19 07:50:56 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-09-19 07:53:17 +0800 |
commit | b1926eb6d4f695b6877b08bfc2618fe91e546d90 (patch) | |
tree | d64bb466bc7ab7d4c2ce303b9a89ceefd6d1b2f2 /calendar/gui/alarm-notify/alarm-queue.c | |
parent | 01490b5881a0bb28074a37e93abd940a989d593a (diff) | |
download | gsoc2013-evolution-b1926eb6d4f695b6877b08bfc2618fe91e546d90.tar.gz gsoc2013-evolution-b1926eb6d4f695b6877b08bfc2618fe91e546d90.tar.zst gsoc2013-evolution-b1926eb6d4f695b6877b08bfc2618fe91e546d90.zip |
Get "Edit Event" working from the alarm notify window.
This also removes the last remaining piece of Bonobo.
Diffstat (limited to 'calendar/gui/alarm-notify/alarm-queue.c')
-rw-r--r-- | calendar/gui/alarm-notify/alarm-queue.c | 72 |
1 files changed, 31 insertions, 41 deletions
diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index 7793e62d80..5c4959f2c6 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -28,10 +28,6 @@ #include <string.h> #include <glib.h> -#include <bonobo-activation/bonobo-activation.h> -#include <bonobo/bonobo-object.h> -#include <bonobo/bonobo-exception.h> -#include <bonobo/bonobo-main.h> #include <gtk/gtk.h> #include <glib/gi18n.h> #include <canberra-gtk.h> @@ -887,51 +883,45 @@ create_snooze (CompQueuedAlarms *cqa, gpointer alarm_id, gint snooze_mins) static void edit_component (ECal *client, ECalComponent *comp) { -#if 0 /* KILL-BONOBO */ - const gchar *uid; - const gchar *uri; - ECalSourceType source_type; - CORBA_Environment ev; - GNOME_Evolution_Calendar_CompEditorFactory factory; - GNOME_Evolution_Calendar_CompEditorFactory_CompEditorMode corba_type; + ESource *source; + gchar *command_line; + const gchar *scheme; + const gchar *comp_uid; + const gchar *source_uid; + GError *error = NULL; - d(printf("%s:%d (edit_component) - Client %p\n",__FILE__, __LINE__, client)); + /* XXX Don't we have a function to construct these URIs? + * How are other apps expected to know this stuff? */ - e_cal_component_get_uid (comp, &uid); + source = e_cal_get_source (client); + source_uid = e_source_peek_uid (source); - uri = e_cal_get_uri (client); - source_type = e_cal_get_source_type (client); + e_cal_component_get_uid (comp, &comp_uid); - /* Get the factory */ - CORBA_exception_init (&ev); - factory = bonobo_activation_activate_from_id ( - (Bonobo_ActivationID) "OAFIID:GNOME_Evolution_Calendar_CompEditorFactory:" BASE_VERSION, 0, NULL, &ev); - - if (BONOBO_EX (&ev)) { - e_error_run (NULL, "editor-error", bonobo_exception_get_text (&ev), NULL); - CORBA_exception_free (&ev); - return; - } - - /* Edit the component */ - switch (source_type) { - case E_CAL_SOURCE_TYPE_TODO: - corba_type = GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_TODO; - break; - default: - corba_type = GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_EVENT; + switch (e_cal_get_source_type (client)) { + case E_CAL_SOURCE_TYPE_EVENT: + scheme = "calendar:"; + break; + case E_CAL_SOURCE_TYPE_TODO: + scheme = "task:"; + break; + case E_CAL_SOURCE_TYPE_JOURNAL: + scheme = "memo:"; + break; + default: + g_return_if_reached (); } - GNOME_Evolution_Calendar_CompEditorFactory_editExisting (factory, uri, (gchar *) uid, corba_type, &ev); + command_line = g_strdup_printf ( + "%s %s///?source-uid=%s&comp-uid=%s", + PACKAGE, scheme, source_uid, comp_uid); - if (BONOBO_EX (&ev)) - e_error_run (NULL, "editor-error", bonobo_exception_get_text (&ev), NULL); - - CORBA_exception_free (&ev); + if (!g_spawn_command_line_async (command_line, &error)) { + g_critical ("%s", error->message); + g_error_free (error); + } - /* Get rid of the factory */ - bonobo_object_release_unref (factory, NULL); -#endif + g_free (command_line); } typedef struct { |