Remove tagging code introduced in error

svn: r22973
This commit is contained in:
Nick Hall 2013-08-31 10:15:36 +00:00
parent 314bbe6ca0
commit ad40ffe102
5 changed files with 11 additions and 157 deletions

View File

@ -47,7 +47,7 @@ from .. import build_filter_model
from . import SidebarFilter
from gramps.gen.constfunc import cuni
from gramps.gen.filters import GenericFilterFactory, rules
from gramps.gen.filters.rules.citation import (RegExpIdOf, HasCitation, HasTag,
from gramps.gen.filters.rules.citation import (RegExpIdOf, HasCitation,
HasNoteRegexp, MatchesFilter)
from gramps.gen.utils.string import confidence
GenericCitationFilter = GenericFilterFactory('Citation')
@ -75,7 +75,6 @@ class CitationSidebarFilter(SidebarFilter):
self.filter_regex = Gtk.CheckButton(_('Use regular expressions'))
self.tag = Gtk.ComboBox()
self.generic = Gtk.ComboBox()
SidebarFilter.__init__(self, dbstate, uistate, "Citation")
@ -94,18 +93,11 @@ class CitationSidebarFilter(SidebarFilter):
self.filter_conf.pack_start(cell, True)
self.filter_conf.add_attribute(cell, 'text', 0)
cell = Gtk.CellRendererText()
cell.set_property('width', self._FILTER_WIDTH)
cell.set_property('ellipsize', self._FILTER_ELLIPSIZE)
self.tag.pack_start(cell, True)
self.tag.add_attribute(cell, 'text', 0)
self.add_text_entry(_('ID'), self.filter_id)
self.add_text_entry(_('Volume/Page'), self.filter_page)
self.add_text_entry(_('Date'), self.filter_date)
self.add_entry(_('Minimum Confidence|Min. Conf.'), self.filter_conf)
self.add_text_entry(_('Note'), self.filter_note)
self.add_entry(_('Tag'), self.tag)
self.add_filter_entry(_('Custom filter'), self.generic)
self.add_entry(None, self.filter_regex)
@ -115,7 +107,6 @@ class CitationSidebarFilter(SidebarFilter):
self.filter_date.set_text('')
self.filter_conf.set_active(2)
self.filter_note.set_text('')
self.tag.set_active(0)
self.generic.set_active(0)
def get_filter(self):
@ -133,10 +124,9 @@ class CitationSidebarFilter(SidebarFilter):
# conf = self.citn.get_confidence_level()
note = cuni(self.filter_note.get_text()).strip()
regex = self.filter_regex.get_active()
tag = self.tag.get_active() > 0
gen = self.generic.get_active() > 0
empty = not (gid or page or date or conf or note or regex or tag or gen)
empty = not (gid or page or date or conf or note or regex or gen)
if empty:
generic_filter = None
else:
@ -152,14 +142,6 @@ class CitationSidebarFilter(SidebarFilter):
rule = HasNoteRegexp([note], use_regex=regex)
generic_filter.add_rule(rule)
# check the Tag
if tag:
model = self.tag.get_model()
node = self.tag.get_active_iter()
attr = model.get_value(node, 0)
rule = HasTag([attr])
generic_filter.add_rule(rule)
if self.generic.get_active() != 0:
model = self.generic.get_model()
node = self.generic.get_active_iter()
@ -176,14 +158,3 @@ class CitationSidebarFilter(SidebarFilter):
all_filter.add_rule(rules.citation.AllCitations([]))
self.generic.set_model(build_filter_model('Citation', [all_filter]))
self.generic.set_active(0)
def on_tags_changed(self, tag_list):
"""
Update the list of tags in the tag filter.
"""
model = Gtk.ListStore(str)
model.append(('',))
for tag_name in tag_list:
model.append((tag_name,))
self.tag.set_model(model)
self.tag.set_active(0)

View File

@ -47,7 +47,7 @@ from . import SidebarFilter
from gramps.gen.constfunc import cuni
from gramps.gen.filters import GenericFilterFactory, rules
from gramps.gen.filters.rules.event import (RegExpIdOf, HasNoteRegexp,
MatchesFilter, HasEvent, HasTag)
MatchesFilter, HasEvent)
GenericEventFilter = GenericFilterFactory('Event')
#-------------------------------------------------------------------------
@ -77,7 +77,6 @@ class EventSidebarFilter(SidebarFilter):
self.filter_regex = Gtk.CheckButton(_('Use regular expressions'))
self.tag = Gtk.ComboBox()
self.generic = Gtk.ComboBox()
SidebarFilter.__init__(self, dbstate, uistate, "Event")
@ -90,12 +89,6 @@ class EventSidebarFilter(SidebarFilter):
self.generic.add_attribute(cell, 'text', 0)
self.on_filters_changed('Event')
cell = Gtk.CellRendererText()
cell.set_property('width', self._FILTER_WIDTH)
cell.set_property('ellipsize', self._FILTER_ELLIPSIZE)
self.tag.pack_start(cell, True)
self.tag.add_attribute(cell, 'text', 0)
self.etype.get_child().set_width_chars(5)
self.add_text_entry(_('ID'), self.filter_id)
@ -105,7 +98,6 @@ class EventSidebarFilter(SidebarFilter):
self.add_text_entry(_('Date'), self.filter_date)
self.add_text_entry(_('Place'), self.filter_place)
self.add_text_entry(_('Note'), self.filter_note)
self.add_entry(_('Tag'), self.tag)
self.add_filter_entry(_('Custom filter'), self.generic)
self.add_regex_entry(self.filter_regex)
@ -117,7 +109,6 @@ class EventSidebarFilter(SidebarFilter):
self.filter_place.set_text('')
self.filter_note.set_text('')
self.etype.get_child().set_text('')
self.tag.set_active(0)
self.generic.set_active(0)
def get_filter(self):
@ -128,12 +119,11 @@ class EventSidebarFilter(SidebarFilter):
place = cuni(self.filter_place.get_text()).strip()
note = cuni(self.filter_note.get_text()).strip()
regex = self.filter_regex.get_active()
tag = self.tag.get_active() > 0
generic = self.generic.get_active() > 0
etype = self.filter_event.get_type().xml_str()
empty = not (gid or desc or mainparts or date or place or note
or etype or regex or tag or generic)
or etype or regex or generic)
if empty:
generic_filter = None
else:
@ -150,14 +140,6 @@ class EventSidebarFilter(SidebarFilter):
rule = HasNoteRegexp([note], use_regex=regex)
generic_filter.add_rule(rule)
# check the Tag
if tag:
model = self.tag.get_model()
node = self.tag.get_active_iter()
attr = model.get_value(node, 0)
rule = HasTag([attr])
generic_filter.add_rule(rule)
if self.generic.get_active() != 0:
model = self.generic.get_model()
node = self.generic.get_active_iter()
@ -174,14 +156,3 @@ class EventSidebarFilter(SidebarFilter):
all_filter.add_rule(rules.event.AllEvents([]))
self.generic.set_model(build_filter_model('Event', [all_filter]))
self.generic.set_active(0)
def on_tags_changed(self, tag_list):
"""
Update the list of tags in the tag filter.
"""
model = Gtk.ListStore(str)
model.append(('',))
for tag_name in tag_list:
model.append((tag_name,))
self.tag.set_model(model)
self.tag.set_active(0)

View File

@ -47,7 +47,7 @@ from .. import build_filter_model
from . import SidebarFilter
from gramps.gen.constfunc import cuni
from gramps.gen.filters import GenericFilterFactory, rules
from gramps.gen.filters.rules.place import (RegExpIdOf, HasPlace, HasTag,
from gramps.gen.filters.rules.place import (RegExpIdOf, HasPlace,
HasNoteRegexp, MatchesFilter)
GenericPlaceFilter = GenericFilterFactory('Place')
@ -74,7 +74,6 @@ class PlaceSidebarFilter(SidebarFilter):
self.filter_note = widgets.BasicEntry()
self.filter_regex = Gtk.CheckButton(_('Use regular expressions'))
self.tag = Gtk.ComboBox()
self.generic = Gtk.ComboBox()
SidebarFilter.__init__(self, dbstate, uistate, "Place")
@ -87,12 +86,6 @@ class PlaceSidebarFilter(SidebarFilter):
self.generic.add_attribute(cell, 'text', 0)
self.on_filters_changed('Place')
cell = Gtk.CellRendererText()
cell.set_property('width', self._FILTER_WIDTH)
cell.set_property('ellipsize', self._FILTER_ELLIPSIZE)
self.tag.pack_start(cell, True)
self.tag.add_attribute(cell, 'text', 0)
self.add_text_entry(_('ID'), self.filter_id)
self.add_text_entry(_('Place Name'), self.filter_title)
self.add_text_entry(_('Street'), self.filter_street)
@ -104,7 +97,6 @@ class PlaceSidebarFilter(SidebarFilter):
self.add_text_entry(_('ZIP/Postal code'), self.filter_zip)
self.add_text_entry(_('Church parish'), self.filter_parish)
self.add_text_entry(_('Note'), self.filter_note)
self.add_entry(_('Tag'), self.tag)
self.add_filter_entry(_('Custom filter'), self.generic)
self.add_regex_entry(self.filter_regex)
@ -120,7 +112,6 @@ class PlaceSidebarFilter(SidebarFilter):
self.filter_zip.set_text('')
self.filter_parish.set_text('')
self.filter_note.set_text('')
self.tag.set_active(0)
self.generic.set_active(0)
def get_filter(self):
@ -136,12 +127,10 @@ class PlaceSidebarFilter(SidebarFilter):
parish = cuni(self.filter_parish.get_text()).strip()
note = cuni(self.filter_note.get_text()).strip()
regex = self.filter_regex.get_active()
tag = self.tag.get_active() > 0
gen = self.generic.get_active() > 0
empty = not (gid or title or street or locality or city or county or
state or country or zipc or parish or note or regex or tag
or gen)
state or country or zipc or parish or note or regex or gen)
if empty:
generic_filter = None
else:
@ -158,14 +147,6 @@ class PlaceSidebarFilter(SidebarFilter):
rule = HasNoteRegexp([note], use_regex=regex)
generic_filter.add_rule(rule)
# check the Tag
if tag:
model = self.tag.get_model()
node = self.tag.get_active_iter()
attr = model.get_value(node, 0)
rule = HasTag([attr])
generic_filter.add_rule(rule)
if self.generic.get_active() != 0:
model = self.generic.get_model()
node = self.generic.get_active_iter()
@ -182,14 +163,3 @@ class PlaceSidebarFilter(SidebarFilter):
all_filter.add_rule(rules.place.AllPlaces([]))
self.generic.set_model(build_filter_model('Place', [all_filter]))
self.generic.set_active(0)
def on_tags_changed(self, tag_list):
"""
Update the list of tags in the tag filter.
"""
model = Gtk.ListStore(str)
model.append(('',))
for tag_name in tag_list:
model.append((tag_name,))
self.tag.set_model(model)
self.tag.set_active(0)

View File

@ -46,7 +46,7 @@ from .. import build_filter_model
from . import SidebarFilter
from gramps.gen.constfunc import cuni
from gramps.gen.filters import GenericFilterFactory, rules
from gramps.gen.filters.rules.repository import (RegExpIdOf, HasRepo, HasTag,
from gramps.gen.filters.rules.repository import (RegExpIdOf, HasRepo,
HasNoteRegexp, MatchesFilter)
GenericRepoFilter = GenericFilterFactory('Repository')
@ -76,7 +76,6 @@ class RepoSidebarFilter(SidebarFilter):
self.filter_regex = Gtk.CheckButton(_('Use regular expressions'))
self.tag = Gtk.ComboBox()
self.generic = Gtk.ComboBox()
SidebarFilter.__init__(self, dbstate, uistate, "Repository")
@ -89,12 +88,6 @@ class RepoSidebarFilter(SidebarFilter):
self.generic.add_attribute(cell, 'text', 0)
self.on_filters_changed('Repository')
cell = Gtk.CellRendererText()
cell.set_property('width', self._FILTER_WIDTH)
cell.set_property('ellipsize', self._FILTER_ELLIPSIZE)
self.tag.pack_start(cell, True)
self.tag.add_attribute(cell, 'text', 0)
self.rtype.get_child().set_width_chars(5)
self.add_text_entry(_('ID'), self.filter_id)
@ -103,7 +96,6 @@ class RepoSidebarFilter(SidebarFilter):
self.add_text_entry(_('Address'), self.filter_address)
self.add_text_entry(_('URL'), self.filter_url)
self.add_text_entry(_('Note'), self.filter_note)
self.add_entry(_('Tag'), self.tag)
self.add_filter_entry(_('Custom filter'), self.generic)
self.add_regex_entry(self.filter_regex)
@ -114,7 +106,6 @@ class RepoSidebarFilter(SidebarFilter):
self.filter_url.set_text('')
self.rtype.get_child().set_text('')
self.filter_note.set_text('')
self.tag.set_active(0)
self.generic.set_active(0)
def get_filter(self):
@ -125,11 +116,10 @@ class RepoSidebarFilter(SidebarFilter):
rtype = self.repo.get_type().xml_str()
note = cuni(self.filter_note.get_text()).strip()
regex = self.filter_regex.get_active()
tag = self.tag.get_active() > 0
gen = self.generic.get_active() > 0
empty = not (gid or title or address or url or rtype
or note or regex or tag or gen)
empty = not (gid or title or address or url or rtype or note or regex
or gen)
if empty:
generic_filter = None
else:
@ -145,14 +135,6 @@ class RepoSidebarFilter(SidebarFilter):
rule = HasNoteRegexp([note], use_regex=regex)
generic_filter.add_rule(rule)
# check the Tag
if tag:
model = self.tag.get_model()
node = self.tag.get_active_iter()
attr = model.get_value(node, 0)
rule = HasTag([attr])
generic_filter.add_rule(rule)
if self.generic.get_active() != 0:
model = self.generic.get_model()
node = self.generic.get_active_iter()
@ -170,14 +152,3 @@ class RepoSidebarFilter(SidebarFilter):
self.generic.set_model(build_filter_model('Repository',
[all_filter]))
self.generic.set_active(0)
def on_tags_changed(self, tag_list):
"""
Update the list of tags in the tag filter.
"""
model = Gtk.ListStore(str)
model.append(('',))
for tag_name in tag_list:
model.append((tag_name,))
self.tag.set_model(model)
self.tag.set_active(0)

View File

@ -45,7 +45,7 @@ from .. import build_filter_model
from . import SidebarFilter
from gramps.gen.constfunc import cuni
from gramps.gen.filters import GenericFilterFactory, rules
from gramps.gen.filters.rules.source import (RegExpIdOf, HasSource, HasTag,
from gramps.gen.filters.rules.source import (RegExpIdOf, HasSource,
HasNoteRegexp, MatchesFilter)
GenericSourceFilter = GenericFilterFactory('Source')
@ -67,7 +67,6 @@ class SourceSidebarFilter(SidebarFilter):
self.filter_regex = Gtk.CheckButton(_('Use regular expressions'))
self.tag = Gtk.ComboBox()
self.generic = Gtk.ComboBox()
SidebarFilter.__init__(self, dbstate, uistate, "Source")
@ -80,19 +79,12 @@ class SourceSidebarFilter(SidebarFilter):
self.generic.add_attribute(cell, 'text', 0)
self.on_filters_changed('Source')
cell = Gtk.CellRendererText()
cell.set_property('width', self._FILTER_WIDTH)
cell.set_property('ellipsize', self._FILTER_ELLIPSIZE)
self.tag.pack_start(cell, True)
self.tag.add_attribute(cell, 'text', 0)
self.add_text_entry(_('ID'), self.filter_id)
self.add_text_entry(_('Title'), self.filter_title)
self.add_text_entry(_('Author'), self.filter_author)
self.add_text_entry(_('Abbreviation'), self.filter_abbr)
self.add_text_entry(_('Publication'), self.filter_pub)
self.add_text_entry(_('Note'), self.filter_note)
self.add_entry(_('Tag'), self.tag)
self.add_filter_entry(_('Custom filter'), self.generic)
self.add_regex_entry(self.filter_regex)
@ -103,7 +95,6 @@ class SourceSidebarFilter(SidebarFilter):
self.filter_abbr.set_text('')
self.filter_pub.set_text('')
self.filter_note.set_text('')
self.tag.set_active(0)
self.generic.set_active(0)
def get_filter(self):
@ -114,11 +105,10 @@ class SourceSidebarFilter(SidebarFilter):
pub = cuni(self.filter_pub.get_text()).strip()
note = cuni(self.filter_note.get_text()).strip()
regex = self.filter_regex.get_active()
tag = self.tag.get_active() > 0
gen = self.generic.get_active() > 0
empty = not (gid or title or author or abbr or pub or note or regex
or tag or gen)
or gen)
if empty:
generic_filter = None
else:
@ -134,14 +124,6 @@ class SourceSidebarFilter(SidebarFilter):
rule = HasNoteRegexp([note], use_regex=regex)
generic_filter.add_rule(rule)
# check the Tag
if tag:
model = self.tag.get_model()
node = self.tag.get_active_iter()
attr = model.get_value(node, 0)
rule = HasTag([attr])
generic_filter.add_rule(rule)
if self.generic.get_active() != 0:
model = self.generic.get_model()
node = self.generic.get_active_iter()
@ -158,14 +140,3 @@ class SourceSidebarFilter(SidebarFilter):
all_filter.add_rule(rules.source.AllSources([]))
self.generic.set_model(build_filter_model('Source', [all_filter]))
self.generic.set_active(0)
def on_tags_changed(self, tag_list):
"""
Update the list of tags in the tag filter.
"""
model = Gtk.ListStore(str)
model.append(('',))
for tag_name in tag_list:
model.append((tag_name,))
self.tag.set_model(model)
self.tag.set_active(0)