don't crash if glade file is not available
2007-05-06 Jens Granseuer <jensgr@gmx.net> * sound-properties-capplet.c: (create_dialog), (main): don't crash if glade file is not available svn path=/trunk/; revision=7561
This commit is contained in:
parent
c40974353b
commit
b21871170d
2 changed files with 23 additions and 12 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2007-05-06 Jens Granseuer <jensgr@gmx.net>
|
||||||
|
|
||||||
|
* sound-properties-capplet.c: (create_dialog), (main): don't crash if
|
||||||
|
glade file is not available
|
||||||
|
|
||||||
2007-05-06 Jens Granseuer <jensgr@gmx.net>
|
2007-05-06 Jens Granseuer <jensgr@gmx.net>
|
||||||
|
|
||||||
* sound-properties-capplet.c: (create_dialog):
|
* sound-properties-capplet.c: (create_dialog):
|
||||||
|
|
|
@ -163,6 +163,9 @@ create_dialog (void)
|
||||||
GtkWidget *widget, *box, *view, *image;
|
GtkWidget *widget, *box, *view, *image;
|
||||||
|
|
||||||
dialog = glade_xml_new (GNOMECC_GLADE_DIR "/sound-properties.glade", "sound_prefs_dialog", NULL);
|
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");
|
widget = glade_xml_get_widget (dialog, "sound_prefs_dialog");
|
||||||
|
|
||||||
props = sound_properties_new ();
|
props = sound_properties_new ();
|
||||||
|
@ -1013,7 +1016,7 @@ int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
GConfChangeSet *changeset;
|
GConfChangeSet *changeset;
|
||||||
GladeXML *dialog = NULL;
|
GladeXML *dialog;
|
||||||
GnomeProgram *program;
|
GnomeProgram *program;
|
||||||
GOptionContext *context;
|
GOptionContext *context;
|
||||||
gboolean apply_only = FALSE;
|
gboolean apply_only = FALSE;
|
||||||
|
@ -1058,20 +1061,23 @@ main (int argc, char **argv)
|
||||||
if (get_legacy) {
|
if (get_legacy) {
|
||||||
get_legacy_settings ();
|
get_legacy_settings ();
|
||||||
} else {
|
} else {
|
||||||
changeset = gconf_change_set_new ();
|
|
||||||
dialog = create_dialog ();
|
dialog = create_dialog ();
|
||||||
setup_dialog (dialog, changeset);
|
|
||||||
setup_devices ();
|
|
||||||
|
|
||||||
dialog_win = WID ("sound_prefs_dialog");
|
if (dialog) {
|
||||||
g_signal_connect (dialog_win, "response", G_CALLBACK (dialog_response_cb), changeset);
|
changeset = gconf_change_set_new ();
|
||||||
g_signal_connect (dialog_win, "destroy", G_CALLBACK (gtk_main_quit), NULL);
|
setup_dialog (dialog, changeset);
|
||||||
capplet_set_icon (dialog_win, "gnome-settings-sound");
|
setup_devices ();
|
||||||
gtk_widget_show (dialog_win);
|
|
||||||
|
|
||||||
gtk_main ();
|
dialog_win = WID ("sound_prefs_dialog");
|
||||||
gconf_change_set_unref (changeset);
|
g_signal_connect (dialog_win, "response", G_CALLBACK (dialog_response_cb), changeset);
|
||||||
g_object_unref (dialog);
|
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);
|
g_object_unref (gconf_client);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue