From 340c261e2d9e5515145f1747ab7efac8ff0a099f Mon Sep 17 00:00:00 2001 From: Anna Date: Wed, 19 May 2010 16:10:25 -0400 Subject: [PATCH] Update follow status on account change --- TODO | 8 +++++++- mytwitter.py | 17 ++++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index d37493a..16a2adf 100644 --- a/TODO +++ b/TODO @@ -6,9 +6,15 @@ features: * Add a graphical options menu * Come up with a better bloody name * Status bar icon + * Support viewing a list of friends and unfollowing them * Support creating new lists and adding users to it (as well as removing users and deleting lists) -* Changing the active user needs to be more 'work'... for instance, user tabs need to be re-checked for followship... + +* Refactor TweetPane to support things more logically, so that we can do less bizarre checking for things... +** Have a UserTweetPane, SingleTweetPane, ConversationPane, etc (or maybe just these) + +* Changing the active user needs to do more 'work' +** Refresh pages bugs: diff --git a/mytwitter.py b/mytwitter.py index 1336e99..2786202 100755 --- a/mytwitter.py +++ b/mytwitter.py @@ -513,11 +513,18 @@ class MyTwitter(): def on_account_changed(self, widget, new_account): - if widget.get_active() and self.accounts.has_key(new_account): - self.username = new_account - self.api = self.accounts[self.username] - self.db['active_user'] = self.username - self.update_account_label() + if not (widget.get_active() and self.accounts.has_key(new_account)): + return + + self.username = new_account + self.api = self.accounts[self.username] + self.db['active_user'] = self.username + self.update_account_label() + for i in range(0, self.tweet_notebook.get_n_pages()): + pane = self.tweet_notebook.get_nth_page(i) + if re.match(r'user: ', pane.get_list_name()): + user = re.sub(r'user: ', r'', pane.get_list_name()) + apithreads.GetFollowing(api=self.api, pane=pane, user=user).start() def on_lists_ready(self, widget, username, list_names):