From 4eddf2174e3fb4fe13850666996ecc35f2732d1a Mon Sep 17 00:00:00 2001 From: John Darrington Date: Mon, 24 May 2010 09:50:50 +0200 Subject: [PATCH] Added a SelectAll menuitem to the output viewer --- src/ui/gui/output-viewer.ui | 7 +++++++ src/ui/gui/psppire-output-window.c | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/ui/gui/output-viewer.ui b/src/ui/gui/output-viewer.ui index 13a39f8889..57d3754942 100644 --- a/src/ui/gui/output-viewer.ui +++ b/src/ui/gui/output-viewer.ui @@ -28,6 +28,12 @@ _Edit + + + edit_select-all + Select _All + + gtk-copy @@ -56,6 +62,7 @@ + diff --git a/src/ui/gui/psppire-output-window.c b/src/ui/gui/psppire-output-window.c index f2580b7b16..2fddefc16a 100644 --- a/src/ui/gui/psppire-output-window.c +++ b/src/ui/gui/psppire-output-window.c @@ -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")); -- 2.30.2