projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
table-casereader: Put space between columns.
[pspp]
/
src
/
ui
/
gui
/
var-type-dialog.c
diff --git
a/src/ui/gui/var-type-dialog.c
b/src/ui/gui/var-type-dialog.c
index db2e85b5f792bc5b4c5ee96daed8891ae8b0de19..f196e554f9d0c224ee6bfc5a268814e566472050 100644
(file)
--- a/
src/ui/gui/var-type-dialog.c
+++ b/
src/ui/gui/var-type-dialog.c
@@
-1,5
+1,5
@@
/* PSPPIRE - a graphical user interface for PSPP.
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2005, 2006 Free Software Foundation
+ Copyright (C) 2005, 2006
, 2010
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
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
@@
-21,7
+21,6
@@
#include <config.h>
#include <gtk/gtk.h>
#include <config.h>
#include <gtk/gtk.h>
-#include <glade/glade.h>
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
@@
-263,12
+262,12
@@
preview_custom (GtkWidget *w, gpointer data)
union value v;
v.f = 1234.56;
union value v;
v.f = 1234.56;
- sample_text = value_to_text (v, dialog->fmt_l);
+ sample_text = value_to_text (v, dialog->
vs->dictionary, dialog->
fmt_l);
gtk_label_set_text (GTK_LABEL (dialog->label_psample), sample_text);
g_free (sample_text);
v.f = -v.f;
gtk_label_set_text (GTK_LABEL (dialog->label_psample), sample_text);
g_free (sample_text);
v.f = -v.f;
- sample_text = value_to_text (v, dialog->fmt_l);
+ sample_text = value_to_text (v, dialog->
vs->dictionary, dialog->
fmt_l);
gtk_label_set_text (GTK_LABEL (dialog->label_nsample), sample_text);
g_free (sample_text);
}
gtk_label_set_text (GTK_LABEL (dialog->label_nsample), sample_text);
g_free (sample_text);
}
@@
-316,20
+315,19
@@
set_format_type_from_treeview (GtkTreeView *treeview, gpointer data)
dialog->fmt_l = custom_format;
dialog->fmt_l.type = *(int*) g_value_get_pointer (&the_value);
dialog->fmt_l = custom_format;
dialog->fmt_l.type = *(int*) g_value_get_pointer (&the_value);
-
}
}
-
-
-/* Create the structure from the XML definitions */
+/* Create the structure */
struct var_type_dialog *
struct var_type_dialog *
-var_type_dialog_create (G
ladeXML *xml
)
+var_type_dialog_create (G
tkWindow *toplevel, PsppireVarStore *vs
)
{
gint i;
struct var_type_dialog *dialog = g_malloc (sizeof (struct var_type_dialog));
{
gint i;
struct var_type_dialog *dialog = g_malloc (sizeof (struct var_type_dialog));
- g_assert (xml);
+ GtkBuilder *xml = builder_new ("var-sheet-dialogs.ui");
+
+ dialog->vs = vs;
dialog->window = get_widget_assert (xml,"var_type_dialog");
dialog->active_button = -1;
dialog->window = get_widget_assert (xml,"var_type_dialog");
dialog->active_button = -1;
@@
-339,7
+337,7
@@
var_type_dialog_create (GladeXML *xml)
G_CALLBACK (gtk_widget_hide_on_delete), NULL);
gtk_window_set_transient_for (GTK_WINDOW (dialog->window),
G_CALLBACK (gtk_widget_hide_on_delete), NULL);
gtk_window_set_transient_for (GTK_WINDOW (dialog->window),
-
GTK_WINDOW (get_widget_assert (xml, "data_editor"))
);
+
toplevel
);
dialog->radioButton[BUTTON_NUMERIC] =
get_widget_assert (xml,"radiobutton1");
dialog->radioButton[BUTTON_NUMERIC] =
get_widget_assert (xml,"radiobutton1");
@@
-446,7
+444,7
@@
var_type_dialog_create (GladeXML *xml)
g_object_unref (list_store);
g_signal_connect (dialog->date_format_treeview, "cursor-changed",
g_object_unref (list_store);
g_signal_connect (dialog->date_format_treeview, "cursor-changed",
- G
TK_SIGNAL_FUNC
(set_format_from_treeview), dialog);
+ G
_CALLBACK
(set_format_from_treeview), dialog);
/* populate the dollar treeview */
/* populate the dollar treeview */
@@
-484,11
+482,11
@@
var_type_dialog_create (GladeXML *xml)
g_signal_connect (dialog->dollar_treeview,
"cursor-changed",
g_signal_connect (dialog->dollar_treeview,
"cursor-changed",
- G
TK_SIGNAL_FUNC
(set_format_from_treeview), dialog);
+ G
_CALLBACK
(set_format_from_treeview), dialog);
g_signal_connect_swapped (dialog->dollar_treeview,
"cursor-changed",
g_signal_connect_swapped (dialog->dollar_treeview,
"cursor-changed",
- G
TK_SIGNAL_FUNC
(update_width_decimals), dialog);
+ G
_CALLBACK
(update_width_decimals), dialog);
/* populate the custom treeview */
/* populate the custom treeview */
@@
-528,22
+526,22
@@
var_type_dialog_create (GladeXML *xml)
g_signal_connect (dialog->custom_treeview,
"cursor-changed",
g_signal_connect (dialog->custom_treeview,
"cursor-changed",
- G
TK_SIGNAL_FUNC
(set_format_type_from_treeview), dialog);
+ G
_CALLBACK
(set_format_type_from_treeview), dialog);
g_signal_connect (dialog->custom_treeview,
"cursor-changed",
g_signal_connect (dialog->custom_treeview,
"cursor-changed",
- G
TK_SIGNAL_FUNC
(preview_custom), dialog);
+ G
_CALLBACK
(preview_custom), dialog);
g_signal_connect (dialog->entry_width,
"changed",
g_signal_connect (dialog->entry_width,
"changed",
- G
TK_SIGNAL_FUNC
(preview_custom), dialog);
+ G
_CALLBACK
(preview_custom), dialog);
g_signal_connect (dialog->entry_decimals,
"changed",
g_signal_connect (dialog->entry_decimals,
"changed",
- G
TK_SIGNAL_FUNC
(preview_custom), dialog);
+ G
_CALLBACK
(preview_custom), dialog);
/* Connect to the OK button */
/* Connect to the OK button */
@@
-555,10
+553,10
@@
var_type_dialog_create (GladeXML *xml)
g_signal_connect (get_widget_assert (xml, "var_type_cancel") , "clicked",
G_CALLBACK (hide_dialog),
dialog);
g_signal_connect (get_widget_assert (xml, "var_type_cancel") , "clicked",
G_CALLBACK (hide_dialog),
dialog);
-
-
}
}
+ g_object_unref (xml);
+
return dialog;
}
return dialog;
}
@@
-791,14
+789,12
@@
on_var_type_ok_clicked (GtkWidget *w, gpointer data)
gint decimals = atoi (gtk_entry_get_text
(GTK_ENTRY (dialog->entry_decimals)));
gint decimals = atoi (gtk_entry_get_text
(GTK_ENTRY (dialog->entry_decimals)));
- gint new_type = VAL_NUMERIC;
gint new_width = 0;
bool result = false;
struct fmt_spec spec;
switch (dialog->active_button)
{
case BUTTON_STRING:
gint new_width = 0;
bool result = false;
struct fmt_spec spec;
switch (dialog->active_button)
{
case BUTTON_STRING:
- new_type = VAL_STRING;
new_width = width;
result = make_output_format_try (&spec, FMT_A, width, 0);
break;
new_width = width;
result = make_output_format_try (&spec, FMT_A, width, 0);
break;