changeset 14379:a7e29c0b51f4

[gaim-migrate @ 17085] Parts of Richard Nelson (wabz)'s patch: Emit the selection-changed signal when you wheel-scroll. Show the idle-time only when it has an appropriate idle-time. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 30 Aug 2006 05:07:43 +0000
parents d1d275a95d02
children 4badb7289e31
files console/gntblist.c console/libgnt/gnttree.c
diffstat 2 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/console/gntblist.c	Wed Aug 30 04:19:14 2006 +0000
+++ b/console/gntblist.c	Wed Aug 30 05:07:43 2006 +0000
@@ -977,9 +977,11 @@
 			if (gaim_presence_is_idle(pre))
 			{
 				time_t idle = gaim_presence_get_idle_time(pre);
-				char *st = gaim_str_seconds_to_string(time(NULL) - idle);
-				g_string_append_printf(str, _("\nIdle: %s"), st);
-				g_free(st);
+				if (idle > 0) {
+					char *st = gaim_str_seconds_to_string(time(NULL) - idle);
+					g_string_append_printf(str, _("\nIdle: %s"), st);
+					g_free(st);
+				}
 			}
 		}
 
--- a/console/libgnt/gnttree.c	Wed Aug 30 04:19:14 2006 +0000
+++ b/console/libgnt/gnttree.c	Wed Aug 30 05:07:43 2006 +0000
@@ -614,6 +614,8 @@
 static gboolean
 gnt_tree_clicked(GntWidget *widget, GntMouseEvent event, int x, int y)
 {
+	GntTree *tree = GNT_TREE(widget);
+	GntTreeRow *old = tree->current;
 	if (event == GNT_MOUSE_SCROLL_UP) {
 		action_up(GNT_TREE(widget));
 	} else if (event == GNT_MOUSE_SCROLL_DOWN) {
@@ -645,6 +647,9 @@
 	} else {
 		return FALSE;
 	}
+	if (old != tree->current) {
+		tree_selection_changed(tree, old, tree->current);
+	}
 	return TRUE;
 }