X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-dialog-action-examine.c;h=2bafe67952e065a94bba665f1b01f329df9c974c;hb=17339b8ef2b6c9c403ceccb9f0ab534a943f92e1;hp=a01d4536f8cbd96d57ebf7e193568af1bd32704c;hpb=e2da62d735c597afeef2e0e9b36e5a4a83d7da94;p=pspp diff --git a/src/ui/gui/psppire-dialog-action-examine.c b/src/ui/gui/psppire-dialog-action-examine.c index a01d4536f8..2bafe67952 100644 --- a/src/ui/gui/psppire-dialog-action-examine.c +++ b/src/ui/gui/psppire-dialog-action-examine.c @@ -107,7 +107,7 @@ run_opts_dialog (PsppireDialogActionExamine *ed) static char * -generate_syntax (PsppireDialogAction *act) +generate_syntax (const PsppireDialogAction *act) { PsppireDialogActionExamine *ed = PSPPIRE_DIALOG_ACTION_EXAMINE (act); @@ -197,8 +197,8 @@ dialog_refresh (PsppireDialogAction *da) dae->opts = OPT_LISTWISE; } -static void -psppire_dialog_action_examine_activate (GtkAction *a) +static GtkBuilder * +psppire_dialog_action_examine_activate (PsppireDialogAction *a, GVariant *param) { PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a); PsppireDialogActionExamine *act = PSPPIRE_DIALOG_ACTION_EXAMINE (a); @@ -207,8 +207,17 @@ psppire_dialog_action_examine_activate (GtkAction *a) GtkWidget *stats_button = get_widget_assert (xml, "stats-button"); GtkWidget *opts_button = get_widget_assert (xml, "opts-button"); - + + 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); + GtkWidget *dep_sel = get_widget_assert (xml, "psppire-selector1"); + GtkWidget *dep_sel2 = get_widget_assert (xml, "psppire-selector2"); + GtkWidget *dep_sel3 = get_widget_assert (xml, "psppire-selector3"); + GtkWidget *table = get_widget_assert (xml, "table1"); pda->dialog = get_widget_assert (xml, "examine-dialog"); pda->source = get_widget_assert (xml, "treeview1"); @@ -216,9 +225,23 @@ psppire_dialog_action_examine_activate (GtkAction *a) act->factors = get_widget_assert (xml, "treeview3"); act->id_var = get_widget_assert (xml, "entry1"); + /* Setting the focus chain like this is a pain. + But the default focus order seems to be somewhat odd. */ + GList *list = NULL; + list = g_list_append (list, get_widget_assert (xml, "scrolledwindow1")); + list = g_list_append (list, dep_sel); + list = g_list_append (list, get_widget_assert (xml, "frame1")); + list = g_list_append (list, dep_sel2); + list = g_list_append (list, get_widget_assert (xml, "frame2")); + list = g_list_append (list, dep_sel3); + list = g_list_append (list, get_widget_assert (xml, "frame3")); + gtk_container_set_focus_chain (GTK_CONTAINER (table), list); + g_list_free (list); + + 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->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"); @@ -230,22 +253,13 @@ psppire_dialog_action_examine_activate (GtkAction *a) 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); - - g_object_unref (xml); + return xml; } static void psppire_dialog_action_examine_class_init (PsppireDialogActionExamineClass *class) { - GTK_ACTION_CLASS (class)->activate = psppire_dialog_action_examine_activate; + PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_examine_activate; PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax; }