Var type dialog: Add a return value
authorJohn Darrington <john@darrington.wattle.id.au>
Wed, 19 Apr 2017 11:45:03 +0000 (13:45 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Wed, 19 Apr 2017 11:45:03 +0000 (13:45 +0200)
src/ui/gui/var-type-dialog.c
src/ui/gui/var-type-dialog.h

index 7f1d4aeccdc6e187332045965438a54f537f2170..a2792ef08993b5ea7d55830f85b899035b079957 100644 (file)
@@ -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;
 }
 
 
index 32c160f05238f533f99a2bfe78ef1bb85d9e3032..ee9b7b2ac567fb005588ad4ec8f7ea3576ef1fa5 100644 (file)
@@ -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