EditLink: When changing the link type choose the active object as default.
This commit is contained in:
parent
6f18918b9c
commit
3f217aeed1
@ -208,17 +208,28 @@ class EditLink(ManagedWindow):
|
|||||||
(object_class, prop, value))
|
(object_class, prop, value))
|
||||||
|
|
||||||
def _on_type_changed(self, widget):
|
def _on_type_changed(self, widget):
|
||||||
self.selected.set_text("")
|
|
||||||
if self.uri_list.get_active() == WEB:
|
if self.uri_list.get_active() == WEB:
|
||||||
self.url_link.set_sensitive(True)
|
self.url_link.set_sensitive(True)
|
||||||
self.pick_item.set_sensitive(False)
|
self.pick_item.set_sensitive(False)
|
||||||
self.new_button.set_sensitive(False)
|
self.new_button.set_sensitive(False)
|
||||||
self.edit_button.set_sensitive(False)
|
self.edit_button.set_sensitive(False)
|
||||||
|
self.selected.set_text("")
|
||||||
|
self.url_link.set_text("https://")
|
||||||
else:
|
else:
|
||||||
self.url_link.set_sensitive(False)
|
self.url_link.set_sensitive(False)
|
||||||
self.pick_item.set_sensitive(True)
|
self.pick_item.set_sensitive(True)
|
||||||
self.new_button.set_sensitive(True)
|
self.new_button.set_sensitive(True)
|
||||||
self.edit_button.set_sensitive(True)
|
self.edit_button.set_sensitive(True)
|
||||||
|
object_class = OBJECT_MAP[self.uri_list.get_active()]
|
||||||
|
handle = self.uistate.get_active(object_class)
|
||||||
|
if handle:
|
||||||
|
self.selected.set_text(self.display_link(
|
||||||
|
object_class, "handle", handle))
|
||||||
|
self.url_link.set_text("gramps://%s/handle/%s" %
|
||||||
|
(object_class, handle))
|
||||||
|
else:
|
||||||
|
self.selected.set_text("")
|
||||||
|
self.url_link.set_text("")
|
||||||
|
|
||||||
def get_uri(self):
|
def get_uri(self):
|
||||||
if self.uri_list.get_active() == WEB:
|
if self.uri_list.get_active() == WEB:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user