6874: Use shorter names in add gramplet list. Remove old attributes gramplet.
svn: r22958
This commit is contained in:
parent
d1c0be81f8
commit
a474703187
@ -112,7 +112,8 @@ def GET_AVAILABLE_GRAMPLETS(name):
|
||||
return None
|
||||
|
||||
def GET_GRAMPLET_LIST(nav_type, skip):
|
||||
return [(gplug.name, gplug.id) for gplug in PLUGMAN.get_reg_gramplets()
|
||||
return [(gplug.gramplet_title, gplug.id)
|
||||
for gplug in PLUGMAN.get_reg_gramplets()
|
||||
if gplug.navtypes == [] or nav_type in gplug.navtypes
|
||||
and gplug.name not in skip]
|
||||
|
||||
|
@ -1,56 +0,0 @@
|
||||
# Gramps - a GTK+/GNOME based genealogy program
|
||||
#
|
||||
# Copyright (C) 2009 Douglas S. Blank
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
from gramps.gen.plug import Gramplet
|
||||
from gramps.gen.display.name import displayer as name_displayer
|
||||
from gramps.gen.const import GRAMPS_LOCALE as glocale
|
||||
_ = glocale.translation.gettext
|
||||
|
||||
class AttributesGramplet(Gramplet):
|
||||
"""
|
||||
Displays attributes of a person.
|
||||
"""
|
||||
def init(self):
|
||||
self.set_text(_("No Family Tree loaded."))
|
||||
self.set_use_markup(True)
|
||||
self.no_wrap()
|
||||
|
||||
def db_changed(self):
|
||||
self.dbstate.db.connect('person-edit', self.update)
|
||||
self.update()
|
||||
|
||||
def active_changed(self, handle):
|
||||
self.update()
|
||||
|
||||
def main(self): # return false finishes
|
||||
self.set_text("")
|
||||
active_handle = self.get_active('Person')
|
||||
active_person = self.dbstate.db.get_person_from_handle(active_handle)
|
||||
if not active_person:
|
||||
return
|
||||
name = name_displayer.display(active_person)
|
||||
self.render_text(_("Active person: <b>%s</b>") % name)
|
||||
self.append_text("\n\n")
|
||||
for attr in active_person.attribute_list:
|
||||
# # text, type, data
|
||||
self.link(str(attr.type), 'Attribute', str(attr.type))
|
||||
self.append_text(": %s\n" % attr.get_value())
|
||||
self.append_text("\n", scroll_to="begin")
|
@ -66,23 +66,6 @@ register(GRAMPLET,
|
||||
gramps_target_version="4.0",
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Attributes",
|
||||
name=_("Attributes"),
|
||||
description = _("Gramplet showing active person's attributes"),
|
||||
status = STABLE,
|
||||
fname="attributesgramplet.py",
|
||||
height=150,
|
||||
expand=True,
|
||||
gramplet = 'AttributesGramplet',
|
||||
gramplet_title=_("Attributes"),
|
||||
detached_width = 325,
|
||||
detached_height = 250,
|
||||
version="1.0.0",
|
||||
gramps_target_version="4.0",
|
||||
navtypes=["Person"],
|
||||
)
|
||||
|
||||
register(GRAMPLET,
|
||||
id="Calendar",
|
||||
name=_("Calendar"),
|
||||
|
@ -530,7 +530,6 @@ gramps/plugins/export/exportxml.py
|
||||
gramps/plugins/gramplet/ageondategramplet.py
|
||||
gramps/plugins/gramplet/agestats.py
|
||||
gramps/plugins/gramplet/attributes.py
|
||||
gramps/plugins/gramplet/attributesgramplet.py
|
||||
gramps/plugins/gramplet/backlinks.py
|
||||
gramps/plugins/gramplet/calendargramplet.py
|
||||
gramps/plugins/gramplet/children.py
|
||||
|
Loading…
Reference in New Issue
Block a user