X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-dialog-action-indep-samps.c;h=08529e43e8896d3ca0d89195f2a10ee425907d5d;hb=1fce5ac3073c36061e61a3956a8e96516a4a5723;hp=3747d3e83d9c5e0dda630523eef90f399184619a;hpb=3255c12b6a9c2f4217d6df0649556d8e45c954ed;p=pspp diff --git a/src/ui/gui/psppire-dialog-action-indep-samps.c b/src/ui/gui/psppire-dialog-action-indep-samps.c index 3747d3e83d..08529e43e8 100644 --- a/src/ui/gui/psppire-dialog-action-indep-samps.c +++ b/src/ui/gui/psppire-dialog-action-indep-samps.c @@ -151,18 +151,19 @@ run_define_groups (PsppireDialogActionIndepSamps *act) { gint response; PsppireDialogAction *da = PSPPIRE_DIALOG_ACTION (act); + GtkWidget *parent1 = gtk_widget_get_parent (act->dg_table1); + GtkWidget *parent2 = gtk_widget_get_parent (act->dg_table2); - if ( act->dg_table2->parent) - gtk_container_remove (GTK_CONTAINER (act->dg_table2->parent), act->dg_table2); - - if ( act->dg_table1->parent) - gtk_container_remove (GTK_CONTAINER (act->dg_table1->parent), act->dg_table1); + if (parent1) + gtk_container_remove (GTK_CONTAINER (parent1), act->dg_table1); + if (parent2) + gtk_container_remove (GTK_CONTAINER (parent2), act->dg_table2); if ( var_is_numeric (act->grp_var)) { - gtk_table_attach_defaults (GTK_TABLE (act->dg_table1), act->dg_table2, - 1, 2, 1, 2); + gtk_grid_attach (GTK_GRID (act->dg_table1), act->dg_table2, + 1, 1, 1, 1); gtk_container_add (GTK_CONTAINER (act->dg_box), act->dg_table1); } @@ -291,16 +292,22 @@ psppire_dialog_action_indep_samps_activate (GtkAction *a) PsppireDialogActionIndepSamps *act = PSPPIRE_DIALOG_ACTION_INDEP_SAMPS (a); PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a); - GtkBuilder *xml = builder_new ("t-test.ui"); + GHashTable *thing = psppire_dialog_action_get_pointer (pda); + GtkBuilder *xml = g_hash_table_lookup (thing, a); + if (!xml) + { + xml = builder_new ("indep-samples.ui"); + g_hash_table_insert (thing, a, xml); + } - pda->dialog = get_widget_assert (xml,"t-test-independent-samples-dialog"); - pda->source = get_widget_assert (xml, "indep-samples-t-test-treeview1"); + pda->dialog = get_widget_assert (xml,"independent-samples-dialog"); + pda->source = get_widget_assert (xml, "indep-samples-treeview1"); act->define_groups_button = get_widget_assert (xml, "define-groups-button"); - act->options_button = get_widget_assert (xml, "indep-samples-t-test-options-button"); + act->options_button = get_widget_assert (xml, "indep-samples-options-button"); act->def_grps_dialog = get_widget_assert (xml, "define-groups-dialog"); - act->group_var_entry = get_widget_assert (xml, "indep-samples-t-test-entry"); - act->test_vars_tv = get_widget_assert (xml, "indep-samples-t-test-treeview2"); + act->group_var_entry = get_widget_assert (xml, "indep-samples-entry"); + act->test_vars_tv = get_widget_assert (xml, "indep-samples-treeview2"); act->dg_dialog = get_widget_assert (xml, "define-groups-dialog"); act->dg_grp_entry[0] = get_widget_assert (xml, "group1-entry"); @@ -323,9 +330,6 @@ psppire_dialog_action_indep_samps_activate (GtkAction *a) g_signal_connect (act->dg_values_toggle_button, "toggled", G_CALLBACK (set_group_criterion_type), act); - - g_object_unref (xml); - psppire_dialog_action_set_refresh (pda, refresh); psppire_dialog_action_set_valid_predicate (pda, @@ -413,9 +417,7 @@ generate_syntax (PsppireDialogAction *a) static void psppire_dialog_action_indep_samps_class_init (PsppireDialogActionIndepSampsClass *class) { - GtkActionClass *action_class = GTK_ACTION_CLASS (class); - - action_class->activate = psppire_dialog_action_indep_samps_activate; + psppire_dialog_action_set_activation (class, psppire_dialog_action_indep_samps_activate); PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax; }