psppire-var-sheet: Make clicking on Variables column select all data.
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 14 Oct 2012 18:45:36 +0000 (11:45 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 14 Oct 2012 18:46:06 +0000 (11:46 -0700)
This does what users expect in the variable sheet.

Reported by John Darrington.

src/ui/gui/psppire-var-sheet.c

index 0234573196c96d0f1675344d2027e24f404f7ab6..970da7dfbcb491c81ce21e3f0ee5a3cb38c51189 100644 (file)
@@ -1054,6 +1054,16 @@ psppire_var_sheet_row_number_double_clicked (PsppireCellRendererButton *button,
   gtk_tree_path_free (path);
 }
 
+static void
+psppire_var_sheet_variables_column_clicked (PsppSheetViewColumn *column,
+                                            PsppireVarSheet *var_sheet)
+{
+  PsppSheetView *sheet_view = PSPP_SHEET_VIEW (var_sheet);
+  PsppSheetSelection *selection = pspp_sheet_view_get_selection (sheet_view);
+
+  pspp_sheet_selection_select_all (selection);
+}
+
 static PsppSheetViewColumn *
 make_row_number_column (PsppireVarSheet *var_sheet)
 {
@@ -1068,9 +1078,14 @@ make_row_number_column (PsppireVarSheet *var_sheet)
 
   column = pspp_sheet_view_column_new_with_attributes (_("Variable"),
                                                        renderer, NULL);
+  pspp_sheet_view_column_set_clickable (column, TRUE);
   pspp_sheet_view_column_set_cell_data_func (
     column, renderer, render_row_number_cell, var_sheet, NULL);
   pspp_sheet_view_column_set_fixed_width (column, 50);
+  g_signal_connect (column, "clicked",
+                    G_CALLBACK (psppire_var_sheet_variables_column_clicked),
+                    var_sheet);
+
   return column;
 }