Initial commit of 'conversation' button... needs a lot of work still
This commit is contained in:
@ -63,6 +63,7 @@ class TweetPane(gtk.ScrolledWindow):
|
||||
self.tweets[i].connect('reply', self.on_tweet_reply)
|
||||
self.tweets[i].connect('retweet', self.on_retweet)
|
||||
self.tweets[i].connect('in-reply-to', self.on_tweet_reply_to)
|
||||
self.tweets[i].connect('conversation', self.on_tweet_conversation)
|
||||
self.tweets[i].connect('show-user', self.on_show_user)
|
||||
|
||||
viewport.add(tweet_box)
|
||||
@ -173,6 +174,9 @@ class TweetPane(gtk.ScrolledWindow):
|
||||
self.emit('tweet-in-reply-to', data)
|
||||
|
||||
|
||||
def on_tweet_conversation(self, widget, data):
|
||||
self.emit('tweet-conversation', data)
|
||||
|
||||
def on_show_user(self, widget, data):
|
||||
self.emit('show-user', data)
|
||||
|
||||
@ -216,6 +220,9 @@ gobject.signal_new("tweet-retweet", TweetPane,
|
||||
gobject.signal_new("tweet-in-reply-to", TweetPane,
|
||||
gobject.SIGNAL_RUN_LAST,
|
||||
gobject.TYPE_NONE, (gobject.TYPE_PYOBJECT,))
|
||||
gobject.signal_new("tweet-conversation", TweetPane,
|
||||
gobject.SIGNAL_RUN_LAST,
|
||||
gobject.TYPE_NONE, (gobject.TYPE_PYOBJECT,))
|
||||
gobject.signal_new("show-user", TweetPane,
|
||||
gobject.SIGNAL_RUN_LAST,
|
||||
gobject.TYPE_NONE, (gobject.TYPE_PYOBJECT,))
|
||||
@ -300,6 +307,11 @@ class TweetBox(gtk.HBox):
|
||||
self.reply_to_button.set_relief(gtk.RELIEF_NONE)
|
||||
button_box.pack_start(self.reply_to_button, expand=False)
|
||||
self.reply_to_button.connect("clicked", self.on_in_reply_to_clicked)
|
||||
|
||||
self.conversation_button = gtk.Button("Conversation")
|
||||
self.conversation_button.set_relief(gtk.RELIEF_NONE)
|
||||
button_box.pack_start(self.conversation_button, expand=False)
|
||||
self.conversation_button.connect("clicked", self.on_conversation_clicked)
|
||||
|
||||
reply_button = gtk.Button("Reply")
|
||||
reply_button.set_relief(gtk.RELIEF_HALF)
|
||||
@ -356,6 +368,7 @@ class TweetBox(gtk.HBox):
|
||||
# If this is in reply to something, set appropriate label
|
||||
if self.in_reply_to_screen_name and self.in_reply_to_id:
|
||||
self.reply_to_button.set_label('in reply to ' + self.in_reply_to_screen_name)
|
||||
self.conversation_button.show()
|
||||
|
||||
|
||||
def clear_status(self):
|
||||
@ -365,6 +378,7 @@ class TweetBox(gtk.HBox):
|
||||
self.id = None
|
||||
self.set_read(True)
|
||||
self.reply_to_button.set_label('')
|
||||
self.conversation_button.hide()
|
||||
self.avatar.hide()
|
||||
|
||||
|
||||
@ -389,6 +403,10 @@ class TweetBox(gtk.HBox):
|
||||
self.emit('in-reply-to', {'id': self.in_reply_to_id, 'name': self.in_reply_to_screen_name})
|
||||
|
||||
|
||||
def on_conversation_clicked(self, widget):
|
||||
self.emit('in-reply-to', {'id': self.in_reply_to_id, 'name': self.in_reply_to_screen_name})
|
||||
|
||||
|
||||
def on_user_clicked(self, widget):
|
||||
self.emit('show-user', self.screen_name)
|
||||
|
||||
@ -418,6 +436,9 @@ gobject.signal_new("retweet", TweetBox,
|
||||
gobject.signal_new("in-reply-to", TweetBox,
|
||||
gobject.SIGNAL_RUN_LAST,
|
||||
gobject.TYPE_NONE, (gobject.TYPE_PYOBJECT,))
|
||||
gobject.signal_new("conversation", TweetBox,
|
||||
gobject.SIGNAL_RUN_LAST,
|
||||
gobject.TYPE_NONE, (gobject.TYPE_PYOBJECT,))
|
||||
gobject.signal_new("show-user", TweetBox,
|
||||
gobject.SIGNAL_RUN_LAST,
|
||||
gobject.TYPE_NONE, (gobject.TYPE_PYOBJECT,))
|
||||
|
Reference in New Issue
Block a user