6874: Use shorter names in add gramplet list. Remove old attributes gramplet.

svn: r22957
This commit is contained in:
Nick Hall 2013-08-30 18:08:49 +00:00
parent 563591b031
commit b0d5343d24
5 changed files with 2 additions and 75 deletions

View File

@ -264,7 +264,6 @@ src/plugins/export/ExportXml.py
src/plugins/gramplet/AgeOnDateGramplet.py
src/plugins/gramplet/AgeStats.py
src/plugins/gramplet/Attributes.py
src/plugins/gramplet/AttributesGramplet.py
src/plugins/gramplet/Backlinks.py
src/plugins/gramplet/bottombar.gpr.py
src/plugins/gramplet/CalendarGramplet.py

View File

@ -97,7 +97,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]

View File

@ -1,55 +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 gen.plug import Gramplet
from gen.display.name import displayer as name_displayer
from gen.ggettext import gettext as _
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")

View File

@ -10,7 +10,6 @@ pkgpython_PYTHON = \
AgeOnDateGramplet.py \
AgeStats.py \
Attributes.py \
AttributesGramplet.py \
Backlinks.py \
bottombar.gpr.py \
CalendarGramplet.py \

View File

@ -54,23 +54,6 @@ register(GRAMPLET,
gramps_target_version="3.4",
)
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="3.4",
navtypes=["Person"],
)
register(GRAMPLET,
id="Calendar",
name=_("Calendar"),