From dfb396395e6ee5e847a82f8ad1d78fabb2628f9f Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Sat, 17 Mar 2001 02:29:29 +0000 Subject: New function: inits the BonoboPersistFile server. 2001-03-07 Miguel de Icaza * gui/control-factory.c (calendar_persist_init): New function: inits the BonoboPersistFile server. * gui/GNOME_Evolution_Calendar.oaf.in: Added BonoboPropertyBag to the list of supported interfaces that were supported but not reported. Add the new PersistFile. Add text/calendar mime type attribute. svn path=/trunk/; revision=8771 --- calendar/gui/control-factory.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'calendar/gui/control-factory.c') diff --git a/calendar/gui/control-factory.c b/calendar/gui/control-factory.c index 678870da91..c00e10d35a 100644 --- a/calendar/gui/control-factory.c +++ b/calendar/gui/control-factory.c @@ -158,6 +158,33 @@ control_factory_init (void) g_error ("I could not register a Calendar control factory."); } +static int +load_calendar (BonoboPersistFile *pf, const CORBA_char *filename, CORBA_Environment *ev, void *closure) +{ + GnomeCalendar *gcal = closure; + + calendar_set_uri (gcal, filename); + + return 0; +} + +static int +save_calendar (BonoboPersistFile *pf, const CORBA_char *filename, CORBA_Environment *ev, void *closure) +{ + /* Do not know how to save stuff yet */ + return -1; +} + +void +calendar_persist_init (GnomeCalendar *gcal, BonoboControl *control) +{ + BonoboPersistFile *f; + + f = bonobo_persist_file_new (load_calendar, save_calendar, gcal); + bonobo_object_add_interface ( + BONOBO_OBJECT (control), + BONOBO_OBJECT (f)); +} BonoboControl * control_factory_new_control (void) @@ -178,7 +205,8 @@ control_factory_new_control (void) } calendar_properties_init (gcal, control); - + calendar_persist_init (gcal, control); + gtk_signal_connect (GTK_OBJECT (control), "activate", GTK_SIGNAL_FUNC (control_activate_cb), gcal); -- cgit v1.2.3