use Linkbutton in vcard window if we have PyGTK2.10. For #1840

This commit is contained in:
Yann Leboulanger 2006-09-16 12:20:12 +00:00
parent 34270370e2
commit f69cd8ad5c
2 changed files with 15 additions and 30 deletions

View File

@ -652,7 +652,7 @@
</child>
<child>
<widget class="GtkTable" id="table2">
<widget class="GtkTable" id="personal_info_table">
<property name="border_width">12</property>
<property name="visible">True</property>
<property name="n_rows">6</property>
@ -1640,34 +1640,6 @@
</packing>
</child>
<child>
<widget class="GtkLabel" id="URL_label">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">True</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="xpad">5</property>
<property name="ypad">5</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">4</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="TEL_HOME_NUMBER_label">
<property name="visible">True</property>

View File

@ -71,6 +71,12 @@ class VcardWindow:
self.fill_jabber_page()
if gtk.pygtk_version >= (2, 10, 0) and gtk.gtk_version >= (2, 10, 0):
self.url_label = gtk.LinkButton('')
else:
self.url_label = gtk.Label('')
table = self.xml.get_widget('personal_info_table')
table.attach(self.url_label, 1, 4, 3, 4, yoptions = 0)
self.xml.signal_autoconnect(self)
self.window.show_all()
@ -113,7 +119,14 @@ class VcardWindow:
def set_value(self, entry_name, value):
try:
self.xml.get_widget(entry_name).set_text(value)
if entry_name == 'URL_label':
if gtk.pygtk_version >= (2, 10, 0) and gtk.gtk_version >= (2, 10,
0):
self.url_label.set_uri(value)
else:
self.url_label.set_text(value)
else:
self.xml.get_widget(entry_name).set_text(value)
except AttributeError:
pass