kkujansuu / gramps

MIT License
1 stars 1 forks source link

Display of Filters with multiple rules referencing the same filter #35

Closed emyoulation closed 1 year ago

emyoulation commented 1 year ago

GUI spot omits showing the secondary Rule name. Shows only the tertiary Filter name being referenced. Example is from the Filter Params display when the custom filter has multiple rules referencing the same <filter>

image

See Discourse for full discussion: https://gramps.discourse.group/t/how-exclude-one-filter-from-another-one/4291/7

custom_filters.xml from example. use filter "Descendants of Ancestors":

<?xml version="1.0" encoding="utf-8"?>
<filters>
  <object type="Person">
    <filter name="Ancestors" function="or">
      <rule class="IsAncestorOf" use_regex="False">
        <arg value="I0163"/>
        <arg value="1"/>
      </rule>
    </filter>
    <filter name="Descendants of Ancestors" function="or">
      <rule class="IsChildOfFilterMatch" use_regex="False">
        <arg value="Ancestors"/>
      </rule>
      <rule class="IsParentOfFilterMatch" use_regex="False">
        <arg value="Ancestors"/>
      </rule>
      <rule class="IsSiblingOfFilterMatch" use_regex="False">
        <arg value="Ancestors"/>
      </rule>
      <rule class="IsSpouseOfFilterMatch" use_regex="False">
        <arg value="Ancestors"/>
      </rule>
      <rule class="IsDescendantOfFilterMatch" use_regex="False">
        <arg value="Ancestors"/>
      </rule>
      <rule class="MatchesFilter" use_regex="False">
        <arg value="Ancestors"/>
      </rule>
    </filter>
    <filter name="Exclude" function="or" invert="1">
      <rule class="HasTextMatchingSubstringOf" use_regex="True">
        <arg value="Гусаров|Бабуха|Голуб|Здовбель|Моспан|Бондарчук|Гіндін|Гончар|Лисенко|Мазевич|Малишкін|Пилькевич|Пономарьов|Скаржинський|Товарницький|Утевський|Шалдин"/>
        <arg value="0"/>
      </rule>
    </filter>
    <filter name="Filtered" function="and">
      <rule class="MatchesFilter" use_regex="False">
        <arg value="Descendants of Ancestors"/>
      </rule>
      <rule class="MatchesFilter" use_regex="False">
        <arg value="Exclude"/>
      </rule>
    </filter>
  </object>
</filters>
kkujansuu commented 1 year ago

There is now a new version. Hope it works better. There is also a dropdown box where the user can change the referenced filter.

kkujansuu commented 1 year ago

The sample filter above now looks like

image