From 213b3ce9ac29211a901bbd41e37649ae3f488783 Mon Sep 17 00:00:00 2001 From: Anna Date: Thu, 15 Apr 2010 23:02:14 -0400 Subject: [PATCH] Improved handling of clicking a username / @ feed / searching / etc for a tab that's already open --- mytwitter.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/mytwitter.py b/mytwitter.py index 65aa1d7..01ba295 100755 --- a/mytwitter.py +++ b/mytwitter.py @@ -161,18 +161,8 @@ class MyTwitter(): else: full_name = 'list: ' + name - # If it already exists, don't add it, just switch to it - for i in range(self.tweet_notebook.get_n_pages()): - pane = self.tweet_notebook.get_nth_page(i) - if pane.get_list_name() == full_name: - self.tweet_notebook.set_current_page(i) - return - # Now, add a new tab with this list self.add_to_notebook(full_name) - - # And, to propagate it: - self.update_windows() # Remove one of the views from the tweet notebook. @@ -186,9 +176,11 @@ class MyTwitter(): def add_to_notebook(self, name, single_tweet=None): - # If we already have a pane by this name, bail + # If it already exists, don't add it, just switch to it for i in range(self.tweet_notebook.get_n_pages()): - if self.tweet_notebook.get_nth_page(i).get_list_name() == name: + pane = self.tweet_notebook.get_nth_page(i) + if pane.get_list_name() == name: + self.tweet_notebook.set_current_page(i) return is_user = False