[Xfce4-commits] <terminal:master> Add 'Select All' shortcut and menu item
Nick Schermer
noreply at xfce.org
Sun Jun 19 13:54:01 CEST 2011
Updating branch refs/heads/master
to e5cbffbe345ceced7d4737f1de3e09f24b176502 (commit)
from 402dafbcb734c5cafcb05fa026971c267e5510f8 (commit)
commit e5cbffbe345ceced7d4737f1de3e09f24b176502
Author: Enrico Tröger <enrico.troeger at uvena.de>
Date: Thu Jul 29 20:45:54 2010 +0200
Add 'Select All' shortcut and menu item
terminal/terminal-preferences.c | 12 ++++++++++++
terminal/terminal-screen.c | 15 +++++++++++++++
terminal/terminal-screen.h | 2 ++
terminal/terminal-shortcut-editor.c | 1 +
terminal/terminal-window-ui.xml | 4 +++-
terminal/terminal-window.c | 13 +++++++++++++
6 files changed, 46 insertions(+), 1 deletions(-)
diff --git a/terminal/terminal-preferences.c b/terminal/terminal-preferences.c
index 0809118..b57f902 100644
--- a/terminal/terminal-preferences.c
+++ b/terminal/terminal-preferences.c
@@ -50,6 +50,7 @@ enum
PROP_ACCEL_COPY,
PROP_ACCEL_PASTE,
PROP_ACCEL_PASTE_SELECTION,
+ PROP_ACCEL_SELECT_ALL,
PROP_ACCEL_PREFERENCES,
PROP_ACCEL_SHOW_MENUBAR,
PROP_ACCEL_SHOW_TOOLBARS,
@@ -389,6 +390,17 @@ terminal_preferences_class_init (TerminalPreferencesClass *klass)
EXO_PARAM_READWRITE));
/**
+ * TerminalPreferences:accel-select-all:
+ **/
+ g_object_class_install_property (gobject_class,
+ PROP_ACCEL_SELECT_ALL,
+ g_param_spec_string ("accel-select-all",
+ _("Select All"),
+ "AccelSelectAll",
+ "<Shift><Control>a",
+ EXO_PARAM_READWRITE));
+
+ /**
* TerminalPreferences:accel-preferences:
**/
g_object_class_install_property (gobject_class,
diff --git a/terminal/terminal-screen.c b/terminal/terminal-screen.c
index a5312eb..0c0217a 100644
--- a/terminal/terminal-screen.c
+++ b/terminal/terminal-screen.c
@@ -1876,6 +1876,21 @@ terminal_screen_paste_primary (TerminalScreen *screen)
/**
+ * terminal_screen_select_all:
+ * @screen : A #TerminalScreen.
+ *
+ * Selects all text in the terminal.
+ **/
+void
+terminal_screen_select_all (TerminalScreen *screen)
+{
+ terminal_return_if_fail (TERMINAL_IS_SCREEN (screen));
+ vte_terminal_select_all (VTE_TERMINAL (screen->terminal));
+}
+
+
+
+/**
* terminal_screen_reset:
* @screen : A #TerminalScreen.
* @clear : %TRUE to also clear the terminal screen.
diff --git a/terminal/terminal-screen.h b/terminal/terminal-screen.h
index 7498409..faee251 100644
--- a/terminal/terminal-screen.h
+++ b/terminal/terminal-screen.h
@@ -74,6 +74,8 @@ void terminal_screen_copy_clipboard (TerminalScreen *scree
void terminal_screen_paste_clipboard (TerminalScreen *screen);
void terminal_screen_paste_primary (TerminalScreen *screen);
+void terminal_screen_select_all (TerminalScreen *screen);
+
void terminal_screen_reset (TerminalScreen *screen,
gboolean clear);
diff --git a/terminal/terminal-shortcut-editor.c b/terminal/terminal-shortcut-editor.c
index ed057f2..de3021c 100644
--- a/terminal/terminal-shortcut-editor.c
+++ b/terminal/terminal-shortcut-editor.c
@@ -101,6 +101,7 @@ static const ToplevelMenu toplevel_menus[] =
"accel-copy",
"accel-paste",
"accel-paste-selection",
+ "accel-select-all",
"accel-preferences",
NULL,
},
diff --git a/terminal/terminal-window-ui.xml b/terminal/terminal-window-ui.xml
index 9709078..cf298b3 100644
--- a/terminal/terminal-window-ui.xml
+++ b/terminal/terminal-window-ui.xml
@@ -1,7 +1,7 @@
<ui>
<!--
Copyright (c) 2004-2007 os-cillation
-
+
Terminal User Interface description file, parsed by Terminal to create
the menu bar and the right click menu.
-->
@@ -22,6 +22,8 @@
<menuitem action="paste" />
<menuitem action="paste-selection" />
<separator />
+ <menuitem action="select-all" />
+ <separator />
<menuitem action="edit-toolbars" />
<menuitem action="preferences" />
</menu>
diff --git a/terminal/terminal-window.c b/terminal/terminal-window.c
index 0d461a4..0607f5f 100644
--- a/terminal/terminal-window.c
+++ b/terminal/terminal-window.c
@@ -153,6 +153,8 @@ static void terminal_window_action_paste (GtkAction
TerminalWindow *window);
static void terminal_window_action_paste_selection (GtkAction *action,
TerminalWindow *window);
+static void terminal_window_action_select_all (GtkAction *action,
+ TerminalWindow *window);
static void terminal_window_action_edit_toolbars (GtkAction *action,
TerminalWindow *window);
static void terminal_window_action_prefs (GtkAction *action,
@@ -224,6 +226,7 @@ static const GtkActionEntry action_entries[] =
{ "copy", GTK_STOCK_COPY, N_ ("_Copy"), NULL, N_ ("Copy to clipboard"), G_CALLBACK (terminal_window_action_copy), },
{ "paste", GTK_STOCK_PASTE, N_ ("_Paste"), NULL, N_ ("Paste from clipboard"), G_CALLBACK (terminal_window_action_paste), },
{ "paste-selection", NULL, N_ ("Paste _Selection"), NULL, N_ ("Paste from primary selection"), G_CALLBACK (terminal_window_action_paste_selection), },
+ { "select-all", GTK_STOCK_SELECT_ALL, N_ ("Select _All"), NULL, N_ ("Select all text in the terminal"), G_CALLBACK (terminal_window_action_select_all), },
{ "edit-toolbars", NULL, N_ ("_Toolbars..."), NULL, N_ ("Customize the toolbars"), G_CALLBACK (terminal_window_action_edit_toolbars), },
{ "preferences", GTK_STOCK_PREFERENCES, N_ ("Pr_eferences..."), NULL, N_ ("Open the Terminal preferences dialog"), G_CALLBACK (terminal_window_action_prefs), },
{ "view-menu", NULL, N_ ("_View"), NULL, NULL, NULL, },
@@ -1318,6 +1321,16 @@ terminal_window_action_paste_selection (GtkAction *action,
static void
+terminal_window_action_select_all (GtkAction *action,
+ TerminalWindow *window)
+{
+ if (G_LIKELY (window->active != NULL))
+ terminal_screen_select_all (window->active);
+}
+
+
+
+static void
terminal_window_action_edit_toolbars (GtkAction *action,
TerminalWindow *window)
{
More information about the Xfce4-commits
mailing list