* src/FilterEditor/_EditFilter.py (on_edit_clicked,on_add_clicked):

Pass filter name to the rule editor.
	* src/FilterEditor/_EditRule.py (EditRule.__init__): Pass filter
	name to MyFilters.
	(MyFilters.__init__): Exclude filter being edited from the
	matching filter.


svn: r7187
This commit is contained in:
Alex Roitman 2006-08-16 04:45:45 +00:00
parent 9bdfc05f02
commit a9a3d9acbf
3 changed files with 17 additions and 6 deletions

View File

@ -4,6 +4,12 @@
* src/GrampsDb/_GedTokens.py: support for AGE and AGENCY
2006-08-15 Alex Roitman <shura@gramps-project.org>
* src/FilterEditor/_EditFilter.py (on_edit_clicked,on_add_clicked):
Pass filter name to the rule editor.
* src/FilterEditor/_EditRule.py (EditRule.__init__): Pass filter
name to MyFilters.
(MyFilters.__init__): Exclude filter being edited from the
matching filter.
* example/gramps/data.gramps: Add Age and Cause event attributes.
* example/gramps/example.gramps: Add Age and Cause event attributes.
* src/GrampsDb/_ReadXML.py (start_attribute): Support attributes

View File

@ -171,7 +171,8 @@ class EditFilter(ManagedWindow.ManagedWindow):
try:
EditRule(self.space, self.dbstate, self.uistate, self.track,
self.filterdb, None, _('Add Rule'), self.update_rule)
self.filterdb, None, _('Add Rule'), self.update_rule,
self.filter.get_name())
except Errors.WindowActiveError:
pass
@ -184,7 +185,8 @@ class EditFilter(ManagedWindow.ManagedWindow):
try:
EditRule(self.space, self.dbstate, self.uistate, self.track,
self.filterdb, d, _('Edit Rule'), self.update_rule)
self.filterdb, d, _('Edit Rule'), self.update_rule,
self.filter.get_name())
except Errors.WindowActiveError:
pass

View File

@ -138,7 +138,7 @@ class MyInteger(gtk.SpinButton):
#-------------------------------------------------------------------------
class MyFilters(gtk.ComboBox):
def __init__(self,filters):
def __init__(self,filters,filter_name):
gtk.ComboBox.__init__(self)
store = gtk.ListStore(str)
self.set_model(store)
@ -149,7 +149,8 @@ class MyFilters(gtk.ComboBox):
self.flist.sort()
for fname in self.flist:
store.append(row=[fname])
if filter_name.strip() and (fname != filter_name):
store.append(row=[fname])
self.set_active(0)
self.show()
@ -341,7 +342,7 @@ class MyEntry(gtk.Entry):
#-------------------------------------------------------------------------
class EditRule(ManagedWindow.ManagedWindow):
def __init__(self, space, dbstate, uistate, track, filterdb, val,
label, update):
label, update, filter_name):
ManagedWindow.ManagedWindow.__init__(self, uistate, track, EditRule)
@ -350,6 +351,7 @@ class EditRule(ManagedWindow.ManagedWindow):
self.db = dbstate.db
self.filterdb = filterdb
self.update_rule = update
self.filter_name = filter_name
self.active_rule = val
self.define_glade('rule_editor', const.rule_glade)
@ -421,7 +423,8 @@ class EditRule(ManagedWindow.ManagedWindow):
elif v == _('Source ID:'):
t = MySource(self.db)
elif v == _('Filter name:'):
t = MyFilters(self.filterdb.get_filters(self.space))
t = MyFilters(self.filterdb.get_filters(self.space),
self.filter_name)
elif _name2typeclass.has_key(v):
t = MySelect(_name2typeclass[v])
elif v == _('Inclusive:'):