From c496b59ca8d4323b1a05e00c1cf434e3b0b38b9d Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sun, 21 Jun 2015 12:21:54 +0200 Subject: [PATCH] Missing value dialog: Simplify error dialog. This also avoids the use of deprecated API features. --- src/ui/gui/missing-val-dialog.c | 38 +++++++-------------------------- 1 file changed, 8 insertions(+), 30 deletions(-) diff --git a/src/ui/gui/missing-val-dialog.c b/src/ui/gui/missing-val-dialog.c index 2d38442466..f4077a42ab 100644 --- a/src/ui/gui/missing-val-dialog.c +++ b/src/ui/gui/missing-val-dialog.c @@ -176,39 +176,17 @@ psppire_missing_val_dialog_run (GtkWindow *parent_window, static void err_dialog (const gchar *msg, GtkWindow *window) { - GtkWidget *hbox ; - GtkWidget *label = gtk_label_new (msg); - GtkWidget *dialog = - gtk_dialog_new_with_buttons ("PSPP", - window, - GTK_DIALOG_MODAL | - GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_STOCK_OK, - GTK_RESPONSE_ACCEPT, - NULL); - - - GtkWidget *icon = gtk_image_new_from_stock (GTK_STOCK_DIALOG_ERROR, - GTK_ICON_SIZE_DIALOG); - - g_signal_connect_swapped (dialog, - "response", - G_CALLBACK (gtk_widget_destroy), - dialog); - - hbox = gtk_hbox_new (FALSE, 10); - - gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), - hbox); - - gtk_box_pack_start (GTK_BOX (hbox), icon, TRUE, FALSE, 10); - gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 10); - - gtk_widget_show_all (dialog); + gtk_message_dialog_new (window, + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + msg); + + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); } - /* Acceptability predicate for PsppireMissingValDialog. This function is also the only place that dialog->mvl gets updated. */ -- 2.30.2