Select Person dialog with a search?

I just ran across Bruce Jackson’s ( @ebj075 ) fork of Artem Glebov’s 2013 PhotoTagging Gramplet. And found that one of his changes was in the Person Selector to enable the Searchbar?!? I’m excited!

Does it only require that one extra Parameter? Can I tweak the other Person Selectors that are missing a search bar that easily?

    def sel_person_clicked(self, event):
        if self.selection_widget.get_current():
            SelectPerson = SelectorFactory('Person')
           sel = SelectPerson(self.dbstate, self.uistate, self.track,

                                 _("Select Person"), show_search_bar=True)

            person = sel.run()
            if person:
                self.set_current_person(person)
                self.selection_widget.clear_selection()
                self.refresh()
                self.enable_buttons()

The only remaining drawback is that it is a 'Grouped ’ list instead of a ‘Flat’ list. Is that another similarly simple tweak?

As I recall, I found this class and the show_search_bar defaults to False for the Person Selector. I suspect adding the parameter for other instances would work.

I never looked into that and I agree that would be really nice!

1 Like

Thanks Bruce! Any chance you’ll increment the version number on the “photo tagging” .gpr.py file and push that fork out for the general public? It could use the extra love of a public release.

I liked the looks of those extra metadata fields.

Although if you could figure out how to use the re-order the marques rectangles (similarly to what we can do with Organize Tags), it would make a more orderly output.

Of course the Up/Down gadgets in most of the Edit dialogs are a lot more compact in the interface:

I’m still waiting on some clarification on code review. I’m not a python programmer and I need a bit more info so I know what is being requested. I expect it’s quite trivial but I got completely confused trying to search the GTK docs.

The credit for this goes to Nick Hall. He wrote the code that detected the metadata fields. I found the code in a Mantis ticket. I was pretty pleased to get it working.

1 Like

It needs a line 5 added to the header which freshens copyright plus a credit for you & Nick. (This isn’t just about the kudos… It helps people find someone who has been through the code review process with that module.)

Also, please add an updated PhotoTaggingGramplet.gpr.py file. At a minimum, it needs the version incremented so the Plugin Manager will recognize new versions are available. But that 2013 version is missing a lot of the niceties: a help_url ( Addon:Photo_Tagging_Gramplet ), the author, a commented header…

Gary Griffin and Nick made a fairly complete example of a multiple author gramplet for the DNA gramplet:

#
# Gramps - a GTK+/GNOME based genealogy program
# http://gramps-project.org
# Gramplet registration - plug-in/add-on to extend Gramps
#
# Copyright (C) 2020    Nick Hall
# Copyright (C) 2020    Gary Griffin
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
register(GRAMPLET,
         id = "DNASegmentMap",
         name = _("DNA Segment Map"),
         authors = ["Nick Hall", "Gary Griffin"],
         authors_email = ["http://gramps-project.org", "http://gramps-project.org"],
         description = _("Gramplet showing a matching DNA segment map"),
         status = STABLE,
         fname="dnasegmentmap.py",
         height=100,
         expand=True,
         gramplet = 'DNASegmentMap',
         gramplet_title=_("DNA Segment Map"),
         detached_width = 600,
         detached_height = 450,
         version = '1.1.4',
         gramps_target_version='5.1',
         help_url="Addon:DNASegmentMap",
         include_in_listing = True,
         )

I’ve updated the PhotoTaggingGramplet.gpr.py file and the PhotoTaggingGramplet.py file. I think I have straightened out the conflict in PhotoTaggingGramplet.py with the gramps project repository. Hopefully, that will let a merge proceed.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.