static void
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 ("indep-samples.ui");

  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-options-button");

  act->def_grps_dialog = get_widget_assert (xml, "define-groups-dialog");
  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");
  act->dg_grp_entry[1] = get_widget_assert (xml, "group2-entry");
  act->dg_cut_point_entry = get_widget_assert (xml, "cut-point-entry");
  act->dg_box = get_widget_assert (xml, "dialog-hbox2");

  act->dg_table1 = get_widget_assert (xml, "table1");
  act->dg_table2 = get_widget_assert (xml, "table2");
  act->dg_label  = get_widget_assert (xml, "label4");
  act->dg_hbox1  = get_widget_assert (xml, "hbox1");
  act->dg_values_toggle_button = get_widget_assert (xml, "radiobutton3");
  act->dg_cut_point_toggle_button = get_widget_assert (xml, "radiobutton4");

  act->opts = tt_options_dialog_create (GTK_WINDOW (pda->toplevel));

  g_object_ref (act->dg_table1);
  g_object_ref (act->dg_table2);

  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,
					dialog_state_valid);

  g_signal_connect_swapped (act->define_groups_button, "clicked",
			    G_CALLBACK (run_define_groups), act);

  g_signal_connect_swapped (act->options_button, "clicked",
			    G_CALLBACK (tt_options_dialog_run), act->opts);


  g_signal_connect (act->group_var_entry, "changed",
		    G_CALLBACK (on_grp_var_change), act);

  if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_indep_samps_parent_class)->activate)
    PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_indep_samps_parent_class)->activate (pda);
}
static void
psppire_dialog_action_examine_activate (GtkAction *a)
{
  PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
  PsppireDialogActionExamine *act = PSPPIRE_DIALOG_ACTION_EXAMINE (a);

  GtkBuilder *xml = builder_new ("examine.ui");

  GtkWidget *stats_button = get_widget_assert (xml, "stats-button");
  GtkWidget *opts_button = get_widget_assert (xml, "opts-button");

  GtkWidget *dep_sel = get_widget_assert (xml, "psppire-selector1");

  pda->dialog    = get_widget_assert   (xml, "examine-dialog");
  pda->source    = get_widget_assert   (xml, "treeview1");
  act->variables = get_widget_assert   (xml, "treeview2");
  act->factors   = get_widget_assert   (xml, "treeview3");
  act->id_var    = get_widget_assert   (xml, "entry1");

  act->stats_dialog        = get_widget_assert (xml, "statistics-dialog");
  act->descriptives_button = get_widget_assert (xml, "descriptives-button");
  act->extremes_button     = get_widget_assert (xml, "extremes-button"); 
  act->percentiles_button  = get_widget_assert (xml, "percentiles-button");

  act->opts_dialog = get_widget_assert (xml, "options-dialog");
  act->listwise    = get_widget_assert (xml, "radiobutton1");
  act->pairwise    = get_widget_assert (xml, "radiobutton2");
  act->report      = get_widget_assert (xml, "radiobutton3");

  g_object_set (pda->source,
		"model", pda->dict,
		NULL);

  psppire_selector_set_allow (PSPPIRE_SELECTOR (dep_sel), numeric_only);

  psppire_dialog_action_set_valid_predicate (pda, (void *) dialog_state_valid);
  psppire_dialog_action_set_refresh (pda, dialog_refresh);

  g_signal_connect_swapped (stats_button, "clicked",
		    G_CALLBACK (run_stats_dialog), act);

  g_signal_connect_swapped (opts_button, "clicked",
			    G_CALLBACK (run_opts_dialog), act);

  PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_examine_parent_class)->activate (pda);
}
static void
psppire_dialog_action_reliability_activate (GtkAction *a)
{
  PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
  PsppireDialogActionReliability *act = PSPPIRE_DIALOG_ACTION_RELIABILITY (a);
  GtkTreeModel *liststore ;
  GtkBuilder *xml = builder_new ("reliability.ui");
  pda->dialog = get_widget_assert   (xml, "reliability-dialog");
  pda->source = get_widget_assert   (xml, "dict-view");

  act->variables = get_widget_assert   (xml, "treeview2");

  act->split_point_hbox = get_widget_assert (xml, "split-point-hbox");

  act->variables = get_widget_assert   (xml, "treeview2");

  act->model_combo = get_widget_assert   (xml, "combobox1");
  act->split_spinbutton = get_widget_assert (xml, "spinbutton1");

  liststore =
    gtk_tree_view_get_model (GTK_TREE_VIEW (act->variables));


  act->scale_if_item_deleted_checkbutton = get_widget_assert (xml, "totals-checkbutton");

  g_signal_connect_swapped (act->model_combo, "changed",
			    G_CALLBACK (update_split_control), pda);


  g_signal_connect_swapped (liststore, "row-inserted",
			    G_CALLBACK (update_split_control), pda);
  g_signal_connect_swapped (liststore, "row-deleted",
			    G_CALLBACK (update_split_control), pda);


  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_reliability_parent_class)->activate)
    PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_reliability_parent_class)->activate (pda);

  g_object_unref (xml);
}
static void
psppire_dialog_action_sort_activate (GtkAction *a)
{
  PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
  PsppireDialogActionSort *act = PSPPIRE_DIALOG_ACTION_SORT (a);

  GtkBuilder *xml = builder_new ("sort.ui");
  pda->dialog = get_widget_assert   (xml, "sort-cases-dialog");
  pda->source = get_widget_assert   (xml, "sort-cases-treeview1");
  
  act->variables =  get_widget_assert   (xml, "sort-cases-treeview2");
  act->ascending = get_widget_assert (xml, "sort-cases-radiobutton0");

  psppire_dialog_action_set_refresh (pda, reset);

  psppire_dialog_action_set_valid_predicate (pda,
				      dialog_state_valid);

  if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_sort_parent_class)->activate)
    PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_sort_parent_class)->activate (pda);
}
static void
psppire_dialog_action_crosstabs_activate (GtkAction *a)
{
  PsppireDialogActionCrosstabs *act = PSPPIRE_DIALOG_ACTION_CROSSTABS (a);
  PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);

  GtkBuilder *xml = builder_new ("crosstabs.ui");

  pda->dialog = get_widget_assert   (xml, "crosstabs-dialog");
  pda->source = get_widget_assert   (xml, "dict-treeview");

  act->dest_rows =   get_widget_assert   (xml, "rows");
  act->dest_cols =   get_widget_assert   (xml, "cols");
  act->format_button = get_widget_assert (xml, "format-button");
  act->stat_button = get_widget_assert (xml, "stats-button");
  act->cell_button = get_widget_assert (xml, "cell-button");
  act->stat_view =   get_widget_assert (xml, "stats-view");
  act->cell_view =   get_widget_assert (xml, "cell-view");
  act->cell_dialog = get_widget_assert (xml, "cell-dialog");
  act->stat_dialog = get_widget_assert (xml, "stat-dialog");
  act->format_dialog = get_widget_assert (xml, "format-dialog");

  act->avalue_button = get_widget_assert (xml, "ascending");
  act->table_button = get_widget_assert (xml, "print-tables");
  act->pivot_button = get_widget_assert (xml, "pivot");


  g_object_unref (xml);

  act->format_options_avalue = TRUE;
  act->format_options_table = TRUE;
  act->format_options_pivot = TRUE;

  psppire_checkbox_treeview_populate (PSPPIRE_CHECKBOX_TREEVIEW (act->cell_view),
  				  B_CS_CELL_DEFAULT,
  				  N_CROSSTABS_CELLS,
  				  cells);

  act->cell = gtk_tree_view_get_model (GTK_TREE_VIEW (act->cell_view));

  psppire_checkbox_treeview_populate (PSPPIRE_CHECKBOX_TREEVIEW (act->stat_view),
  				  B_CS_STATS_DEFAULT,
  				  N_CROSSTABS_STATS,
  				  stats);

  act->stat = gtk_tree_view_get_model (GTK_TREE_VIEW (act->stat_view));

  psppire_dialog_action_set_refresh (pda, refresh);

  psppire_dialog_action_set_valid_predicate (pda,
					dialog_state_valid);

  g_signal_connect_swapped (act->cell_button, "clicked",
			    G_CALLBACK (on_cell_clicked), act);

  g_signal_connect_swapped (act->stat_button, "clicked",
			    G_CALLBACK (on_statistics_clicked), act);

  g_signal_connect_swapped (act->format_button, "clicked",
			    G_CALLBACK (on_format_clicked), act);


  if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_crosstabs_parent_class)->activate)
    PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_crosstabs_parent_class)->activate (pda);
}