* src/GrampsCfg.py: fix color dialog buttons
* src/Filters/Rules/Person/_HasEvent.py: handle EventType svn: r6635
This commit is contained in:
@@ -224,12 +224,15 @@ class PersonView(PageView.PersonNavView):
|
||||
self.filter_id = gtk.Entry()
|
||||
self.filter_birth = gtk.Entry()
|
||||
self.filter_death = gtk.Entry()
|
||||
self.filter_event = gtk.Entry()
|
||||
self.filter_event.set_sensitive(False)
|
||||
self.filter_event = RelLib.Event()
|
||||
self.filter_event.set_type((RelLib.EventType.CUSTOM,''))
|
||||
etype = gtk.ComboBoxEntry()
|
||||
|
||||
self.event_menu = GrampsWidgets.MonitoredDataType(
|
||||
etype,
|
||||
self.filter_event.set_type,
|
||||
self.filter_event.get_type)
|
||||
|
||||
self.filter_source = gtk.Entry()
|
||||
self.filter_source.set_sensitive(False)
|
||||
|
||||
self.filter_note = gtk.Entry()
|
||||
self.filter_gender = gtk.combo_box_new_text()
|
||||
for i in [ _('any'), _('male'), _('female'), _('unknown') ]:
|
||||
@@ -276,27 +279,20 @@ class PersonView(PageView.PersonNavView):
|
||||
table.attach(self.filter_death, 2, 3, 5, 6,
|
||||
xoptions=gtk.FILL, yoptions=0)
|
||||
|
||||
table.attach(GrampsWidgets.BasicLabel(_('Event')),
|
||||
table.attach(GrampsWidgets.BasicLabel(_('Has Event')),
|
||||
1, 2, 6, 7, xoptions=gtk.FILL, yoptions=0)
|
||||
|
||||
table.attach(self.filter_event, 2, 3, 6, 7,
|
||||
xoptions=gtk.FILL, yoptions=0)
|
||||
|
||||
table.attach(GrampsWidgets.BasicLabel(_('Source')),
|
||||
1, 2, 7, 8, xoptions=gtk.FILL, yoptions=0)
|
||||
|
||||
table.attach(self.filter_source, 2, 3, 7, 8,
|
||||
xoptions=gtk.FILL, yoptions=0)
|
||||
table.attach(etype, 2, 3, 6, 7, xoptions=gtk.FILL, yoptions=0)
|
||||
|
||||
table.attach(GrampsWidgets.BasicLabel(_('Note')),
|
||||
1, 2, 8, 9, xoptions=gtk.FILL, yoptions=0)
|
||||
1, 2, 7, 8, xoptions=gtk.FILL, yoptions=0)
|
||||
|
||||
table.attach(self.filter_note, 2, 3, 8, 9,
|
||||
table.attach(self.filter_note, 2, 3, 7, 8,
|
||||
xoptions=gtk.FILL, yoptions=0)
|
||||
|
||||
table.attach(self.filter_regex, 2, 3, 9, 10, xoptions=gtk.FILL,
|
||||
table.attach(self.filter_regex, 2, 3, 8, 9, xoptions=gtk.FILL,
|
||||
yoptions=0)
|
||||
table.attach(self.apply_btn, 2, 3, 10, 11, xoptions=0,
|
||||
table.attach(self.apply_btn, 2, 3, 9, 10, xoptions=0,
|
||||
yoptions=0)
|
||||
|
||||
return table
|
||||
@@ -306,14 +302,14 @@ class PersonView(PageView.PersonNavView):
|
||||
gid = self.filter_id.get_text().strip()
|
||||
birth = self.filter_birth.get_text().strip()
|
||||
death = self.filter_death.get_text().strip()
|
||||
event = self.filter_event.get_text().strip()
|
||||
source = self.filter_source.get_text().strip()
|
||||
note = self.filter_note.get_text().strip()
|
||||
gender = self.filter_gender.get_active()
|
||||
regex = self.filter_regex.get_active()
|
||||
|
||||
if not name and not gid and not birth and not death \
|
||||
and not event and not source and not note and not gender > 0:
|
||||
and not str(self.filter_event.get_type()) and \
|
||||
not source and not note and not gender > 0:
|
||||
self.generic_filter = None
|
||||
else:
|
||||
self.generic_filter = GenericFilter()
|
||||
@@ -336,6 +332,12 @@ class PersonView(PageView.PersonNavView):
|
||||
self.generic_filter.add_rule(IsFemale([]))
|
||||
else:
|
||||
self.generic_filter.add_rule(HasUnknownGender([]))
|
||||
|
||||
etype = self.filter_event.get_type()
|
||||
if str(etype):
|
||||
rule = HasEvent([etype, '', '', ''])
|
||||
self.generic_filter.add_rule(rule)
|
||||
|
||||
if birth:
|
||||
rule = HasBirth([birth,'',''])
|
||||
self.generic_filter.add_rule(rule)
|
||||
|
Reference in New Issue
Block a user