svn: r6801
This commit is contained in:
Alex Roitman 2006-05-28 08:36:29 +00:00
parent e4670721fd
commit bdeec2753a

View File

@ -442,11 +442,12 @@ class VerifyResults(ManagedWindow):
self.hide_button = self.top.get_widget('hide_button') self.hide_button = self.top.get_widget('hide_button')
self.hide_button.connect('toggled',self.hide_toggled) self.hide_button.connect('toggled',self.hide_toggled)
self.warn_model = gtk.ListStore(bool,str,str,str,str,int,str,str, self.real_model = gtk.ListStore(bool,str,str,str,str,int,str,str,
bool,bool) bool,bool)
self.model_filter = self.warn_model.filter_new() self.filt_model = self.real_model.filter_new()
self.model_filter.set_visible_column(8) self.filt_model.set_visible_column(8)
self.warn_tree.set_model(self.model_filter) self.sort_model = gtk.TreeModelSort(self.filt_model)
self.warn_tree.set_model(self.sort_model)
self.renderer = gtk.CellRendererText() self.renderer = gtk.CellRendererText()
self.img_renderer = gtk.CellRendererPixbuf() self.img_renderer = gtk.CellRendererPixbuf()
@ -463,17 +464,17 @@ class VerifyResults(ManagedWindow):
warn_column = gtk.TreeViewColumn(_('Warning'), self.renderer, warn_column = gtk.TreeViewColumn(_('Warning'), self.renderer,
text=1,foreground=7) text=1,foreground=7)
# warn_column.set_sort_column_id(1) warn_column.set_sort_column_id(1)
self.warn_tree.append_column(warn_column) self.warn_tree.append_column(warn_column)
id_column = gtk.TreeViewColumn(_('ID'), self.renderer, id_column = gtk.TreeViewColumn(_('ID'), self.renderer,
text=2,foreground=7) text=2,foreground=7)
# id_column.set_sort_column_id(2) id_column.set_sort_column_id(2)
self.warn_tree.append_column(id_column) self.warn_tree.append_column(id_column)
name_column = gtk.TreeViewColumn(_('Name'), self.renderer, name_column = gtk.TreeViewColumn(_('Name'), self.renderer,
text=3,foreground=7) text=3,foreground=7)
# name_column.set_sort_column_id(3) name_column.set_sort_column_id(3)
self.warn_tree.append_column(name_column) self.warn_tree.append_column(name_column)
self.window.show_all() self.window.show_all()
@ -516,9 +517,9 @@ class VerifyResults(ManagedWindow):
def get_new_marking(self): def get_new_marking(self):
new_ignores = {} new_ignores = {}
for row_num in range(len(self.warn_model)): for row_num in range(len(self.real_model)):
path = (row_num,) path = (row_num,)
row = self.warn_model[path] row = self.real_model[path]
ignore = row[0] ignore = row[0]
if ignore: if ignore:
handle = row[6] handle = row[6]
@ -536,22 +537,26 @@ class VerifyResults(ManagedWindow):
def hide_toggled(self,button): def hide_toggled(self,button):
if button.get_active(): if button.get_active():
button.set_label(_("_Show selected")) button.set_label(_("_Show all"))
self.model_filter = self.warn_model.filter_new() self.filt_model = self.real_model.filter_new()
self.model_filter.set_visible_column(9) self.filt_model.set_visible_column(9)
self.warn_tree.set_model(self.model_filter) self.sort_model = gtk.TreeModelSort(self.filt_model)
self.warn_tree.set_model(self.sort_model)
else: else:
self.model_filter = self.warn_model.filter_new() self.filt_model = self.real_model.filter_new()
self.model_filter.set_visible_column(8) self.filt_model.set_visible_column(8)
self.warn_tree.set_model(self.model_filter) self.sort_model = gtk.TreeModelSort(self.filt_model)
self.warn_tree.set_model(self.sort_model)
button.set_label(_("_Hide selected")) button.set_label(_("_Hide selected"))
def selection_toggled(self,cell,path_string): def selection_toggled(self,cell,path_string):
path = tuple([int (i) for i in path_string.split(':')]) sort_path = tuple([int (i) for i in path_string.split(':')])
row = self.warn_model[path] filt_path = self.sort_model.convert_path_to_child_path(sort_path)
real_path = self.filt_model.convert_path_to_child_path(filt_path)
row = self.real_model[real_path]
row[0] = not row[0] row[0] = not row[0]
row[9] = not row[0] row[9] = not row[0]
self.warn_model.row_changed(path,row.iter) self.real_model.row_changed(real_path,row.iter)
def get_image(self, column, cell, model, iter, user_data=None): def get_image(self, column, cell, model, iter, user_data=None):
the_type = model.get_value(iter, 4) the_type = model.get_value(iter, 4)
@ -570,7 +575,7 @@ class VerifyResults(ManagedWindow):
## fg = '#008b00' ## fg = '#008b00'
else: else:
fg = None fg = None
self.warn_model.append(row=[ignore,msg,gramps_id,name, self.real_model.append(row=[ignore,msg,gramps_id,name,
the_type,rule_id,handle,fg, the_type,rule_id,handle,fg,
True, not ignore]) True, not ignore])