First, unsuccessful attempt at making links work
This commit is contained in:
parent
6282ecc053
commit
b22e80c915
|
@ -2,7 +2,7 @@
|
||||||
#
|
#
|
||||||
# Custom twitter client... mostly for learning Python
|
# 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():
|
class MyTwitter():
|
||||||
|
@ -177,6 +177,7 @@ class TweetBox(gtk.VBox):
|
||||||
self.text.set_alignment(0.0, 0.0)
|
self.text.set_alignment(0.0, 0.0)
|
||||||
self.text.set_selectable(True)
|
self.text.set_selectable(True)
|
||||||
self.text.set_line_wrap(True)
|
self.text.set_line_wrap(True)
|
||||||
|
self.text.connect('activate-link', self.on_url_clicked)
|
||||||
|
|
||||||
button_box = gtk.HBox()
|
button_box = gtk.HBox()
|
||||||
self.pack_start(button_box)
|
self.pack_start(button_box)
|
||||||
|
@ -229,6 +230,12 @@ class TweetBox(gtk.VBox):
|
||||||
def on_retweet_clicked(self, widget):
|
def on_retweet_clicked(self, widget):
|
||||||
self.emit('retweet')
|
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
|
# end class TweetBox
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user