Fixed invalid numbering; also has sequence as logical rule connector

svn: r18570
This commit is contained in:
Doug Blank 2011-12-11 03:59:25 +00:00
parent 3536e8e58b
commit 676af3bcc8

View File

@ -764,9 +764,8 @@ class EditFilter(ManagedWindow.ManagedWindow):
self.fname.connect('changed', self.filter_name_changed) self.fname.connect('changed', self.filter_name_changed)
op = self.filter.get_logical_op() op = self.filter.get_logical_op()
self.logical.set_active( # WARNING: must be listed in this order:
1 if op == 'or' else 2 if op == 'one' else 2 self.logical.set_active(["and", "or", "one", "sequence"].index(op))
)
self.logical_not.set_active(self.filter.get_invert()) self.logical_not.set_active(self.filter.get_invert())
if self.filter.get_name(): if self.filter.get_name():
self.fname.set_text(self.filter.get_name()) self.fname.set_text(self.filter.get_name())
@ -819,7 +818,12 @@ class EditFilter(ManagedWindow.ManagedWindow):
self.filterdb.get_filters(self.namespace).remove(f) self.filterdb.get_filters(self.namespace).remove(f)
break break
val = self.logical.get_active() val = self.logical.get_active()
op = 'or' if val == 1 else 'one' if val == 2 else 'and' # WARNING: must be listed in this order:
op = ('and' if val == 0 else
'or' if val == 1 else
'one' if val == 2 else
'sequence')
self.logical.set_active(val)
self.filter.set_logical_op(op) self.filter.set_logical_op(op)
self.filter.set_invert(self.logical_not.get_active()) self.filter.set_invert(self.logical_not.get_active())
self.filterdb.add(self.namespace,self.filter) self.filterdb.add(self.namespace,self.filter)