* src/DataViews/_RelationView.py: don't crash on missing media ref
	* src/DisplayTabs/_GalleryTab.py: on missing media ref, notify to run check tool
	* src/plugins/Check.py: add code to remove missing media ref in person,
	family, event, place, source.


svn: r9089
This commit is contained in:
Benny Malengier
2007-10-06 12:58:11 +00:00
parent 8bc8b9858e
commit e7f02d1855
4 changed files with 118 additions and 5 deletions

View File

@@ -213,10 +213,16 @@ class GalleryTab(ButtonTab):
for ref in self.media_list:
handle = ref.get_reference_handle()
obj = self.dbstate.db.get_object_from_handle(handle)
pixbuf = ThumbNails.get_thumbnail_image(obj.get_path(),
if obj is None :
#notify user of error
from QuestionDialog import RunDatabaseRepair
RunDatabaseRepair(
_('Unexisting media found in the Gallery'))
else :
pixbuf = ThumbNails.get_thumbnail_image(obj.get_path(),
obj.get_mime_type(),
ref.get_rectangle())
self.iconmodel.append(row=[pixbuf, obj.get_description(), ref])
self.iconmodel.append(row=[pixbuf, obj.get_description(), ref])
self._connect_icon_model()
self._set_label()
self._selection_changed()