X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fgtkmathview-bonobo%2Ftest%2Fmain.c;h=41ec0a9fe4f3472587c4fd10494e54f8213c278b;hb=db8c9ea3c96097b03d522f0c8b54aa7da214e5e4;hp=d0d646a946086e3e23bab8cebb6accf3adfcdb6b;hpb=3ac183ee3dd4eea25d61bd4c5be4f7db9f829a7e;p=helm.git diff --git a/helm/gtkmathview-bonobo/test/main.c b/helm/gtkmathview-bonobo/test/main.c index d0d646a94..41ec0a9fe 100644 --- a/helm/gtkmathview-bonobo/test/main.c +++ b/helm/gtkmathview-bonobo/test/main.c @@ -17,6 +17,18 @@ struct FileSelectionInfo { static struct FileSelectionInfo file_selection_info = { NULL, NULL }; +static void +load_through_persist_file (const gchar *filename, + Bonobo_PersistFile pfile) +{ + CORBA_Environment ev; + CORBA_exception_init (&ev); + Bonobo_PersistFile_load (pfile, filename, &ev); + if (ev._major != CORBA_NO_EXCEPTION) + g_warning ("Cannot load."); + CORBA_exception_free (&ev); +} + static void file_selection_ok_cb (GtkWidget *widget, gpointer data) @@ -39,8 +51,7 @@ file_selection_ok_cb (GtkWidget *widget, else { const gchar *fname = gtk_file_selection_get_filename (GTK_FILE_SELECTION (file_selection_info.widget)); - /* load_through_persist_file (fname, interface); */ - /* todo */ + load_through_persist_file (fname, interface); } gtk_widget_destroy (file_selection_info.widget); @@ -205,8 +216,7 @@ load_file (const gchar *fname) interface = Bonobo_Unknown_queryInterface (bonobo_widget_get_objref (BONOBO_WIDGET (control)), "IDL:Bonobo/PersistFile:1.0", &ev); CORBA_exception_free (&ev); - /* load_through_persist_file (fname, interface); */ - /* TODO */ + load_through_persist_file (fname, interface); return FALSE; }