diff options
author | Slava Aseev <[email protected]> | 2019-07-18 17:15:11 +0300 |
---|---|---|
committer | Victor Kareh <[email protected]> | 2019-08-02 07:43:29 -0400 |
commit | dd4a31a1eb6fdd0fd4c22276de864d83c98830a2 (patch) | |
tree | c67b0d4d55610bfb1c221f43c5011c9adda5762f /src | |
parent | d638f84c9dfbbb8cca2625cd431921f52e603c02 (diff) | |
download | caja-dd4a31a1eb6fdd0fd4c22276de864d83c98830a2.tar.bz2 caja-dd4a31a1eb6fdd0fd4c22276de864d83c98830a2.tar.xz |
Support querying files by contained text
ODF files also supported via odt2txt
Diffstat (limited to 'src')
-rw-r--r-- | src/caja-query-editor.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/caja-query-editor.c b/src/caja-query-editor.c index 55dff943..5fbfddc9 100644 --- a/src/caja-query-editor.c +++ b/src/caja-query-editor.c @@ -57,6 +57,7 @@ typedef enum CAJA_QUERY_EDITOR_ROW_TAGS, CAJA_QUERY_EDITOR_ROW_TIME_MODIFIED, CAJA_QUERY_EDITOR_ROW_SIZE, + CAJA_QUERY_EDITOR_ROW_CONTAINED_TEXT, CAJA_QUERY_EDITOR_ROW_LAST } CajaQueryEditorRowType; @@ -157,6 +158,13 @@ static void size_row_free_data(CajaQueryEditorRow *row); static void size_add_rows_from_query(CajaQueryEditor *editor, CajaQuery *query); +static GtkWidget *contained_text_row_create_widgets(CajaQueryEditorRow *row); +static void contained_text_row_add_to_query(CajaQueryEditorRow *row, + CajaQuery *query); +static void contained_text_row_free_data(CajaQueryEditorRow *row); +static void contained_text_add_rows_from_query(CajaQueryEditor *editor, + CajaQuery *query); + static CajaQueryEditorRowOps row_type[] = { { @@ -193,6 +201,13 @@ static CajaQueryEditorRowOps row_type[] = size_row_add_to_query, size_row_free_data, size_add_rows_from_query + }, + { + N_("Contained text"), + contained_text_row_create_widgets, + contained_text_row_add_to_query, + contained_text_row_free_data, + contained_text_add_rows_from_query } }; @@ -1323,6 +1338,41 @@ static void size_add_rows_from_query(CajaQueryEditor *editor, CajaQuery *query) { } +static GtkWidget * +contained_text_row_create_widgets (CajaQueryEditorRow *row) +{ + GtkWidget *entry = gtk_entry_new(); + gtk_widget_set_tooltip_text (entry, + _("Matches files that contains specified text.")); + + gtk_entry_set_placeholder_text (GTK_ENTRY (entry), + _("Matches files that contains specified text.")); + + gtk_widget_show (entry); + gtk_box_pack_start (GTK_BOX (row->hbox), entry, TRUE, TRUE, 0); + g_signal_connect (entry, "activate", G_CALLBACK (go_search_cb), row->editor); + + return entry; +} + +static void +contained_text_row_add_to_query (CajaQueryEditorRow *row, CajaQuery *query) +{ + GtkEntry *entry = GTK_ENTRY (row->type_widget); + const gchar *text = gtk_entry_get_text (entry); + + caja_query_set_contained_text (query, text); +} + +static void +contained_text_row_free_data (CajaQueryEditorRow *row) +{ +} + +static void +contained_text_add_rows_from_query (CajaQueryEditor *editor, CajaQuery *query) +{ +} static CajaQueryEditorRowType get_next_free_type (CajaQueryEditor *editor) |