2007-10-18 Benny Malengier <benny.malengier@gramps-project.org>

* src/DisplayModels/_BaseModel.py: remove comments
	* src/DisplayModels/_NoteModel.py: show all notes again in note view


svn: r9208
This commit is contained in:
Benny Malengier 2007-10-18 20:49:45 +00:00
parent 4a6723072e
commit f050646e31
3 changed files with 19 additions and 72 deletions

View File

@ -1,3 +1,7 @@
2007-10-18 Benny Malengier <benny.malengier@gramps-project.org>
* src/DisplayModels/_BaseModel.py: remove comments
* src/DisplayModels/_NoteModel.py: show all notes again in note view
2007-10-17 Benny Malengier <benny.malengier@gramps-project.org> 2007-10-17 Benny Malengier <benny.malengier@gramps-project.org>
* src/GrampsDbUtils/_WriteGedcom.py: bug get_phon must be get_phone * src/GrampsDbUtils/_WriteGedcom.py: bug get_phon must be get_phone

View File

@ -223,7 +223,6 @@ class BaseModel(gtk.GenericTreeModel):
def _rebuild_search(self,ignore=None): def _rebuild_search(self,ignore=None):
""" function called when view must be build, given a search text """ function called when view must be build, given a search text
in the top search bar in the top search bar
Remark: this method is overridden in NoteModel !
""" """
self.total = 0 self.total = 0
if self.db.is_open(): if self.db.is_open():
@ -243,7 +242,6 @@ class BaseModel(gtk.GenericTreeModel):
def _rebuild_filter(self, ignore=None): def _rebuild_filter(self, ignore=None):
""" function called when view must be build, given filter options """ function called when view must be build, given filter options
in the filter sidebar in the filter sidebar
Remark: this method is overridden in NoteModel !
""" """
self.total = 0 self.total = 0
if self.db.is_open(): if self.db.is_open():

View File

@ -81,61 +81,6 @@ class NoteModel(BaseModel):
BaseModel.__init__(self, db, scol, order, BaseModel.__init__(self, db, scol, order,
search=search, skip=skip, sort_map=sort_map) search=search, skip=skip, sort_map=sort_map)
def __unattached_note(self, handle):
""" function that returns true if note is not attached to another
object
"""
if handle :
return len([x for x in self.db.find_backlink_handles(handle)]) == 0
return False
def _rebuild_search(self,ignore=None):
""" function called when view must be build, given a search text
in the top search bar
Remark: this method is overrides BaseModel as only unattached notes
must be shown
"""
self.total = 0
if self.db.is_open():
if self.search and self.search.text:
dlist = [h for h in self.sort_keys()\
if self.search.match(h) and \
h not in self.skip and h != ignore and \
self.__unattached_note(h)]
else:
dlist = [h for h in self.sort_keys() \
if h not in self.skip and h != ignore and \
self.__unattached_note(h)]
self.displayed = len(dlist)
self.node_map.set_path_map(dlist)
else:
self.displayed = 0
self.node_map.clear_map()
def _rebuild_filter(self, ignore=None):
""" function called when view must be build, given filter options
in the filter sidebar
Remark: this method is overrides BaseModel as only unattached notes
must be shown
"""
self.total = 0
if self.db.is_open():
if self.search:
dlist = self.search.apply(self.db,
[ k for k in self.sort_keys()\
if k != ignore and \
self.__unattached_note(k)])
else:
dlist = [ k for k in self.sort_keys() \
if k != ignore and \
self.__unattached_note(k)]
self.displayed = len(dlist)
self.node_map.set_path_map(dlist)
else:
self.displayed = 0
self.node_map.clear_map()
def on_get_n_columns(self): def on_get_n_columns(self):
return len(self.fmap)+1 return len(self.fmap)+1