diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index aaded5b49..e465eaedf 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,20 @@ 2006-08-22 Alex Roitman + * src/Filters/Rules/MediaObject: Added to replace Media. + * src/Filters/Rules/Media: Removed. + * src/DataViews/_MediaView.py (filter_editor): Change Media to + MediaObject. + * src/Filters/_GenericFilter.py: Change Media to MediaObject. + * src/DataViews/_PersonView.py (build_widget): Pass uistate + to filter class. + * src/PageView.py (ListView.build_filter_container): Pass uistate + to filter class. + * src/DisplayState.py (DisplayState.__signals__): Register + 'filters-changed' signal. + * src/FilterEditor/_ShowResults.py: Change Media to MediaObject. + * src/FilterEditor/_EditRule.py: Change Media to MediaObject. + * src/FilterEditor/_FilterEditor.py (close): Emit 'filters-changed'. + * src/Filters/SideBar/*py: Take uistate and connect to the + 'filters-changed' signal. * src/glade/gramps.glade: Make MediaRef editor's General label bold. 2006-08-21 Alex Roitman diff --git a/gramps2/src/DataViews/_MediaView.py b/gramps2/src/DataViews/_MediaView.py index 7bfc36434..4e3b18da0 100644 --- a/gramps2/src/DataViews/_MediaView.py +++ b/gramps2/src/DataViews/_MediaView.py @@ -195,7 +195,7 @@ class MediaView(PageView.ListView): from FilterEditor import FilterEditor try: - FilterEditor('Media',const.custom_filters, + FilterEditor('MediaObject',const.custom_filters, self.dbstate,self.uistate) except Errors.WindowActiveError: pass diff --git a/gramps2/src/DataViews/_PersonView.py b/gramps2/src/DataViews/_PersonView.py index 21fc47324..f21660ebf 100644 --- a/gramps2/src/DataViews/_PersonView.py +++ b/gramps2/src/DataViews/_PersonView.py @@ -267,7 +267,8 @@ class PersonView(PageView.PersonNavView): self.selection.set_mode(gtk.SELECTION_MULTIPLE) self.selection.connect('changed',self.row_changed) - self.filter_sidebar = PersonSidebarFilter(self.filter_clicked) + self.filter_sidebar = PersonSidebarFilter(self.uistate, + self.filter_clicked) self.filter_pane = self.filter_sidebar.get_widget() hpaned.pack_start(self.vbox, True, True) diff --git a/gramps2/src/DisplayState.py b/gramps2/src/DisplayState.py index 6eb9c4267..7debb4e28 100644 --- a/gramps2/src/DisplayState.py +++ b/gramps2/src/DisplayState.py @@ -248,6 +248,7 @@ class WarnHandler(RotateHandler): class DisplayState(GrampsDb.GrampsDBCallback): __signals__ = { + 'filters-changed' : (str,), } def __init__(self, window, status, progress, warnbtn, uimanager): diff --git a/gramps2/src/FilterEditor/_EditRule.py b/gramps2/src/FilterEditor/_EditRule.py index c0e322fc0..69fa1ca05 100644 --- a/gramps2/src/FilterEditor/_EditRule.py +++ b/gramps2/src/FilterEditor/_EditRule.py @@ -226,7 +226,7 @@ class MyID(gtk.HBox): 'Event' : _('Event'), 'Place' : _('Place'), 'Source' : _('Source'), - 'Media' : _('Media Object'), + 'MediaObject' : _('Media Object'), 'Repository' : _('Repository'), } @@ -254,10 +254,7 @@ class MyID(gtk.HBox): self.set_text('') def button_press(self,obj): - if self.namespace == 'Media': - obj_class = 'MediaObject' - else: - obj_class = self.namespace + obj_class = self.namespace selector = selector_factory(obj_class) inst = selector(self.dbstate, self.uistate, self.track) val = inst.run() @@ -285,7 +282,7 @@ class MyID(gtk.HBox): elif self.namespace == 'Source': source = self.db.get_source_from_gramps_id(gramps_id) name = source.get_title() - elif self.namespace == 'Media': + elif self.namespace == 'MediaObject': obj = self.db.get_object_from_gramps_id(gramps_id) name = obj.get_path() elif self.namespace == 'Repository': @@ -383,8 +380,8 @@ class EditRule(ManagedWindow.ManagedWindow): class_list = Rules.Source.editor_rule_list elif self.space == 'Place': class_list = Rules.Place.editor_rule_list - elif self.space == 'Media': - class_list = Rules.Media.editor_rule_list + elif self.space == 'MediaObject': + class_list = Rules.MediaObject.editor_rule_list elif self.space == 'Repository': class_list = Rules.Repository.editor_rule_list diff --git a/gramps2/src/FilterEditor/_FilterEditor.py b/gramps2/src/FilterEditor/_FilterEditor.py index de3a413b7..9a4d92659 100644 --- a/gramps2/src/FilterEditor/_FilterEditor.py +++ b/gramps2/src/FilterEditor/_FilterEditor.py @@ -127,6 +127,7 @@ class FilterEditor(ManagedWindow.ManagedWindow): self.filterdb.save() reload_custom_filters() reload_system_filters() + self.uistate.emit('filters-changed',(self.space,)) ManagedWindow.ManagedWindow.close(self,obj) def draw_filters(self): @@ -178,7 +179,7 @@ class FilterEditor(ManagedWindow.ManagedWindow): return self.db.get_source_handles() elif self.space == 'Place': return self.db.get_place_handles() - elif self.space == 'Media': + elif self.space == 'MediaObject': return self.db.get_media_object_handles() elif self.space == 'Repository': return self.db.get_repository_handles() diff --git a/gramps2/src/FilterEditor/_ShowResults.py b/gramps2/src/FilterEditor/_ShowResults.py index ef4ff68cc..52bad6010 100644 --- a/gramps2/src/FilterEditor/_ShowResults.py +++ b/gramps2/src/FilterEditor/_ShowResults.py @@ -123,7 +123,7 @@ class ShowResults(ManagedWindow.ManagedWindow): place = self.db.get_place_from_handle(handle) name = place.get_title() gid = place.get_gramps_id() - elif self.space == 'Media': + elif self.space == 'MediaObject': obj = self.db.get_object_from_handle(handle) name = obj.get_description() gid = obj.get_gramps_id() @@ -150,7 +150,7 @@ class ShowResults(ManagedWindow.ManagedWindow): elif self.space == 'Place': name = self.db.get_place_from_handle(handle).get_title() sortname = locale.strxfrm(name) - elif self.space == 'Media': + elif self.space == 'MediaObject': name = self.db.get_object_from_handle(handle).get_description() sortname = locale.strxfrm(name) elif self.space == 'Repository': diff --git a/gramps2/src/Filters/Rules/Media/Makefile.am b/gramps2/src/Filters/Rules/MediaObject/Makefile.am similarity index 100% rename from gramps2/src/Filters/Rules/Media/Makefile.am rename to gramps2/src/Filters/Rules/MediaObject/Makefile.am diff --git a/gramps2/src/Filters/Rules/Media/_AllMedia.py b/gramps2/src/Filters/Rules/MediaObject/_AllMedia.py similarity index 100% rename from gramps2/src/Filters/Rules/Media/_AllMedia.py rename to gramps2/src/Filters/Rules/MediaObject/_AllMedia.py diff --git a/gramps2/src/Filters/Rules/Media/_HasIdOf.py b/gramps2/src/Filters/Rules/MediaObject/_HasIdOf.py similarity index 100% rename from gramps2/src/Filters/Rules/Media/_HasIdOf.py rename to gramps2/src/Filters/Rules/MediaObject/_HasIdOf.py diff --git a/gramps2/src/Filters/Rules/Media/_HasMedia.py b/gramps2/src/Filters/Rules/MediaObject/_HasMedia.py similarity index 100% rename from gramps2/src/Filters/Rules/Media/_HasMedia.py rename to gramps2/src/Filters/Rules/MediaObject/_HasMedia.py diff --git a/gramps2/src/Filters/Rules/Media/_HasNoteMatchingSubstringOf.py b/gramps2/src/Filters/Rules/MediaObject/_HasNoteMatchingSubstringOf.py similarity index 100% rename from gramps2/src/Filters/Rules/Media/_HasNoteMatchingSubstringOf.py rename to gramps2/src/Filters/Rules/MediaObject/_HasNoteMatchingSubstringOf.py diff --git a/gramps2/src/Filters/Rules/Media/_HasNoteRegexp.py b/gramps2/src/Filters/Rules/MediaObject/_HasNoteRegexp.py similarity index 100% rename from gramps2/src/Filters/Rules/Media/_HasNoteRegexp.py rename to gramps2/src/Filters/Rules/MediaObject/_HasNoteRegexp.py diff --git a/gramps2/src/Filters/Rules/Media/_MatchesFilter.py b/gramps2/src/Filters/Rules/MediaObject/_MatchesFilter.py similarity index 100% rename from gramps2/src/Filters/Rules/Media/_MatchesFilter.py rename to gramps2/src/Filters/Rules/MediaObject/_MatchesFilter.py diff --git a/gramps2/src/Filters/Rules/Media/_MediaPrivate.py b/gramps2/src/Filters/Rules/MediaObject/_MediaPrivate.py similarity index 100% rename from gramps2/src/Filters/Rules/Media/_MediaPrivate.py rename to gramps2/src/Filters/Rules/MediaObject/_MediaPrivate.py diff --git a/gramps2/src/Filters/Rules/Media/_RegExpIdOf.py b/gramps2/src/Filters/Rules/MediaObject/_RegExpIdOf.py similarity index 100% rename from gramps2/src/Filters/Rules/Media/_RegExpIdOf.py rename to gramps2/src/Filters/Rules/MediaObject/_RegExpIdOf.py diff --git a/gramps2/src/Filters/Rules/Media/__init__.py b/gramps2/src/Filters/Rules/MediaObject/__init__.py similarity index 100% rename from gramps2/src/Filters/Rules/Media/__init__.py rename to gramps2/src/Filters/Rules/MediaObject/__init__.py diff --git a/gramps2/src/Filters/Rules/__init__.py b/gramps2/src/Filters/Rules/__init__.py index b32b44c2a..0ad8d8c69 100644 --- a/gramps2/src/Filters/Rules/__init__.py +++ b/gramps2/src/Filters/Rules/__init__.py @@ -41,5 +41,5 @@ import Family import Event import Source import Place -import Media +import MediaObject import Repository diff --git a/gramps2/src/Filters/SideBar/_EventSidebarFilter.py b/gramps2/src/Filters/SideBar/_EventSidebarFilter.py index 5c5165e23..1d217f6a3 100644 --- a/gramps2/src/Filters/SideBar/_EventSidebarFilter.py +++ b/gramps2/src/Filters/SideBar/_EventSidebarFilter.py @@ -54,8 +54,8 @@ GenericEventFilter = GenericFilterFactory('Event') #------------------------------------------------------------------------- class EventSidebarFilter(SidebarFilter): - def __init__(self, clicked): - SidebarFilter.__init__(self) + def __init__(self,uistate, clicked): + SidebarFilter.__init__(self,uistate) self.clicked_func = clicked def create_widget(self): @@ -76,16 +76,11 @@ class EventSidebarFilter(SidebarFilter): self.filter_regex = gtk.CheckButton(_('Use regular expressions')) - all = GenericEventFilter() - all.set_name(_("None")) - all.add_rule(Rules.Event.AllEvents([])) - self.generic = gtk.ComboBox() cell = gtk.CellRendererText() self.generic.pack_start(cell, True) self.generic.add_attribute(cell, 'text', 0) - self.generic.set_model(build_filter_model('Event', [all])) - self.generic.set_active(0) + self.on_filters_changed('Event') self.add_text_entry(_('ID'), self.filter_id) self.add_text_entry(_('Description'), self.filter_desc) @@ -149,3 +144,11 @@ class EventSidebarFilter(SidebarFilter): generic_filter.add_rule(rule) return generic_filter + + def on_filters_changed(self,name_space): + if name_space == 'Event': + all = GenericEventFilter() + all.set_name(_("None")) + all.add_rule(Rules.Event.AllEvents([])) + self.generic.set_model(build_filter_model('Event', [all])) + self.generic.set_active(0) diff --git a/gramps2/src/Filters/SideBar/_FamilySidebarFilter.py b/gramps2/src/Filters/SideBar/_FamilySidebarFilter.py index bc4299dd7..2b8a3d80e 100644 --- a/gramps2/src/Filters/SideBar/_FamilySidebarFilter.py +++ b/gramps2/src/Filters/SideBar/_FamilySidebarFilter.py @@ -54,8 +54,8 @@ GenericFamilyFilter = GenericFilterFactory('Family') #------------------------------------------------------------------------- class FamilySidebarFilter(SidebarFilter): - def __init__(self, clicked): - SidebarFilter.__init__(self) + def __init__(self,uistate, clicked): + SidebarFilter.__init__(self,uistate) self.clicked_func = clicked def create_widget(self): @@ -86,16 +86,11 @@ class FamilySidebarFilter(SidebarFilter): self.filter_regex = gtk.CheckButton(_('Use regular expressions')) - all = GenericFamilyFilter() - all.set_name(_("None")) - all.add_rule(Rules.Family.AllFamilies([])) - self.generic = gtk.ComboBox() cell = gtk.CellRendererText() self.generic.pack_start(cell, True) self.generic.add_attribute(cell, 'text', 0) - self.generic.set_model(build_filter_model('Family', [all])) - self.generic.set_active(0) + self.on_filters_changed('Family') self.add_text_entry(_('ID'), self.filter_id) self.add_text_entry(_('Father'), self.filter_father) @@ -180,3 +175,10 @@ class FamilySidebarFilter(SidebarFilter): return generic_filter + def on_filters_changed(self,name_space): + if name_space == 'Family': + all = GenericFamilyFilter() + all.set_name(_("None")) + all.add_rule(Rules.Family.AllFamilies([])) + self.generic.set_model(build_filter_model('Family', [all])) + self.generic.set_active(0) diff --git a/gramps2/src/Filters/SideBar/_MediaSidebarFilter.py b/gramps2/src/Filters/SideBar/_MediaSidebarFilter.py index 616118ae3..0261718a0 100644 --- a/gramps2/src/Filters/SideBar/_MediaSidebarFilter.py +++ b/gramps2/src/Filters/SideBar/_MediaSidebarFilter.py @@ -44,9 +44,9 @@ import RelLib from _SidebarFilter import SidebarFilter from Filters import GenericFilterFactory, build_filter_model, Rules -from Filters.Rules.Media import * +from Filters.Rules.MediaObject import * -GenericMediaFilter = GenericFilterFactory('Media') +GenericMediaFilter = GenericFilterFactory('MediaObject') #------------------------------------------------------------------------- # # PersonSidebarFilter class @@ -54,8 +54,8 @@ GenericMediaFilter = GenericFilterFactory('Media') #------------------------------------------------------------------------- class MediaSidebarFilter(SidebarFilter): - def __init__(self, clicked): - SidebarFilter.__init__(self) + def __init__(self,uistate, clicked): + SidebarFilter.__init__(self,uistate) self.clicked_func = clicked def create_widget(self): @@ -69,16 +69,11 @@ class MediaSidebarFilter(SidebarFilter): self.filter_regex = gtk.CheckButton(_('Use regular expressions')) - all = GenericMediaFilter() - all.set_name(_("None")) - all.add_rule(Rules.Media.AllMedia([])) - self.generic = gtk.ComboBox() cell = gtk.CellRendererText() self.generic.pack_start(cell, True) self.generic.add_attribute(cell, 'text', 0) - self.generic.set_model(build_filter_model('MediaObject', [all])) - self.generic.set_active(0) + self.on_filters_changed('MediaObject') self.add_text_entry(_('ID'), self.filter_id) self.add_text_entry(_('Title'), self.filter_title) @@ -142,3 +137,12 @@ class MediaSidebarFilter(SidebarFilter): generic_filter.add_rule(rule) return generic_filter + + def on_filters_changed(self,name_space): + print name_space + if name_space == 'MediaObject': + all = GenericMediaFilter() + all.set_name(_("None")) + all.add_rule(Rules.MediaObject.AllMedia([])) + self.generic.set_model(build_filter_model('MediaObject', [all])) + self.generic.set_active(0) diff --git a/gramps2/src/Filters/SideBar/_PersonSidebarFilter.py b/gramps2/src/Filters/SideBar/_PersonSidebarFilter.py index b4feeac45..0b5025580 100644 --- a/gramps2/src/Filters/SideBar/_PersonSidebarFilter.py +++ b/gramps2/src/Filters/SideBar/_PersonSidebarFilter.py @@ -53,8 +53,8 @@ from Filters import GenericFilter, build_filter_model, Rules #------------------------------------------------------------------------- class PersonSidebarFilter(SidebarFilter): - def __init__(self, clicked): - SidebarFilter.__init__(self) + def __init__(self,uistate,clicked): + SidebarFilter.__init__(self,uistate) self.clicked_func = clicked def create_widget(self): @@ -79,16 +79,11 @@ class PersonSidebarFilter(SidebarFilter): self.filter_regex = gtk.CheckButton(_('Use regular expressions')) - all = GenericFilter() - all.set_name(_("None")) - all.add_rule(Rules.Person.Everyone([])) - self.generic = gtk.ComboBox() cell = gtk.CellRendererText() self.generic.pack_start(cell, True) self.generic.add_attribute(cell, 'text', 0) - self.generic.set_model(build_filter_model('Person', [all])) - self.generic.set_active(0) + self.on_filters_changed('Person') self.add_text_entry(_('Name'), self.filter_name) self.add_text_entry(_('ID'), self.filter_id) @@ -177,3 +172,10 @@ class PersonSidebarFilter(SidebarFilter): return generic_filter + def on_filters_changed(self,name_space): + if name_space == 'Person': + all = GenericFilter() + all.set_name(_("None")) + all.add_rule(Rules.Person.Everyone([])) + self.generic.set_model(build_filter_model('Person', [all])) + self.generic.set_active(0) diff --git a/gramps2/src/Filters/SideBar/_PlaceSidebarFilter.py b/gramps2/src/Filters/SideBar/_PlaceSidebarFilter.py index 91957aa51..9ef043cdd 100644 --- a/gramps2/src/Filters/SideBar/_PlaceSidebarFilter.py +++ b/gramps2/src/Filters/SideBar/_PlaceSidebarFilter.py @@ -54,8 +54,8 @@ GenericPlaceFilter = GenericFilterFactory('Place') #------------------------------------------------------------------------- class PlaceSidebarFilter(SidebarFilter): - def __init__(self, clicked): - SidebarFilter.__init__(self) + def __init__(self,uistate, clicked): + SidebarFilter.__init__(self,uistate) self.clicked_func = clicked def create_widget(self): @@ -72,16 +72,11 @@ class PlaceSidebarFilter(SidebarFilter): self.filter_regex = gtk.CheckButton(_('Use regular expressions')) - all = GenericPlaceFilter() - all.set_name(_("None")) - all.add_rule(Rules.Place.AllPlaces([])) - self.generic = gtk.ComboBox() cell = gtk.CellRendererText() self.generic.pack_start(cell, True) self.generic.add_attribute(cell, 'text', 0) - self.generic.set_model(build_filter_model('Place', [all])) - self.generic.set_active(0) + self.on_filters_changed('Place') self.add_text_entry(_('ID'), self.filter_id) self.add_text_entry(_('Name'), self.filter_title) @@ -154,3 +149,11 @@ class PlaceSidebarFilter(SidebarFilter): generic_filter.add_rule(rule) return generic_filter + + def on_filters_changed(self,name_space): + if name_space == 'Place': + all = GenericPlaceFilter() + all.set_name(_("None")) + all.add_rule(Rules.Place.AllPlaces([])) + self.generic.set_model(build_filter_model('Place', [all])) + self.generic.set_active(0) diff --git a/gramps2/src/Filters/SideBar/_RepoSidebarFilter.py b/gramps2/src/Filters/SideBar/_RepoSidebarFilter.py index aa2126db5..c7667d4ae 100644 --- a/gramps2/src/Filters/SideBar/_RepoSidebarFilter.py +++ b/gramps2/src/Filters/SideBar/_RepoSidebarFilter.py @@ -54,8 +54,8 @@ GenericRepoFilter = GenericFilterFactory('Repository') #------------------------------------------------------------------------- class RepoSidebarFilter(SidebarFilter): - def __init__(self, clicked): - SidebarFilter.__init__(self) + def __init__(self,uistate, clicked): + SidebarFilter.__init__(self,uistate) self.clicked_func = clicked def create_widget(self): @@ -76,16 +76,11 @@ class RepoSidebarFilter(SidebarFilter): self.filter_regex = gtk.CheckButton(_('Use regular expressions')) - all = GenericRepoFilter() - all.set_name(_("None")) - all.add_rule(Rules.Repository.AllRepos([])) - self.generic = gtk.ComboBox() cell = gtk.CellRendererText() self.generic.pack_start(cell, True) self.generic.add_attribute(cell, 'text', 0) - self.generic.set_model(build_filter_model('Repository', [all])) - self.generic.set_active(0) + self.on_filters_changed('Repository') self.add_text_entry(_('ID'), self.filter_id) self.add_text_entry(_('Name'), self.filter_title) @@ -149,3 +144,11 @@ class RepoSidebarFilter(SidebarFilter): generic_filter.add_rule(rule) return generic_filter + + def on_filters_changed(self,name_space): + if name_space == 'Repository': + all = GenericRepoFilter() + all.set_name(_("None")) + all.add_rule(Rules.Repository.AllRepos([])) + self.generic.set_model(build_filter_model('Repository', [all])) + self.generic.set_active(0) diff --git a/gramps2/src/Filters/SideBar/_SidebarFilter.py b/gramps2/src/Filters/SideBar/_SidebarFilter.py index d6e63d345..2acc5e396 100644 --- a/gramps2/src/Filters/SideBar/_SidebarFilter.py +++ b/gramps2/src/Filters/SideBar/_SidebarFilter.py @@ -28,7 +28,7 @@ _RETURN = gtk.gdk.keyval_from_name("Return") class SidebarFilter: - def __init__(self): + def __init__(self,uistate): self.position = 1 self.table = gtk.Table(3,11) self.table.set_border_width(6) @@ -36,6 +36,7 @@ class SidebarFilter: self.table.set_col_spacing(0,6) self.table.set_col_spacing(1,6) self._init_interface() + uistate.connect('filters-changed',self.on_filters_changed) def _init_interface(self): self.table.attach(GrampsWidgets.MarkupLabel(_('Filter')), @@ -101,3 +102,7 @@ class SidebarFilter: self.table.attach(widget, 2, 3, self.position, self.position+1, xoptions=gtk.FILL, yoptions=0) self.position += 1 + + def on_filters_changed(self,namespace): + pass + diff --git a/gramps2/src/Filters/SideBar/_SourceSidebarFilter.py b/gramps2/src/Filters/SideBar/_SourceSidebarFilter.py index 974314469..d1724c8b8 100644 --- a/gramps2/src/Filters/SideBar/_SourceSidebarFilter.py +++ b/gramps2/src/Filters/SideBar/_SourceSidebarFilter.py @@ -54,8 +54,8 @@ GenericSourceFilter = GenericFilterFactory('Source') #------------------------------------------------------------------------- class SourceSidebarFilter(SidebarFilter): - def __init__(self, clicked): - SidebarFilter.__init__(self) + def __init__(self,uistate, clicked): + SidebarFilter.__init__(self,uistate) self.clicked_func = clicked def create_widget(self): @@ -67,16 +67,11 @@ class SourceSidebarFilter(SidebarFilter): self.filter_regex = gtk.CheckButton(_('Use regular expressions')) - all = GenericSourceFilter() - all.set_name(_("None")) - all.add_rule(Rules.Source.AllSources([])) - self.generic = gtk.ComboBox() cell = gtk.CellRendererText() self.generic.pack_start(cell, True) self.generic.add_attribute(cell, 'text', 0) - self.generic.set_model(build_filter_model('Source', [all])) - self.generic.set_active(0) + self.on_filters_changed('Source') self.add_text_entry(_('ID'), self.filter_id) self.add_text_entry(_('Title'), self.filter_title) @@ -136,3 +131,11 @@ class SourceSidebarFilter(SidebarFilter): generic_filter.add_rule(rule) return generic_filter + + def on_filters_changed(self,name_space): + if name_space == 'Source': + all = GenericSourceFilter() + all.set_name(_("None")) + all.add_rule(Rules.Source.AllSources([])) + self.generic.set_model(build_filter_model('Source', [all])) + self.generic.set_active(0) diff --git a/gramps2/src/Filters/_GenericFilter.py b/gramps2/src/Filters/_GenericFilter.py index ef0561b11..5aa4da7c5 100644 --- a/gramps2/src/Filters/_GenericFilter.py +++ b/gramps2/src/Filters/_GenericFilter.py @@ -300,7 +300,7 @@ def GenericFilterFactory(namespace): return GenericSourceFilter elif namespace == 'Place': return GenericPlaceFilter - elif namespace == 'Media': + elif namespace == 'MediaObject': return GenericMediaFilter elif namespace == 'Repository': return GenericRepoFilter diff --git a/gramps2/src/PageView.py b/gramps2/src/PageView.py index a001459de..0239eaa59 100644 --- a/gramps2/src/PageView.py +++ b/gramps2/src/PageView.py @@ -464,7 +464,7 @@ class ListView(BookMarkView): dbstate.connect('database-changed',self.change_db) def build_filter_container(self, box, filter_class): - self.filter_sidebar = filter_class(self.filter_clicked) + self.filter_sidebar = filter_class(self.uistate,self.filter_clicked) self.filter_pane = self.filter_sidebar.get_widget() hpaned = gtk.HBox()