remove pysexy dependance, PyGTK2.18 supports links in gtk.Label

This commit is contained in:
Yann Leboulanger 2010-01-12 22:30:46 +01:00
parent cbbfe98d32
commit a19cbbfc9d
7 changed files with 35 additions and 45 deletions

View file

@ -38,7 +38,6 @@ Gajim is a GTK+ app that loves GNOME. You can do 'make' so you don't require gno
<li>notification-daemon or notify-python (and D-Bus) to get cooler popups</li>
<li>D-Bus running to have gajim-remote working. Some distributions split dbus-x11, which is needed for dbus to work with Gajim. Version >= 0.80 is required.</li>
<li>python-dbus bindings (>=0.81)</li>
<li>python-sexy to have clickable URLs in chat windows</li>
<li>python-kerberos to use GSSAPI authentification. Note: version1.1 or higher is required</li>
</ul>

View file

@ -69,7 +69,17 @@
</packing>
</child>
<child>
<placeholder/>
<widget class="GtkLabel" id="banner_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">label</property>
<property name="use_markup">True</property>
<property name="selectable">True</property>
<signal name="populate_popup" handler="on_banner_label_populate_popup"/>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
@ -948,7 +958,16 @@
</packing>
</child>
<child>
<placeholder/>
<widget class="GtkLabel" id="banner_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">label</property>
<property name="use_markup">True</property>
<property name="selectable">True</property>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>

2
debian/control vendored
View file

@ -15,7 +15,7 @@ Architecture: any
XB-Python-Version: ${python:Versions}
Depends: ${misc:Depends}, ${shlibs:Depends}, ${python:Depends}, python-support (>= 0.7.1), python-glade2 (>= 2.12.0), python-gtk2 (>= 2.12.0), dnsutils
Recommends: dbus, python-dbus, notification-daemon, python-gnupginterface, python-openssl, python-crypto
Suggests: python-gconf, python-gnome2, nautilus-sendto, avahi-daemon, python-avahi, network-manager, libgtkspell0, aspell-en, python-gnomekeyring, gnome-keyring, python-sexy, python-kerberos (>= 1.1), texlive-latex-base, dvipng
Suggests: python-gconf, python-gnome2, nautilus-sendto, avahi-daemon, python-avahi, network-manager, libgtkspell0, aspell-en, python-gnomekeyring, gnome-keyring, python-kerberos (>= 1.1), texlive-latex-base, dvipng
Description: Jabber client written in PyGTK
Gajim is a Jabber client. It has a tabbed user interface with normal chats,
group chats, and has many features such as, TLS, GPG, SSL, multiple accounts,

View file

@ -96,7 +96,10 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
def make_href(self, match):
url_color = gajim.config.get('urlmsgcolor')
return '<a href="%s"><span color="%s">%s</span></a>' % (match.group(),
url = match.group()
if not '://' in url:
url = 'http://' + url
return '<a href="%s"><span color="%s">%s</span></a>' % (url,
url_color, match.group())
def get_font_attrs(self):
@ -257,21 +260,10 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
self.urlfinder = re.compile(
r"(www\.(?!\.)|[a-z][a-z0-9+.-]*://)[^\s<>'\"]+[^!,\.\s<>\)'\"\]]")
if gajim.HAVE_PYSEXY:
import sexy
self.banner_status_label = sexy.UrlLabel()
self.banner_status_label.connect('url_activated',
self.status_url_clicked)
else:
self.banner_status_label = gtk.Label()
self.banner_status_label.set_selectable(True)
self.banner_status_label.set_alignment(0,0.5)
self.banner_status_label.connect('populate_popup',
self.banner_status_label = self.xml.get_widget('banner_label')
id_ = self.banner_status_label.connect('populate_popup',
self.on_banner_label_populate_popup)
banner_vbox = self.xml.get_widget('banner_vbox')
banner_vbox.pack_start(self.banner_status_label)
self.banner_status_label.show()
self.handlers[id_] = self.banner_status_label
# Init DND
self.TARGET_TYPE_URI_LIST = 80
@ -1843,14 +1835,11 @@ class ChatControl(ChatControlBase):
label_tooltip = '%s%s' % (name, acct_info)
if status_escaped:
if gajim.HAVE_PYSEXY:
status_text = self.urlfinder.sub(self.make_href, status_escaped)
status_text = '<span %s>%s</span>' % (font_attrs_small, status_text)
else:
status_text = '<span %s>%s</span>' % (font_attrs_small, status_escaped)
status_text = self.urlfinder.sub(self.make_href, status_escaped)
status_text = '<span %s>%s</span>' % (font_attrs_small, status_escaped)
self.banner_status_label.set_tooltip_text(status)
self.banner_status_label.show()
self.banner_status_label.set_no_show_all(False)
self.banner_status_label.show()
else:
status_text = ''
self.banner_status_label.hide()

View file

@ -166,12 +166,6 @@ try:
except ImportError:
HAVE_PYCRYPTO = False
HAVE_PYSEXY = True
try:
import sexy
except ImportError:
HAVE_PYSEXY = False
HAVE_GPG = True
try:
import GnuPGInterface

View file

@ -101,10 +101,6 @@ class FeaturesWindow:
_('Generate XHTML output from RST code (see http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html).'),
_('Requires python-docutils.'),
_('Requires python-docutils.')),
_('Banners and clickable links'): (self.pysexy_available,
_('Ability to have clickable URLs in chat and groupchat window banners.'),
_('Requires python-sexy.'),
_('Requires python-sexy.')),
_('Audio / Video'): (self.farsight_available,
_('Ability to start audio and video chat.'),
_('Requires python-farsight.'),
@ -256,9 +252,6 @@ class FeaturesWindow:
return False
return True
def pysexy_available(self):
return gajim.HAVE_PYSEXY
def farsight_available(self):
return gajim.HAVE_FARSIGHT

View file

@ -634,17 +634,13 @@ class GroupchatControl(ChatControlBase):
if self.subject:
subject = helpers.reduce_chars_newlines(self.subject, max_lines=2)
subject = gobject.markup_escape_text(subject)
if gajim.HAVE_PYSEXY:
subject_text = self.urlfinder.sub(self.make_href, subject)
subject_text = '<span %s>%s</span>' % (font_attrs_small,
subject_text)
else:
subject_text = '<span %s>%s</span>' % (font_attrs_small, subject)
subject_text = self.urlfinder.sub(self.make_href, subject)
subject_text = '<span %s>%s</span>' % (font_attrs_small, subject_text)
# tooltip must always hold ALL the subject
self.event_box.set_tooltip_text(self.subject)
self.banner_status_label.show()
self.banner_status_label.set_no_show_all(False)
self.banner_status_label.show()
else:
subject_text = ''
self.event_box.set_has_tooltip(False)