Status icon flashes on new tweets
This commit is contained in:
parent
5a9aa09167
commit
cc7011b724
3 changed files with 18 additions and 13 deletions
20
hrafn.py
20
hrafn.py
|
@ -329,8 +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)
|
||||
new_pane.connect('new-tweets', self.on_read_tweets_changed)
|
||||
new_pane.connect('tweets-read', self.on_read_tweets_changed)
|
||||
|
||||
if is_user:
|
||||
new_pane.connect('at-clicked', self.on_at_button_clicked)
|
||||
|
@ -627,12 +627,16 @@ class Hrafn():
|
|||
config_filehandle.close()
|
||||
|
||||
|
||||
def on_new_tweets(self, widget, num_tweets):
|
||||
pass
|
||||
|
||||
|
||||
def on_tweets_read(self, widget, num_tweets):
|
||||
pass
|
||||
def on_read_tweets_changed(self, widget):
|
||||
unread_tweets = 0
|
||||
for i in range(self.tweet_notebook.get_n_pages()):
|
||||
pane = self.tweet_notebook.get_nth_page(i)
|
||||
unread_tweets += pane.num_new_tweets
|
||||
|
||||
if unread_tweets > 0:
|
||||
self.tray_icon.set_property('blinking', True)
|
||||
else:
|
||||
self.tray_icon.set_property('blinking', False)
|
||||
|
||||
### end class Hrafn
|
||||
|
||||
|
|
Reference in a new issue