X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-dialog-action-scatterplot.c;h=9b4dd08570056c3ce6e7af960ba73fdd4bb65cf0;hb=514d9af1f690c316a5ad501aa0083ba6c1e00e56;hp=64017df7c9935d6e9b9933176d04724c360d5827;hpb=612b51515e356bc4dd625a3fb18d0a4f827a1e2c;p=pspp diff --git a/src/ui/gui/psppire-dialog-action-scatterplot.c b/src/ui/gui/psppire-dialog-action-scatterplot.c index 64017df7c9..9b4dd08570 100644 --- a/src/ui/gui/psppire-dialog-action-scatterplot.c +++ b/src/ui/gui/psppire-dialog-action-scatterplot.c @@ -38,7 +38,7 @@ G_DEFINE_TYPE (PsppireDialogActionScatterplot, psppire_dialog_action_scatterplot static char * -generate_syntax (PsppireDialogAction *act) +generate_syntax (const PsppireDialogAction *act) { PsppireDialogActionScatterplot *ow = PSPPIRE_DIALOG_ACTION_SCATTERPLOT (act); gchar *text; @@ -46,11 +46,11 @@ generate_syntax (PsppireDialogAction *act) ds_init_cstr (&dss, "GRAPH SCATTERPLOT(BIVARIATE) = "); - ds_put_cstr (&dss, gtk_entry_get_text (GTK_ENTRY (ow->y_axis))); - + ds_put_cstr (&dss, gtk_entry_get_text (GTK_ENTRY (ow->x_axis))); + ds_put_cstr (&dss, " WITH "); - ds_put_cstr (&dss, gtk_entry_get_text (GTK_ENTRY (ow->x_axis))); + ds_put_cstr (&dss, gtk_entry_get_text (GTK_ENTRY (ow->y_axis))); ds_put_cstr (&dss, ".\n"); @@ -69,13 +69,13 @@ dialog_state_valid (gpointer data) const char *xvar = gtk_entry_get_text (GTK_ENTRY (ow->x_axis)); const char *yvar = gtk_entry_get_text (GTK_ENTRY (ow->y_axis)); - if ( 0 == strcmp ("", xvar)) + if (0 == strcmp ("", xvar)) return FALSE; - if ( 0 == strcmp ("", yvar)) + if (0 == strcmp ("", yvar)) return FALSE; - + return TRUE; } @@ -90,14 +90,13 @@ refresh (PsppireDialogAction *rd_) -static void -psppire_dialog_action_scatterplot_activate (GtkAction *a) +static GtkBuilder * +psppire_dialog_action_scatterplot_activate (PsppireDialogAction *a, GVariant *param) { PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a); PsppireDialogActionScatterplot *act = PSPPIRE_DIALOG_ACTION_SCATTERPLOT (a); GtkBuilder *xml = builder_new ("scatterplot.ui"); - pda->dialog = get_widget_assert (xml, "scatterplot-dialog"); pda->source = get_widget_assert (xml, "scatterplot-treeview1"); @@ -106,19 +105,14 @@ psppire_dialog_action_scatterplot_activate (GtkAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); psppire_dialog_action_set_refresh (pda, refresh); - - g_object_unref (xml); - - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_scatterplot_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_scatterplot_parent_class)->activate (pda); + return xml; } static void psppire_dialog_action_scatterplot_class_init (PsppireDialogActionScatterplotClass *class) { - GtkActionClass *action_class = GTK_ACTION_CLASS (class); + PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_scatterplot_activate; - action_class->activate = psppire_dialog_action_scatterplot_activate; PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax; }