changeset 18868:d470282d49da

Fix typeahead searching in the file-dialog.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 11 Aug 2007 04:12:09 +0000
parents 1d96cfd8879f
children 5dc587a877d6
files finch/libgnt/gntfilesel.c
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/finch/libgnt/gntfilesel.c	Sat Aug 11 03:21:36 2007 +0000
+++ b/finch/libgnt/gntfilesel.c	Sat Aug 11 04:12:09 2007 +0000
@@ -355,6 +355,7 @@
 		} else if (strcmp(str, "..") == 0) {
 			gnt_tree_set_selected(tree, dir);
 		}
+		gnt_bindable_perform_action_named(GNT_BINDABLE(tree), "end-search", NULL);
 		g_free(dir);
 		g_free(str);
 		g_free(path);
@@ -495,10 +496,11 @@
 	if (!sel->multiselect)
 		return FALSE;
 	tree = sel->dirsonly ? sel->dirs : sel->files;
-	if (!gnt_widget_has_focus(tree))
+	if (!gnt_widget_has_focus(tree) ||
+			gnt_tree_is_searching(GNT_TREE(tree)))
 		return FALSE;
 
-	file = gnt_tree_get_selection_data(sel->dirsonly ? GNT_TREE(sel->dirs) : GNT_TREE(sel->files));
+	file = gnt_tree_get_selection_data(GNT_TREE(tree));
 
 	str = gnt_file_sel_get_selected_file(sel);
 	if ((find = g_list_find_custom(sel->tags, str, (GCompareFunc)g_utf8_collate)) != NULL) {
@@ -526,7 +528,8 @@
 	if (!sel->multiselect)
 		return FALSE;
 	tree = sel->dirsonly ? sel->dirs : sel->files;
-	if (!gnt_widget_has_focus(tree))
+	if (!gnt_widget_has_focus(tree) ||
+			gnt_tree_is_searching(GNT_TREE(tree)))
 		return FALSE;
 
 	g_list_foreach(sel->tags, (GFunc)g_free, NULL);
@@ -547,6 +550,9 @@
 	if (!gnt_widget_has_focus(sel->dirs) &&
 			!gnt_widget_has_focus(sel->files))
 		return FALSE;
+	if (gnt_tree_is_searching(GNT_TREE(sel->dirs)) ||
+			gnt_tree_is_searching(GNT_TREE(sel->files)))
+		return FALSE;
 
 	path = g_build_filename(sel->current, "..", NULL);
 	dir = g_path_get_basename(sel->current);