diff --git a/TODO b/TODO index 56243e7..1791d17 100644 --- a/TODO +++ b/TODO @@ -4,7 +4,6 @@ features: * Make the buttons prettier * Add a graphical options menu -* 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) diff --git a/hrafn.py b/hrafn.py index 372b49c..c061570 100755 --- a/hrafn.py +++ b/hrafn.py @@ -329,6 +329,8 @@ class Hrafn(): entries=1 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: new_pane.connect('at-clicked', self.on_at_button_clicked) @@ -624,6 +626,14 @@ class Hrafn(): config.write(config_filehandle) config_filehandle.close() + + def on_new_tweets(self, widget, num_tweets): + pass + + + def on_tweets_read(self, widget, num_tweets): + pass + ### end class Hrafn diff --git a/twitterwidgets.py b/twitterwidgets.py index 1a63bb3..46ce54c 100644 --- a/twitterwidgets.py +++ b/twitterwidgets.py @@ -123,6 +123,9 @@ class TweetPane(gtk.ScrolledWindow): self.tweets[i].clear_status() self.tweets[i].hide() + if self.num_new_tweets > 0: + self.emit('new-tweets', self.num_new_tweets) + if len(statuses) == 0: self.message.set_label('There is no data to display') @@ -154,9 +157,12 @@ class TweetPane(gtk.ScrolledWindow): def set_tweets_read(self): + num_read = self.num_new_tweets self.last_tweet_read = self.latest_tweet self.num_new_tweets = 0 self.update_tab_label() + self.emit('tweets-read', num_read) + 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_RUN_LAST, 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,))