Laid foundation for telling Hrafn object how many new tweets all the panes have... may have to iterate over them every time a signal comes in; not sure how to handle closing a tab otherwise...

This commit is contained in:
Anna 2010-05-25 16:47:11 -04:00
parent f49c0ff27d
commit 5a9aa09167
3 changed files with 22 additions and 1 deletions

1
TODO
View File

@ -4,7 +4,6 @@ features:
* Make the buttons prettier * Make the buttons prettier
* Add a graphical options menu * Add a graphical options menu
* Status bar icon
* Support viewing a list of friends and unfollowing them * 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) * Support creating new lists and adding users to it (as well as removing users and deleting lists)

View File

@ -329,6 +329,8 @@ class Hrafn():
entries=1 entries=1
new_pane = TweetPane(name, num_entries=entries, single_tweet=single_tweet, is_user=is_user, conversation=conversation) new_pane = TweetPane(name, num_entries=entries, single_tweet=single_tweet, is_user=is_user, conversation=conversation)
new_pane.connect('new-tweets', self.on_new_tweets)
new_pane.connect('tweets-read', self.on_tweets_read)
if is_user: if is_user:
new_pane.connect('at-clicked', self.on_at_button_clicked) new_pane.connect('at-clicked', self.on_at_button_clicked)
@ -624,6 +626,14 @@ class Hrafn():
config.write(config_filehandle) config.write(config_filehandle)
config_filehandle.close() config_filehandle.close()
def on_new_tweets(self, widget, num_tweets):
pass
def on_tweets_read(self, widget, num_tweets):
pass
### end class Hrafn ### end class Hrafn

View File

@ -123,6 +123,9 @@ class TweetPane(gtk.ScrolledWindow):
self.tweets[i].clear_status() self.tweets[i].clear_status()
self.tweets[i].hide() self.tweets[i].hide()
if self.num_new_tweets > 0:
self.emit('new-tweets', self.num_new_tweets)
if len(statuses) == 0: if len(statuses) == 0:
self.message.set_label('There is no data to display') self.message.set_label('There is no data to display')
@ -154,9 +157,12 @@ class TweetPane(gtk.ScrolledWindow):
def set_tweets_read(self): def set_tweets_read(self):
num_read = self.num_new_tweets
self.last_tweet_read = self.latest_tweet self.last_tweet_read = self.latest_tweet
self.num_new_tweets = 0 self.num_new_tweets = 0
self.update_tab_label() self.update_tab_label()
self.emit('tweets-read', num_read)
def set_tweets_read_callback(self, event, arg1=None, arg2=None): def set_tweets_read_callback(self, event, arg1=None, arg2=None):
@ -231,6 +237,12 @@ gobject.signal_new("follow-clicked", TweetPane,
gobject.signal_new("at-clicked", TweetPane, gobject.signal_new("at-clicked", TweetPane,
gobject.SIGNAL_RUN_LAST, gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE, (gobject.TYPE_PYOBJECT,)) gobject.TYPE_NONE, (gobject.TYPE_PYOBJECT,))
gobject.signal_new("new-tweets", TweetPane,
gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE, (gobject.TYPE_PYOBJECT,))
gobject.signal_new("tweets-read", TweetPane,
gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE, (gobject.TYPE_PYOBJECT,))