Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select Form Dialogs fixes and improvements, inc search filtering #351

Closed
wants to merge 42 commits into from

Commits on Jul 5, 2019

  1. OSM forward all http resquest to https. (#212)

    After asking the OSM support, I was told OSM forward all http request to
    https when we use .org url.
    So it should work in all cases.
    
    This has an energy cost, so it would be good for the planet to change http
    to https.
    
    Fixes #11057
    SNoiraud authored and sam-m888 committed Jul 5, 2019
    Configuration menu
    Copy the full SHA
    ec431a4 View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2019

  1. Merge branch 'gramps51'

    prculley committed Jul 8, 2019
    Configuration menu
    Copy the full SHA
    45c2dff View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2019

  1. Merge branch 'gramps51'

    prculley committed Jul 9, 2019
    Configuration menu
    Copy the full SHA
    e720c94 View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2019

  1. [DynamicWeb] Add Slovak translation [gramps51] (#210)

    * DynamicWeb Slovak translation
    
    * DynamicWeb Slovak translation whitespace fix
    bubakovsky authored and sam-m888 committed Jul 11, 2019
    Configuration menu
    Copy the full SHA
    9b41042 View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2019

  1. start to update for GEPS045

    romjerome committed Jul 12, 2019
    Configuration menu
    Copy the full SHA
    d9285cd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7fecc31 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    12d43f1 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    75ef674 View commit details
    Browse the repository at this point in the history
  5. also runs with lxml 4.3.4

    romjerome committed Jul 12, 2019
    Configuration menu
    Copy the full SHA
    353e9c4 View commit details
    Browse the repository at this point in the history
  6. TODO: fix an issue around 'db.get_number_of_citation'

    need to look at DB design changes related to dummy DB
    romjerome committed Jul 12, 2019
    Configuration menu
    Copy the full SHA
    3e94b70 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    1fcbac8 View commit details
    Browse the repository at this point in the history

Commits on Jul 14, 2019

  1. Configuration menu
    Copy the full SHA
    2321523 View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2019

  1. revert GEPS045 stuff

    romjerome committed Jul 18, 2019
    Configuration menu
    Copy the full SHA
    b4f7be9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bb3ce01 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7ced2ed View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2019

  1. [AssociationsTool]Enhanced by calling relcal[gramps52] (#204)

    * Enhanced Associations Tool by calling relcal
    romjerome authored Sep 19, 2019
    Configuration menu
    Copy the full SHA
    f7d30d8 View commit details
    Browse the repository at this point in the history
  2. Update associationstool.py

    better description as proposed on #204
    romjerome authored Sep 19, 2019
    Configuration menu
    Copy the full SHA
    0683494 View commit details
    Browse the repository at this point in the history
  3. Upgrade version

    romjerome authored Sep 19, 2019
    Configuration menu
    Copy the full SHA
    65c0747 View commit details
    Browse the repository at this point in the history

Commits on Oct 16, 2019

  1. [TMGimporter]Remove Older WIP addon from master branch[52] (#244)

    Cleanup (removing older version to make it easier to merge up newer version from gramps51 branch when needed)
    sam-m888 authored Oct 16, 2019
    Configuration menu
    Copy the full SHA
    adbc704 View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2019

  1. Merge branch 'gramps51'

    prculley committed Oct 25, 2019
    Configuration menu
    Copy the full SHA
    2ac2478 View commit details
    Browse the repository at this point in the history

Commits on Dec 29, 2019

  1. Merge branch 'gramps51'

    prculley committed Dec 29, 2019
    Configuration menu
    Copy the full SHA
    e9aebf6 View commit details
    Browse the repository at this point in the history

Commits on Jan 4, 2020

  1. Configuration menu
    Copy the full SHA
    61bff8a View commit details
    Browse the repository at this point in the history

Commits on Feb 25, 2020

  1. New plugin NLWebConnectPack based on similar ConnectionPack addons fo…

    …r other languages with Dutch resources. (#256)
    coret authored Feb 25, 2020
    Configuration menu
    Copy the full SHA
    d6c5602 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9434374 View commit details
    Browse the repository at this point in the history

Commits on Feb 29, 2020

  1. Configuration menu
    Copy the full SHA
    d4cbb91 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cb87b59 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    449cea6 View commit details
    Browse the repository at this point in the history

Commits on Apr 7, 2020

  1. Configuration menu
    Copy the full SHA
    a97348d View commit details
    Browse the repository at this point in the history

Commits on May 15, 2020

  1. Configuration menu
    Copy the full SHA
    9575ee9 View commit details
    Browse the repository at this point in the history
  2. Improve XML and other validations and error handling, extended Forms …

    …XML to add Reference/Location defaulting (changes listed below)
    
    CHANGES
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    * All changed areas marked with DB$ (start/end)
    
    * Added error handler "DisplayLogError()".
      When invoked this will display errors in a popup and
      show exception details in the log (gramps51.log).
    
    * DisplayLogError() used:
        * On XML SYNTAX Error in any of the forms configuration files.
          This shows the file name and what the DOM reports as the issue.
        * If no "<form>" tags exist in a file.
        * If a "section" is missing a "role" attribute (or it's empty).
        * If a "section" is missing a "type" attribute (or it's invalid).
    
    * Some debug messages are now produced by Forms.
      -d "Form Gramplet"
    
    * The environment variable "G.FORMS" can now specify extra Form XML files that
      should be loaded, these are loaded before the inbuilt ones in the order
      specified.
      SET G.FORMS=SameDirAsDefined.xml;xml\InAnXmlSubDirectoryFromDefined.xml
      SET G.FORMS=[G.FORMS]\Australia, Queensland - Birth, Death and Marriages Register.xml;[G.FORMS]\Graves - Find-a-Grave.xml
    
    * If there is no date or reference in the event an error message will be
      displayed for you to fix that.  If for some reason your form doesn't need
      them then I'd suggest giving them default values date='today' and
      reference='none required'.
    
    * I display a message (and abort the save) in at least one error
      situation (person unchosen) where in the past it just quietly closed.
      Because of my other improvement to default a 'person" you should only
      see this on 'multi' or 'family'.
    
    * The created event how has the "Description" field filled in with
      the reference followed by " @ " then the name of the source followed by
      " [form]".
    
    * For section "type=person" [others later...], you no longer have to remember
      if you have selected someone or worry that you selected the wrong person
      as the state is now displayed:
          * Initially "no one selected yet" (in italics)
          * After person creation/selection the name is displayed [small bold]
    
    * For section "type=person" [maybe 'multi' later...], the selected person becomes
      the default person (don't need to go though person selection dialog).
      If multiple people selected then the first is used.
      This occurs exactly once per form.
      [Bug] Currently doesn't work well for multiple sections/people, all will
            have same person preloaded (still better than before).
    
    * The "title" attribute of the "<section>" tag has been improved.
      If not specified (or blank) then the "role" tag's value will be used.
      Also, that way, a title is always displayed, in the past you could have
      completely anonymous sections on the form!!!!
    
    * The value for the "type" attribute of a "section" is now case insensitive
      ('Person' == 'person').
    
    * Fixed the Location "+" & "use existing" location button order so it is not
      only consistent with the rest of the form but with Gramps in general.
    
    * The "Headings" tab is no longer displayed if there are no headings, if it
      exists then you should remember to swap to it and fill it in.
    
    * The following applies to the existing 'date' and the new
      'location' & 'reference' values (rather than creating a lot of xml attributes):
    
      # If no "=" exists in the string then it is the "default" value, this makes
        the 'date' value backwards compatible for existing forms.
    
      # If you want a default value to contain a "=" sign you need to put
        "default=" in front of it.  This works since for each pair only the first
        "=" is used to separate the key from the value.
    
      # If "=" is anywhere in the value you provide then its contents are one or
        more "key=value" pairs separated by "; "
        (semi-colon followed by a single space, all other spaces significant).
    
      # The order you supply keys is irrelevant.
    
      # Incorrectly specified keys will be reported in the log (gramps51.log).
    
      # Unspecified keys will default to some value (generally '').
    
    * New "location" attribute on the "<form>" tag:
        * Example: location="label=Where in QLD?; default=Queensland, Australia"
    
        * [Key: default] You can now specify a default location.
          If the location (place) is pre-existing then it will be used, otherwise it
          will be created (and given the type "_FORM" so you can find and update it easily).
    
        * [Key: label] You can replace the label "Location:" with your own text to better inform
          the user as to the form's intention.
    
    * New "reference" attribute on the "<form>" tag:
        * Example: reference='label=QLD [B]DM #'
    
        * [Key: label] You can replace "Reference:" with your own text to better inform the user
          as to the form's intention.
    
        * [Key: default] Can now specify a default Reference
          (or perhaps a default prefix you want used).
          You can replace or edit the value.
    
    * The "date" attribute of the "<form>" tag:
        * Example: date='label=Date of Birth'
        * Example: date='label=Discovery Date; default=today; ro=N'
    
        * [Key: label] You can replace "Date:" with your own text to better inform the user
          as to the form's intention.
    
        * [Key: default] The default date which can take "today" or "." to represent
          todays date or any valid values like "after 1777".
    
        * [Key: ro] The value should be "Y" (yes) or "N" (no) as to whether the date
          displayed in the form is read-only or can be modified by the user.
          It defaults to "Y" to be backwards compatible with existing functionality.
          This is of course ignored if no "default" date was provided, as you will
          need to enter it!
    
        * Tooltips on date fields in form (for read-only & not).
    
        * In the date entry field you can type "." as shorthand for 'today', which
          you could always type, it was just longer!
          If "." used the field will still be highlighted in red.
    
    * Made the source selection buttons (NEW/EDIT) slightly larger to make
      clicking them easier
    
    
    
    TODO:
    ~~~~~~~~~~~~~~~~~~~~~~~
    * Optional Form Help (how to fill in THIS form)
      Maybe in a column on the right (HTML?)
      Probably in a separate .html file (name = form id or maybe title or both)
    
    * More validation of input. Ability to have integer, required attributes etc.
    
    * [DO MULTI/FAMILY]
      For section type=person, you no longer have to remember if you have
      selected someone or worry that you selected the wrong person
      as the state is now displayed:
          * Initially "no one selected yet" (in italics)
          * Afer person creation/selection the name is displayed [small bold]
    
    * If # selected people = #sections then grab their names (defaulting)
      How do I get the selected information (when multiple selection)?
    
    * Prevent use OK unless all people selected - HOW TO CANCEL Button press?
    
    * [bug] In headings tab, type in data in a field, don't leave it and press OK,
      that field's data is lost.
    
    * The "Heading" tag should be deleted and handled like all other fields,
      these fields should be placed in a "heading" section and handled just
      like any other exception (except that you can't choose people/family).
      That way the UI is also less confusing and the user doesn't need to go
      to 2 tabs to find everything. It also means all the "column"
      formatting also applies to headings.
    
    
    Facts / Pre-existing-Issues
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    * size tag in "column" not used by Form, seems to have been obsoleted
    * title tag in "form" is not used by Form, seems to have been obsoleted,
      still required! Should fix this
    * HeadingsTab.is_empty() doesn't work, always returns True
    
    
    CAN'T WORK IT OUT (YET):
    ~~~~~~~~~~~~~~~~~~~~~~~~
    * How to add selected people as "main participants"?
      ?: from ...utils.db import get_participant_from_event
         MAYBE: set_participant?
    dbareis authored May 15, 2020
    Configuration menu
    Copy the full SHA
    f95e61e View commit details
    Browse the repository at this point in the history
  3. 2 useful forms useful as samples for some of the changes

    SAMPLES:
    ~~~~~~~~~
    Australia, Queensland - Birth, Death and Marriages Register.xml
    Graves - Find-a-Grave.xml
    
    I assume I will also need to submit these separately if the changes are accepted and update the WIKI documentation.
    dbareis authored May 15, 2020
    Configuration menu
    Copy the full SHA
    26f4914 View commit details
    Browse the repository at this point in the history
  4. New envvar "G.FORMSX" + Fixed the baseline code I used

    The environment variable "G.FORMSX" can now specify XML files to be excluded if you don't need them.
    This may improve performance or be useful in testing situations.  It will certainly remove some debugging output.
            SET G.FORMSX=form_be.xml;form_ca.xml;form_dk.xml;form_fr.xml;form_gb.xml;form_pl.xml;form_us.xml
    
    Now that I've tried Github, I also removed my DB$ comments as Github seems to have quite good difference handling...
    
    Also stupid mistake, my code was based on the distributed plugin code which is NEWER than the master code so I changed fixed the differences between the two.  The version was therefore updated from 2.0.24 to 2.0.20 (2.0.19 in master)
    dbareis authored May 15, 2020
    Configuration menu
    Copy the full SHA
    6b7719b View commit details
    Browse the repository at this point in the history
  5. Fixed a mistake in my rebaselining

    Correct Line: if str(attr.get_type()) == DEFINITION_KEY:
    dbareis authored May 15, 2020
    Configuration menu
    Copy the full SHA
    8bc4e73 View commit details
    Browse the repository at this point in the history

Commits on May 17, 2020

  1. Fixed a but if env vars didn't exist plus more improvements + Validat…

    …ions
    
    * Oops form wouldn't load if the environment variables didn't exist
    
    * If a form "id" is duplicated this will be logged as a warning and the  loading of that form aborted (the first occurance will be retained).
      It will also tell you in which file it was originally loaded.
    
    * If the "Select Form" would be empty a message explaining the issue  and how to resolve is logged and displayed to the user.
    
    * If headings tab exists a validation message is displayed if it was  never visited.
    
    * New optional help files get displayed if they exist.
        * They contain text in pango format.
        * Newlines are significant
        * A new paragraph = 2 x newlines
        * You can break up a long line by terminating the continuing line with
          a backslash (\). All whitespace before the backslash is retained.
    
    * Help is always added if there are headings to be entered.
    
    * The height and width of the 'select form' dialog can be overriden by the user   using the "G.FORM.SF.H" and "G.FORM.SF.W" environment variables.   Defaults to original values (height too small for my liking) of 350 & 400.
    
    * All forms env vars now begin with "G.FORM", so renamed existing:
        * "G.FORMS"  to "G.FORM.I"
        * "G.FORMSX" to "G.FORM.X"
    
    * The "basename" of masks listed the inclusion & exclusion
      environment variables can now be a glob to match "MyForms\*.xml" etc
    
    * The existing Form hardcoding could be removed with "form_*.xml"
    dbareis authored May 17, 2020
    Configuration menu
    Copy the full SHA
    c267331 View commit details
    Browse the repository at this point in the history
  2. Delete [G.FORMS] 2 useful in their own right sample forms.zip

    As suggested filemasks are now used to load standard forms and I changed the definition list to include templates for similar form types.  I now include my (currently 4) XML documents as standard (also as suggested).
    dbareis authored May 17, 2020
    Configuration menu
    Copy the full SHA
    14d5259 View commit details
    Browse the repository at this point in the history
  3. 8 new forms (4 files) & "definition_files" now uses file masks

    # Files which may contain form definitions
    definition_files = [ 'test*.xml',       # Test forms have precidence (all but the first duplicate ID's are now ignored)
                         'custom*.xml',     # User's own forms although mainly for backwards compatibility as the envvar "G.FORM.I" can be used to define your own forms.
                         'bdm*.xml',        # Birth Death, marriages registries
                         'graves*.xml',     # Graves/Death sites (findagrave.com, billiongraves.com and similar)
                         ##################
                         'census*.xml',     # Most forms are census related
                         'form*.xml'        # Legacy naming
    dbareis authored May 17, 2020
    Configuration menu
    Copy the full SHA
    0346a7e View commit details
    Browse the repository at this point in the history

Commits on May 18, 2020

  1. Person questions will flow onto multiple lines if needed

    Solves this problem:
    On Mon, 18 May 2020 at 01:39, Paul Culley <[email protected]> wrote:
    I assume that you mean multiple columns in the EditForm window, 'Details' tab.  The current code doesn't seem to support an easy way to have multiple columns spread over more than one row.  The whole tab appears to use a Gtk Grid, with the top row as column headers and subsequent rows for the data.
    
    You would have to redesign that part of the code to utilize the grid differently.  Maybe in the set_columns routines you could detect too many columns and cause the the excess to start another pair of rows.  This would work for the types that are not EntryGrid, which seems to support many rows for each set of headers; I think that would need more work.
    
    Good luck
    Paul C.
    
    On Sat, May 16, 2020 at 4:31 PM Keith Jacobs <[email protected]> wrote:
    I have written a new form definition that has ten consecutive columns
    which I would like to split over two lines but have not managed to find
    out how to do it online.
    
    So I'd be grateful if someone with such knowledge could explain how to
    do it.
    
    --
    Regards
    Keith Jacobs
    dbareis authored May 18, 2020
    Configuration menu
    Copy the full SHA
    9ecd272 View commit details
    Browse the repository at this point in the history
  2. Person questions will flow onto multiple lines if needed

    Not sure why missed on previous upload/commit.
    
    Solves this issue:
    On Mon, 18 May 2020 at 01:39, Paul Culley <[email protected]> wrote:
    I assume that you mean multiple columns in the EditForm window, 'Details' tab.  The current code doesn't seem to support an easy way to have multiple columns spread over more than one row.  The whole tab appears to use a Gtk Grid, with the top row as column headers and subsequent rows for the data.
    
    You would have to redesign that part of the code to utilize the grid differently.  Maybe in the set_columns routines you could detect too many columns and cause the the excess to start another pair of rows.  This would work for the types that are not EntryGrid, which seems to support many rows for each set of headers; I think that would need more work.
    
    Good luck
    Paul C.
    
    On Sat, May 16, 2020 at 4:31 PM Keith Jacobs <[email protected]> wrote:
    I have written a new form definition that has ten consecutive columns
    which I would like to split over two lines but have not managed to find
    out how to do it online.
    
    So I'd be grateful if someone with such knowledge could explain how to
    do it.
    
    --
    Regards
    Keith Jacobs
    dbareis authored May 18, 2020
    Configuration menu
    Copy the full SHA
    a3660e9 View commit details
    Browse the repository at this point in the history
  3. Questions can now flow to multiple lines including down to a single q…

    …uestion per line
    
    Previous lower limit was 2 due to a weird visual issue otherwise, now fixed
    dbareis authored May 18, 2020
    Configuration menu
    Copy the full SHA
    c68934d View commit details
    Browse the repository at this point in the history

Commits on May 19, 2020

  1. New validation and other minor improvements

    * New validation:  XML TITLE FIELD MUST CONTAIN A '/' FOR A FAMILY
    
    * Now using gramps locate information and renamed base help directory to "help"
    
    * I'd broken some of my error handling, now fixed again.
    dbareis authored May 19, 2020
    Configuration menu
    Copy the full SHA
    94b2238 View commit details
    Browse the repository at this point in the history

Commits on May 25, 2020

  1. Select Form Dialogs fixes & Improvements (tree & filter)

    * Smaller targetted change as requested by:
       #349
    
    * Cancel button now works (no longer performs OK's function)
    
    * OK button now performs validation, only continues where possible.
    
    * Added help button
    
    * Can no longer get multiple exceptions from the dialog (no longer need to kill gramps or respond to many exception dialogs to recover).
    
    * CTRL+F (or just start typing) interactive search now works in the form selection dialog.  It filters out mismatches.  Matches are case insensitive and match anywhere in the string.
    
    ![AllChoicesShown+FullyExpanded](https://user-images.githubusercontent.com/295230/82747374-83a13400-9ddb-11ea-8639-2327aedc89b3.png)
    ![Filtered for vic](https://user-images.githubusercontent.com/295230/82747373-82700700-9ddb-11ea-96c6-d8d8909637b8.png)
    ![Filtered for ustr](https://user-images.githubusercontent.com/295230/82747375-8439ca80-9ddb-11ea-985b-baf70ee07230.png)
    
    * Added Reset filter (doubles as an expand tree button)
    
    * Added compact/compress tree button.
    
    * The form title wasn't being used.
        It now optionally is (it is if it begins with '/').
        e.g. title='/path1/subpath1.1/subpath1.1.1/census 1990'
    
    * when the form title isn't used then the dialog puts legacy entries into the same tree roots as in the past but may organise them by country or state below that.
        A Denmark census would be in the path 'Census/Denmark'.
        It also continues to use the source's name/title as the description (that is the title is ignored as previously).
    
        Filtering by "Denmark" is an easy way to get to them. In the US you can filter by state, or year of the census.
    
        EXAMPLE TITLES
        ~~~~~~~~~~~~~~
        title="/Death/World Wide/Find a Grave (https:{s}{s}www.findagrave.com{s})"
        title="/Birth/Australia/Queensland (registry)"
    
    * The size of the select dialog can be modified from the default INI value
       "form.ini".
    
    * hover expand turned off by default, can be enabled from an INI value
    
    * some functions required by future updates
    dbareis authored May 25, 2020
    Configuration menu
    Copy the full SHA
    c58df93 View commit details
    Browse the repository at this point in the history
  2. Undoing my changes to these files

    can't work out if there is a restore operation so uploading the original files
    dbareis authored May 25, 2020
    Configuration menu
    Copy the full SHA
    399dfeb View commit details
    Browse the repository at this point in the history