New abstract class PsppireDialogAction
[pspp-builds.git] / src / ui / gui / psppire-dialog.c
index de2490a016e5f3862d9ed32170404c8de5381e21..c365ab4b8eb47b2d237c9875db4eb92f2664435a 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPPIRE - a graphical user interface for PSPP.
-   Copyright (C) 2007, 2010, 2011  Free Software Foundation
+   Copyright (C) 2007, 2010, 2011, 2012  Free Software Foundation
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -23,7 +23,7 @@
 #include "psppire-selector.h"
 #include "psppire-conf.h"
 #include <string.h>
-#include "helper.h"
+#include "builder-wrapper.h"
 #include "help-menu.h"
 
 static void psppire_dialog_class_init          (PsppireDialogClass *);
@@ -31,6 +31,7 @@ static void psppire_dialog_init                (PsppireDialog      *);
 
 
 enum  {DIALOG_REFRESH,
+       RESPONSE,
        VALIDITY_CHANGED,
        DIALOG_HELP,
        n_SIGNALS};
@@ -248,6 +249,18 @@ psppire_dialog_class_init (PsppireDialogClass *class)
                  0);
 
 
+  signals [RESPONSE] =
+    g_signal_new ("response",
+                 G_TYPE_FROM_CLASS (class),
+                 G_SIGNAL_RUN_FIRST,
+                 0,
+                 NULL, NULL,
+                 g_cclosure_marshal_VOID__INT,
+                 G_TYPE_NONE,
+                 1,
+                 G_TYPE_INT);
+
+
   signals [VALIDITY_CHANGED] =
     g_signal_new ("validity-changed",
                  G_TYPE_FROM_CLASS (class),
@@ -524,6 +537,8 @@ psppire_dialog_run (PsppireDialog *dialog)
 
   g_main_loop_unref (dialog->loop);
 
+  g_signal_emit (dialog, signals [RESPONSE], 0, dialog->response);
+
   return dialog->response;
 }