diff options
author | Federico Mena Quintero <federico@ximian.com> | 2001-09-05 10:52:52 +0800 |
---|---|---|
committer | Federico Mena Quintero <federico@src.gnome.org> | 2001-09-05 10:52:52 +0800 |
commit | 7f6f7e52113103e38dbb27aef10c1ffc25f269ec (patch) | |
tree | f34fb410189e6dedb8a2bcfcf079b85151dcdc84 /calendar/gui/alarm-notify | |
parent | bc21d949ca1a3a1eb0fc5dd735411030c01c6b79 (diff) | |
download | gsoc2013-evolution-7f6f7e52113103e38dbb27aef10c1ffc25f269ec.tar gsoc2013-evolution-7f6f7e52113103e38dbb27aef10c1ffc25f269ec.tar.gz gsoc2013-evolution-7f6f7e52113103e38dbb27aef10c1ffc25f269ec.tar.bz2 gsoc2013-evolution-7f6f7e52113103e38dbb27aef10c1ffc25f269ec.tar.lz gsoc2013-evolution-7f6f7e52113103e38dbb27aef10c1ffc25f269ec.tar.xz gsoc2013-evolution-7f6f7e52113103e38dbb27aef10c1ffc25f269ec.tar.zst gsoc2013-evolution-7f6f7e52113103e38dbb27aef10c1ffc25f269ec.zip |
Implemented.
2001-09-04 Federico Mena Quintero <federico@ximian.com>
* gui/component-factory.c (sc_user_create_new_item_cb):
Implemented.
* gui/main.c (component_editor_factory_init): New function to
create the factory for the comp_editor_factory.
* gui/comp-editor-factory.c: Finished implementation.
* gui/alarm-notify/alarm-queue.c (edit_component): Implemented the
Edit command.
* gui/Makefile.am (evolution_calendar_SOURCES): Added
comp-editor-factory.[ch] to the list of sources.
svn path=/trunk/; revision=12619
Diffstat (limited to 'calendar/gui/alarm-notify')
-rw-r--r-- | calendar/gui/alarm-notify/alarm-queue.c | 52 |
1 files changed, 51 insertions, 1 deletions
diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index b12eca317d..a2035c8b61 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -28,6 +28,8 @@ #include <libgnome/gnome-defs.h> #include <libgnome/gnome-i18n.h> #include <gtk/gtksignal.h> +#include <liboaf/liboaf.h> +#include <bonobo/bonobo-object.h> #include <cal-util/timeutil.h> #include "alarm.h" #include "alarm-notify-dialog.h" @@ -491,6 +493,54 @@ create_snooze (CompQueuedAlarms *cqa, gpointer alarm_id, int snooze_mins) cqa->queued_alarms = g_slist_prepend (cqa->queued_alarms, qa); } +/* Launches a component editor for a component */ +static void +edit_component (CompQueuedAlarms *cqa) +{ + CalComponent *comp; + const char *uid; + const char *uri; + CORBA_Environment ev; + GNOME_Evolution_Calendar_CompEditorFactory factory; + + comp = cqa->alarms->comp; + cal_component_get_uid (comp, &uid); + + uri = cal_client_get_uri (cqa->parent_client->client); + + /* Get the factory */ + + CORBA_exception_init (&ev); + factory = oaf_activate_from_id ("OAFIID:GNOME_Evolution_Calendar_CompEditorFactory", + 0, NULL, &ev); + + if (ev._major != CORBA_NO_EXCEPTION) { + g_message ("edit_component(): Could not activate the component editor factory"); + CORBA_exception_free (&ev); + return; + } + CORBA_exception_free (&ev); + + /* Edit the component */ + + CORBA_exception_init (&ev); + GNOME_Evolution_Calendar_CompEditorFactory_editExisting (factory, uri, (char *) uid, &ev); + + if (ev._major != CORBA_NO_EXCEPTION) + g_message ("edit_component(): Exception while editing the component"); + + CORBA_exception_free (&ev); + + /* Get rid of the factory */ + + CORBA_exception_init (&ev); + bonobo_object_release_unref (factory, &ev); + if (ev._major != CORBA_NO_EXCEPTION) + g_message ("edit_component(): Could not unref the calendar component factory"); + + CORBA_exception_free (&ev); +} + struct notify_dialog_closure { CompQueuedAlarms *cqa; gpointer alarm_id; @@ -510,7 +560,7 @@ notify_dialog_cb (AlarmNotifyResult result, int snooze_mins, gpointer data) break; case ALARM_NOTIFY_EDIT: - /* FIXME */ + edit_component (c->cqa); break; case ALARM_NOTIFY_CLOSE: |