diff --git a/capplets/sound/ChangeLog b/capplets/sound/ChangeLog index 0b7b08c9a..6317f579a 100644 --- a/capplets/sound/ChangeLog +++ b/capplets/sound/ChangeLog @@ -1,3 +1,8 @@ +2007-05-06 Jens Granseuer + + * sound-properties-capplet.c: (create_dialog), (main): don't crash if + glade file is not available + 2007-05-06 Jens Granseuer * sound-properties-capplet.c: (create_dialog): diff --git a/capplets/sound/sound-properties-capplet.c b/capplets/sound/sound-properties-capplet.c index bfc255599..cf8037bb9 100644 --- a/capplets/sound/sound-properties-capplet.c +++ b/capplets/sound/sound-properties-capplet.c @@ -163,6 +163,9 @@ create_dialog (void) GtkWidget *widget, *box, *view, *image; dialog = glade_xml_new (GNOMECC_GLADE_DIR "/sound-properties.glade", "sound_prefs_dialog", NULL); + if (dialog == NULL) + return NULL; + widget = glade_xml_get_widget (dialog, "sound_prefs_dialog"); props = sound_properties_new (); @@ -1013,7 +1016,7 @@ int main (int argc, char **argv) { GConfChangeSet *changeset; - GladeXML *dialog = NULL; + GladeXML *dialog; GnomeProgram *program; GOptionContext *context; gboolean apply_only = FALSE; @@ -1058,20 +1061,23 @@ main (int argc, char **argv) if (get_legacy) { get_legacy_settings (); } else { - changeset = gconf_change_set_new (); dialog = create_dialog (); - setup_dialog (dialog, changeset); - setup_devices (); - dialog_win = WID ("sound_prefs_dialog"); - g_signal_connect (dialog_win, "response", G_CALLBACK (dialog_response_cb), changeset); - g_signal_connect (dialog_win, "destroy", G_CALLBACK (gtk_main_quit), NULL); - capplet_set_icon (dialog_win, "gnome-settings-sound"); - gtk_widget_show (dialog_win); + if (dialog) { + changeset = gconf_change_set_new (); + setup_dialog (dialog, changeset); + setup_devices (); - gtk_main (); - gconf_change_set_unref (changeset); - g_object_unref (dialog); + dialog_win = WID ("sound_prefs_dialog"); + g_signal_connect (dialog_win, "response", G_CALLBACK (dialog_response_cb), changeset); + g_signal_connect (dialog_win, "destroy", G_CALLBACK (gtk_main_quit), NULL); + capplet_set_icon (dialog_win, "gnome-settings-sound"); + gtk_widget_show (dialog_win); + + gtk_main (); + gconf_change_set_unref (changeset); + g_object_unref (dialog); + } } g_object_unref (gconf_client);