* src/FilterEditor/_EditRule.py: wrong filter selection, bug #807
	Based on work Johan


svn: r9015
This commit is contained in:
Benny Malengier
2007-09-27 13:28:54 +00:00
parent 1ca8fdda9e
commit 0e450f1684
2 changed files with 21 additions and 10 deletions

View File

@@ -1,3 +1,7 @@
2007-09-27 Benny Malengier <benny.malengier@gramps-project.org>
* src/FilterEditor/_EditRule.py: wrong filter selection, bug #807
Based on work Johan
2007-09-26 James G. Sack <jgsack@san.rr.com> 2007-09-26 James G. Sack <jgsack@san.rr.com>
* src/plugins/Check.py: same sex marriage need not be CIVIL_UNION, bug #1245 * src/plugins/Check.py: same sex marriage need not be CIVIL_UNION, bug #1245
This includes the 8374 commit which was not present in trunk (??) This includes the 8374 commit which was not present in trunk (??)

View File

@@ -139,20 +139,27 @@ class MyInteger(gtk.SpinButton):
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
class MyFilters(gtk.ComboBox): class MyFilters(gtk.ComboBox):
"""Class to present a combobox of selectable filters
def __init__(self,filters,filter_name): """
def __init__(self, filters, filter_name=None):
""" Construct the combobox from the entries of
the filters list.
filter_name is name of calling filter
If filter_name is given, it will be excluded from the dropdown box
"""
gtk.ComboBox.__init__(self) gtk.ComboBox.__init__(self)
store = gtk.ListStore(str) store = gtk.ListStore(str)
self.set_model(store) self.set_model(store)
cell = gtk.CellRendererText() cell = gtk.CellRendererText()
self.pack_start(cell,True) self.pack_start(cell,True)
self.add_attribute(cell,'text',0) self.add_attribute(cell,'text',0)
self.flist = [ f.get_name() for f in filters ] #remove own name from the list if given.
self.flist = [ f.get_name() for f in filters if \
(filter_name is None or f.get_name() != filter_name)]
self.flist.sort() self.flist.sort()
for fname in self.flist: for fname in self.flist:
if fname != filter_name: store.append(row=[fname])
store.append(row=[fname])
self.set_active(0) self.set_active(0)
self.show() self.show()
@@ -469,13 +476,13 @@ class EditRule(ManagedWindow.ManagedWindow):
elif v == _('Filter name:'): elif v == _('Filter name:'):
t = MyFilters(self.filterdb.get_filters(self.space), t = MyFilters(self.filterdb.get_filters(self.space),
self.filter_name) self.filter_name)
# filters of another namespace # filters of another namespace, name may be same as caller!
elif v == _('Person filter name:'): elif v == _('Person filter name:'):
t = MyFilters(self.filterdb.get_filters('Person'), t = MyFilters(self.filterdb.get_filters('Person'))
self.filter_name)
elif v == _('Event filter name:'): elif v == _('Event filter name:'):
t = MyFilters(self.filterdb.get_filters('Event'), t = MyFilters(self.filterdb.get_filters('Event'))
self.filter_name) elif v == _('Source filter name:'):
t = MyFilters(self.filterdb.get_filters('Source'))
elif _name2typeclass.has_key(v): elif _name2typeclass.has_key(v):
t = MySelect(_name2typeclass[v]) t = MySelect(_name2typeclass[v])
elif v == _('Inclusive:'): elif v == _('Inclusive:'):