/*
PSPPIRE --- A Graphical User Interface for PSPP
- Copyright (C) 2005 Free Software Foundation
+ Copyright (C) 2005, 2006 Free Software Foundation
Written by John Darrington
This program is free software; you can redistribute it and/or modify
/* This module describes the behaviour of the Variable Type dialog box used
for inputing the variable type in the var sheet */
+#include <config.h>
+
#include <gtk/gtk.h>
#include <glade/glade.h>
#include "var-type-dialog.h"
#include "psppire-variable.h"
+#include "helper.h"
#include <data/variable.h>
#include <data/settings.h>
+#include <libpspp/message.h>
struct tgs
text = gtk_entry_get_text(GTK_ENTRY(dialog->entry_width));
dialog->fmt_l.w = atoi(text);
- if ( ! check_output_specifier(&dialog->fmt_l, 0))
+ msg_disable ();
+ if ( ! fmt_check_output(&dialog->fmt_l))
{
gtk_label_set_text(GTK_LABEL(dialog->label_psample), "---");
gtk_label_set_text(GTK_LABEL(dialog->label_nsample), "---");
gtk_label_set_text(GTK_LABEL(dialog->label_nsample), sample_text);
g_free(sample_text);
}
+ msg_enable ();
}
/* Callback for when a treeview row is changed.
list_store = gtk_list_store_new (2, G_TYPE_STRING,
G_TYPE_POINTER);
- for ( i = 0 ; i < CC_CNT ; ++i )
+ for ( i = 0 ; i < 5 ; ++i )
{
+ enum fmt_type cc_fmts[5] = {FMT_CCA, FMT_CCB, FMT_CCC, FMT_CCD, FMT_CCE};
gchar text[4];
- g_snprintf(text, 4, "CC%c", 'A' + i);
+ g_snprintf(text, 4, "%s", fmt_name (cc_fmts[i]));
gtk_list_store_append (list_store, &iter);
gtk_list_store_set (list_store, &iter,
0, text,
gtk_tree_view_set_cursor(treeview, path, 0, 0);
gtk_tree_path_free(path);
}
- else
- g_warning("Unusual date format: %s\n", fmt_to_string(fmt));
-
+ else
+ {
+ char str[FMT_STRING_LEN_MAX + 1];
+ g_warning("Unusual date format: %s\n", fmt_to_string(fmt, str));
+ }
}
f->type = type;
f->w = w;
f->d = d;
- return check_output_specifier (f, true);
+ return fmt_check_output (f);
}
break;
case BUTTON_DATE:
case BUTTON_CUSTOM:
- g_assert(check_output_specifier(&dialog->fmt_l, TRUE));
+ g_assert(fmt_check_output(&dialog->fmt_l));
result = memcpy(&spec, &dialog->fmt_l, sizeof(struct fmt_spec));
break;
case BUTTON_DOLLAR: