changeset 16204:af599ba236ea

merge of '870d6ea8b3a6295793acd9d484c77d4b72424a29' and 'b2915e456e0d33be3624b7edb844a6e787b7503f'
author Richard Laager <rlaager@wiktel.com>
date Mon, 16 Apr 2007 05:27:50 +0000
parents 0973688f4b74 (current diff) 4f6a6443a1e3 (diff)
children 220c11da554c 93f1801d4cc6
files
diffstat 2 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/finch/libgnt/gntfilesel.c	Mon Apr 16 05:27:17 2007 +0000
+++ b/finch/libgnt/gntfilesel.c	Mon Apr 16 05:27:50 2007 +0000
@@ -412,9 +412,11 @@
 static void
 file_sel_changed(GntWidget *widget, gpointer old, gpointer current, GntFileSel *sel)
 {
-	g_free(sel->suggest);
-	sel->suggest = NULL;
-	update_location(sel);
+	if (GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_HAS_FOCUS)) {
+		g_free(sel->suggest);
+		sel->suggest = NULL;
+		update_location(sel);
+	}
 }
 
 static void
--- a/finch/libgnt/gnttree.c	Mon Apr 16 05:27:17 2007 +0000
+++ b/finch/libgnt/gnttree.c	Mon Apr 16 05:27:50 2007 +0000
@@ -47,6 +47,8 @@
 	int span;       /* How many columns does it span? */
 };
 
+static void tree_selection_changed(GntTree *, GntTreeRow *, GntTreeRow *);
+
 static GntWidgetClass *parent_class = NULL;
 static guint signals[SIGS] = { 0 };
 
@@ -340,8 +342,10 @@
 
 	if (tree->top == NULL)
 		tree->top = tree->root;
-	if (tree->current == NULL)
+	if (tree->current == NULL) {
 		tree->current = tree->root;
+		tree_selection_changed(tree, NULL, tree->current);
+	}
 
 	wbkgd(widget->window, COLOR_PAIR(GNT_COLOR_NORMAL));
 
@@ -1394,7 +1398,7 @@
 {
 	int dist;
 	GntTreeRow *row = g_hash_table_lookup(tree->hash, key);
-	if (!row)
+	if (!row || row == tree->current)
 		return;
 
 	if (tree->top == NULL)
@@ -1409,6 +1413,7 @@
 		gnt_tree_scroll(tree, -dist);
 	else
 		redraw_tree(tree);
+	tree_selection_changed(tree, row, tree->current);
 }
 
 void _gnt_tree_init_internals(GntTree *tree, int col)
@@ -1514,6 +1519,7 @@
 		row->collapsed = !expanded;
 		if (GNT_WIDGET(tree)->window)
 			gnt_widget_draw(GNT_WIDGET(tree));
+		g_signal_emit(tree, signals[SIG_COLLAPSED], 0, key, row->collapsed);
 	}
 }