X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-dialog-action-sort.c;h=7dfb0b278ce895ba3f50ef7fb667e9fb7132d5c1;hb=65d602ed236d685ffec00ad1552a193cf47b2e4d;hp=1c5a9e01847101148fe299bd5a22f48a5b841f5c;hpb=2a71889bf86463fb752bcbab248da47b25b4fd9a;p=pspp diff --git a/src/ui/gui/psppire-dialog-action-sort.c b/src/ui/gui/psppire-dialog-action-sort.c index 1c5a9e0184..7dfb0b278c 100644 --- a/src/ui/gui/psppire-dialog-action-sort.c +++ b/src/ui/gui/psppire-dialog-action-sort.c @@ -30,7 +30,7 @@ static void psppire_dialog_action_sort_class_init (PsppireDialogActionSortC G_DEFINE_TYPE (PsppireDialogActionSort, psppire_dialog_action_sort, PSPPIRE_TYPE_DIALOG_ACTION); static char * -generate_syntax (PsppireDialogAction *act) +generate_syntax (const PsppireDialogAction *act) { PsppireDialogActionSort *scd = PSPPIRE_DIALOG_ACTION_SORT (act); gchar *text; @@ -39,7 +39,7 @@ generate_syntax (PsppireDialogAction *act) PsppireVarView *var_view = PSPPIRE_VAR_VIEW (scd->variables); gint n_vars = psppire_var_view_append_names (var_view, 0, string); - if ( n_vars == 0 ) + if (n_vars == 0) { g_string_assign (string, ""); } @@ -82,44 +82,41 @@ dialog_state_valid (gpointer act) gint n_rows = gtk_tree_model_iter_n_children (model, NULL); - if ( n_rows == 0 ) + if (n_rows == 0) return FALSE; return TRUE; } -static void -psppire_dialog_action_sort_activate (GtkAction *a) +static GtkBuilder * +psppire_dialog_action_sort_activate (PsppireDialogAction *a, GVariant *param) { 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"); + + 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); - - g_object_unref (xml); + return xml; } static void psppire_dialog_action_sort_class_init (PsppireDialogActionSortClass *class) { PsppireDialogActionClass *pdac = PSPPIRE_DIALOG_ACTION_CLASS (class); - psppire_dialog_action_set_activation (class, psppire_dialog_action_sort_activate); + PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_sort_activate; - pdac->generate_syntax = generate_syntax; + pdac->generate_syntax = generate_syntax; }