* src/plugins/FilterEditor.py: handle unicode characters

svn: r2662
This commit is contained in:
Don Allingham 2004-01-19 23:05:23 +00:00
parent 4974f20d89
commit 14f97ebcef

View File

@ -410,6 +410,7 @@ class FilterEditor:
self.rule = gtk.glade.XML(const.filterFile,'rule_editor',"gramps") self.rule = gtk.glade.XML(const.filterFile,'rule_editor',"gramps")
self.rule_top = self.rule.get_widget('rule_editor') self.rule_top = self.rule.get_widget('rule_editor')
self.valuebox = self.rule.get_widget('valuebox') self.valuebox = self.rule.get_widget('valuebox')
self.valuebox.set_sensitive(0)
self.rname = self.rule.get_widget('ruletree') self.rname = self.rule.get_widget('ruletree')
self.rule_name = self.rule.get_widget('rulename') self.rule_name = self.rule.get_widget('rulename')
@ -427,7 +428,8 @@ class FilterEditor:
list = [] list = []
keylist = GenericFilter.tasks.keys() keylist = GenericFilter.tasks.keys()
keylist.sort() keylist.sort()
for name in keylist: for xname in keylist:
name = unicode(xname)
cname = GenericFilter.tasks[name] cname = GenericFilter.tasks[name]
arglist = cname.labels arglist = cname.labels
vallist = [] vallist = []
@ -536,7 +538,7 @@ class FilterEditor:
store,iter = self.selection.get_selected() store,iter = self.selection.get_selected()
if iter: if iter:
try: try:
key = store.get_value(iter,0) key = unicode(store.get_value(iter,0))
self.display_values(key) self.display_values(key)
except: except:
self.valuebox.set_sensitive(0) self.valuebox.set_sensitive(0)
@ -559,6 +561,7 @@ class FilterEditor:
def rule_ok(self,obj): def rule_ok(self,obj):
name = unicode(self.rule_name.get_text()) name = unicode(self.rule_name.get_text())
print name
try: try:
page = self.name2page[name] page = self.name2page[name]
(n,c,v,t) = self.page[page] (n,c,v,t) = self.page[page]
@ -574,6 +577,7 @@ class FilterEditor:
self.draw_rules() self.draw_rules()
self.rule_top.destroy() self.rule_top.destroy()
except KeyError: except KeyError:
print name, self.name2page
pass pass
except: except:
import DisplayTrace import DisplayTrace