From 3473c1b88709c3da4f7e38db1faddc9212a2bc98 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Wed, 19 Apr 2017 13:45:03 +0200 Subject: [PATCH] Var type dialog: Add a return value --- src/ui/gui/var-type-dialog.c | 7 +++++-- src/ui/gui/var-type-dialog.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ui/gui/var-type-dialog.c b/src/ui/gui/var-type-dialog.c index 7f1d4aeccd..a2792ef089 100644 --- a/src/ui/gui/var-type-dialog.c +++ b/src/ui/gui/var-type-dialog.c @@ -201,7 +201,7 @@ psppire_var_type_dialog_new (const struct fmt_spec *format) NULL)); } -void +gint psppire_var_type_dialog_run (GtkWindow *parent_window, struct fmt_spec *format) { @@ -212,10 +212,13 @@ psppire_var_type_dialog_run (GtkWindow *parent_window, gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); gtk_widget_show (GTK_WIDGET (dialog)); - if (psppire_dialog_run (PSPPIRE_DIALOG (dialog)) == GTK_RESPONSE_OK) + gint result = psppire_dialog_run (PSPPIRE_DIALOG (dialog)); + if (result == GTK_RESPONSE_OK) *format = *psppire_var_type_dialog_get_format (dialog); gtk_widget_destroy (GTK_WIDGET (dialog)); + + return result; } diff --git a/src/ui/gui/var-type-dialog.h b/src/ui/gui/var-type-dialog.h index 32c160f052..ee9b7b2ac5 100644 --- a/src/ui/gui/var-type-dialog.h +++ b/src/ui/gui/var-type-dialog.h @@ -102,7 +102,7 @@ struct _PsppireVarTypeDialogClass { GType psppire_var_type_dialog_get_type (void) G_GNUC_CONST; PsppireVarTypeDialog* psppire_var_type_dialog_new (const struct fmt_spec *); -void psppire_var_type_dialog_run (GtkWindow *parent_window, +gint psppire_var_type_dialog_run (GtkWindow *parent_window, struct fmt_spec *format); G_END_DECLS -- 2.30.2