Fix Person, Family Sidebar Filters to add custom Event types
Fixes #10112 Also fix Family Sidebar Filter RelType init with closed db
This commit is contained in:
parent
d624d4a0bb
commit
d8057c2b0b
@ -67,21 +67,29 @@ class FamilySidebarFilter(SidebarFilter):
|
|||||||
self.filter_event = Event()
|
self.filter_event = Event()
|
||||||
self.filter_event.set_type((EventType.CUSTOM, ''))
|
self.filter_event.set_type((EventType.CUSTOM, ''))
|
||||||
self.etype = Gtk.ComboBox(has_entry=True)
|
self.etype = Gtk.ComboBox(has_entry=True)
|
||||||
|
if dbstate.is_open():
|
||||||
self.family_stub = Family()
|
self.custom_types = dbstate.db.get_event_types()
|
||||||
self.family_stub.set_relationship((FamilyRelType.CUSTOM, ''))
|
else:
|
||||||
self.rtype = Gtk.ComboBox(has_entry=True)
|
self.custom_types = []
|
||||||
self.custom_types = dbstate.db.get_family_relation_types()
|
|
||||||
|
|
||||||
self.event_menu = widgets.MonitoredDataType(
|
self.event_menu = widgets.MonitoredDataType(
|
||||||
self.etype,
|
self.etype,
|
||||||
self.filter_event.set_type,
|
self.filter_event.set_type,
|
||||||
self.filter_event.get_type)
|
self.filter_event.get_type,
|
||||||
|
custom_values=self.custom_types)
|
||||||
|
|
||||||
|
self.filter_family = Family()
|
||||||
|
self.filter_family.set_relationship((FamilyRelType.CUSTOM, ''))
|
||||||
|
self.rtype = Gtk.ComboBox(has_entry=True)
|
||||||
|
if dbstate.is_open():
|
||||||
|
self.custom_types = dbstate.db.get_family_relation_types()
|
||||||
|
else:
|
||||||
|
self.custom_types = []
|
||||||
|
|
||||||
self.rel_menu = widgets.MonitoredDataType(
|
self.rel_menu = widgets.MonitoredDataType(
|
||||||
self.rtype,
|
self.rtype,
|
||||||
self.family_stub.set_relationship,
|
self.filter_family.set_relationship,
|
||||||
self.family_stub.get_relationship,
|
self.filter_family.get_relationship,
|
||||||
custom_values=self.custom_types)
|
custom_values=self.custom_types)
|
||||||
|
|
||||||
self.filter_note = widgets.BasicEntry()
|
self.filter_note = widgets.BasicEntry()
|
||||||
@ -139,7 +147,7 @@ class FamilySidebarFilter(SidebarFilter):
|
|||||||
child = str(self.filter_child.get_text()).strip()
|
child = str(self.filter_child.get_text()).strip()
|
||||||
note = str(self.filter_note.get_text()).strip()
|
note = str(self.filter_note.get_text()).strip()
|
||||||
etype = self.filter_event.get_type().xml_str()
|
etype = self.filter_event.get_type().xml_str()
|
||||||
rtype = self.family_stub.get_relationship().xml_str()
|
rtype = self.filter_family.get_relationship().xml_str()
|
||||||
regex = self.filter_regex.get_active()
|
regex = self.filter_regex.get_active()
|
||||||
tag = self.tag.get_active() > 0
|
tag = self.tag.get_active() > 0
|
||||||
generic = self.generic.get_active() > 0
|
generic = self.generic.get_active() > 0
|
||||||
|
@ -78,10 +78,15 @@ class PersonSidebarFilter(SidebarFilter):
|
|||||||
self.filter_event = Event()
|
self.filter_event = Event()
|
||||||
self.filter_event.set_type((EventType.CUSTOM, ''))
|
self.filter_event.set_type((EventType.CUSTOM, ''))
|
||||||
self.etype = Gtk.ComboBox(has_entry=True)
|
self.etype = Gtk.ComboBox(has_entry=True)
|
||||||
|
if dbstate.is_open():
|
||||||
|
self.custom_types = dbstate.db.get_event_types()
|
||||||
|
else:
|
||||||
|
self.custom_types = []
|
||||||
self.event_menu = widgets.MonitoredDataType(
|
self.event_menu = widgets.MonitoredDataType(
|
||||||
self.etype,
|
self.etype,
|
||||||
self.filter_event.set_type,
|
self.filter_event.set_type,
|
||||||
self.filter_event.get_type)
|
self.filter_event.get_type,
|
||||||
|
custom_values=self.custom_types)
|
||||||
|
|
||||||
self.filter_note = widgets.BasicEntry()
|
self.filter_note = widgets.BasicEntry()
|
||||||
self.filter_gender = Gtk.ComboBoxText()
|
self.filter_gender = Gtk.ComboBoxText()
|
||||||
|
Loading…
Reference in New Issue
Block a user