Added some logic to TweetPane to track whether the pane is displaying a user's feed, and if so whether we are currently following that user.
This commit is contained in:
@ -13,14 +13,20 @@ class TweetPane(gtk.ScrolledWindow):
|
||||
It also gets some data from its parent, including num_entries
|
||||
'''
|
||||
|
||||
def __init__(self, list_name, num_entries=20, single_tweet=None):
|
||||
def __init__(self, list_name, num_entries=20, single_tweet=None, is_user=False, following=False):
|
||||
gtk.ScrolledWindow.__init__(self)
|
||||
|
||||
self.updated_once = False
|
||||
|
||||
self.list_name = list_name
|
||||
self.single_tweet = single_tweet
|
||||
|
||||
self.list_name = list_name
|
||||
self.num_entries = num_entries
|
||||
if self.single_tweet is not None:
|
||||
self.num_entries = 1
|
||||
|
||||
self.is_user = is_user
|
||||
self.following = following
|
||||
|
||||
self.tab_label = CloseTabLabel(self.list_name)
|
||||
|
||||
@ -31,10 +37,6 @@ class TweetPane(gtk.ScrolledWindow):
|
||||
|
||||
self.tweets = []
|
||||
|
||||
self.num_entries = num_entries
|
||||
if self.single_tweet is not None:
|
||||
self.num_entries = 1
|
||||
|
||||
self.init_widgets()
|
||||
|
||||
|
||||
@ -142,6 +144,17 @@ class TweetPane(gtk.ScrolledWindow):
|
||||
self.emit('tweet-in-reply-to', data)
|
||||
|
||||
|
||||
def get_following(self):
|
||||
return following
|
||||
|
||||
|
||||
def set_following(self, following):
|
||||
self.following = following
|
||||
|
||||
|
||||
def is_user(self):
|
||||
return is_user
|
||||
|
||||
# To keep things simple elsewhere and improve code reuse
|
||||
# we'll build a list of home-cooked Status objects out of results.
|
||||
# Why is this even necessary?
|
||||
@ -360,7 +373,10 @@ class CloseTabLabel(gtk.EventBox):
|
||||
self.init_widgets(name)
|
||||
|
||||
|
||||
# This code is still heinous, but at least it is
|
||||
# This code modified from create_custom_tab in:
|
||||
# http://www.daa.com.au/pipermail/pygtk/2006-April/012216.html
|
||||
#
|
||||
# My version of this code is a little heinous, but at least it is
|
||||
# isolated to its own class
|
||||
def init_widgets(self, name):
|
||||
#create a custom tab for notebook containing a
|
||||
@ -404,7 +420,6 @@ class CloseTabLabel(gtk.EventBox):
|
||||
def on_button_press(self, event, direction):
|
||||
self.emit('label-clicked')
|
||||
|
||||
|
||||
### end class CloseTabLabel
|
||||
|
||||
# signals for CloseTabLabel
|
||||
|
Reference in New Issue
Block a user