svn: r13752
This commit is contained in:
Gerald Britton
2009-12-10 21:06:00 +00:00
parent 0c18bc53ce
commit a82b115192
3 changed files with 18 additions and 25 deletions

View File

@ -48,5 +48,5 @@ class Disconnected(Rule):
'to any other person in the database') 'to any other person in the database')
def apply(self,db,person): def apply(self,db,person):
return (len(person.get_parent_family_handle_list()) return not (person.get_parent_family_handle_list()
+ len(person.get_family_handle_list()) == 0) or person.get_family_handle_list())

View File

@ -59,8 +59,6 @@ class HasAttributeBase(Rule):
specified_type.set_from_xml_str(self.list[0]) specified_type.set_from_xml_str(self.list[0])
name_match = attr.get_type() == specified_type name_match = attr.get_type() == specified_type
value_match = \ if name_match:
attr.get_value().upper().find(self.list[1].upper()) != -1 return attr.get_value().upper().find(self.list[1].upper()) != -1
if name_match and value_match:
return True
return False return False

View File

@ -190,7 +190,8 @@ class ListView(NavigationView):
self.columns = [] self.columns = []
index = 0 index = 0
for pair in [pair for pair in self.column_order() if pair[0]]: for pair in self.column_order():
if not pair[0]: continue
name = self.colinfo[pair[1]] name = self.colinfo[pair[1]]
column = gtk.TreeViewColumn(name, self.renderer) column = gtk.TreeViewColumn(name, self.renderer)
@ -223,10 +224,7 @@ class ListView(NavigationView):
filter_info = (True, self.generic_filter, False) filter_info = (True, self.generic_filter, False)
else: else:
value = self.search_bar.get_value() value = self.search_bar.get_value()
if value[0] in self.exact_search(): filter_info = (False, value, value[0] in self.exact_search())
filter_info = (False, value, True)
else:
filter_info = (False, value, False)
if self.dirty or not self.model: if self.dirty or not self.model:
self.model = self.make_model(self.dbstate.db, self.sort_col, self.model = self.make_model(self.dbstate.db, self.sort_col,
@ -338,10 +336,9 @@ class ListView(NavigationView):
def setup_filter(self): def setup_filter(self):
"""Build the default filters and add them to the filter menu.""" """Build the default filters and add them to the filter menu."""
cols = [] self.search_bar.setup_filter(
for pair in [pair for pair in self.column_order() if pair[0]]: [(self.colinfo[pair[1]], pair[1])
cols.append((self.colinfo[pair[1]], pair[1])) for pair in self.column_order() if pair[0]])
self.search_bar.setup_filter(cols)
#################################################################### ####################################################################
# Navigation # Navigation
@ -352,15 +349,15 @@ class ListView(NavigationView):
Required by the NavigationView interface. Required by the NavigationView interface.
We have a bit of a problem due to the nature of how GTK works. We have a bit of a problem due to the nature of how GTK works.
We have unselect the previous path and select the new path. However, We have to unselect the previous path and select the new path. However,
these cause a row change, which calls the row_change callback, which these cause a row change, which calls the row_change callback, which
can end up calling change_active_person, which can call can end up calling change_active_person, which can call
goto_active_person, causing a bit of recusion. Confusing, huh? goto_active_person, causing a bit of recusion. Confusing, huh?
Unforunately, we row_change has to be able to call change_active_person, Unfortunately, row_change has to be able to call change_active_person,
because the can occur from the interface in addition to programatically. because this can occur from the interface in addition to programatically.
TO handle this, we set the self.inactive variable that we can check To handle this, we set the self.inactive variable that we can check
in row_change to look for this particular condition. in row_change to look for this particular condition.
""" """
if not handle or handle in self.selected_handles(): if not handle or handle in self.selected_handles():
@ -488,7 +485,7 @@ class ListView(NavigationView):
else: else:
msg = _('Deleting item will remove it from the database.') msg = _('Deleting item will remove it from the database.')
msg = "%s %s" % (msg, Utils.data_recover_msg) msg += ' ' + Utils.data_recover_msg
#descr = object.get_description() #descr = object.get_description()
#if descr == "": #if descr == "":
descr = object.get_gramps_id() descr = object.get_gramps_id()
@ -807,8 +804,7 @@ class ListView(NavigationView):
ofile.start_page() ofile.start_page()
ofile.start_row() ofile.start_row()
# Headings # Headings
for name in column_names: map(ofile.write_cell, column_names)
ofile.write_cell(name)
ofile.end_row() ofile.end_row()
if self.model.get_flags() & gtk.TREE_MODEL_LIST_ONLY: if self.model.get_flags() & gtk.TREE_MODEL_LIST_ONLY:
@ -831,8 +827,7 @@ class ListView(NavigationView):
return return
while node is not None: while node is not None:
ofile.start_row() ofile.start_row()
for counter in range(level): # Indentation map(ofile.write_cell, ('',)*level)
ofile.write_cell('')
for index in data_cols: for index in data_cols:
ofile.write_cell(self.model.get_value(node, index)) ofile.write_cell(self.model.get_value(node, index))
ofile.end_row() ofile.end_row()