comparison finch/libgnt/pygnt/dbus-gnt @ 18713:8000beb73585

propagate from branch 'im.pidgin.pidgin' (head c2cc31f23a71f23062555721f8101fc9c997bae2) to branch 'libgnt.pygnt' (head e69d5919b7bf3b9ace0cb482c147654e60e135a8)
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 29 Jul 2007 07:59:10 +0000
parents 6b16fca71f8b
children ed50c9745b1d
comparison
equal deleted inserted replaced
18712:c65c4caa817a 18713:8000beb73585
22 22
23 def conv_closed(conv): 23 def conv_closed(conv):
24 key = get_dict_key(conv) 24 key = get_dict_key(conv)
25 stuff = convwins[key] 25 stuff = convwins[key]
26 stuff[0].destroy() 26 stuff[0].destroy()
27 # if a conv window is closed, then reopened, this thing crashes
27 convwins[key] = None 28 convwins[key] = None
28 29
29 def wrote_msg(account, who, msg, conv, flags): 30 def wrote_msg(account, who, msg, conv, flags):
30 stuff = show_conversation(conv) 31 stuff = show_conversation(conv)
31 tv = stuff[1] 32 tv = stuff[1]
32 tv.append_text_with_flags("\n", 0) 33 tv.append_text_with_flags("\n", 0)
33 tv.append_text_with_flags(strftime("(%X) "), 8) 34 tv.append_text_with_flags(strftime("(%X) "), 8)
34 tv.append_text_with_flags(who + ": ", 1) 35 tv.append_text_with_flags(who + ": ", 1)
35 tv.append_text_with_flags(msg, 0) 36 tv.append_text_with_flags(msg, 0)
36 tv.scroll(0) 37 tv.scroll(0)
37 stuff[0].set_urgent() 38 if flags & 3:
39 stuff[0].set_urgent()
38 40
39 bus = dbus.SessionBus() 41 bus = dbus.SessionBus()
40 obj = bus.get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject") 42 obj = bus.get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject")
41 purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface") 43 purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")
42 44
89 vbox.add_widget(entry) 91 vbox.add_widget(entry)
90 entry.connect("key_pressed", send_im_cb, conv) 92 entry.connect("key_pressed", send_im_cb, conv)
91 tv.clear() 93 tv.clear()
92 win.show() 94 win.show()
93 convwins[key] = [win, tv, entry] 95 convwins[key] = [win, tv, entry]
96 # XXX: listen to "destroy" for the window, and reset the key
94 return convwins[key] 97 return convwins[key]
95 98
96 def show_buddylist(): 99 def show_buddylist():
97 win = gnt.Window() 100 win = gnt.Window()
98 tree = gnt.Tree() 101 tree = gnt.Tree()