Index: gedit/dialogs/gedit-page-setup-dialog.c =================================================================== RCS file: /cvs/gnome/gedit/gedit/dialogs/gedit-page-setup-dialog.c,v retrieving revision 1.8.2.3 diff -u -r1.8.2.3 gedit-page-setup-dialog.c --- gedit/dialogs/gedit-page-setup-dialog.c 11 Sep 2005 20:55:46 -0000 1.8.2.3 +++ gedit/dialogs/gedit-page-setup-dialog.c 23 Sep 2005 10:57:03 -0000 @@ -35,7 +35,6 @@ #include #include -#include #include #include @@ -482,8 +481,9 @@ page_setup_get_dialog (GtkWindow *parent) { static GeditPageSetupDialog *dialog = NULL; - GladeXML *gui; - + GtkWidget *error_widget; + gboolean ret; + gedit_debug (DEBUG_PRINT); if (dialog != NULL) @@ -495,62 +495,36 @@ return dialog; } - gui = glade_xml_new (GEDIT_GLADEDIR "page-setup-dialog.glade2", - "dialog", NULL); - if (!gui) - { - gedit_warning (parent, - MISSING_FILE, - GEDIT_GLADEDIR "page-setup-dialog.glade2"); - return NULL; - } - dialog = g_new0 (GeditPageSetupDialog, 1); - dialog->dialog = glade_xml_get_widget (gui, "dialog"); - - dialog->syntax_checkbutton = glade_xml_get_widget (gui, "syntax_checkbutton"); - dialog->page_header_checkbutton = glade_xml_get_widget (gui, "page_header_checkbutton"); - - dialog->line_numbers_checkbutton = glade_xml_get_widget (gui, "line_numbers_checkbutton"); - dialog->line_numbers_hbox = glade_xml_get_widget (gui, "line_numbers_hbox"); - dialog->line_numbers_spinbutton = glade_xml_get_widget (gui, "line_numbers_spinbutton"); - - dialog->text_wrapping_checkbutton = glade_xml_get_widget (gui, "text_wrapping_checkbutton"); - dialog->do_not_split_checkbutton = glade_xml_get_widget (gui, "do_not_split_checkbutton"); - - dialog->fonts_table = glade_xml_get_widget (gui, "fonts_table"); - - dialog->body_font_label = glade_xml_get_widget (gui, "body_font_label"); - dialog->headers_font_label = glade_xml_get_widget (gui, "headers_font_label"); - dialog->numbers_font_label = glade_xml_get_widget (gui, "numbers_font_label"); - - dialog->restore_button = glade_xml_get_widget (gui, "restore_button"); - - if (!dialog->dialog || - !dialog->syntax_checkbutton || - !dialog->page_header_checkbutton || - !dialog->line_numbers_checkbutton || - !dialog->line_numbers_hbox || - !dialog->line_numbers_spinbutton || - !dialog->text_wrapping_checkbutton || - !dialog->do_not_split_checkbutton || - !dialog->fonts_table || - !dialog->body_font_label || - !dialog->headers_font_label || - !dialog->numbers_font_label || - !dialog->restore_button) + ret = gedit_utils_get_glade_widgets (GEDIT_GLADEDIR "page-setup-dialog.glade2", + "dialog", + &error_widget, + "dialog", &dialog->dialog, + "syntax_checkbutton", &dialog->syntax_checkbutton, + "page_header_checkbutton", &dialog->page_header_checkbutton, + "line_numbers_checkbutton", &dialog->line_numbers_checkbutton, + "line_numbers_hbox", &dialog->line_numbers_hbox, + "line_numbers_spinbutton", &dialog->line_numbers_spinbutton, + "text_wrapping_checkbutton", &dialog->text_wrapping_checkbutton, + "do_not_split_checkbutton", &dialog->do_not_split_checkbutton, + "fonts_table", &dialog->fonts_table, + "body_font_label", &dialog->body_font_label, + "headers_font_label", &dialog->headers_font_label, + "numbers_font_label", &dialog->numbers_font_label, + "restore_button", &dialog->restore_button, + NULL); + + if (!ret) { gedit_warning (parent, - MISSING_WIDGETS, - GEDIT_GLADEDIR "page-setup-dialog.glade2"); + gtk_label_get_label (GTK_LABEL (error_widget))); if (!dialog->dialog) gtk_widget_destroy (dialog->dialog); - - g_object_unref (gui); + g_free (dialog); - dialog = NULL; + gtk_widget_destroy (error_widget); return NULL; } @@ -567,12 +541,9 @@ g_signal_connect (G_OBJECT (dialog->dialog), "response", G_CALLBACK (dialog_response_handler), dialog); - g_object_unref (gui); - gtk_window_set_resizable (GTK_WINDOW (dialog->dialog), FALSE); return dialog; - } void