summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2017-11-07 10:14:17 +0100
committerraveit65 <[email protected]>2017-11-18 23:04:47 +0100
commitca53774e9fcb7ab8fb4402ac09db5ed3f6489c21 (patch)
tree835b7102a281eb7d3661155e578b0e13d955e98a /src
parent8c0cb6d5faef66548644f0289bfe7c1c84b9cb19 (diff)
downloadmate-terminal-ca53774e9fcb7ab8fb4402ac09db5ed3f6489c21.tar.bz2
mate-terminal-ca53774e9fcb7ab8fb4402ac09db5ed3f6489c21.tar.xz
allow remapping "search" keyboard shortcuts
Closes https://github.com/mate-desktop/mate-terminal/issues/160
Diffstat (limited to 'src')
-rw-r--r--src/org.mate.terminal.gschema.xml.in15
-rw-r--r--src/terminal-accels.c75
2 files changed, 64 insertions, 26 deletions
diff --git a/src/org.mate.terminal.gschema.xml.in b/src/org.mate.terminal.gschema.xml.in
index 3a3d5e1..0a45fc8 100644
--- a/src/org.mate.terminal.gschema.xml.in
+++ b/src/org.mate.terminal.gschema.xml.in
@@ -320,6 +320,21 @@
<summary>Keyboard shortcut to select all text</summary>
<description>Keyboard shortcut key for selecting all the text into the terminal. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action.</description>
</key>
+ <key name="search-find" type="s">
+ <default>'&lt;Ctrl&gt;&lt;Shift&gt;f'</default>
+ <summary>Keyboard shortcut to show the find dialog</summary>
+ <description>Keyboard shortcut key for showing the find dialog. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action.</description>
+ </key>
+ <key name="search-find-next" type="s">
+ <default>'&lt;Ctrl&gt;&lt;Shift&gt;h'</default>
+ <summary>Keyboard shortcut to find the next text</summary>
+ <description>Keyboard shortcut key for finding the next text into the terminal. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action.</description>
+ </key>
+ <key name="search-find-previous" type="s">
+ <default>'&lt;Ctrl&gt;&lt;Shift&gt;g'</default>
+ <summary>Keyboard shortcut to find the previous text</summary>
+ <description>Keyboard shortcut key for finding the previous text into the terminal. Expressed as a string in the same format used for GTK+ resource files. If you set the option to the special string "disabled", then there will be no keyboard shortcut for this action.</description>
+ </key>
<key name="full-screen" type="s">
<default>'F11'</default>
<summary>Keyboard shortcut to toggle full screen mode</summary>
diff --git a/src/terminal-accels.c b/src/terminal-accels.c
index d533477..ca285f3 100644
--- a/src/terminal-accels.c
+++ b/src/terminal-accels.c
@@ -56,6 +56,9 @@
#define ACCEL_PATH_COPY ACCEL_PATH_ROOT "EditCopy"
#define ACCEL_PATH_PASTE ACCEL_PATH_ROOT "EditPaste"
#define ACCEL_PATH_SELECT_ALL ACCEL_PATH_ROOT "EditSelectAll"
+#define ACCEL_PATH_SEARCH_FIND ACCEL_PATH_ROOT "SearchFind"
+#define ACCEL_PATH_SEARCH_FIND_NEXT ACCEL_PATH_ROOT "SearchFindNext"
+#define ACCEL_PATH_SEARCH_FIND_PREVIOUS ACCEL_PATH_ROOT "SearchFindPrevious"
#define ACCEL_PATH_TOGGLE_MENUBAR ACCEL_PATH_ROOT "ViewMenubar"
#define ACCEL_PATH_FULL_SCREEN ACCEL_PATH_ROOT "ViewFullscreen"
#define ACCEL_PATH_RESET ACCEL_PATH_ROOT "TerminalReset"
@@ -74,32 +77,35 @@
#define ACCEL_PATH_DETACH_TAB ACCEL_PATH_ROOT "TabsDetach"
#define ACCEL_PATH_SWITCH_TAB_PREFIX ACCEL_PATH_ROOT "TabsSwitch"
-#define KEY_CLOSE_TAB "close-tab"
-#define KEY_CLOSE_WINDOW "close-window"
-#define KEY_COPY "copy"
-#define KEY_DETACH_TAB "detach-tab"
-#define KEY_FULL_SCREEN "full-screen"
-#define KEY_HELP "help"
-#define KEY_MOVE_TAB_LEFT "move-tab-left"
-#define KEY_MOVE_TAB_RIGHT "move-tab-right"
-#define KEY_NEW_PROFILE "new-profile"
-#define KEY_NEW_TAB "new-tab"
-#define KEY_NEW_WINDOW "new-window"
-#define KEY_NEXT_PROFILE "next-profile"
-#define KEY_NEXT_TAB "next-tab"
-#define KEY_PASTE "paste"
-#define KEY_PREV_PROFILE "prev-profile"
-#define KEY_PREV_TAB "prev-tab"
-#define KEY_RESET_AND_CLEAR "reset-and-clear"
-#define KEY_RESET "reset"
-#define KEY_SELECT_ALL "select-all"
-#define KEY_SAVE_CONTENTS "save-contents"
-#define KEY_SET_TERMINAL_TITLE "set-terminal-title"
-#define KEY_TOGGLE_MENUBAR "toggle-menubar"
-#define KEY_ZOOM_IN "zoom-in"
-#define KEY_ZOOM_NORMAL "zoom-normal"
-#define KEY_ZOOM_OUT "zoom-out"
-#define KEY_SWITCH_TAB_PREFIX "switch-to-tab-"
+#define KEY_CLOSE_TAB "close-tab"
+#define KEY_CLOSE_WINDOW "close-window"
+#define KEY_COPY "copy"
+#define KEY_DETACH_TAB "detach-tab"
+#define KEY_FULL_SCREEN "full-screen"
+#define KEY_HELP "help"
+#define KEY_MOVE_TAB_LEFT "move-tab-left"
+#define KEY_MOVE_TAB_RIGHT "move-tab-right"
+#define KEY_NEW_PROFILE "new-profile"
+#define KEY_NEW_TAB "new-tab"
+#define KEY_NEW_WINDOW "new-window"
+#define KEY_NEXT_PROFILE "next-profile"
+#define KEY_NEXT_TAB "next-tab"
+#define KEY_PASTE "paste"
+#define KEY_PREV_PROFILE "prev-profile"
+#define KEY_PREV_TAB "prev-tab"
+#define KEY_RESET_AND_CLEAR "reset-and-clear"
+#define KEY_RESET "reset"
+#define KEY_SEARCH_FIND "search-find"
+#define KEY_SEARCH_FIND_NEXT "search-find-next"
+#define KEY_SEARCH_FIND_PREVIOUS "search-find-previous"
+#define KEY_SELECT_ALL "select-all"
+#define KEY_SAVE_CONTENTS "save-contents"
+#define KEY_SET_TERMINAL_TITLE "set-terminal-title"
+#define KEY_TOGGLE_MENUBAR "toggle-menubar"
+#define KEY_ZOOM_IN "zoom-in"
+#define KEY_ZOOM_NORMAL "zoom-normal"
+#define KEY_ZOOM_OUT "zoom-out"
+#define KEY_SWITCH_TAB_PREFIX "switch-to-tab-"
#if 1
/*
@@ -206,6 +212,22 @@ static KeyEntry view_entries[] =
}
};
+static KeyEntry search_entries[] =
+{
+ {
+ N_("Find..."),
+ KEY_SEARCH_FIND, ACCEL_PATH_SEARCH_FIND, GDK_SHIFT_MASK | GDK_CONTROL_MASK, GDK_KEY_f, NULL, FALSE, TRUE
+ },
+ {
+ N_("Find Next"),
+ KEY_SEARCH_FIND_NEXT, ACCEL_PATH_SEARCH_FIND_NEXT, GDK_SHIFT_MASK | GDK_CONTROL_MASK, GDK_KEY_h, NULL, FALSE, TRUE
+ },
+ {
+ N_("Find Previous"),
+ KEY_SEARCH_FIND_PREVIOUS, ACCEL_PATH_SEARCH_FIND_PREVIOUS, GDK_SHIFT_MASK | GDK_CONTROL_MASK, GDK_KEY_g, NULL, FALSE, TRUE
+ }
+};
+
static KeyEntry terminal_entries[] =
{
{
@@ -324,6 +346,7 @@ static KeyEntryList all_entries[] =
{ file_entries, G_N_ELEMENTS (file_entries), N_("File") },
{ edit_entries, G_N_ELEMENTS (edit_entries), N_("Edit") },
{ view_entries, G_N_ELEMENTS (view_entries), N_("View") },
+ { search_entries, G_N_ELEMENTS (search_entries), N_("Search") },
{ terminal_entries, G_N_ELEMENTS (terminal_entries), N_("Terminal") },
{ tabs_entries, G_N_ELEMENTS (tabs_entries), N_("Tabs") },
{ help_entries, G_N_ELEMENTS (help_entries), N_("Help") }