Created
March 18, 2018 10:49
-
-
Save BrianOn99/8ec7b753b75678b727158f76f3da2159 to your computer and use it in GitHub Desktop.
vte_search.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=== modified file 'po/ca.po' | |
--- po/ca.po 2017-12-30 16:58:52 +0000 | |
+++ po/ca.po 2018-03-18 09:52:14 +0000 | |
@@ -5,7 +5,7 @@ | |
msgstr "" | |
"Project-Id-Version: sakura\n" | |
"Report-Msgid-Bugs-To: \n" | |
-"POT-Creation-Date: 2017-09-14 21:02+0200\n" | |
+"POT-Creation-Date: 2018-03-18 17:52+0800\n" | |
"PO-Revision-Date: 2015-07-26 17:52+0000\n" | |
"Last-Translator: David Gómez <[email protected]>\n" | |
"Language-Team: Jordi Jané Cardo <[email protected]>\n" | |
@@ -117,6 +117,9 @@ | |
msgid "Opacity level (%)" | |
msgstr "Nivell d'opacitat (%)" | |
+msgid "Search" | |
+msgstr "" | |
+ | |
msgid "New window title" | |
msgstr "Definiu el nom de la finestra" | |
=== modified file 'po/cs.po' | |
--- po/cs.po 2017-12-30 16:58:52 +0000 | |
+++ po/cs.po 2018-03-18 09:52:14 +0000 | |
@@ -7,7 +7,7 @@ | |
msgstr "" | |
"Project-Id-Version: sakura 2.3.8\n" | |
"Report-Msgid-Bugs-To: \n" | |
-"POT-Creation-Date: 2017-09-14 21:02+0200\n" | |
+"POT-Creation-Date: 2018-03-18 17:52+0800\n" | |
"PO-Revision-Date: 2014-06-23 01:17+0000\n" | |
"Last-Translator: David Gómez <[email protected]>\n" | |
"Language-Team: Czech <[email protected]>\n" | |
@@ -126,6 +126,9 @@ | |
msgid "Opacity level (%)" | |
msgstr "Úroveň průhlednosti (%):" | |
+msgid "Search" | |
+msgstr "" | |
+ | |
msgid "New window title" | |
msgstr "Název nového okna" | |
=== modified file 'po/de.po' | |
--- po/de.po 2017-12-30 16:58:52 +0000 | |
+++ po/de.po 2018-03-18 09:52:14 +0000 | |
@@ -7,7 +7,7 @@ | |
msgstr "" | |
"Project-Id-Version: 2.3.4\n" | |
"Report-Msgid-Bugs-To: \n" | |
-"POT-Creation-Date: 2017-09-14 21:02+0200\n" | |
+"POT-Creation-Date: 2018-03-18 17:52+0800\n" | |
"PO-Revision-Date: 2015-07-26 17:00+0000\n" | |
"Last-Translator: David Gómez <[email protected]>\n" | |
"Language-Team: Deutsch <[email protected]>\n" | |
@@ -120,6 +120,9 @@ | |
msgid "Opacity level (%)" | |
msgstr "Opazitätsgrad (%)" | |
+msgid "Search" | |
+msgstr "" | |
+ | |
msgid "New window title" | |
msgstr "Fenstertitel wählen" | |
=== modified file 'po/en_GB.po' | |
--- po/en_GB.po 2017-12-30 16:58:52 +0000 | |
+++ po/en_GB.po 2018-03-18 09:52:14 +0000 | |
@@ -7,7 +7,7 @@ | |
msgstr "" | |
"Project-Id-Version: sakura\n" | |
"Report-Msgid-Bugs-To: \n" | |
-"POT-Creation-Date: 2017-09-14 21:02+0200\n" | |
+"POT-Creation-Date: 2018-03-18 17:52+0800\n" | |
"PO-Revision-Date: 2015-11-24 16:05+0000\n" | |
"Last-Translator: David Gómez <[email protected]>\n" | |
"Language-Team: English (United Kingdom) <[email protected]>\n" | |
@@ -115,6 +115,9 @@ | |
msgid "Opacity level (%)" | |
msgstr "Opacity level (%)" | |
+msgid "Search" | |
+msgstr "" | |
+ | |
msgid "New window title" | |
msgstr "New window title" | |
=== modified file 'po/es.po' | |
--- po/es.po 2017-12-30 16:58:52 +0000 | |
+++ po/es.po 2018-03-18 09:52:14 +0000 | |
@@ -5,7 +5,7 @@ | |
msgstr "" | |
"Project-Id-Version: sakura\n" | |
"Report-Msgid-Bugs-To: \n" | |
-"POT-Creation-Date: 2017-09-14 21:02+0200\n" | |
+"POT-Creation-Date: 2018-03-18 17:52+0800\n" | |
"PO-Revision-Date: 2015-11-24 19:54+0000\n" | |
"Last-Translator: David Gómez <[email protected]>\n" | |
"Language-Team: <[email protected]>\n" | |
@@ -113,6 +113,9 @@ | |
msgid "Opacity level (%)" | |
msgstr "Nivel de opacidad (%)" | |
+msgid "Search" | |
+msgstr "" | |
+ | |
msgid "New window title" | |
msgstr "Título nuevo de la ventana" | |
=== modified file 'po/fr.po' | |
--- po/fr.po 2017-12-30 16:58:52 +0000 | |
+++ po/fr.po 2018-03-18 09:52:14 +0000 | |
@@ -6,7 +6,7 @@ | |
msgstr "" | |
"Project-Id-Version: sakura 1.2.0\n" | |
"Report-Msgid-Bugs-To: \n" | |
-"POT-Creation-Date: 2017-09-14 21:02+0200\n" | |
+"POT-Creation-Date: 2018-03-18 17:52+0800\n" | |
"PO-Revision-Date: 2015-07-26 16:54+0000\n" | |
"Last-Translator: David Gómez <[email protected]>\n" | |
"Language-Team: <[email protected]>\n" | |
@@ -113,6 +113,9 @@ | |
msgid "Opacity level (%)" | |
msgstr "Niveau d'opacité (%)" | |
+msgid "Search" | |
+msgstr "" | |
+ | |
msgid "New window title" | |
msgstr "Définir le titre de la fenêtre" | |
=== modified file 'po/he.po' | |
--- po/he.po 2017-12-30 16:58:52 +0000 | |
+++ po/he.po 2018-03-18 09:52:14 +0000 | |
@@ -7,7 +7,7 @@ | |
msgstr "" | |
"Project-Id-Version: sakura 3.1.4\n" | |
"Report-Msgid-Bugs-To: \n" | |
-"POT-Creation-Date: 2017-09-14 21:02+0200\n" | |
+"POT-Creation-Date: 2018-03-18 17:52+0800\n" | |
"PO-Revision-Date: 2015-07-26 17:10+0000\n" | |
"Last-Translator: David Gómez <[email protected]>\n" | |
"Language-Team: Rahut <[email protected]>\n" | |
@@ -137,6 +137,9 @@ | |
msgid "Opacity level (%)" | |
msgstr "רמת העמימות (%)" | |
+msgid "Search" | |
+msgstr "" | |
+ | |
msgid "New window title" | |
msgstr "כותרת חלון חדשה" | |
=== modified file 'po/hr.po' | |
--- po/hr.po 2017-12-30 16:58:52 +0000 | |
+++ po/hr.po 2018-03-18 09:52:14 +0000 | |
@@ -6,7 +6,7 @@ | |
msgstr "" | |
"Project-Id-Version: Sakura 2.3.2\n" | |
"Report-Msgid-Bugs-To: \n" | |
-"POT-Creation-Date: 2017-09-14 21:02+0200\n" | |
+"POT-Creation-Date: 2018-03-18 17:52+0800\n" | |
"PO-Revision-Date: 2015-10-14 17:21+0000\n" | |
"Last-Translator: gogo <[email protected]>\n" | |
"Language-Team: brentaal <Unknown>\n" | |
@@ -123,6 +123,9 @@ | |
msgid "Opacity level (%)" | |
msgstr "Nivo zasićenosti (%):" | |
+msgid "Search" | |
+msgstr "" | |
+ | |
msgid "New window title" | |
msgstr "Novi naslov prozora" | |
=== modified file 'po/hu.po' | |
--- po/hu.po 2017-12-30 16:58:52 +0000 | |
+++ po/hu.po 2018-03-18 09:52:14 +0000 | |
@@ -5,7 +5,7 @@ | |
msgstr "" | |
"Project-Id-Version: sakura\n" | |
"Report-Msgid-Bugs-To: \n" | |
-"POT-Creation-Date: 2017-09-14 21:02+0200\n" | |
+"POT-Creation-Date: 2018-03-18 17:52+0800\n" | |
"PO-Revision-Date: 2016-04-21 00:01+0000\n" | |
"Last-Translator: David Gómez <[email protected]>\n" | |
"Language-Team: hu\n" | |
@@ -113,6 +113,9 @@ | |
msgid "Opacity level (%)" | |
msgstr "Átlátszóság mértéke (%)" | |
+msgid "Search" | |
+msgstr "" | |
+ | |
msgid "New window title" | |
msgstr "Új ablakcím" | |
=== modified file 'po/it.po' | |
--- po/it.po 2017-12-30 16:58:52 +0000 | |
+++ po/it.po 2018-03-18 09:52:14 +0000 | |
@@ -5,7 +5,7 @@ | |
msgstr "" | |
"Project-Id-Version: sakura\n" | |
"Report-Msgid-Bugs-To: \n" | |
-"POT-Creation-Date: 2017-09-14 21:02+0200\n" | |
+"POT-Creation-Date: 2018-03-18 17:52+0800\n" | |
"PO-Revision-Date: 2016-02-08 09:47+0000\n" | |
"Last-Translator: David Gómez <[email protected]>\n" | |
"Language-Team: sakura-it <[email protected]>\n" | |
@@ -118,6 +118,9 @@ | |
msgid "Opacity level (%)" | |
msgstr "Livello di opacità (%)" | |
+msgid "Search" | |
+msgstr "" | |
+ | |
msgid "New window title" | |
msgstr "Nuovo titolo della finestra" | |
=== modified file 'po/ja.po' | |
--- po/ja.po 2017-12-30 16:58:52 +0000 | |
+++ po/ja.po 2018-03-18 09:52:14 +0000 | |
@@ -4,7 +4,7 @@ | |
msgstr "" | |
"Project-Id-Version: ja\n" | |
"Report-Msgid-Bugs-To: \n" | |
-"POT-Creation-Date: 2017-09-14 21:02+0200\n" | |
+"POT-Creation-Date: 2018-03-18 17:52+0800\n" | |
"PO-Revision-Date: 2016-01-30 07:01+0000\n" | |
"Last-Translator: David Gómez <[email protected]>\n" | |
"Language-Team: Japanese <[email protected]>\n" | |
@@ -112,6 +112,9 @@ | |
msgid "Opacity level (%)" | |
msgstr "不透過率 (%)" | |
+msgid "Search" | |
+msgstr "" | |
+ | |
msgid "New window title" | |
msgstr "新しいウィンドウタイトル" | |
=== modified file 'po/ko.po' | |
--- po/ko.po 2017-12-30 16:58:52 +0000 | |
+++ po/ko.po 2018-03-18 09:52:14 +0000 | |
@@ -7,7 +7,7 @@ | |
msgstr "" | |
"Project-Id-Version: sakura\n" | |
"Report-Msgid-Bugs-To: \n" | |
-"POT-Creation-Date: 2017-09-14 21:02+0200\n" | |
+"POT-Creation-Date: 2018-03-18 17:52+0800\n" | |
"PO-Revision-Date: 2016-02-08 09:40+0000\n" | |
"Last-Translator: David Gómez <[email protected]>\n" | |
"Language-Team: Korean <[email protected]>\n" | |
@@ -115,6 +115,9 @@ | |
msgid "Opacity level (%)" | |
msgstr "불투명도" | |
+msgid "Search" | |
+msgstr "" | |
+ | |
msgid "New window title" | |
msgstr "새 창 제목" | |
=== modified file 'po/pl.po' | |
--- po/pl.po 2017-12-30 16:58:52 +0000 | |
+++ po/pl.po 2018-03-18 09:52:14 +0000 | |
@@ -7,7 +7,7 @@ | |
msgstr "" | |
"Project-Id-Version: sakura\n" | |
"Report-Msgid-Bugs-To: \n" | |
-"POT-Creation-Date: 2017-09-14 21:02+0200\n" | |
+"POT-Creation-Date: 2018-03-18 17:52+0800\n" | |
"PO-Revision-Date: 2014-06-23 01:17+0000\n" | |
"Last-Translator: David Gómez <[email protected]>\n" | |
"Language-Team: Polish <[email protected]>\n" | |
@@ -126,6 +126,9 @@ | |
msgid "Opacity level (%)" | |
msgstr "Przezroczystość (%):" | |
+msgid "Search" | |
+msgstr "" | |
+ | |
msgid "New window title" | |
msgstr "Nowy tytuł okna" | |
=== modified file 'po/pt.po' | |
--- po/pt.po 2017-12-30 16:58:52 +0000 | |
+++ po/pt.po 2018-03-18 09:52:14 +0000 | |
@@ -7,7 +7,7 @@ | |
msgstr "" | |
"Project-Id-Version: sakura\n" | |
"Report-Msgid-Bugs-To: \n" | |
-"POT-Creation-Date: 2017-09-14 21:02+0200\n" | |
+"POT-Creation-Date: 2018-03-18 17:52+0800\n" | |
"PO-Revision-Date: 2015-07-27 20:27+0000\n" | |
"Last-Translator: Sérgio Marques <Unknown>\n" | |
"Language-Team: Portuguese <[email protected]>\n" | |
@@ -119,6 +119,9 @@ | |
msgid "Opacity level (%)" | |
msgstr "Nivel de opacidade (%)" | |
+msgid "Search" | |
+msgstr "" | |
+ | |
msgid "New window title" | |
msgstr "Título da nova janela" | |
=== modified file 'po/pt_BR.po' | |
--- po/pt_BR.po 2017-12-30 16:58:52 +0000 | |
+++ po/pt_BR.po 2018-03-18 09:52:14 +0000 | |
@@ -2,7 +2,7 @@ | |
msgstr "" | |
"Project-Id-Version: sakura\n" | |
"Report-Msgid-Bugs-To: \n" | |
-"POT-Creation-Date: 2017-09-14 21:02+0200\n" | |
+"POT-Creation-Date: 2018-03-18 17:52+0800\n" | |
"PO-Revision-Date: 2015-07-26 17:44+0000\n" | |
"Last-Translator: David Gómez <[email protected]>\n" | |
"Language-Team: [email protected] <[email protected]>\n" | |
@@ -115,6 +115,9 @@ | |
msgid "Opacity level (%)" | |
msgstr "Nível de opacidade (%):" | |
+msgid "Search" | |
+msgstr "" | |
+ | |
msgid "New window title" | |
msgstr "Definir título da janela" | |
=== modified file 'po/ru.po' | |
--- po/ru.po 2017-12-30 16:58:52 +0000 | |
+++ po/ru.po 2018-03-18 09:52:14 +0000 | |
@@ -2,7 +2,7 @@ | |
msgstr "" | |
"Project-Id-Version: sakura\n" | |
"Report-Msgid-Bugs-To: \n" | |
-"POT-Creation-Date: 2017-09-14 21:02+0200\n" | |
+"POT-Creation-Date: 2018-03-18 17:52+0800\n" | |
"PO-Revision-Date: 2015-11-23 14:11+0000\n" | |
"Last-Translator: ManDrive <[email protected]>\n" | |
"Language-Team: Evgenij Vdovin <[email protected]>\n" | |
@@ -109,6 +109,9 @@ | |
msgid "Opacity level (%)" | |
msgstr "Уровень прозрачности (%)" | |
+msgid "Search" | |
+msgstr "" | |
+ | |
msgid "New window title" | |
msgstr "Новый заголовок окна:" | |
=== modified file 'po/sv.po' | |
--- po/sv.po 2017-12-30 16:58:52 +0000 | |
+++ po/sv.po 2018-03-18 09:52:14 +0000 | |
@@ -7,7 +7,7 @@ | |
msgstr "" | |
"Project-Id-Version: sakura\n" | |
"Report-Msgid-Bugs-To: \n" | |
-"POT-Creation-Date: 2017-09-14 21:02+0200\n" | |
+"POT-Creation-Date: 2018-03-18 17:52+0800\n" | |
"PO-Revision-Date: 2015-11-26 19:08+0000\n" | |
"Last-Translator: Andreas Rönnquist <[email protected]>\n" | |
"Language-Team: Swedish <[email protected]>\n" | |
@@ -115,6 +115,9 @@ | |
msgid "Opacity level (%)" | |
msgstr "Opacitetsnivå (%)" | |
+msgid "Search" | |
+msgstr "" | |
+ | |
msgid "New window title" | |
msgstr "Ny fönstertitel" | |
=== modified file 'po/uk.po' | |
--- po/uk.po 2017-12-30 16:58:52 +0000 | |
+++ po/uk.po 2018-03-18 09:52:14 +0000 | |
@@ -7,7 +7,7 @@ | |
msgstr "" | |
"Project-Id-Version: sakura\n" | |
"Report-Msgid-Bugs-To: \n" | |
-"POT-Creation-Date: 2017-09-14 21:02+0200\n" | |
+"POT-Creation-Date: 2018-03-18 17:52+0800\n" | |
"PO-Revision-Date: 2014-06-23 01:17+0000\n" | |
"Last-Translator: Andriy Nezhivy <[email protected]>\n" | |
"Language-Team: Ukrainian <[email protected]>\n" | |
@@ -124,6 +124,9 @@ | |
msgid "Opacity level (%)" | |
msgstr "Рівень прозорості (%):" | |
+msgid "Search" | |
+msgstr "" | |
+ | |
msgid "New window title" | |
msgstr "Новий заголовок вікна" | |
=== modified file 'po/zh_CN.po' | |
--- po/zh_CN.po 2017-12-30 16:58:52 +0000 | |
+++ po/zh_CN.po 2018-03-18 09:52:14 +0000 | |
@@ -7,7 +7,7 @@ | |
msgstr "" | |
"Project-Id-Version: sakura 1.0.4\n" | |
"Report-Msgid-Bugs-To: \n" | |
-"POT-Creation-Date: 2017-09-14 21:02+0200\n" | |
+"POT-Creation-Date: 2018-03-18 17:52+0800\n" | |
"PO-Revision-Date: 2016-02-08 09:42+0000\n" | |
"Last-Translator: David Gómez <[email protected]>\n" | |
"Language-Team: Chinese/Simplified <[email protected]>\n" | |
@@ -115,6 +115,9 @@ | |
msgid "Opacity level (%)" | |
msgstr "不透明度(%)" | |
+msgid "Search" | |
+msgstr "" | |
+ | |
msgid "New window title" | |
msgstr "新窗口标题" | |
=== modified file 'src/sakura.c' | |
--- src/sakura.c 2017-12-31 14:14:25 +0000 | |
+++ src/sakura.c 2018-03-18 10:37:59 +0000 | |
@@ -20,6 +20,7 @@ | |
* | |
*****************************************************************************/ | |
+#include <stdio.h> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
#include <string.h> | |
@@ -304,6 +305,7 @@ | |
gint open_url_accelerator; | |
gint font_size_accelerator; | |
gint set_tab_name_accelerator; | |
+ gint search_accelerator; | |
gint set_colorset_accelerator; | |
gint add_tab_key; | |
gint del_tab_key; | |
@@ -313,6 +315,7 @@ | |
gint paste_key; | |
gint scrollbar_key; | |
gint set_tab_name_key; | |
+ gint search_key; | |
gint fullscreen_key; | |
gint increase_font_size_key; | |
gint decrease_font_size_key; | |
@@ -363,6 +366,7 @@ | |
#define DEFAULT_OPEN_URL_ACCELERATOR (GDK_CONTROL_MASK|GDK_SHIFT_MASK) | |
#define DEFAULT_FONT_SIZE_ACCELERATOR (GDK_CONTROL_MASK) | |
#define DEFAULT_SET_TAB_NAME_ACCELERATOR (GDK_CONTROL_MASK|GDK_SHIFT_MASK) | |
+#define DEFAULT_SEARCH_ACCELERATOR (GDK_CONTROL_MASK|GDK_SHIFT_MASK) | |
#define DEFAULT_SELECT_COLORSET_ACCELERATOR (GDK_CONTROL_MASK|GDK_SHIFT_MASK) | |
#define DEFAULT_ADD_TAB_KEY GDK_KEY_T | |
#define DEFAULT_DEL_TAB_KEY GDK_KEY_W | |
@@ -372,6 +376,7 @@ | |
#define DEFAULT_PASTE_KEY GDK_KEY_V | |
#define DEFAULT_SCROLLBAR_KEY GDK_KEY_S | |
#define DEFAULT_SET_TAB_NAME_KEY GDK_KEY_N | |
+#define DEFAULT_SEARCH_KEY GDK_KEY_F | |
#define DEFAULT_FULLSCREEN_KEY GDK_KEY_F11 | |
#define DEFAULT_INCREASE_FONT_SIZE_KEY GDK_KEY_plus | |
#define DEFAULT_DECREASE_FONT_SIZE_KEY GDK_KEY_minus | |
@@ -434,6 +439,7 @@ | |
static void sakura_set_name_dialog (GtkWidget *, void *); | |
static void sakura_color_dialog (GtkWidget *, void *); | |
static void sakura_set_title_dialog (GtkWidget *, void *); | |
+static void sakura_search_dialog (GtkWidget *, void *); | |
static void sakura_new_tab (GtkWidget *, void *); | |
static void sakura_close_tab (GtkWidget *, void *); | |
static void sakura_fullscreen (GtkWidget *, void *); | |
@@ -529,6 +535,26 @@ | |
return res; | |
} | |
+ | |
+#define PCRE2_CODE_UNIT_WIDTH 8 | |
+#include <pcre2.h> | |
+void | |
+search(VteTerminal *vte, const char *pattern, bool reverse) { | |
+ vte_terminal_search_set_wrap_around(vte, TRUE); | |
+ VteRegex *regex = vte_terminal_search_get_regex(vte); | |
+ if (regex) vte_regex_unref(regex); | |
+ vte_terminal_search_set_regex(vte, | |
+ vte_regex_new_for_search(pattern, | |
+ (gssize) strlen(pattern), | |
+ PCRE2_MULTILINE | PCRE2_CASELESS, | |
+ NULL), 0); | |
+ | |
+ if (!vte_terminal_search_find_next(vte)) { | |
+ vte_terminal_unselect_all(vte); | |
+ vte_terminal_search_find_next(vte); | |
+ } | |
+} | |
+ | |
static gboolean | |
sakura_key_press (GtkWidget *widget, GdkEventKey *event, gpointer user_data) | |
{ | |
@@ -633,6 +659,14 @@ | |
} | |
} | |
+ /* Search keybinding pressed */ | |
+ if ( (event->state & sakura.search_accelerator)==sakura.search_accelerator ) { | |
+ if (keycode==sakura_tokeycode(sakura.search_key)) { | |
+ sakura_search_dialog(NULL, NULL); | |
+ return TRUE; | |
+ } | |
+ } | |
+ | |
/* Increase/decrease font size keybinding pressed */ | |
if ( (event->state & sakura.font_size_accelerator)==sakura.font_size_accelerator ) { | |
if (keycode==sakura_tokeycode(sakura.increase_font_size_key)) { | |
@@ -1426,6 +1460,59 @@ | |
} | |
static void | |
+sakura_search_dialog (GtkWidget *widget, void *data) | |
+{ | |
+ GtkWidget *title_dialog, *title_header; | |
+ GtkWidget *entry, *label; | |
+ GtkWidget *title_hbox; | |
+ gint response; | |
+ | |
+ title_dialog=gtk_dialog_new_with_buttons(_("Search"), | |
+ GTK_WINDOW(sakura.main_window), | |
+ GTK_DIALOG_MODAL|GTK_DIALOG_USE_HEADER_BAR, | |
+ _("_Cancel"), GTK_RESPONSE_CANCEL, | |
+ _("_Apply"), GTK_RESPONSE_ACCEPT, | |
+ NULL); | |
+ | |
+ /* Configure the new gtk header bar*/ | |
+ title_header=gtk_dialog_get_header_bar(GTK_DIALOG(title_dialog)); | |
+ gtk_header_bar_set_show_close_button(GTK_HEADER_BAR(title_header), FALSE); | |
+ gtk_dialog_set_default_response(GTK_DIALOG(title_dialog), GTK_RESPONSE_ACCEPT); | |
+ | |
+ /* Set style */ | |
+ gchar *css = g_strdup_printf (HIG_DIALOG_CSS); | |
+ gtk_css_provider_load_from_data(sakura.provider, css, -1, NULL); | |
+ GtkStyleContext *context = gtk_widget_get_style_context (title_dialog); | |
+ gtk_style_context_add_provider (context, GTK_STYLE_PROVIDER (sakura.provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); | |
+ g_free(css); | |
+ | |
+ entry=gtk_entry_new(); | |
+ label=gtk_label_new(_("Search")); | |
+ title_hbox=gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); | |
+ gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE); | |
+ gtk_box_pack_start(GTK_BOX(title_hbox), label, TRUE, TRUE, 12); | |
+ gtk_box_pack_start(GTK_BOX(title_hbox), entry, TRUE, TRUE, 12); | |
+ gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(title_dialog))), title_hbox, FALSE, FALSE, 12); | |
+ | |
+ /* Disable accept button until some text is entered */ | |
+ g_signal_connect(G_OBJECT(entry), "changed", G_CALLBACK(sakura_setname_entry_changed), title_dialog); | |
+ gtk_dialog_set_response_sensitive(GTK_DIALOG(title_dialog), GTK_RESPONSE_ACCEPT, FALSE); | |
+ | |
+ gtk_widget_show_all(title_hbox); | |
+ | |
+ response=gtk_dialog_run(GTK_DIALOG(title_dialog)); | |
+ if (response==GTK_RESPONSE_ACCEPT) { | |
+ gint page; | |
+ struct terminal *term; | |
+ page = gtk_notebook_get_current_page(GTK_NOTEBOOK(sakura.notebook)); | |
+ term = sakura_get_page_term(sakura, page); | |
+ search(VTE_TERMINAL(term->vte), gtk_entry_get_text(GTK_ENTRY(entry)), 0); | |
+ } | |
+ gtk_widget_destroy(title_dialog); | |
+} | |
+ | |
+ | |
+static void | |
sakura_set_title_dialog (GtkWidget *widget, void *data) | |
{ | |
GtkWidget *title_dialog, *title_header; | |
@@ -1474,7 +1561,6 @@ | |
gtk_window_set_title(GTK_WINDOW(sakura.main_window), gtk_entry_get_text(GTK_ENTRY(entry))); | |
} | |
gtk_widget_destroy(title_dialog); | |
- | |
} | |
@@ -2287,6 +2373,11 @@ | |
} | |
sakura.set_tab_name_accelerator = g_key_file_get_integer(sakura.cfg, cfg_group, "set_tab_name_accelerator", NULL); | |
+ if (!g_key_file_has_key(sakura.cfg, cfg_group, "search_accelerator", NULL)) { | |
+ sakura_set_config_integer("search_accelerator", DEFAULT_SEARCH_ACCELERATOR); | |
+ } | |
+ sakura.search_accelerator = g_key_file_get_integer(sakura.cfg, cfg_group, "search_accelerator", NULL); | |
+ | |
if (!g_key_file_has_key(sakura.cfg, cfg_group, "add_tab_key", NULL)) { | |
sakura_set_keybind("add_tab_key", DEFAULT_ADD_TAB_KEY); | |
} | |
@@ -2326,6 +2417,11 @@ | |
sakura_set_keybind("set_tab_name_key", DEFAULT_SET_TAB_NAME_KEY); | |
} | |
sakura.set_tab_name_key = sakura_get_keybind("set_tab_name_key"); | |
+ | |
+ if (!g_key_file_has_key(sakura.cfg, cfg_group, "search_key", NULL)) { | |
+ sakura_set_keybind("search_key", DEFAULT_SEARCH_KEY); | |
+ } | |
+ sakura.search_key = sakura_get_keybind("search_key"); | |
if (!g_key_file_has_key(sakura.cfg, cfg_group, "increase_font_size_key", NULL)) { | |
sakura_set_keybind("increase_font_size_key", DEFAULT_INCREASE_FONT_SIZE_KEY); | |
@@ -2477,7 +2573,8 @@ | |
*item_palette, *item_palette_tango, *item_palette_linux, *item_palette_xterm, *item_palette_rxvt, | |
*item_palette_solarized_dark, *item_palette_solarized_light, *item_palette_gruvbox, | |
*item_show_close_button, *item_tabs_on_bottom, *item_less_questions, | |
- *item_disable_numbered_tabswitch, *item_use_fading, *item_stop_tab_cycling_at_end_tabs; | |
+ *item_disable_numbered_tabswitch, *item_use_fading, *item_stop_tab_cycling_at_end_tabs, | |
+ *item_search; | |
GtkWidget *options_menu, *other_options_menu, *cursor_menu, *palette_menu; | |
sakura.item_open_mail=gtk_menu_item_new_with_label(_("Open mail")); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment