X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-dialog-action-roc.c;h=23c6cae24ce1bab8eed7c38391a7837809c128ef;hb=b525a9596e60d5ae4c6c464b4a426b77ade3dd72;hp=694effb7b888512556a2a229b230cf6827537d8f;hpb=6e097c89af440da90b43ce90864394c4d0c843d5;p=pspp diff --git a/src/ui/gui/psppire-dialog-action-roc.c b/src/ui/gui/psppire-dialog-action-roc.c index 694effb7b8..23c6cae24c 100644 --- a/src/ui/gui/psppire-dialog-action-roc.c +++ b/src/ui/gui/psppire-dialog-action-roc.c @@ -55,7 +55,7 @@ dialog_state_valid (gpointer data) var = psppire_dict_lookup_var (PSPPIRE_DIALOG_ACTION (rd)->dict, var_name); - if ( var == NULL) + if (var == NULL) return FALSE; width = var_get_width (var); @@ -63,7 +63,7 @@ dialog_state_valid (gpointer data) result = psppire_value_entry_get_value (PSPPIRE_VALUE_ENTRY (rd->state_value), &val, width); - if (var_is_value_missing (var, &val, MV_SYSTEM)) + if (var_is_value_missing (var, &val) == MV_SYSTEM) result = FALSE; value_destroy (&val, width); @@ -74,9 +74,9 @@ dialog_state_valid (gpointer data) static void on_curve_button_toggle (GtkCheckButton *curve, PsppireDialogActionRoc *rd) { - if ( !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (curve))) + if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (curve))) { - if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->reference))) + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->reference))) g_object_set (rd->reference, "inconsistent", TRUE, NULL); g_object_set (rd->reference, "sensitive", FALSE, NULL); } @@ -114,26 +114,19 @@ on_state_var_changed (PsppireDialogAction *a) const struct variable *var = psppire_dict_lookup_var (PSPPIRE_DIALOG_ACTION(act)->dict, var_name); - if ( var == NULL) + if (var == NULL) return; psppire_value_entry_set_variable (PSPPIRE_VALUE_ENTRY (act->state_value), var); } -static void -psppire_dialog_action_roc_activate (PsppireDialogAction *a) +static GtkBuilder * +psppire_dialog_action_roc_activate (PsppireDialogAction *a, GVariant *param) { PsppireDialogActionRoc *act = PSPPIRE_DIALOG_ACTION_ROC (a); PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a); - GHashTable *thing = psppire_dialog_action_get_hash_table (pda); - GtkBuilder *xml = g_hash_table_lookup (thing, a); - if (!xml) - { - xml = builder_new ("roc.ui"); - g_hash_table_insert (thing, a, xml); - } - + GtkBuilder *xml = builder_new ("roc.ui"); pda->dialog = get_widget_assert (xml, "roc-dialog"); pda->source = get_widget_assert (xml, "dict-view"); @@ -157,7 +150,7 @@ psppire_dialog_action_roc_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); - + return xml; } @@ -207,10 +200,10 @@ generate_syntax (const PsppireDialogAction *a) /* The /PLOT subcommand */ g_string_append (string, "\n\t/PLOT "); - if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->curve))) + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->curve))) { g_string_append (string, "CURVE"); - if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->reference))) + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->reference))) g_string_append (string, " (REFERENCE)"); } else @@ -218,15 +211,15 @@ generate_syntax (const PsppireDialogAction *a) /* The /PRINT subcommand */ - if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->standard_error)) || - gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->coordinates)) ) + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->standard_error)) || + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->coordinates))) { g_string_append (string, "\n\t/PRINT"); - if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->standard_error))) + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->standard_error))) g_string_append (string, " SE"); - if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->coordinates))) + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->coordinates))) g_string_append (string, " COORDINATES"); } @@ -242,7 +235,7 @@ generate_syntax (const PsppireDialogAction *a) static void psppire_dialog_action_roc_class_init (PsppireDialogActionRocClass *class) { - psppire_dialog_action_set_activation (class, psppire_dialog_action_roc_activate); + PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_roc_activate; PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax; }