Mercurial > pidgin
changeset 18841:03a0054954bb
"Bless me father for I have sinned."
"You use 4-space tabs?! OMG! Me too!"
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Wed, 08 Aug 2007 01:35:56 +0000 |
parents | 75a6fdc7f622 |
children | e20619418edf 7bf6b9a70b41 9998470a01de 3afcfbed2ced e12fb409262f 7d3e53e3f623 |
files | finch/libgnt/pygnt/dbus-gnt |
diffstat | 1 files changed, 22 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/finch/libgnt/pygnt/dbus-gnt Wed Aug 08 00:38:18 2007 +0000 +++ b/finch/libgnt/pygnt/dbus-gnt Wed Aug 08 01:35:56 2007 +0000 @@ -24,7 +24,7 @@ key = get_dict_key(conv) stuff = convwins[key] stuff[0].destroy() - # if a conv window is closed, then reopened, this thing crashes + # if a conv window is closed, then reopened, this thing crashes convwins[key] = None def wrote_msg(account, who, msg, conv, flags): @@ -76,6 +76,9 @@ purple.PurpleConvChatSend(chatdata, entry.get_text()) entry.clear() +def conv_window_destroyed(win, key): + del convwins[key] + def show_conversation(conv): key = get_dict_key(conv) if key in convwins: @@ -95,28 +98,28 @@ tv.clear() win.show() convwins[key] = [win, tv, entry] - # XXX: listen to "destroy" for the window, and reset the key + win.connect("destroy", conv_window_destroyed, key) return convwins[key] def show_buddylist(): - win = gnt.Window() - tree = gnt.Tree() - tree.set_property("columns", 1) - win.add_widget(tree) - node = purple.PurpleBlistGetRoot() - while node: - if purple.PurpleBlistNodeIsGroup(node): - sys.stderr.write(str(node) + "\n") - tree.add_row_after(str(node), ["asd", ""], None, None) - #tree.add_row_after(node, [str(purple.PurpleGroupGetName(node)), ""], None, None) - #tree.add_row_after(node, ["aasd", ""], None, None) - elif purple.PurpleBlistNodeIsContact(node): - buddy = purple.PurpleContactGetPriorityBuddy(node) - group = purple.PurpleBuddyGetGroup(buddy) - #tree.add_row_after(node, [str(purple.PurpleBuddyGetName(buddy)), ""], group, None) + win = gnt.Window() + tree = gnt.Tree() + tree.set_property("columns", 1) + win.add_widget(tree) + node = purple.PurpleBlistGetRoot() + while node: + if purple.PurpleBlistNodeIsGroup(node): + sys.stderr.write(str(node) + "\n") + tree.add_row_after(str(node), ["asd", ""], None, None) + #tree.add_row_after(node, [str(purple.PurpleGroupGetName(node)), ""], None, None) + #tree.add_row_after(node, ["aasd", ""], None, None) + elif purple.PurpleBlistNodeIsContact(node): + buddy = purple.PurpleContactGetPriorityBuddy(node) + group = purple.PurpleBuddyGetGroup(buddy) + #tree.add_row_after(node, [str(purple.PurpleBuddyGetName(buddy)), ""], group, None) - node = purple.PurpleBlistNodeNext(node, False) - win.show() + node = purple.PurpleBlistNodeNext(node, False) + win.show() gnt.gnt_init()