diff --git a/apithreads.py b/apithreads.py index d2ea080..188fdfe 100644 --- a/apithreads.py +++ b/apithreads.py @@ -337,9 +337,9 @@ class ChangeFriendship(ApiThread): gtk.gdk.threads_enter() try: if self.follow: - self.pane.set_following(success) + self.pane.user_box.set_following(success) else: - self.pane.set_following(not success) + self.pane.user_box.set_following(not success) finally: gtk.gdk.threads_leave() diff --git a/mytwitter.py b/mytwitter.py index 0f25857..bac57cf 100755 --- a/mytwitter.py +++ b/mytwitter.py @@ -436,9 +436,8 @@ class MyTwitter(): 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 = apithreads.ChangeFriendship(self.api, widget, 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() diff --git a/twitterwidgets.py b/twitterwidgets.py index 049b21b..ce6ea3f 100644 --- a/twitterwidgets.py +++ b/twitterwidgets.py @@ -508,7 +508,7 @@ class UserBox(gtk.VBox): try: with AvCache().lock: - self.avatar.set_from_pixbuf(AvCache().map[status.user.screen_name]) + self.avatar.set_from_pixbuf(AvCache().map[user.screen_name]) self.avatar.show() except KeyError: self.avatar.hide() @@ -530,11 +530,6 @@ 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) @@ -553,10 +548,10 @@ class UserBox(gtk.VBox): with self.data_lock: self.following = following if following: - self.follow_button.set_text('Unfollow') + self.follow_button.set_label('Unfollow') self.follow_label.show() else: - self.follow_button.set_text('Follow') + self.follow_button.set_label('Follow') self.follow_label.hide() # end class UserBox