From 1b3082d8246dcf9439197a5c2404cf2515c7a2f6 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Fri, 19 Nov 2010 12:30:52 +0000 Subject: [PATCH] Added a callback that takes the filterdb and filter name edited/saved svn: r16213 --- src/gui/filtereditor.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/filtereditor.py b/src/gui/filtereditor.py index ef45aff9b..2973ace56 100644 --- a/src/gui/filtereditor.py +++ b/src/gui/filtereditor.py @@ -665,7 +665,7 @@ class EditRule(ManagedWindow.ManagedWindow): class EditFilter(ManagedWindow.ManagedWindow): def __init__(self, namespace, dbstate, uistate, track, gfilter, - filterdb, update): + filterdb, update=None, selection_callback=None): ManagedWindow.ManagedWindow.__init__(self, uistate, track, self) @@ -675,6 +675,7 @@ class EditFilter(ManagedWindow.ManagedWindow): self.db = dbstate.db self.filter = gfilter self.filterdb = filterdb + self.selection_callback = selection_callback self.define_glade('define_filter', const.RULE_GLADE) @@ -769,7 +770,10 @@ class EditFilter(ManagedWindow.ManagedWindow): self.filter.set_logical_op(op) self.filter.set_invert(self.logical_not.get_active()) self.filterdb.add(self.namespace,self.filter) - self.update() + if self.update: + self.update() + if self.selection_callback: + self.selection_callback(self.filterdb, self.filter.get_name()) self.close() def on_add_clicked(self, obj):