Mercurial > pidgin
diff console/gntblist.c @ 13896:a621329e8c85
[gaim-migrate @ 16381]
Changes in GntTextView. Things go somewhat 'smooth' when run inside
valgrind. Otherwise, it's kind of flaky. I don't mind a single bit
if someone gave me a hint :)
committer: Tailor Script <tailor@pidgin.im>
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Sat, 01 Jul 2006 00:56:05 +0000 |
parents | 582aaa4e287e |
children | eaaf73de9188 |
line wrap: on
line diff
--- a/console/gntblist.c Fri Jun 30 16:23:56 2006 +0000 +++ b/console/gntblist.c Sat Jul 01 00:56:05 2006 +0000 @@ -6,6 +6,7 @@ #include "gntgaim.h" #include "gntbox.h" +#include "gntlabel.h" #include "gnttree.h" #include "gntblist.h" @@ -238,12 +239,27 @@ static void selection_activate(GntWidget *widget, GGBlist *ggblist) { - gnt_widget_set_focus(widget, FALSE); + GntTree *tree = GNT_TREE(ggblist->tree); + GaimBlistNode *node = gnt_tree_get_selection_data(tree); + + if (GAIM_BLIST_NODE_IS_BUDDY(node)) + { + GaimBuddy *buddy = (GaimBuddy *)node; + gaim_conversation_new(GAIM_CONV_TYPE_IM, + gaim_buddy_get_account(buddy), + gaim_buddy_get_name(buddy)); + } + else if (GAIM_BLIST_NODE_IS_CHAT(node)) + { + GaimChat *chat = (GaimChat*)node; + serv_join_chat(chat->account->gc, chat->components); + } } static void draw_tooltip(GGBlist *ggblist) { + return; GaimBlistNode *node; int x, y, top, width; GString *str; @@ -251,12 +267,15 @@ GaimPluginProtocolInfo *prpl_info; GaimAccount *account; GntTree *tree; - GntWidget *widget, *box, *label; + GntWidget *widget, *box; char *title = NULL; widget = ggblist->tree; tree = GNT_TREE(widget); + if (!gnt_widget_has_focus(ggblist->tree)) + return; + if (ggblist->tooltip) { /* XXX: Once we can properly redraw on expose events, this can be removed at the end @@ -332,7 +351,7 @@ GNT_WIDGET_SET_FLAGS(box, GNT_WIDGET_NO_SHADOW); gnt_box_set_title(GNT_BOX(box), title); - gnt_box_add_widget(GNT_BOX(box), GNT_WIDGET(gnt_label_new(str->str))); + gnt_box_add_widget(GNT_BOX(box), gnt_label_new(str->str)); gnt_widget_set_position(box, x, y); gnt_widget_draw(box); @@ -365,24 +384,6 @@ return TRUE; } } - else if (text[0] == '\r' && text[1] == '\0') - { - GntTree *tree = GNT_TREE(ggblist->tree); - GaimBlistNode *node = gnt_tree_get_selection_data(tree); - - if (GAIM_BLIST_NODE_IS_BUDDY(node)) - { - GaimBuddy *buddy = (GaimBuddy *)node; - gaim_conversation_new(GAIM_CONV_TYPE_IM, - gaim_buddy_get_account(buddy), - gaim_buddy_get_name(buddy)); - } - else if (GAIM_BLIST_NODE_IS_CHAT(node)) - { - GaimChat *chat = (GaimChat*)node; - serv_join_chat(chat->account->gc, chat->components); - } - } return FALSE; }