Got all the buttons, signals, etc linked up for follow and at, I think...
This commit is contained in:
parent
22067b4ad2
commit
897f2273ce
10
mytwitter.py
10
mytwitter.py
|
@ -433,6 +433,16 @@ class MyTwitter():
|
|||
self.add_to_notebook('@' + user_name)
|
||||
|
||||
|
||||
def on_follow_button_clicked(self, widget, follow):
|
||||
user_name = re.sub('^user: ', '', widget.get_list_name())
|
||||
|
||||
thread = apithreads.ChangeFriendship(self.api, current_pane, user_name, follow)
|
||||
thread.sig_proxy.connect('friendship-changed', self.on_friendship_changed)
|
||||
thread.sig_proxy.connect('friendship-changed', widget.user_box.on_friendship_changed)
|
||||
thread.start()
|
||||
|
||||
|
||||
|
||||
def global_key_press_handler(self, widget, event):
|
||||
keyname = gtk.gdk.keyval_name(event.keyval)
|
||||
if keyname == 'w' and event.state & gtk.gdk.CONTROL_MASK:
|
||||
|
|
|
@ -467,6 +467,8 @@ gobject.signal_new("show-user", TweetBox,
|
|||
|
||||
class UserBox(gtk.VBox):
|
||||
def __init__(self):
|
||||
gtk.VBox.__init__(self)
|
||||
|
||||
self.data_lock = RLock()
|
||||
|
||||
self.user_name = None
|
||||
|
@ -490,10 +492,10 @@ class UserBox(gtk.VBox):
|
|||
button_row = gtk.HBox()
|
||||
button_row.pack_start(self.follow_button)
|
||||
button_row.pack_start(at_button)
|
||||
self.pack_start(self.button_row)
|
||||
self.pack_start(button_row)
|
||||
|
||||
at_button.connect('clicked', self.on_at_clicked)
|
||||
follow_button.connect('clicked', self.on_follow_clicked)
|
||||
self.follow_button.connect('clicked', self.on_follow_clicked)
|
||||
|
||||
self.show_all()
|
||||
self.verified_label.hide()
|
||||
|
@ -528,6 +530,11 @@ class UserBox(gtk.VBox):
|
|||
self.emit('follow-clicked', follow)
|
||||
|
||||
|
||||
def on_friendship_changed(self, widget, data):
|
||||
if data['success']:
|
||||
self.set_following(data['follow']
|
||||
)
|
||||
|
||||
def on_at_clicked(self, widget):
|
||||
self.emit('at-clicked', self.user_name)
|
||||
|
||||
|
|
Reference in New Issue
Block a user