Added a SelectAll menuitem to the output viewer
authorJohn Darrington <john@darrington.wattle.id.au>
Mon, 24 May 2010 07:50:50 +0000 (09:50 +0200)
committerBen Pfaff <blp@cs.stanford.edu>
Mon, 24 May 2010 16:27:27 +0000 (09:27 -0700)
src/ui/gui/output-viewer.ui
src/ui/gui/psppire-output-window.c

index 13a39f8889ee89b08b204ec7d27bf12023fa24f1..57d3754942c55e24aa526938c42b09b2238c4e26 100644 (file)
             <property name="label" translatable="yes">_Edit</property>
           </object>
         </child>
+        <child>
+          <object class="GtkAction" id="edit_select-all">
+            <property name="name">edit_select-all</property>
+            <property name="label" translatable="yes">Select _All</property>
+          </object>
+        </child>
         <child>
           <object class="GtkAction" id="edit_copy">
             <property name="stock-id">gtk-copy</property>
@@ -56,6 +62,7 @@
         </menu>
         <menu action="menuitem2">
           <menuitem action="edit_copy"/>
+          <menuitem action="edit_select-all"/>
         </menu>
         <menu action="windows_menuitem">
           <menuitem action="windows_minimise-all"/>
index f2580b7b16ca225844caa6ecc5bb150fc8d49658..2fddefc16ab1857b15c9d558d0417109e2525b9c 100644 (file)
@@ -715,6 +715,14 @@ on_selection_change (GtkTreeSelection *sel, GtkAction *copy_action)
   gtk_action_set_sensitive (copy_action, gtk_tree_selection_count_selected_rows (sel) > 0);
 }
 
+static void
+on_select_all (PsppireOutputWindow *window)
+{
+  GtkTreeSelection *sel = gtk_tree_view_get_selection (window->overview);
+  gtk_tree_selection_select_all (sel);
+}
+
+
 static void
 psppire_output_window_init (PsppireOutputWindow *window)
 {
@@ -722,16 +730,20 @@ psppire_output_window_init (PsppireOutputWindow *window)
   GtkCellRenderer *renderer;
   GtkBuilder *xml;
   GtkAction *copy_action;
+  GtkAction *select_all_action;
   GtkTreeSelection *sel;
 
   xml = builder_new ("output-viewer.ui");
 
   copy_action = get_action_assert (xml, "edit_copy");
+  select_all_action = get_action_assert (xml, "edit_select-all");
 
   gtk_action_set_sensitive (copy_action, FALSE);
 
   g_signal_connect_swapped (copy_action, "activate", G_CALLBACK (on_copy), window);
 
+  g_signal_connect_swapped (select_all_action, "activate", G_CALLBACK (on_select_all), window);
+
   gtk_widget_reparent (get_widget_assert (xml, "vbox1"), GTK_WIDGET (window));
 
   window->output = GTK_LAYOUT (get_widget_assert (xml, "output"));