From: John Darrington Date: Mon, 24 May 2010 07:50:50 +0000 (+0200) Subject: Added a SelectAll menuitem to the output viewer X-Git-Tag: v0.7.6~410 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4eddf2174e3fb4fe13850666996ecc35f2732d1a;p=pspp-builds.git Added a SelectAll menuitem to the output viewer --- diff --git a/src/ui/gui/output-viewer.ui b/src/ui/gui/output-viewer.ui index 13a39f88..57d37549 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 f2580b7b..2fddefc1 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"));