Remove HRef instances

svn: r394
This commit is contained in:
Don Allingham 2001-09-08 21:02:53 +00:00
parent a1dfa4938d
commit 23cd9c9052
4 changed files with 86 additions and 33 deletions

View File

@ -3488,12 +3488,34 @@
</child>
<widget>
<class>GnomeHRef</class>
<class>GtkLabel</class>
<name>web_url</name>
<sensitive>False</sensitive>
<can_focus>True</can_focus>
<url>http://gramps.sourceforge.net</url>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
</widget>
<widget>
<class>GtkButton</class>
<name>web_go</name>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_web_go_clicked</handler>
<object>web_url</object>
<last_modification_time>Sat, 08 Sep 2001 20:48:58 GMT</last_modification_time>
</signal>
<label>Go</label>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>0</padding>
<expand>False</expand>

View File

@ -112,6 +112,7 @@ class EditPerson:
self.attr_value = self.get_widget("attr_value")
self.web_list = self.get_widget("web_list")
self.web_url = self.get_widget("web_url")
self.web_go = self.get_widget("web_go")
self.web_description = self.get_widget("url_des")
self.addr_label = self.get_widget("address_label")
self.addr_list = self.get_widget("address_list")
@ -194,6 +195,7 @@ class EditPerson:
"on_update_address_clicked" : on_update_addr_clicked,
"on_update_attr_clicked" : on_update_attr_clicked,
"on_update_url_clicked" : on_update_url_clicked,
"on_web_go_clicked" : on_web_go_clicked,
"on_web_list_select_row" : on_web_list_select_row,
})
@ -299,11 +301,10 @@ class EditPerson:
def redraw_url_list(self):
length = utils.redraw_list(self.ulist,self.web_list,disp_url)
if length > 0:
self.web_url.set_sensitive(1)
self.web_go.set_sensitive(1)
else:
self.web_url.set_sensitive(0)
self.web_url.set_label("")
self.web_url.set_url(_DEFHTTP)
self.web_go.set_sensitive(0)
self.web_url.set_text("")
self.web_description.set_text("")
#---------------------------------------------------------------------
@ -495,6 +496,14 @@ def did_data_change(obj):
return changed
def on_web_go_clicked(obj):
import gnome.url
text = obj.get()
if text != "":
gnome.url.show(text)
#-------------------------------------------------------------------------
#
# on_cancel_edit
@ -569,17 +578,13 @@ def on_web_list_select_row(obj,row,b,c):
url = obj.get_row_data(row)
if url == None:
epo.web_url.set_label("")
epo.web_url.set_url(_DEFHTTP)
epo.web_url.set_sensitive(0)
epo.web_url.set_text("")
epo.web_go.set_sensitive(0)
epo.web_description.set_text("")
else:
path = url.get_path()
if path == "":
path = _DEFHTTP
epo.web_url.set_label(path)
epo.web_url.set_url(path)
epo.web_url.set_sensitive(1)
epo.web_url.set_text(path)
epo.web_go.set_sensitive(1)
epo.web_description.set_text(url.get_description())
#-------------------------------------------------------------------------

View File

@ -84,6 +84,7 @@ class EditPlace:
self.web_list = self.top_window.get_widget("web_list")
self.web_url = self.top_window.get_widget("web_url")
self.web_go = self.top_window.get_widget("web_go")
self.web_description = self.top_window.get_widget("url_des")
self.source_field = self.top_window.get_widget("source_field")
@ -131,6 +132,7 @@ class EditPlace:
"on_delete_loc_clicked" : on_delete_loc_clicked,
"on_update_loc_clicked" : on_update_loc_clicked,
"on_web_list_select_row" : on_web_list_select_row,
"on_web_go_clicked": on_web_go_clicked,
"on_loc_list_select_row" : on_loc_list_select_row,
"on_apply_clicked" : on_place_apply_clicked
})
@ -169,11 +171,10 @@ class EditPlace:
def redraw_url_list(self):
length = utils.redraw_list(self.ulist,self.web_list,disp_url)
if length > 0:
self.web_url.set_sensitive(1)
self.web_go.set_sensitive(1)
else:
self.web_url.set_sensitive(0)
self.web_url.set_label("")
self.web_url.set_url(_DEFHTTP)
self.web_go.set_sensitive(0)
self.web_url.set_text("")
self.web_description.set_text("")
#---------------------------------------------------------------------
@ -212,6 +213,13 @@ class EditPlace:
self.add_thumbnail(photo)
self.photo_list.thaw()
def on_web_go_clicked(obj):
import gnome.url
text = obj.get()
if text != "":
gnome.url.show(text)
#-----------------------------------------------------------------------------
#
#
@ -623,17 +631,13 @@ def on_web_list_select_row(obj,row,b,c):
url = obj.get_row_data(row)
if url == None:
epo.web_url.set_label("")
epo.web_url.set_url(_DEFHTTP)
epo.web_url.set_sensitive(0)
epo.web_url.set_text("")
epo.web_go.set_sensitive(0)
epo.web_description.set_text("")
else:
path = url.get_path()
if path == "":
path = _DEFHTTP
epo.web_url.set_label(path)
epo.web_url.set_url(path)
epo.web_url.set_sensitive(1)
epo.web_url.set_text(path)
epo.web_go.set_sensitive(1)
epo.web_description.set_text(url.get_description())
#-------------------------------------------------------------------------

View File

@ -1381,16 +1381,38 @@
</child>
<widget>
<class>GnomeHRef</class>
<class>GtkLabel</class>
<name>web_url</name>
<sensitive>False</sensitive>
<can_focus>True</can_focus>
<url>http://gramps.sourceforge.net</url>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>True</expand>
<fill>True</fill>
</child>
</widget>
<widget>
<class>GtkButton</class>
<name>web_go</name>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
<handler>on_web_go_clicked</handler>
<object>web_url</object>
<last_modification_time>Sat, 08 Sep 2001 20:56:48 GMT</last_modification_time>
</signal>
<label>Go</label>
<relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>True</fill>
<fill>False</fill>
</child>
</widget>
</widget>