From 8d99fd960e5ffa6a032f6d5bb33efa9ef3298d33 Mon Sep 17 00:00:00 2001 From: Bradford Hovinen Date: Mon, 23 Jul 2001 22:58:32 +0000 Subject: [PATCH] Set InvalidValue exception if the program could not resolve the moniker 2001-07-23 Bradford Hovinen * capplet-util.c (set_moniker_cb): Set InvalidValue exception if the program could not resolve the moniker * capplet-dir.c (capplet_control_launch): Put up an error dialog and abort the process if the capplet reports an error trying to resolve its moniker --- capplets/common/ChangeLog | 4 ++-- capplets/common/capplet-util.c | 6 ++++-- control-center/ChangeLog | 6 ++++++ control-center/capplet-dir.c | 14 ++++++++++++-- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/capplets/common/ChangeLog b/capplets/common/ChangeLog index a971bb3a5..bf0196bd5 100644 --- a/capplets/common/ChangeLog +++ b/capplets/common/ChangeLog @@ -1,7 +1,7 @@ 2001-07-23 Bradford Hovinen - * capplet-util.c (set_moniker_cb): Put up error dialog if we could - not resolve the configuration moniker + * capplet-util.c (set_moniker_cb): Set InvalidValue exception if + the program could not resolve the moniker 2001-07-20 Chema Celorio diff --git a/capplets/common/capplet-util.c b/capplets/common/capplet-util.c index 6a5b95e73..c3f76171b 100644 --- a/capplets/common/capplet-util.c +++ b/capplets/common/capplet-util.c @@ -124,8 +124,10 @@ set_moniker_cb (BonoboPropertyBag *bag, BonoboArg *arg, guint arg_id, pf = BONOBO_PROPERTY_FRAME (bonobo_control_get_widget (control)); bonobo_property_frame_set_moniker (pf, full_moniker); - if (pf->proxy->bag == CORBA_OBJECT_NIL) - gnome_error_dialog ("Could not load your configuration settings."); + if (pf->proxy->bag == CORBA_OBJECT_NIL) { + bonobo_exception_set (ev, ex_Bonobo_Property_InvalidValue); + return; + } proxy = BONOBO_OBJREF (pf->proxy); diff --git a/control-center/ChangeLog b/control-center/ChangeLog index 049ab4bbf..1f20ad9ce 100644 --- a/control-center/ChangeLog +++ b/control-center/ChangeLog @@ -1,3 +1,9 @@ +2001-07-23 Bradford Hovinen + + * capplet-dir.c (capplet_control_launch): Put up an error dialog + and abort the process if the capplet reports an error trying to + resolve its moniker + 2001-07-20 Chema Celorio * RELEASE : 1.5.0 diff --git a/control-center/capplet-dir.c b/control-center/capplet-dir.c index 0373be85a..d7ffae99f 100644 --- a/control-center/capplet-dir.c +++ b/control-center/capplet-dir.c @@ -480,9 +480,19 @@ capplet_control_launch (const gchar *capplet_name, gchar *window_title) } else { gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (app)->vbox), control, TRUE, TRUE, 0); - bonobo_widget_set_property (BONOBO_WIDGET (control), "moniker", moniker, NULL); + bonobo_widget_set_property (BONOBO_WIDGET (control), "moniker", moniker, &ev); - gtk_widget_show_all (app); + if (BONOBO_EX (&ev)) { + GtkWidget *dialog; + + dialog = gnome_error_dialog ("Could not load your configuration settings."); + gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); + gtk_widget_destroy (app); + g_free (moniker); + app = NULL; + } else { + gtk_widget_show_all (app); + } } gnome_dialog_button_connect (GNOME_DIALOG (app), 0, GTK_SIGNAL_FUNC (capplet_ok_cb), app);