0002070: Event Comparison Tool filter list doesn't update with new filter
remove old unused libglade menu in _FilterMenu svn: r12855
This commit is contained in:
parent
9e5cc9d93a
commit
874d43f2aa
@ -26,7 +26,6 @@
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import gtk
|
||||
from gettext import gettext as _
|
||||
import gobject
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
@ -34,36 +33,7 @@ import gobject
|
||||
# This is used by plugins to create a menu of available filters
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
def build_filter_menu(local_filters = [], default=""):
|
||||
from Filters import SystemFilters, CustomFilters
|
||||
menu = gtk.Menu()
|
||||
|
||||
for filt in local_filters:
|
||||
menuitem = gtk.MenuItem(filt.get_name())
|
||||
menuitem.show()
|
||||
menu.append(menuitem)
|
||||
menuitem.set_data("filter", filt)
|
||||
|
||||
for filt in SystemFilters.get_filters():
|
||||
menuitem = gtk.MenuItem(_(filt.get_name()))
|
||||
menuitem.show()
|
||||
menu.append(menuitem)
|
||||
menuitem.set_data("filter", filt)
|
||||
|
||||
for filt in CustomFilters.get_filters():
|
||||
menuitem = gtk.MenuItem(_(filt.get_name()))
|
||||
menuitem.show()
|
||||
menu.append(menuitem)
|
||||
menuitem.set_data("filter", filt)
|
||||
|
||||
return menu
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# This is used by plugins to create a menu of available filters
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
def build_filter_model(space, local = [], default=""):
|
||||
def build_filter_model(space, local = []):
|
||||
from Filters import SystemFilters, CustomFilters
|
||||
|
||||
model = gtk.ListStore(gobject.TYPE_STRING, object)
|
||||
|
@ -49,7 +49,7 @@ if not CustomFilters:
|
||||
reload_custom_filters()
|
||||
|
||||
from _FilterComboBox import FilterComboBox
|
||||
from _FilterMenu import build_filter_menu, build_filter_model
|
||||
from _FilterMenu import build_filter_model
|
||||
from _FilterStore import FilterStore
|
||||
from _SearchBar import SearchBar
|
||||
from _SearchFilter import SearchFilter, ExactSearchFilter
|
||||
|
@ -139,20 +139,20 @@ class EventComparison(Tool.Tool,ManagedWindow.ManagedWindow):
|
||||
self.set_window(window,self.filterDialog.get_object('title'),
|
||||
self.label)
|
||||
|
||||
all = GenericFilter()
|
||||
all.set_name(_("Entire Database"))
|
||||
all.add_rule(Rules.Person.Everyone([]))
|
||||
|
||||
the_filters = [all]
|
||||
from Filters import CustomFilters
|
||||
the_filters.extend(CustomFilters.get_filters('Person'))
|
||||
|
||||
self.filter_menu = build_filter_model(the_filters)
|
||||
filter_num = self.options.handler.options_dict['filter']
|
||||
self.filters.set_model(self.filter_menu)
|
||||
self.filters.set_active(0)
|
||||
self.on_filters_changed('Person')
|
||||
uistate.connect('filters-changed', self.on_filters_changed)
|
||||
|
||||
self.show()
|
||||
|
||||
|
||||
def on_filters_changed(self, name_space):
|
||||
if name_space == 'Person':
|
||||
all_filter = GenericFilter()
|
||||
all_filter.set_name(_("Entire Database"))
|
||||
all_filter.add_rule(Rules.Person.Everyone([]))
|
||||
self.filter_model = build_filter_model('Person', [all_filter])
|
||||
self.filters.set_model(self.filter_model)
|
||||
self.filters.set_active(0)
|
||||
|
||||
def on_help_clicked(self, obj):
|
||||
"""Display the relevant portion of GRAMPS manual"""
|
||||
@ -170,7 +170,7 @@ class EventComparison(Tool.Tool,ManagedWindow.ManagedWindow):
|
||||
pass
|
||||
|
||||
def on_apply_clicked(self, obj):
|
||||
cfilter = self.filter_menu[self.filters.get_active()][1]
|
||||
cfilter = self.filter_model[self.filters.get_active()][1]
|
||||
|
||||
progress_bar = ProgressMeter(_('Comparing events'),'')
|
||||
progress_bar.set_pass(_('Selecting people'),1)
|
||||
|
Loading…
Reference in New Issue
Block a user