#include <ui/gui/psppire-dialog.h>
#include <ui/gui/psppire-var-sheet.h>
#include <ui/gui/psppire-var-store.h>
-#include <ui/gui/helper.h>
+#include "executor.h"
#include "error.h"
#include "xalloc.h"
syntax_gen_pspp (s, "MISSING VALUES %ss (", name);
for (j = 0; j < mv_n_values (mv); j++)
{
- union value value;
if (j)
ds_put_cstr (s, ", ");
- mv_get_value (mv, &value, j);
- syntax_gen_value (s, &value, width, format);
+ syntax_gen_value (s, mv_get_value (mv, j), width, format);
}
if (mv_has_range (mv))
if (var_has_value_labels (var))
{
const struct val_labs *vls = var_get_value_labels (var);
- struct val_labs_iterator *iter;
- struct val_lab *vl;
+ const struct val_lab **labels = val_labs_sorted (vls);
+ size_t n_labels = val_labs_count (vls);
+ size_t i;
syntax_gen_pspp (s, "VALUE LABELS %ss", name);
- for (vl = val_labs_first_sorted (vls, &iter); vl != NULL;
- vl = val_labs_next (vls, &iter))
+ for (i = 0; i < n_labels; i++)
{
+ const struct val_lab *vl = labels[i];
ds_put_cstr (s, "\n ");
syntax_gen_value (s, &vl->value, width, format);
ds_put_char (s, ' ');
- syntax_gen_string (s, ss_cstr (vl->label));
+ syntax_gen_string (s, ss_cstr (val_lab_get_label (vl)));
}
+ free (labels);
ds_put_cstr (s, ".\n");
}
if (var_has_label (var))
on_prepare (GtkAssistant *assistant, GtkWidget *page,
struct import_assistant *ia)
{
+
+ if (gtk_assistant_get_page_type (assistant, page)
+ == GTK_ASSISTANT_PAGE_CONFIRM)
+ gtk_widget_grab_focus (assistant->apply);
+ else
+ gtk_widget_grab_focus (assistant->forward);
+
if (page == ia->separators.page)
prepare_separators_page (ia);
else if (page == ia->formats.page)
set_separators (ia);
set_quote_list (GTK_COMBO_BOX_ENTRY (p->quote_combo));
p->fields_tree_view = GTK_TREE_VIEW (get_widget_assert (builder, "fields"));
- g_signal_connect (GTK_COMBO_BOX (p->quote_combo), "changed",
+ g_signal_connect (p->quote_combo, "changed",
G_CALLBACK (on_quote_combo_change), ia);
g_signal_connect (p->quote_cb, "toggled",
G_CALLBACK (on_quote_cb_toggle), ia);
- g_signal_connect (GTK_ENTRY (p->custom_entry), "notify::text",
+ g_signal_connect (p->custom_entry, "notify::text",
G_CALLBACK (on_separators_custom_entry_notify), ia);
g_signal_connect (p->custom_cb, "toggled",
G_CALLBACK (on_separators_custom_cb_toggle), ia);
char **outputp, char **tooltipp)
{
struct substring field;
- union value *val;
+ union value val;
struct variable *var;
const struct fmt_spec *in;
struct fmt_spec out;
field = ia->separators.columns[column].contents[row];
var = dict_get_var (ia->formats.dict, column);
- val = value_create (var_get_width (var));
+ value_init (&val, var_get_width (var));
in = var_get_print_format (var);
out = fmt_for_output_from_input (in);
tooltip = NULL;
{
msg_disable ();
if (!data_in (field, LEGACY_NATIVE, in->type, 0, 0, 0,
- val, var_get_width (var)))
+ &val, var_get_width (var)))
{
char fmt_string[FMT_STRING_LEN_MAX + 1];
fmt_to_string (in, fmt_string);
{
tooltip = xstrdup (_("This input line has too few separators "
"to fill in this field."));
- value_set_missing (val, var_get_width (var));
+ value_set_missing (&val, var_get_width (var));
}
if (outputp != NULL)
{
char *output = xmalloc (out.w + 1);
- data_out (val, &out, output);
+ data_out (&val, &out, output);
output[out.w] = '\0';
*outputp = output;
}
- free (val);
+ value_destroy (&val, var_get_width (var));
ok = tooltip == NULL;
if (tooltipp != NULL)