Compute dialog: Avoid double population
authorJohn Darrington <john@darrington.wattle.id.au>
Wed, 9 Dec 2015 07:14:56 +0000 (08:14 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Wed, 9 Dec 2015 12:25:17 +0000 (13:25 +0100)
src/ui/gui/psppire-dialog-action-compute.c

index 164737ce21b6fa1853d8cd3a78d2c7aeb158bc41..01c9136ee0ef96f3fc8e0c6b1eba092d9862b8ca 100644 (file)
@@ -467,65 +467,65 @@ psppire_dialog_action_compute_activate (GtkAction *a)
     {
       xml = builder_new ("compute.ui");
       g_hash_table_insert (thing, a, xml);
-    }
 
-  pda->dialog = get_widget_assert   (xml, "compute-variable-dialog");
-  pda->source = get_widget_assert   (xml, "compute-treeview1");
+      pda->dialog = get_widget_assert   (xml, "compute-variable-dialog");
+      pda->source = get_widget_assert   (xml, "compute-treeview1");
 
-  act->textview = get_widget_assert (xml, "compute-textview1");
-  act->entry =
-    get_widget_assert (xml, "type-and-label-label-entry");
+      act->textview = get_widget_assert (xml, "compute-textview1");
+      act->entry =
+       get_widget_assert (xml, "type-and-label-label-entry");
 
-  act->width_entry =
-    get_widget_assert (xml, "type-and-label-width");
+      act->width_entry =
+       get_widget_assert (xml, "type-and-label-width");
 
-  act->functions = get_widget_assert (xml, "compute-treeview2");
-  act->keypad    = get_widget_assert (xml, "psppire-keypad1");
-  act->target    = get_widget_assert (xml, "compute-entry1");
-  act->var_selector = get_widget_assert (xml, "compute-selector1");
-  act->func_selector = get_widget_assert (xml, "compute-selector2");
-  act->type_and_label = get_widget_assert (xml, "compute-button1");
+      act->functions = get_widget_assert (xml, "compute-treeview2");
+      act->keypad    = get_widget_assert (xml, "psppire-keypad1");
+      act->target    = get_widget_assert (xml, "compute-entry1");
+      act->var_selector = get_widget_assert (xml, "compute-selector1");
+      act->func_selector = get_widget_assert (xml, "compute-selector2");
+      act->type_and_label = get_widget_assert (xml, "compute-button1");
 
-  act->subdialog = get_widget_assert (xml, "type-and-label-dialog");
+      act->subdialog = get_widget_assert (xml, "type-and-label-dialog");
 
-  act->numeric_target = get_widget_assert (xml, "radio-button-numeric");
-  act->expression = get_widget_assert (xml, "radio-button-expression-label");
-  act->user_label  = get_widget_assert (xml, "radio-button-user-label");
-  act->str_btn    = get_widget_assert (xml, "radio-button-string");
+      act->numeric_target = get_widget_assert (xml, "radio-button-numeric");
+      act->expression = get_widget_assert (xml, "radio-button-expression-label");
+      act->user_label  = get_widget_assert (xml, "radio-button-user-label");
+      act->str_btn    = get_widget_assert (xml, "radio-button-string");
 
-  g_signal_connect (act->expression, "toggled",
-                   G_CALLBACK (on_expression_toggle), pda);
+      g_signal_connect (act->expression, "toggled",
+                       G_CALLBACK (on_expression_toggle), pda);
 
-  g_signal_connect (act->str_btn, "toggled",
-                   G_CALLBACK (on_type_toggled), pda);
+      g_signal_connect (act->str_btn, "toggled",
+                       G_CALLBACK (on_type_toggled), pda);
 
 
-  g_object_set (pda->source,
-               "selection-mode", GTK_SELECTION_SINGLE,
-               NULL);
+      g_object_set (pda->source,
+                   "selection-mode", GTK_SELECTION_SINGLE,
+                   NULL);
 
-  psppire_selector_set_select_func (PSPPIRE_SELECTOR (act->var_selector),
-                                   insert_source_row_into_text_view, NULL);
+      psppire_selector_set_select_func (PSPPIRE_SELECTOR (act->var_selector),
+                                       insert_source_row_into_text_view, NULL);
 
 
-  function_list_populate (GTK_TREE_VIEW (act->functions));
+      function_list_populate (GTK_TREE_VIEW (act->functions));
 
-  psppire_selector_set_select_func (PSPPIRE_SELECTOR (act->func_selector),
-                                   insert_function_into_syntax_area, NULL);
+      psppire_selector_set_select_func (PSPPIRE_SELECTOR (act->func_selector),
+                                       insert_function_into_syntax_area, NULL);
 
-  g_signal_connect (act->target, "changed", G_CALLBACK (on_target_change), act);
+      g_signal_connect (act->target, "changed", G_CALLBACK (on_target_change), act);
 
-  g_signal_connect (act->keypad, "insert-syntax",
-                   G_CALLBACK (on_keypad_button),  act);
+      g_signal_connect (act->keypad, "insert-syntax",
+                       G_CALLBACK (on_keypad_button),  act);
 
-  g_signal_connect (act->keypad, "erase",
-                   G_CALLBACK (erase),  act);
+      g_signal_connect (act->keypad, "erase",
+                       G_CALLBACK (erase),  act);
 
-  g_signal_connect (act->type_and_label, "clicked",
-                   G_CALLBACK (run_type_label_dialog),  pda);
+      g_signal_connect (act->type_and_label, "clicked",
+                       G_CALLBACK (run_type_label_dialog),  pda);
 
-  psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
-  psppire_dialog_action_set_refresh (pda, refresh);
+      psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
+      psppire_dialog_action_set_refresh (pda, refresh);
+    }
 
   if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_compute_parent_class)->activate)
     PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_compute_parent_class)->activate (pda);