X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-dialog-action-histogram.c;h=f99000ac2898767180c2663e15971329effe02c2;hb=53241f59ac766997bf67870639f70afb82396640;hp=5a57c2aece6fc46798794968305c8ada474136a8;hpb=612b51515e356bc4dd625a3fb18d0a4f827a1e2c;p=pspp diff --git a/src/ui/gui/psppire-dialog-action-histogram.c b/src/ui/gui/psppire-dialog-action-histogram.c index 5a57c2aece..f99000ac28 100644 --- a/src/ui/gui/psppire-dialog-action-histogram.c +++ b/src/ui/gui/psppire-dialog-action-histogram.c @@ -14,7 +14,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ - #include #include "psppire-dialog-action-histogram.h" @@ -43,7 +42,7 @@ dialog_state_valid (gpointer data) const gchar *var_name = gtk_entry_get_text (GTK_ENTRY (rd->variable)); const struct variable *var = psppire_dict_lookup_var (PSPPIRE_DIALOG_ACTION (rd)->dict, var_name); - if ( var == NULL) + if (var == NULL) return FALSE; @@ -59,34 +58,35 @@ refresh (PsppireDialogAction *rd_) gtk_entry_set_text (GTK_ENTRY (rd->variable), ""); } -static void -psppire_dialog_action_histogram_activate (GtkAction *a) +static GtkBuilder * +psppire_dialog_action_histogram_activate (PsppireDialogAction *a, GVariant *param) { PsppireDialogActionHistogram *act = PSPPIRE_DIALOG_ACTION_HISTOGRAM (a); PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a); GtkBuilder *xml = builder_new ("histogram.ui"); + pda->dialog = get_widget_assert (xml, "histogram-dialog"); pda->source = get_widget_assert (xml, "dict-view"); + g_object_set (pda->source, + "predicate", var_is_numeric, NULL); + act->variable = get_widget_assert (xml, "entry1"); act->curve = get_widget_assert (xml, "curve"); - g_object_unref (xml); - psppire_dialog_action_set_refresh (pda, refresh); psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_histogram_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_histogram_parent_class)->activate (pda); + return xml; } static char * -generate_syntax (PsppireDialogAction *a) +generate_syntax (const PsppireDialogAction *a) { PsppireDialogActionHistogram *rd = PSPPIRE_DIALOG_ACTION_HISTOGRAM (a); gchar *text; @@ -113,9 +113,7 @@ generate_syntax (PsppireDialogAction *a) static void psppire_dialog_action_histogram_class_init (PsppireDialogActionHistogramClass *class) { - GtkActionClass *action_class = GTK_ACTION_CLASS (class); - - action_class->activate = psppire_dialog_action_histogram_activate; + PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_histogram_activate; PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax; } @@ -125,4 +123,3 @@ static void psppire_dialog_action_histogram_init (PsppireDialogActionHistogram *act) { } -