diff --git a/gramps/src/EditPerson.glade b/gramps/src/EditPerson.glade index 40665d31a..14b8177fc 100644 --- a/gramps/src/EditPerson.glade +++ b/gramps/src/EditPerson.glade @@ -3488,12 +3488,34 @@ - GnomeHRef + GtkLabel web_url - False - True - http://gramps.sourceforge.net + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + True + True + + + + + GtkButton + web_go + True + + clicked + on_web_go_clicked + web_url + Sat, 08 Sep 2001 20:48:58 GMT + + + GTK_RELIEF_NORMAL 0 False diff --git a/gramps/src/EditPerson.py b/gramps/src/EditPerson.py index 3c20c6186..2c543daa6 100644 --- a/gramps/src/EditPerson.py +++ b/gramps/src/EditPerson.py @@ -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()) #------------------------------------------------------------------------- diff --git a/gramps/src/EditPlace.py b/gramps/src/EditPlace.py index 19d986f41..036e74ea7 100644 --- a/gramps/src/EditPlace.py +++ b/gramps/src/EditPlace.py @@ -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()) #------------------------------------------------------------------------- diff --git a/gramps/src/places.glade b/gramps/src/places.glade index 4a5c054f1..26cd36a5d 100644 --- a/gramps/src/places.glade +++ b/gramps/src/places.glade @@ -1381,16 +1381,38 @@ - GnomeHRef + GtkLabel web_url - False - True - http://gramps.sourceforge.net + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + True + True + + + + + GtkButton + web_go + True + + clicked + on_web_go_clicked + web_url + Sat, 08 Sep 2001 20:56:48 GMT + + + GTK_RELIEF_NORMAL 0 False - True + False