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:
parent
f49c0ff27d
commit
5a9aa09167
1
TODO
1
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)
|
||||
|
|
10
hrafn.py
10
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
|
||||
|
||||
|
||||
|
|
|
@ -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,))
|
||||
|
||||
|
||||
|
||||
|
|
Reference in New Issue
Block a user