Improved handling of clicking a username / @ feed / searching / etc for a tab that's already open

This commit is contained in:
Anna 2010-04-15 23:02:14 -04:00
parent a1a0da7059
commit 213b3ce9ac

View File

@ -161,18 +161,8 @@ class MyTwitter():
else: else:
full_name = 'list: ' + name 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 # Now, add a new tab with this list
self.add_to_notebook(full_name) self.add_to_notebook(full_name)
# And, to propagate it:
self.update_windows()
# Remove one of the views from the tweet notebook. # Remove one of the views from the tweet notebook.
@ -186,9 +176,11 @@ class MyTwitter():
def add_to_notebook(self, name, single_tweet=None): 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()): 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 return
is_user = False is_user = False