kkujansuu / gramps

MIT License
1 stars 1 forks source link

FilterParams doesn't like scrolling through Categories of filters #36

Closed emyoulation closed 1 year ago

emyoulation commented 1 year ago

Quickly scrolling through the Categories pop-up menu (with a wheel mouse's roller wheel button) generates an error.

(Had just noticed that the wheel mouse roller scrolls more than the scrollbar area indicated by the mouse pointer. So was trying scrolling while indicating different GUI elements. This time was is the Categories pop-up menu indicated in the FilterParams dialog.)

3623802: ERROR: grampsapp.py: line 173: Unhandled exception
Traceback (most recent call last):
  File "/home/districtsupport/.gramps/gramps51/plugins/FilterParams/FilterParams.py", line 892, in on_filter_changed
    frame2 = self.add_frame_and_filter(None, self.current_category, filtername, filtername, 0)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/districtsupport/.gramps/gramps51/plugins/FilterParams/FilterParams.py", line 831, in add_frame_and_filter
    self.addfilter(grid2, category, filter, level+1)
  File "/home/districtsupport/.gramps/gramps51/plugins/FilterParams/FilterParams.py", line 766, in addfilter
    entry.entry.connect("changed", self.update_params)
    ^^^^^^^^^^^
AttributeError: 'MyEntry' object has no attribute 'entry'

I was using the following custom_filters.xml file:

<?xml version="1.0" encoding="utf-8"?>
<filters>
  <object type="Place">
    <filter name="comma" function="and" invert="1">
      <rule class="HasTitle" use_regex="False">
        <arg value=","/>
      </rule>
    </filter>
    <filter name="enclosed" function="and">
      <rule class="HasTitle" use_regex="False">
        <arg value=","/>
      </rule>
    </filter>
    <filter name="Enclosed" function="and">
      <rule class="IsEnclosedBy" use_regex="False">
        <arg value="GEO2648110"/>
        <arg value="1"/>
      </rule>
    </filter>
    <filter name="No coordinates" function="and" invert="1">
      <rule class="HasNoLatOrLon" use_regex="False">
      </rule>
    </filter>
  </object>
  <object type="Person">
    <filter name="Children of ___" function="or" comment="see https://gramps.discourse.group/t/4173/5">
      <rule class="IsChildOfFilterMatch" use_regex="False">
        <arg value="SpecificPeople"/>
      </rule>
      <rule class="MatchesFilter" use_regex="False">
        <arg value="SpecificPeople"/>
      </rule>
    </filter>
    <filter name="Garner" function="and" comment="Created on 2023/09/20">
      <rule class="RegExpIdOf" use_regex="True">
        <arg value="^I0044$"/>
      </rule>
    </filter>
    <filter name="Home" function="and" comment="Created on 2023/09/25">
      <rule class="RegExpIdOf" use_regex="True">
        <arg value="^I0044$"/>
      </rule>
    </filter>
    <filter name="noMedia" function="and">
      <rule class="HavePhotos" use_regex="False">
        <arg value="1"/>
        <arg value="less than"/>
      </rule>
    </filter>
    <filter name="SpecificPeople" function="and" comment="created from Clipboard context menu for 3 selected people">
      <rule class="RegExpIdOf" use_regex="True">
        <arg value="^I0044$|^I0627$|^I0628$"/>
      </rule>
    </filter>
    <filter name="Черниш П.Ф." function="and" comment="problematic Ukranian Cyrillic filter name surname &quot;Chernysh P.F.&quot;">
      <rule class="HasIdOf" use_regex="False">
        <arg value="I0044"/>
      </rule>
    </filter>
    <filter name="Черниш П.Ф. + прямі родичі" function="or" comment="Chernysh P.F. + direct relatives">
      <rule class="MatchesFilter" use_regex="False">
        <arg value="Черниш П.Ф."/>
      </rule>
      <rule class="IsChildOfFilterMatch" use_regex="False">
        <arg value="Черниш П.Ф."/>
      </rule>
    </filter>
  </object>
  <object type="Event">
    <filter name="Enclosed" function="and">
      <rule class="MatchesPlaceFilter" use_regex="False">
        <arg value="Enclosed"/>
      </rule>
    </filter>
  </object>
  <object type="Family">
    <filter name="children" function="and">
      <rule class="ChildHasIdOf" use_regex="False">
        <arg value="I"/>
      </rule>
    </filter>
  </object>
  <object type="Source">
    <filter name="No Refs" function="and">
      <rule class="HasReferenceCountOf" use_regex="False">
        <arg value="less than"/>
        <arg value="1"/>
      </rule>
    </filter>
  </object>
  <object type="Note">
    <filter name="No Refs" function="and">
      <rule class="HasReferenceCountOf" use_regex="False">
        <arg value="less than"/>
        <arg value="1"/>
      </rule>
    </filter>
  </object>
</filters>
kkujansuu commented 1 year ago

Fixed