Small cleanup of link type names

svn: r15349
This commit is contained in:
Doug Blank 2010-05-07 18:33:44 +00:00
parent 99c4671e3e
commit a7d5470caa
3 changed files with 13 additions and 16 deletions

View File

@ -42,7 +42,7 @@
<object class="GtkLabel" id="label220"> <object class="GtkLabel" id="label220">
<property name="visible">True</property> <property name="visible">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="label" translatable="yes">Web Address:</property> <property name="label" translatable="yes">Internet Address:</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="justify">center</property> <property name="justify">center</property>
<property name="mnemonic_widget">entry1</property> <property name="mnemonic_widget">entry1</property>
@ -58,7 +58,7 @@
<object class="GtkLabel" id="label591"> <object class="GtkLabel" id="label591">
<property name="visible">True</property> <property name="visible">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="label" translatable="yes">Type:</property> <property name="label" translatable="yes">Link Type:</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
</object> </object>
<packing> <packing>

View File

@ -77,15 +77,15 @@ class EditLink(ManagedWindow.ManagedWindow):
_('Link Editor')) _('Link Editor'))
self.table = self.top.get_object('table27') self.table = self.top.get_object('table27')
self.uri_list = gtk.combo_box_new_text() self.uri_list = gtk.combo_box_new_text()
for text in [_("Web Address"), # 0 this order range above for text in [_("Internet Address"), # 0 this order range above
_("Gramps Event"), # 1 _("Event"), # 1
_("Gramps Family"), # 2 _("Family"), # 2
_("Gramps Media"), # 3 _("Media"), # 3
_("Gramps Note"), # 4 _("Note"), # 4
_("Gramps Person"), # 5 _("Person"), # 5
_("Gramps Place"), # 6 _("Place"), # 6
_("Gramps Repository"), # 7 _("Repository"), # 7
_("Gramps Source"), # 8 _("Source"), # 8
]: ]:
self.uri_list.append_text(text) self.uri_list.append_text(text)
self.table.attach(self.uri_list, 1, 2, 0, 1) self.table.attach(self.uri_list, 1, 2, 0, 1)
@ -137,6 +137,7 @@ class EditLink(ManagedWindow.ManagedWindow):
return self.simple_access.display(obj_class, prop, value) return self.simple_access.display(obj_class, prop, value)
def _on_edit_one(self, widget): def _on_edit_one(self, widget):
# Not used due to modal dialog in StyledTextEditor
from gui.editors import EditObject from gui.editors import EditObject
uri = self.url_link.get_text() uri = self.url_link.get_text()
if uri.startswith("gramps://"): if uri.startswith("gramps://"):
@ -187,10 +188,6 @@ class EditLink(ManagedWindow.ManagedWindow):
if self.uri_list.get_active() == WEB: if self.uri_list.get_active() == WEB:
return self.url_link.get_text() return self.url_link.get_text()
else: else:
#object_class = OBJECT_MAP[self.uri_list.get_active()]
#prop = "handle"
#value = ""
#return "gramps://%s/%s/%s" % (object_class, prop, value)
return self.url_link.get_text() return self.url_link.get_text()
def _connect_signals(self): def _connect_signals(self):

View File

@ -50,7 +50,7 @@ def run(database, document, obj):
if int(styledtext_tag.name) == StyledTextTagType.LINK: if int(styledtext_tag.name) == StyledTextTagType.LINK:
if styledtext_tag.value.startswith("gramps://"): if styledtext_tag.value.startswith("gramps://"):
object_class, prop, value = styledtext_tag.value[9:].split("/", 2) object_class, prop, value = styledtext_tag.value[9:].split("/", 2)
tagtype = _("Gramps") tagtype = _(object_class)
ref_obj = sdb.get_link(object_class, prop, value) ref_obj = sdb.get_link(object_class, prop, value)
if ref_obj: if ref_obj:
tagvalue = ref_obj tagvalue = ref_obj