Add filter progress to export assistant

This commit is contained in:
Nick Hall 2017-01-26 22:12:32 +00:00
parent 4912cc08e4
commit 1e54054953
2 changed files with 9 additions and 8 deletions

View File

@ -42,7 +42,7 @@ class FilterProxyDb(ProxyDbBase):
"""
def __init__(self, db, person_filter=None, event_filter=None,
note_filter=None):
note_filter=None, user=None):
"""
Create a new FilterProxyDb instance.
"""
@ -50,19 +50,19 @@ class FilterProxyDb(ProxyDbBase):
self.person_filter = person_filter
if person_filter:
self.plist = set(person_filter.apply(
self.db, self.db.iter_person_handles()))
self.db, self.db.iter_person_handles(), user=user))
else:
self.plist = set(self.db.iter_person_handles())
if event_filter:
self.elist = set(event_filter.apply(
self.db, self.db.iter_event_handles()))
self.db, self.db.iter_event_handles(), user=user))
else:
self.elist = set(self.db.iter_event_handles())
if note_filter:
self.nlist = set(note_filter.apply(
self.db, self.db.iter_note_handles()))
self.db, self.db.iter_note_handles(), user=user))
else:
self.nlist = set(self.db.iter_note_handles())

View File

@ -40,6 +40,7 @@ from gramps.gen.config import config
from gramps.gen.display.name import displayer as name_displayer
from gramps.gen.filters import GenericFilter, rules
from ...utils import ProgressMeter
from ...user import User
from gramps.gen.proxy import (PrivateProxyDb,
LivingProxyDb,
FilterProxyDb,
@ -615,8 +616,8 @@ class WriterOptionBox:
progress.reset(_("Applying selected person filter"))
progress.update(progress.progress_cnt)
progress.progress_cnt += 1
dbase = FilterProxyDb(
dbase, self.cfilter)
dbase = FilterProxyDb(dbase, self.cfilter,
user=User())
# Apply the Note Filter
elif proxy_name == "note":
@ -625,8 +626,8 @@ class WriterOptionBox:
progress.reset(_("Applying selected note filter"))
progress.update(progress.progress_cnt)
progress.progress_cnt += 1
dbase = FilterProxyDb(
dbase, note_filter=self.nfilter)
dbase = FilterProxyDb(dbase, note_filter=self.nfilter,
user=User())
# Apply the ReferencedBySelection
elif proxy_name == "reference":