2006-07-10 Don Allingham <don@gramps-project.org>
* src/DataViews/_FamlyList.py: add filter editor support * src/FilterEditor/_FilterEditor.py: add family support * src/FilterEditor/_EditRule.py: add family support * src/Filters/_FamilySidebarFilter.py: start of family support * src/Filters/Rules/Family/_HasRelType.py: start of family filters * src/Filters/Rules/Family/__init__.py: start of family filters svn: r7014
This commit is contained in:
@@ -350,7 +350,13 @@ class EditRule(ManagedWindow.ManagedWindow):
|
||||
self.page = []
|
||||
self.class2page = {}
|
||||
the_map = {}
|
||||
for class_obj in Rules.Person.editor_rule_list:
|
||||
|
||||
if self.space == "Family":
|
||||
class_list = Rules.Family.editor_rule_list
|
||||
else:
|
||||
class_list = Rules.Person.editor_rule_list
|
||||
|
||||
for class_obj in class_list:
|
||||
arglist = class_obj.labels
|
||||
vallist = []
|
||||
tlist = []
|
||||
|
||||
@@ -65,11 +65,11 @@ import ManagedWindow
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
class FilterEditor(ManagedWindow.ManagedWindow):
|
||||
def __init__(self, space, filterdb, dbstate, uistate):
|
||||
def __init__(self, space, filterdb, dbstate, uistate, ftype=GenericFilter):
|
||||
|
||||
ManagedWindow.ManagedWindow.__init__(self, uistate, [],
|
||||
FilterEditor)
|
||||
|
||||
self.ftype = ftype
|
||||
self.dbstate = dbstate
|
||||
self.db = dbstate.db
|
||||
self.filterdb = FilterList(filterdb)
|
||||
@@ -138,7 +138,7 @@ class FilterEditor(ManagedWindow.ManagedWindow):
|
||||
def add_new_filter(self,obj):
|
||||
from _EditFilter import EditFilter
|
||||
|
||||
the_filter = GenericFilter()
|
||||
the_filter = self.ftype()
|
||||
EditFilter(self.space, self.dbstate, self.uistate, self.track,
|
||||
the_filter, self.filterdb, self.draw_filters)
|
||||
|
||||
@@ -157,7 +157,8 @@ class FilterEditor(ManagedWindow.ManagedWindow):
|
||||
from _ShowResults import ShowResults
|
||||
|
||||
filt = self.clist.get_object(node)
|
||||
handle_list = filt.apply(self.db,self.db.get_person_handles(sort_handles=False))
|
||||
handle_list = filt.apply(
|
||||
self.db, self.db.get_person_handles(sort_handles=False))
|
||||
ShowResults(self.db, self.uistate, self.track, handle_list,
|
||||
filt.get_name())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user