Only update new pane when adding a pane to the notebook

This commit is contained in:
Anna 2010-05-17 22:47:57 -04:00
parent f85189712b
commit 39f5d216e4

View File

@ -109,7 +109,7 @@ class MyTwitter():
# Add the tabs from last session to the notebook # Add the tabs from last session to the notebook
page_num = self.db['active_page'] page_num = self.db['active_page']
for tab, single_tweet in self.db['open_tabs']: for tab, single_tweet in self.db['open_tabs']:
self.add_to_notebook(tab, single_tweet, update=False) self.add_to_notebook(tab, single_tweet)
self.tweet_notebook.set_current_page(page_num) self.tweet_notebook.set_current_page(page_num)
self.update_windows() self.update_windows()
@ -262,7 +262,7 @@ class MyTwitter():
self.remove_view(name, single_tweet) self.remove_view(name, single_tweet)
def add_to_notebook(self, name, single_tweet=None, update=True): def add_to_notebook(self, name, single_tweet=None):
# If it already exists, don't add it, just switch to it # 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()):
pane = self.tweet_notebook.get_nth_page(i) pane = self.tweet_notebook.get_nth_page(i)
@ -307,10 +307,8 @@ class MyTwitter():
apithreads.GetSingleTweet(api=self.api, apithreads.GetSingleTweet(api=self.api,
pane=new_pane, pane=new_pane,
single_tweet=single_tweet).start() single_tweet=single_tweet).start()
else:
if update: self.update_single_window(new_pane)
self.update_windows()
self.tweet_notebook.set_current_page(-1) # switch to the new pane
def on_tab_change(self, event, page, page_num): def on_tab_change(self, event, page, page_num):