From b30e225dcf247f38086d163a0275bd219df62a22 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Fri, 10 Nov 2006 06:11:23 +0000 Subject: [PATCH] 2006-11-09 Don Allingham * src/DisplayModels/PageView.py: fix delete MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2006-02-09 Jérôme Rapinat 2005-12-10 Jérôme Rapinat 2005-12-09 Jérôme Rapinat 2005-12-07 Jérôme Rapinat 2005-12-06 Jérôme Rapinat svn: r7602 --- ChangeLog | 13 ++++++++----- src/DisplayModels/_BaseModel.py | 21 +++++++-------------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2eb71d637..b9a71dcb9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2006-11-09 Don Allingham + * src/DisplayModels/PageView.py: fix delete + 2006-11-09 Alex Roitman * data/*.svg: Add mime type icons. * data/*.png: Update bitmap icons to look the same as SVG. @@ -4656,7 +4659,7 @@ * src/PersonView.py: Add SetActive action * src/ViewManager.py: move ColumnEdit action -2006-02-09 Jérôme Rapinat +2006-02-09 Jérôme Rapinat * src/data/gramps.desktop: Add French strings. 2006-02-09 Alexandre Prokoudine @@ -5880,7 +5883,7 @@ * src/po/de.po: Correct mismatched % parameters. * src/po/eo.po: Correct mismatched % parameters. -2005-12-10 Jérôme Rapinat +2005-12-10 Jérôme Rapinat * src/po/fr.po: Translation update. * src/dates/Date_fr.py (DateParserFR): Add more quality_to_int pairs. @@ -5890,7 +5893,7 @@ * doc/gramps-manual/C/preface.xml: update * doc/gramps-manual/C/usage.xml: update -2005-12-09 Jérôme Rapinat +2005-12-09 Jérôme Rapinat * doc/gramps-manual/fr/cmdplug.xml: Add file with new section. * doc/gramps-manual/fr/gramps-manual.xml: Define entity for new section. @@ -5959,7 +5962,7 @@ gtl.FILE_CHOOSER_SELECT_FOLDER. GTK documentation error. * src/plugins/NavWebPage.py: restore .tar.gz archive option -2005-12-07 Jérôme Rapinat +2005-12-07 Jérôme Rapinat * src/po/fr.po: Translation update. 2005-12-06 Alex Roitman @@ -5970,7 +5973,7 @@ the preformatted notes; (IndividualPage.__init__): restrict notes, url list, and source on living people. -2005-12-06 Jérôme Rapinat +2005-12-06 Jérôme Rapinat * src/po/fr.po: Partial translation update. 2005-12-06 Don Allingham diff --git a/src/DisplayModels/_BaseModel.py b/src/DisplayModels/_BaseModel.py index 811fbc88c..0aca2a46c 100644 --- a/src/DisplayModels/_BaseModel.py +++ b/src/DisplayModels/_BaseModel.py @@ -110,27 +110,27 @@ class BaseModel(gtk.GenericTreeModel): return [ x[1] for x in sarray ] - def _rebuild_search(self): + def _rebuild_search(self,ignore=None): if self.db.is_open(): if self.search: self.datalist = [h for h in self.sort_keys()\ - if self.search.match(h) and h not in self.skip] + if self.search.match(h) and h not in self.skip and h != ignore] else: - self.datalist = [h for h in self.sort_keys() if h not in self.skip] + self.datalist = [h for h in self.sort_keys() if h not in self.skip and h != ignore] i = 0 self.indexlist = {} for key in self.datalist: - if key not in self.skip: + if key not in self.skip and key != ignore: self.indexlist[key] = i i += 1 else: self.datalist = [] self.indexlist = {} - def _rebuild_filter(self): + def _rebuild_filter(self, ignore=None): if self.db.is_open(): if self.search: - self.datalist = self.search.apply(self.db, self.sort_keys()) + self.datalist = self.search.apply(self.db, [ k for k in self.sort_keys() if k != ignore]) else: self.datalist = self.sort_keys() @@ -157,14 +157,7 @@ class BaseModel(gtk.GenericTreeModel): def delete_row_by_handle(self,handle): index = self.indexlist[handle] - self.indexlist = {} - self.datalist = [] - i = 0 - for key in self.sort_keys(): - if key != handle: - self.indexlist[key] = i - self.datalist.append(key) - i += 1 + self.rebuild_data(ignore=handle) self.row_deleted(index) def update_row_by_handle(self,handle):