First, unsuccessful attempt at making links work

This commit is contained in:
Anna 2010-04-10 13:21:52 -04:00
parent 6282ecc053
commit b22e80c915

View File

@ -2,7 +2,7 @@
#
# Custom twitter client... mostly for learning Python
import sys, twitter, ConfigParser, os, datetime, dateutil.tz, gtk, gtk.glade, gobject, re
import sys, twitter, ConfigParser, os, datetime, dateutil.tz, gtk, gtk.glade, gobject, re, subprocess
class MyTwitter():
@ -177,6 +177,7 @@ class TweetBox(gtk.VBox):
self.text.set_alignment(0.0, 0.0)
self.text.set_selectable(True)
self.text.set_line_wrap(True)
self.text.connect('activate-link', self.on_url_clicked)
button_box = gtk.HBox()
self.pack_start(button_box)
@ -228,6 +229,12 @@ class TweetBox(gtk.VBox):
def on_retweet_clicked(self, widget):
self.emit('retweet')
def on_url_clicked(self, widget):
# fixme: for now, hard code firefox, since that's what I use
# Eventually make this configgable
subprocess.call('firefox ' + self.text.get_current_uri())
# end class TweetBox