src/ui/gui/crosstabs.ui \
src/ui/gui/chi-square.ui \
src/ui/gui/descriptives.ui \
+ src/ui/gui/entry-dialog.ui \
src/ui/gui/examine.ui \
src/ui/gui/goto-case.ui \
src/ui/gui/factor.ui \
src/ui/gui/dialog-common.h \
src/ui/gui/dict-display.h \
src/ui/gui/dict-display.c \
+ src/ui/gui/entry-dialog.c \
+ src/ui/gui/entry-dialog.h \
src/ui/gui/examine-dialog.c \
src/ui/gui/examine-dialog.h \
src/ui/gui/executor.c \
--- /dev/null
+/* PSPPIRE - a graphical user interface for PSPP.
+ Copyright (C) 2011 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
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+#include "ui/gui/entry-dialog.h"
+
+#include "ui/gui/helper.h"
+#include "ui/gui/psppire-dialog.h"
+
+#include "gl/xalloc.h"
+
+/* Creates a modal dialog with PARENT as its parent (this should be the
+ application window that the dialog is associated with), with TITLE as its
+ title, that prompts for a text string with PROMPT as the explanation and
+ DEFAULT_VALUE as the default value.
+
+ Returns a malloc()'d string owned by the caller if the user clicks on OK or
+ otherwise accepts a value, or NULL if the user cancels. */
+char *
+entry_dialog_run (GtkWindow *parent,
+ const char *title,
+ const char *prompt,
+ const char *default_value)
+{
+ GtkBuilder *xml = builder_new ("entry-dialog.ui");
+ GtkWidget *dialog;
+ GtkWidget *label;
+ GtkWidget *entry;
+ char *result;
+
+ dialog = get_widget_assert (xml, "entry-dialog");
+ gtk_window_set_title (GTK_WINDOW (dialog), title);
+ gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
+
+ label = get_widget_assert (xml, "label");
+ gtk_label_set_text (GTK_LABEL (label), prompt);
+
+ entry = get_widget_assert (xml, "entry");
+ gtk_entry_set_text (GTK_ENTRY (entry), default_value);
+
+ result = (psppire_dialog_run (PSPPIRE_DIALOG (dialog)) == GTK_RESPONSE_OK
+ ? xstrdup (gtk_entry_get_text (GTK_ENTRY (entry)))
+ : NULL);
+
+ g_object_unref (xml);
+
+ return result;
+}
--- /dev/null
+/* PSPPIRE - a graphical user interface for PSPP.
+ Copyright (C) 2011 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
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef ENTRY_DIALOG_H
+#define ENTRY_DIALOG_H 1
+
+#include <gtk/gtk.h>
+
+char *entry_dialog_run (GtkWindow *parent,
+ const char *title,
+ const char *prompt,
+ const char *default_value);
+
+#endif /* ui/gui/entry-dialog.h */
--- /dev/null
+<?xml version="1.0"?>
+<interface>
+ <requires lib="psppire" version="2054.17080"/>
+ <!-- interface-requires gtk+ 2.12 -->
+ <!-- interface-naming-policy project-wide -->
+ <object class="PsppireDialog" id="entry-dialog">
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="modal">True</property>
+ <property name="orientation">Vertical</property>
+ <child internal-child="hbox">
+ <object class="GtkVBox" id="dialog-hbox8">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="spacing">5</property>
+ <child>
+ <object class="GtkLabel" id="label">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkEntry" id="entry">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="activates-default">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="PsppireHButtonBox" id="psppire-hbuttonbox5">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="border_width">5</property>
+ <property name="layout_style">spread</property>
+ <property name="buttons">PSPPIRE_BUTTON_OK_MASK | PSPPIRE_BUTTON_CANCEL_MASK</property>
+ <property name="default">PSPPIRE_BUTTON_OK_MASK</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>