* src/plugins/BookReport.py (BookList.save): Write encoding.

* src/plugins/FilterEditor.py (MyBoolean): Add class.
(FilterEditor.edit_rule): Implement Inclusive option.
* src/GenericFilter.py: Add categories and descriptions. Implement
Inclusive option.


svn: r2093
This commit is contained in:
Alex Roitman
2003-09-05 04:38:43 +00:00
parent 336b296b85
commit 1c46081a4c
4 changed files with 156 additions and 13 deletions

View File

@@ -365,7 +365,7 @@ class BookList:
Saves the current BookList to the associated file.
"""
f = open(self.file,"w")
f.write("<?xml version=\"1.0\"?>\n")
f.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n")
f.write('<booklist>\n')
for name in self.bookmap.keys():

View File

@@ -1,7 +1,7 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000 Donald N. Allingham
# Copyright (C) 2000-2003 Donald N. Allingham
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -60,6 +60,24 @@ _name2list = {
}
#-------------------------------------------------------------------------
#
# MyBoolean - check button with standard interface
#
#-------------------------------------------------------------------------
class MyBoolean(gtk.CheckButton):
def __init__(self,label=None):
gtk.CheckButton.__init__(self,label)
self.show()
def get_text(self):
return str(int(self.get_active()))
def set_text(self,val):
is_active = not not int(val)
self.set_active(is_active)
#-------------------------------------------------------------------------
#
# MyInteger - spin button with standard interface
@@ -448,6 +466,8 @@ class FilterEditor:
t = MyFilters(self.filterdb.get_filters())
elif _name2list.has_key(v1):
t = MySelect(_name2list[v1])
elif v == 'Inclusive:':
t = MyBoolean(_('Include original person'))
else:
t = MyEntry()
tlist.append(t)