2548: deprecated system_filter.xml
svn: r13087
This commit is contained in:
parent
d9dc29c9af
commit
567721323d
@ -52,8 +52,7 @@ import GrampsDisplay
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import const
|
import const
|
||||||
from Filters import (GenericFilterFactory, FilterList, reload_custom_filters,
|
from Filters import (GenericFilterFactory, FilterList, reload_custom_filters)
|
||||||
reload_system_filters)
|
|
||||||
from Filters.Rules._MatchesFilterBase import MatchesFilterBase
|
from Filters.Rules._MatchesFilterBase import MatchesFilterBase
|
||||||
import ListModel
|
import ListModel
|
||||||
import ManagedWindow
|
import ManagedWindow
|
||||||
@ -140,7 +139,7 @@ class FilterEditor(ManagedWindow.ManagedWindow):
|
|||||||
def close(self, *obj):
|
def close(self, *obj):
|
||||||
self.filterdb.save()
|
self.filterdb.save()
|
||||||
reload_custom_filters()
|
reload_custom_filters()
|
||||||
reload_system_filters()
|
#reload_system_filters()
|
||||||
self.uistate.emit('filters-changed', (self.namespace,))
|
self.uistate.emit('filters-changed', (self.namespace,))
|
||||||
ManagedWindow.ManagedWindow.close(self, *obj)
|
ManagedWindow.ManagedWindow.close(self, *obj)
|
||||||
|
|
||||||
|
@ -55,11 +55,11 @@ class MatchesFilterBase(Rule):
|
|||||||
category = _('General filters')
|
category = _('General filters')
|
||||||
|
|
||||||
def prepare(self, db):
|
def prepare(self, db):
|
||||||
if Filters.SystemFilters:
|
#if Filters.SystemFilters:
|
||||||
for filt in Filters.SystemFilters.get_filters(self.namespace):
|
#for filt in Filters.SystemFilters.get_filters(self.namespace):
|
||||||
if filt.get_name() == self.list[0]:
|
#if filt.get_name() == self.list[0]:
|
||||||
for rule in filt.flist:
|
#for rule in filt.flist:
|
||||||
rule.prepare(db)
|
#rule.prepare(db)
|
||||||
if Filters.CustomFilters:
|
if Filters.CustomFilters:
|
||||||
for filt in Filters.CustomFilters.get_filters(self.namespace):
|
for filt in Filters.CustomFilters.get_filters(self.namespace):
|
||||||
if filt.get_name() == self.list[0]:
|
if filt.get_name() == self.list[0]:
|
||||||
@ -67,11 +67,11 @@ class MatchesFilterBase(Rule):
|
|||||||
rule.prepare(db)
|
rule.prepare(db)
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
if Filters.SystemFilters:
|
#if Filters.SystemFilters:
|
||||||
for filt in Filters.SystemFilters.get_filters(self.namespace):
|
#for filt in Filters.SystemFilters.get_filters(self.namespace):
|
||||||
if filt.get_name() == self.list[0]:
|
#if filt.get_name() == self.list[0]:
|
||||||
for rule in filt.flist:
|
#for rule in filt.flist:
|
||||||
rule.reset()
|
#rule.reset()
|
||||||
if Filters.CustomFilters:
|
if Filters.CustomFilters:
|
||||||
for filt in Filters.CustomFilters.get_filters(self.namespace):
|
for filt in Filters.CustomFilters.get_filters(self.namespace):
|
||||||
if filt.get_name() == self.list[0]:
|
if filt.get_name() == self.list[0]:
|
||||||
@ -79,10 +79,10 @@ class MatchesFilterBase(Rule):
|
|||||||
rule.reset()
|
rule.reset()
|
||||||
|
|
||||||
def apply(self, db, obj):
|
def apply(self, db, obj):
|
||||||
if Filters.SystemFilters:
|
#if Filters.SystemFilters:
|
||||||
for filt in Filters.SystemFilters.get_filters(self.namespace):
|
#for filt in Filters.SystemFilters.get_filters(self.namespace):
|
||||||
if filt.get_name() == self.list[0]:
|
#if filt.get_name() == self.list[0]:
|
||||||
return filt.check(db, obj.handle)
|
#return filt.check(db, obj.handle)
|
||||||
if Filters.CustomFilters:
|
if Filters.CustomFilters:
|
||||||
for filt in Filters.CustomFilters.get_filters(self.namespace):
|
for filt in Filters.CustomFilters.get_filters(self.namespace):
|
||||||
if filt.get_name() == self.list[0]:
|
if filt.get_name() == self.list[0]:
|
||||||
@ -93,10 +93,10 @@ class MatchesFilterBase(Rule):
|
|||||||
"""
|
"""
|
||||||
Return the selected filter or None.
|
Return the selected filter or None.
|
||||||
"""
|
"""
|
||||||
if Filters.SystemFilters:
|
#if Filters.SystemFilters:
|
||||||
for filt in Filters.SystemFilters.get_filters(self.namespace):
|
#for filt in Filters.SystemFilters.get_filters(self.namespace):
|
||||||
if filt.get_name() == self.list[0]:
|
#if filt.get_name() == self.list[0]:
|
||||||
return filt
|
#return filt
|
||||||
if Filters.CustomFilters:
|
if Filters.CustomFilters:
|
||||||
for filt in Filters.CustomFilters.get_filters(self.namespace):
|
for filt in Filters.CustomFilters.get_filters(self.namespace):
|
||||||
if filt.get_name() == self.list[0]:
|
if filt.get_name() == self.list[0]:
|
||||||
|
@ -37,7 +37,7 @@ import gobject
|
|||||||
# GRAMPS modules
|
# GRAMPS modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from Filters import SystemFilters, CustomFilters
|
from Filters import CustomFilters
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -64,12 +64,12 @@ class FilterComboBox(gtk.ComboBox):
|
|||||||
active = cnt
|
active = cnt
|
||||||
cnt += 1
|
cnt += 1
|
||||||
|
|
||||||
for filt in SystemFilters.get_filters():
|
#for filt in SystemFilters.get_filters():
|
||||||
self.store.append(row=[filt.get_name()])
|
#self.store.append(row=[filt.get_name()])
|
||||||
self.map[unicode(filt.get_name())] = filt
|
#self.map[unicode(filt.get_name())] = filt
|
||||||
if default != "" and default == filt.get_name():
|
#if default != "" and default == filt.get_name():
|
||||||
active = cnt
|
#active = cnt
|
||||||
cnt += 1
|
#cnt += 1
|
||||||
|
|
||||||
for filt in CustomFilters.get_filters():
|
for filt in CustomFilters.get_filters():
|
||||||
self.store.append(row=[filt.get_name()])
|
self.store.append(row=[filt.get_name()])
|
||||||
@ -82,10 +82,10 @@ class FilterComboBox(gtk.ComboBox):
|
|||||||
self.set_active(active)
|
self.set_active(active)
|
||||||
elif len(local_filters):
|
elif len(local_filters):
|
||||||
self.set_active(2)
|
self.set_active(2)
|
||||||
elif len(SystemFilters.get_filters()):
|
#elif len(SystemFilters.get_filters()):
|
||||||
self.set_active(4 + len(local_filters))
|
#self.set_active(4 + len(local_filters))
|
||||||
elif len(CustomFilters.get_filters()):
|
elif len(CustomFilters.get_filters()):
|
||||||
self.set_active(6 + len(local_filters) + len(SystemFilters.get_filters()))
|
self.set_active(4 + len(local_filters))
|
||||||
else:
|
else:
|
||||||
self.set_active(0)
|
self.set_active(0)
|
||||||
|
|
||||||
|
@ -34,13 +34,12 @@ import gobject
|
|||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
def build_filter_model(space, local = []):
|
def build_filter_model(space, local = []):
|
||||||
from Filters import SystemFilters, CustomFilters
|
from Filters import CustomFilters
|
||||||
|
|
||||||
model = gtk.ListStore(gobject.TYPE_STRING, object)
|
model = gtk.ListStore(gobject.TYPE_STRING, object)
|
||||||
|
|
||||||
if isinstance(space, basestring):
|
if isinstance(space, basestring):
|
||||||
flist = local + SystemFilters.get_filters(space) + \
|
flist = local + CustomFilters.get_filters(space)
|
||||||
CustomFilters.get_filters(space)
|
|
||||||
elif isinstance(space, (list, tuple)):
|
elif isinstance(space, (list, tuple)):
|
||||||
flist = space
|
flist = space
|
||||||
else:
|
else:
|
||||||
|
@ -37,7 +37,7 @@ from gettext import gettext as _
|
|||||||
# GRAMPS modules
|
# GRAMPS modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from Filters import SystemFilters, CustomFilters
|
from Filters import CustomFilters
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -60,8 +60,7 @@ class FilterStore(gtk.ListStore):
|
|||||||
self.def_index = cnt
|
self.def_index = cnt
|
||||||
cnt += 1
|
cnt += 1
|
||||||
|
|
||||||
for filt in SystemFilters.get_filters(namespace) + \
|
for filt in CustomFilters.get_filters(namespace):
|
||||||
CustomFilters.get_filters(namespace):
|
|
||||||
name = _(filt.get_name())
|
name = _(filt.get_name())
|
||||||
self.append(row=[name])
|
self.append(row=[name])
|
||||||
self.list_map.append(filt)
|
self.list_map.append(filt)
|
||||||
|
@ -24,26 +24,26 @@
|
|||||||
Package providing filtering framework for GRAMPS.
|
Package providing filtering framework for GRAMPS.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
SystemFilters = None
|
#SystemFilters = None
|
||||||
CustomFilters = None
|
CustomFilters = None
|
||||||
|
|
||||||
from const import SYSTEM_FILTERS, CUSTOM_FILTERS
|
from const import CUSTOM_FILTERS
|
||||||
from _FilterList import FilterList
|
from _FilterList import FilterList
|
||||||
from _GenericFilter import GenericFilter, GenericFilterFactory
|
from _GenericFilter import GenericFilter, GenericFilterFactory
|
||||||
from _ParamFilter import ParamFilter
|
from _ParamFilter import ParamFilter
|
||||||
|
|
||||||
def reload_system_filters():
|
#def reload_system_filters():
|
||||||
global SystemFilters
|
#global SystemFilters
|
||||||
SystemFilters = FilterList(SYSTEM_FILTERS)
|
#SystemFilters = FilterList(SYSTEM_FILTERS)
|
||||||
SystemFilters.load()
|
#SystemFilters.load()
|
||||||
|
|
||||||
def reload_custom_filters():
|
def reload_custom_filters():
|
||||||
global CustomFilters
|
global CustomFilters
|
||||||
CustomFilters = FilterList(CUSTOM_FILTERS)
|
CustomFilters = FilterList(CUSTOM_FILTERS)
|
||||||
CustomFilters.load()
|
CustomFilters.load()
|
||||||
|
|
||||||
if not SystemFilters:
|
#if not SystemFilters:
|
||||||
reload_system_filters()
|
#reload_system_filters()
|
||||||
|
|
||||||
if not CustomFilters:
|
if not CustomFilters:
|
||||||
reload_custom_filters()
|
reload_custom_filters()
|
||||||
|
@ -136,7 +136,7 @@ RULE_GLADE = os.path.join(GLADE_DIR, "rule.glade")
|
|||||||
|
|
||||||
PLUGINS_DIR = os.path.join(ROOT_DIR, "plugins")
|
PLUGINS_DIR = os.path.join(ROOT_DIR, "plugins")
|
||||||
DATA_DIR = os.path.join(ROOT_DIR, "data")
|
DATA_DIR = os.path.join(ROOT_DIR, "data")
|
||||||
SYSTEM_FILTERS = os.path.join(DATA_DIR, "system_filters.xml")
|
#SYSTEM_FILTERS = os.path.join(DATA_DIR, "system_filters.xml")
|
||||||
TIP_DATA = os.path.join(DATA_DIR, "tips.xml")
|
TIP_DATA = os.path.join(DATA_DIR, "tips.xml")
|
||||||
|
|
||||||
PAPERSIZE = os.path.join(DATA_DIR, "papersize.xml")
|
PAPERSIZE = os.path.join(DATA_DIR, "papersize.xml")
|
||||||
|
@ -9,7 +9,6 @@ dist_pkgdata_DATA = \
|
|||||||
authors.xml \
|
authors.xml \
|
||||||
gedcom.xml \
|
gedcom.xml \
|
||||||
papersize.xml \
|
papersize.xml \
|
||||||
system_filters.xml \
|
|
||||||
tips.xml\
|
tips.xml\
|
||||||
lds.xml\
|
lds.xml\
|
||||||
behaviour.css\
|
behaviour.css\
|
||||||
|
Loading…
x
Reference in New Issue
Block a user