summarylogtreecommitdiffstats
path: root/typeahead.patch
blob: 3c376428c2fc1f331127bfa2982154f18fb7fd5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
@@ -1391,6 +1391,9 @@
 {
   GtkFileChooserWidget *impl = (GtkFileChooserWidget *) widget;
   GtkFileChooserWidgetPrivate *priv = impl->priv;
+  if(event->is_modifier) return FALSE; gtk_widget_grab_focus (priv->browse_files_tree_view);
+  gboolean ret;
+  g_signal_emit_by_name (priv->browse_files_tree_view, "key-press-event", event, &ret);
 
   if (should_trigger_location_entry (impl, event))
     {
@@ -1401,12 +1404,6 @@
           return TRUE;
         }
     }
-  else if (gtk_search_entry_handle_event (GTK_SEARCH_ENTRY (priv->search_entry), (GdkEvent *)event))
-    {
-      if (priv->operation_mode != OPERATION_MODE_SEARCH)
-        operation_mode_set (impl, OPERATION_MODE_SEARCH);
-      return TRUE;
-    }
 
   if (GTK_WIDGET_CLASS (gtk_file_chooser_widget_parent_class)->key_press_event (widget, event))
     return TRUE;
@@ -2478,7 +2475,7 @@
 {
   GtkFileChooserWidgetPrivate *priv = impl->priv;
 
-  gtk_tree_view_set_search_column (GTK_TREE_VIEW (priv->browse_files_tree_view), -1);
+  gtk_tree_view_set_search_column (GTK_TREE_VIEW (priv->browse_files_tree_view), MODEL_COL_NAME);
 
   gtk_tree_view_column_set_sort_column_id (priv->list_name_column, MODEL_COL_NAME);
   gtk_tree_view_column_set_sort_column_id (priv->list_time_column, MODEL_COL_TIME);
@@ -4392,6 +4389,7 @@
   gtk_tree_view_set_model (GTK_TREE_VIEW (priv->browse_files_tree_view),
                            GTK_TREE_MODEL (priv->browse_files_model));
   update_columns (impl, FALSE, _("Modified"));
+  gtk_tree_view_set_enable_search (GTK_TREE_VIEW (priv->browse_files_tree_view), TRUE);
   file_list_set_sort_column_ids (impl);
   set_sort_column (impl);
   profile_msg ("    gtk_tree_view_set_model end", NULL);
@@ -7152,10 +7150,6 @@
 {
   GList *l, *files, *files_with_info, *infos;
   GFile *file;
-  gboolean select = FALSE;
-
-  if (gtk_tree_model_iter_n_children (GTK_TREE_MODEL (impl->priv->search_model), NULL) == 0)
-    select = TRUE;
 
   files = NULL;
   files_with_info = NULL;
@@ -7183,8 +7177,6 @@
   g_list_free_full (infos, g_object_unref);
 
   gtk_stack_set_visible_child_name (GTK_STACK (impl->priv->browse_files_stack), "list");
-  if (select)
-    gtk_widget_grab_focus (impl->priv->browse_files_tree_view);
 }
 
 /* Callback used from GtkSearchEngine when the query is done running */
@@ -7502,6 +7494,7 @@
   gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (priv->recent_model),
                                         GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID,
                                         GTK_SORT_DESCENDING);
+  gtk_tree_view_set_enable_search (GTK_TREE_VIEW (priv->browse_files_tree_view), TRUE);
 }
 
 typedef struct
@@ -7519,7 +7512,7 @@
 
   gtk_tree_view_set_model (GTK_TREE_VIEW (priv->browse_files_tree_view),
                            GTK_TREE_MODEL (priv->recent_model));
-  gtk_tree_view_set_search_column (GTK_TREE_VIEW (priv->browse_files_tree_view), -1);
+  gtk_tree_view_set_search_column (GTK_TREE_VIEW (priv->browse_files_tree_view), MODEL_COL_NAME);
 
   gtk_tree_view_column_set_sort_column_id (priv->list_name_column, -1);
   gtk_tree_view_column_set_sort_column_id (priv->list_time_column, -1);