Need help on Gtk interfaces for my addon

Hi
I m currently writing a tool to import all my DNA matches in Gramps in order to make some data experimentations in Gramps with that.

I have some difficulties with the interface in gtk.

usually when I don’t know how to do a thing, I look for an add-on that does the same thing that I need to do.

and right now, I have to find a way in my interface to have a file chooser to be able to give the path of the file that contains my matches.

Is there some examples of that kind of code?

You are linking or importing DNA match files from services like GEDMatch?

And you are looking for code examples of calling the Gtk interface GtkFileChooserWidget, GtkFileChooserDialog, and GtkFileChooserButton with filtering on specific MIME types?

Please note down anything that is hard to discover.

We need to build a generic set of User & Developer docs for the Gtk.filechooser in Gramps. The are lots of subtleties.

Such as:

  • preset Shortcut & bookmark buttons
  • User defined bookmarks of folders (set & remove)
  • Showing/hiding Breadcrumb paths
  • support (or lack of) for OS environmental variables
  • Gramps environmental variables
  • MIME type filters (and their GUI labels)
  • Setting a parent for the spawned Chooser dialog
  • Sorting (case sensitivity, folder/file grouping, accented letters)
  • Click on selected object idiosyncrasy (behaves like double-click)
  • Spawning screen selection on multi-monitor systems
  • Remembered dialog positions & virtual screen dead zones.

FYI, you can also just drag and drop files into the Media category view, for example, and it automatically creates a new Media object.

Hi, Thanks for your answer

I would like to import DNA match automatically by selecting one or more file.

The people are creating and an association between me and people are created like it s done manually in the dnaSegment gramplet.

Right now, I have hard-coded the file path in the add-on. I would like to be able to enter the path with a basic interface.

I have already look at the imported add-ons but there’s no way to have other options like the type of the file (myheritage , geneanet , gedmatch and so on… )

Your description is where I was hoping you were going. (Eagerly anticipating trying it!)

You might want to look at the Photo Tagging Gramplet too. What you will be doing with ‘fully qualified file paths & names’, he does with with ‘rectangles’ in a picture. (And for OSes that support the Face Detection, it creates a form with a list of multiple rows just you would with adding multiple match files.) Naturally, it has an image preview pane and a thumbnail that you do not need. But it has a table where Associations can be created from a selection dialog or drag’n’drop.

Maybe you could connect with @GaryGriffin and see if he is willing to make his gramplet look at a URI in an Association Citation Vol/Page to read in an external CSV text file. The same way as it currently gathers that data from attached Association Notes of “Association Note” type.

This sounds interesting. Couple questions. Does the imported file correspond to a single associated persons shared matches or a set of associated people. If a set, how to tie the name in the imported file to the gramps Person? If the associated person already has a Association Note, does this add to or replace or no-op? What do you do if you get data from two sources (as they will be slightly different)? Is this two Associations (this is what I currently do).

I tried to make the Notes in the Association be a cut-paste from FTDNA and/or GEDmatch. These are the only two sources I have used for match data. If you have another source, can you tell me how to get a sample. I have about 40 people with DNA Associations to me.

Conceptually, I dont think that importing in the DNA Segment gramplet is the best idea, as the data is not stored permanently. And I dont think that this gramplet should be editing the Notes in an Association.

1 Like

Hi
the purpose is to import all the matches you got when you export your match list.
I create a person for each match
The next thing to do is to merge people with people that are already in the base.
Right now i only import match from myheritage and geneanet.
On these site each match has an unique key
Then i put this keys on each person as an attribbute.
all theses matches are releant to me. Then i have my key on my ptofile.
I store the data the same way it s stored on the dansegment addon.
I put a source in the association to discriminate the site here the match came from.
then to answer to your question if i have the same person on matches from different site there s two association.
The next time i import the matchs i check before if

  • there s person with the key
  • there s and association and the sources of the association.
    If all exist i skip the match as it was alreeady seen.

Right now i don’t use gedmatch or ftdna because there s no matching key and it s reallt a problem.
They don’t permit to use their api. I guess it s because they want to force people to use the 3 party vendors.
One can manually copy the matchs but it s not the purpose of the addon.
I want to enter automatically data to write some code for instance to make triangulation , to create fillters based on triangulation and combinning with the search of MRCA.

I m really a poor developper.
right now my code is more dirty than quick
As soon as i hae polish the code and write some documentation i will share it on github to see if it could be useful to other people.

1 Like

What person attribute do you use for myheritage and for geneanet? I would like to use the same so that in the future I can leverage your gramplet.

You should be able to use the DNASegment gramplet in single chromosome view to see triangulation areas.

Right now i use
GeneanetMatchID
MyHeritageMatchID